-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
38 lines (36 loc) · 904 Bytes
/
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
const { defineConfig } = require('cypress');
const viewport =
process.env.VIDEO_TYPE === 'youtube'
? {
viewportWidth: 1080,
viewportHeight: 2006,
}
: {
viewportWidth: 1366,
viewportHeight: 800,
};
module.exports = defineConfig({
component: {
devServer: {
framework: 'next',
bundler: 'webpack',
},
},
video: true,
videosFolder: './public/videos',
e2e: {
setupNodeEvents(on, config) {},
baseUrl: 'http://localhost:3000',
setupNodeEvents(on, config) {
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.family === 'chromium' && browser.name !== 'electron') {
launchOptions.args.push(
`--window-size=${viewport.viewportWidth},${viewport.viewportHeight}`
);
return launchOptions;
}
});
},
},
...viewport,
});