-
Notifications
You must be signed in to change notification settings - Fork 16
/
cypress-first.config.js
42 lines (40 loc) · 1.33 KB
/
cypress-first.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
const { defineConfig } = require('cypress')
const _ = require('lodash')
const del = require('del')
module.exports = defineConfig({
projectId: '4offi6',
fixturesFolder: false,
defaultCommandTimeout: 15000,
numTestsKeptInMemory: 0,
pageLoadTimeout: 120000,
watchForFileChanges: false,
chromeWebSecurity: false,
video: true,
videosFolder: 'cypress/videos-chat-pair/first-user',
waitForAnimations: false,
animationDistanceThreshold: 50,
experimentalWebKitSupport: true,
screenshotsFolder: 'cypress/screenshots-chat-pair/first-user',
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/integration-pair-chat/**/chat-first-user.js',
supportFile: 'cypress/support/first-user/e2e.js',
},
})