-
Notifications
You must be signed in to change notification settings - Fork 36
/
cypress.config.js
53 lines (49 loc) · 1.66 KB
/
cypress.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const {
addCucumberPreprocessorPlugin,
} = require('@badeball/cypress-cucumber-preprocessor')
const createEsbuildPlugin = require('@badeball/cypress-cucumber-preprocessor/esbuild')
const createBundler = require('@bahmutov/cypress-esbuild-preprocessor')
const { chromeAllowXSiteCookies } = require('@dhis2/cypress-plugins')
const { defineConfig } = require('cypress')
async function setupNodeEvents(on, config) {
await addCucumberPreprocessorPlugin(on, config)
chromeAllowXSiteCookies(on, config)
on(
'file:preprocessor',
createBundler({
plugins: [createEsbuildPlugin.default(config)],
})
)
return config
}
module.exports = defineConfig({
projectId: '5fk191',
chromeWebSecurity: false,
e2e: {
setupNodeEvents,
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/e2e/*.feature',
viewportWidth: 1280,
viewportHeight: 800,
defaultCommandTimeout: 45000,
/* Globally disable test isolation because the test suite
* contains many tests with sequential steps */
testIsolation: false,
// Record video
video: true,
// Enabled to reduce the risk of out-of-memory issues
experimentalMemoryManagement: true,
// Set to a low number to reduce the risk of out-of-memory issues
numTestsKeptInMemory: 5,
/* When allowing 1 retry on CI, the test suite will pass if
* it's flaky. And/but we also get to identify flaky tests on the
* Cypress Dashboard. */
retries: {
runMode: 1,
openMode: 0,
},
},
env: {
networkMode: 'live',
},
})