Skip to content

Commit

Permalink
tests: Chrome bug workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ciyer committed Sep 22, 2023
1 parent d2b4a9d commit b5bda4d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,22 @@ export default defineConfig({
// },
baseUrl: "http://localhost:3000",
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
setupNodeEvents(on) {
// Workaround for a Cypress/Chrome interaction. Can be removed after upgrading to Cypress 12.15.0
// See https://github.com/cypress-io/cypress-documentation/issues/5479#issuecomment-1719336938
on("before:browser:launch", (browser, launchOptions) => {
if (browser.name === "chrome" && browser.isHeadless) {
launchOptions.args = launchOptions.args.map((arg) => {
if (arg === "--headless") {
return "--headless=new";
}

return arg;
});
}

return launchOptions;
});
},
},
});

0 comments on commit b5bda4d

Please sign in to comment.