-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.ts
More file actions
25 lines (24 loc) · 959 Bytes
/
Copy pathcypress.config.ts
File metadata and controls
25 lines (24 loc) · 959 Bytes
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
import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:4173',
setupNodeEvents(on) {
// Give the browser a large window so tall cy.viewport() sizes (e.g. the
// 1080x1920 store-asset frames) aren't clamped to the default ~720px
// window height when capturing screenshots.
on('before:browser:launch', (browser, launchOptions) => {
const width = 1280
const height = 2000
if (browser.family === 'chromium' && browser.name !== 'electron') {
launchOptions.args.push(`--window-size=${width},${height}`)
launchOptions.args.push('--force-device-scale-factor=1')
} else if (browser.name === 'electron') {
launchOptions.preferences.width = width
launchOptions.preferences.height = height
}
return launchOptions
})
},
},
})