forked from safe-global/safe-wallet-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
53 lines (49 loc) · 1.36 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
import { defineConfig } from 'cypress'
import 'dotenv/config'
import * as fs from 'fs'
import { configureVisualRegression } from 'cypress-visual-regression'
export default defineConfig({
projectId: 'exhdra',
trashAssetsBeforeRuns: true,
reporter: 'junit',
reporterOptions: {
mochaFile: 'reports/junit-[hash].xml',
},
retries: {
runMode: 3,
openMode: 0,
},
e2e: {
screenshotsFolder: './cypress/snapshots/actual',
setupNodeEvents(on, config) {
configureVisualRegression(on),
on('task', {
log(message) {
console.log(message)
return null
},
})
on('after:spec', (spec, results) => {
if (results && results.video) {
const failures = results.tests.some((test) => test.attempts.some((attempt) => attempt.state === 'failed'))
if (!failures) {
fs.unlinkSync(results.video)
}
}
})
},
env: {
...process.env,
visualRegressionType: 'regression',
visualRegressionBaseDirectory: 'cypress/snapshots/actual',
visualRegressionDiffDirectory: 'cypress/snapshots/diff',
visualRegressionGenerateDiff: 'fail',
},
baseUrl: 'http://localhost:3000',
testIsolation: false,
hideXHR: true,
defaultCommandTimeout: 10000,
pageLoadTimeout: 60000,
},
chromeWebSecurity: false,
})