-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcypress.config.js
More file actions
74 lines (66 loc) · 2.65 KB
/
Copy pathcypress.config.js
File metadata and controls
74 lines (66 loc) · 2.65 KB
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
67
68
69
70
71
72
73
74
import { defineConfig } from 'cypress';
import { configureVisualRegression } from 'cypress-visual-regression';
const config = defineConfig({
viewportWidth: 1920,
viewportHeight: 1080,
defaultCommandTimeout: 30000,
// reporter: "junit",
experimentalMemoryManagement: true,
numTestsKeptInMemory: 0,
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'reporter-config.json',
},
env: {
projectId: process.env.CYPRESS_PROJECT_ID,
},
expose: {
visualRegressionType: 'regression',
visualRegressionBaseDirectory: 'cypress/screenshots/MultiFlatmapVuer.cy.js/base',
visualRegressionDiffDirectory: 'cypress/screenshots/diff',
visualRegressionGenerateDiff: 'always',
visualRegressionFailSilently: true,
HUMAN_FEMALE_UUID: process.env.HUMAN_FEMALE_UUID ? process.env.HUMAN_FEMALE_UUID : '',
HUMAN_MALE_UUID: process.env.HUMAN_MALE_UUID ? process.env.HUMAN_MALE_UUID : '',
RAT_UUID: process.env.RAT_UUID ? process.env.RAT_UUID : '',
MOUSE_UUID: process.env.MOUSE_UUID ? process.env.MOUSE_UUID : '',
PIG_UUID: process.env.PIG_UUID ? process.env.PIG_UUID : '',
CAT_UUID: process.env.CAT_UUID ? process.env.CAT_UUID : '',
ERROR_TOLERANCE: process.env.ERROR_TOLERANCE ? process.env.ERROR_TOLERANCE : 0.0001,
},
component: {
specPattern: 'cypress/component/*.cy.js',
devServer: {
framework: 'vue',
bundler: 'vite',
},
screenshotsFolder: './cypress/screenshots',
setupNodeEvents(on, _config) {
configureVisualRegression(on);
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
// fullPage screenshot size is 1400x1200 on non-retina screens
// and 2800x2400 on retina screens
launchOptions.args.push('--window-size=1400,1200');
// force screen to be non-retina (1400x1200 size)
launchOptions.args.push('--force-device-scale-factor=1');
// force screen to be retina (2800x2400 size)
// launchOptions.args.push('--force-device-scale-factor=2')
}
if (browser.name === 'electron' && browser.isHeadless) {
// fullPage screenshot size is 1400x1200
launchOptions.preferences.width = 2000;
launchOptions.preferences.height = 2000;
}
if (browser.name === 'firefox' && browser.isHeadless) {
// menubars take up height on the screen
// so fullPage screenshot size is 1400x1126
launchOptions.args.push('--width=1400');
launchOptions.args.push('--height=1200');
}
return launchOptions;
});
},
},
});
export default config;