-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress-base.config.ts
66 lines (62 loc) · 2.05 KB
/
cypress-base.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { addMatchImageSnapshotPlugin } from '@simonsmith/cypress-image-snapshot/plugin';
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
video: true,
trashAssetsBeforeRuns: false,
reporter: 'cypress-multi-reporters',
reporterOptions: {
reporterEnabled: 'mochawesome',
mochawesomeReporterOptions: {
useInlineDiffs: true,
embeddedScreenshots: true,
reportDir: 'cypress/reports/mocha',
quite: true,
overwrite: false,
html: false,
json: true,
},
},
setupNodeEvents(on) {
addMatchImageSnapshotPlugin(on);
on('before:browser:launch', (browser, launchOptions) => {
if (browser.isHeadless) {
if (browser.name === 'chrome') {
launchOptions.args.push('--window-size=1920,1080');
launchOptions.args.push('--force-device-scale-factor=1');
launchOptions.args.push('--mute-audio');
launchOptions.args.push('--disable-gpu');
} else if (browser.name === 'electron') {
launchOptions.preferences.width = 1920;
launchOptions.preferences.height = 1080;
} else if (browser.name === 'firefox') {
launchOptions.args.push('--width=1920');
launchOptions.args.push('--height=1080');
} else if (browser.name === 'edge') {
launchOptions.args.push('--window-size=1920,1080');
}
}
return launchOptions;
});
on('task', {
log(message) {
console.log(message);
return null;
},
table(message) {
console.table(message);
return null;
},
});
},
experimentalWebKitSupport: true,
supportFile: 'cypress/support/index.ts',
chromeWebSecurity: false,
screenshotOnRunFailure: false,
viewportHeight: 1080,
viewportWidth: 1920,
retries: 0,
testIsolation: false ,
specPattern: './cypress/integration/cmp/**/*.ts',
},
});