Cypress
How to Take Screenshots & Videos with Cypress
module.exports = defineConfig({
e2e: {
// Other settings can go here
viewportHeight: 1080,
viewportWidth: 1920,
setupNodeEvents(on, config) {
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'chrome') {
launchOptions.args.push(`--window-size=1920,1080`)
// force screen to be non-retina and just use our given resolution
launchOptions.args.push('--force-device-scale-factor=1')
}
return launchOptions
});
}
});Last updated
Was this helpful?