-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
46 lines (45 loc) · 1.23 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
import { defineConfig } from 'cypress';
import { rmSync } from 'fs';
export default defineConfig({
chromeWebSecurity: false,
reporter: 'junit',
reporterOptions: {
mochaFile: 'cypress/results/output.xml',
},
viewportWidth: 1920,
viewportHeight: 1200,
videoCompression: false,
defaultCommandTimeout: 10000,
e2e: {
setupNodeEvents(on, config) {
on('after:spec', (spec, results) => {
if (results && results.video) {
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === 'failed'),
);
if (!failures) {
return rmSync(results.video);
}
}
return false;
});
on('task', {
log(message) {
// eslint-disable-next-line no-console
console.log(message);
return null;
},
});
// eslint-disable-next-line default-param-last
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'chrome') {
launchOptions.args.push(
'--proxy-bypass-list=<-loopback>,localhost:8080',
);
}
return launchOptions;
});
},
baseUrl: 'http://localhost:3000',
},
});