forked from jalantechnologies/boilerplate-mern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
37 lines (31 loc) · 949 Bytes
/
cypress.config.ts
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
import { defineConfig } from 'cypress';
import scenarios from './cypress/scenarios';
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:8080',
setupNodeEvents(on) {
on('task', {
'scenario:cleanup': async (scenario: string) => {
if (scenarios[scenario] === undefined) throw new Error('Undefined Scenario');
await scenarios[scenario].cleanup();
return null;
},
'scenario:setup': async (scenario: string) => {
if (scenarios[scenario] === undefined) throw new Error('Undefined Scenario');
const res = await scenarios[scenario].setup();
return res || null;
},
});
},
},
retries: {
// Configure retry attempts for `cypress run`
// Default is 0
runMode: 2,
// Configure retry attempts for `cypress open`
// Default is 0
openMode: 0,
},
screenshotOnRunFailure: false,
video: false,
});