-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcypress.config.js
38 lines (36 loc) · 1.12 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
const { defineConfig } = require('cypress')
const _ = require('lodash')
const del = require('del')
module.exports = defineConfig({
projectId: '4offi6',
numTestsKeptInMemory: 0,
pageLoadTimeout: 120000,
defaultCommandTimeout: 10000,
video: true,
chromeWebSecurity: false,
watchForFileChanges: false,
waitForAnimations: false,
experimentalWebKitSupport: true,
animationDistanceThreshold: 50,
e2e: {
setupNodeEvents(on, config) {
on('after:spec', (spec, results) => {
if (results && results.video) {
// Do we have failures for any retry attempts?
const failures = _.some(results.tests, (test) => {
return _.some(test.attempts, { state: 'failed' })
})
if (!failures) {
// delete the video if the spec passed and no tests retried
return del(results.video)
}
}
})
require('./cypress/plugins/index.js')(on, config)
require('cypress-localstorage-commands/plugin')(on, config)
return config
},
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})