Skip to content

Commit

Permalink
Add legacy-handling of headless Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimminich committed Sep 21, 2023
1 parent 1189d67 commit 128b8cf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ export default defineConfig({
fixturesFolder: false,
supportFile: 'test/cypress/support/e2e.ts',
setupNodeEvents (on: any) {
on('before:browser:launch', (browser: any = {}, launchOptions: any) => { // TODO Remove after upgrade to Cypress >=12.5.0, see https://github.com/cypress-io/cypress-documentation/issues/5479
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args = launchOptions.args.map((arg: any) => {
if (arg === '--headless') {
return '--headless=new'
}

return arg
})
}
return launchOptions
})

on('task', {
GenerateCoupon (discount: number) {
return security.generateCoupon(discount)
Expand Down

0 comments on commit 128b8cf

Please sign in to comment.