diff --git a/tests/cypress.config.ts b/tests/cypress.config.ts index 5ecd75340e..22074893d5 100644 --- a/tests/cypress.config.ts +++ b/tests/cypress.config.ts @@ -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; + }); + }, }, });