Skip to content

Commit

Permalink
fix: cypress config
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Dec 30, 2024
1 parent efce6a4 commit 1538b63
Show file tree
Hide file tree
Showing 36 changed files with 3,248 additions and 1,177 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
matrix:
# Run multiple copies of the current job in parallel
# Please increase the number or runners as your tests suite grows
containers: ['component', '1', '2', '3']
containers: ['1', '2', '3']

name: runner ${{ matrix.containers }}

Expand Down
42 changes: 17 additions & 25 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@

import {
configureNextcloud,
startNextcloud,
stopNextcloud,
waitOnNextcloud,
} from './cypress/dockerNode'
import { defineConfig } from 'cypress'

import browserify from '@cypress/browserify-preprocessor'
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { configureNextcloud, startNextcloud, stopNextcloud, waitOnNextcloud } from '@nextcloud/cypress/docker'
import { configureVisualRegression } from 'cypress-visual-regression/dist/plugin'
import { defineConfig } from 'cypress'

export default defineConfig({
projectId: 'okzqgr',
Expand All @@ -34,19 +30,18 @@ export default defineConfig({
// Visual regression testing
env: {
failSilently: false,
type: 'actual',
visualRegressionType: 'regression',
},
screenshotsFolder: 'cypress/snapshots/actual',
trashAssetsBeforeRuns: true,

e2e: {
// Disable session isolation
testIsolation: false,

// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
async setupNodeEvents(on, config) {
// Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
on('file:preprocessor', browserify({ typescript: require.resolve('typescript') }))
configureVisualRegression(on)

// Disable spell checking to prevent rendering differences
Expand All @@ -69,22 +64,19 @@ export default defineConfig({

// Remove container after run
on('after:run', () => {
stopNextcloud()
if (!process.env.CI) {
stopNextcloud()
}
})

// Before the browser launches
// starting Nextcloud testing container
return startNextcloud(process.env.BRANCH)
.then((ip) => {
// Setting container's IP as base Url
config.baseUrl = `http://${ip}/index.php`
return ip
})
.then(waitOnNextcloud)
.then(() => configureNextcloud(process.env.BRANCH))
.then(() => {
return config
})
const ip = await startNextcloud(process.env.BRANCH || 'master')
// Setting container's IP as base Url
config.baseUrl = `http://${ip}/index.php`
await waitOnNextcloud(ip)
await configureNextcloud(['viewer'])
return config
},
},
})
18 changes: 0 additions & 18 deletions cypress/docker-compose.yml

This file was deleted.

224 changes: 0 additions & 224 deletions cypress/dockerNode.ts

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/e2e/placesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export function navigateToPlace(locationName: string) {
}

export function runOccCommand(command: string) {
cy.exec(`docker exec --user www-data nextcloud-cypress-tests-photos php ./occ ${command}`)
cy.exec(`docker exec --user www-data nextcloud-cypress-tests_photos php ./occ ${command}`)
}
12 changes: 10 additions & 2 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"extends": "../tsconfig.json",
"include": ["./**/*.ts"],
}
"include": ["../*.ts", "."],
"compilerOptions": {
"rootDir": "..",
"types": [
"cypress",
"dockerode",
"node"
]
}
}
4 changes: 2 additions & 2 deletions js/photos-dashboard.js

Large diffs are not rendered by default.

Loading

0 comments on commit 1538b63

Please sign in to comment.