-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcypress-base.config.ts
42 lines (40 loc) · 1.48 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
import { addMatchImageSnapshotPlugin } from '@simonsmith/cypress-image-snapshot/plugin';
import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
video: true,
trashAssetsBeforeRuns: false,
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;
});
},
experimentalWebKitSupport: true,
supportFile: 'cypress/support/index.ts',
chromeWebSecurity: false,
screenshotOnRunFailure: true,
viewportHeight: 1080,
viewportWidth: 1920,
retries: 0,
testIsolation: false,
specPattern: './cypress/integration/sf/components/**/*.ts',
baseUrl: 'https://www.cypress.io/',
}
});