diff --git a/projects/demo-cypress/cypress.config.ts b/projects/demo-cypress/cypress.config.ts index 30cf708387f4..2156c07aa5b4 100644 --- a/projects/demo-cypress/cypress.config.ts +++ b/projects/demo-cypress/cypress.config.ts @@ -46,7 +46,26 @@ export default defineConfig({ specPattern: 'src/tests/**/*.cy.ts', experimentalSingleTabRunMode: true, setupNodeEvents(on, config) { - return getCompareSnapshotsPlugin(on, config); + getCompareSnapshotsPlugin(on, config); + + on('before:browser:launch', (browser, launchOptions) => { + if (browser.name === 'chrome') { + launchOptions.args.push( + '--font-render-hinting=none', // prevent inconsistent text rendering in headless mode + '--force-device-scale-factor=2', // force screen to be retina + '--high-dpi-support=1', + '--force-prefers-reduced-motion', + '--force-color-profile=srgb', + '--disable-dev-shm-usage', + '--disable-gpu', + '--incognito', + ); + } + + return launchOptions; + }); + + return config; }, }, }); diff --git a/projects/demo-cypress/project.json b/projects/demo-cypress/project.json index 1a73c648cb03..60448cd21075 100644 --- a/projects/demo-cypress/project.json +++ b/projects/demo-cypress/project.json @@ -12,7 +12,8 @@ "cypressConfig": "{projectRoot}/cypress.config.ts", "testingType": "component", "skipServe": true, - "devServerTarget": "demo:build" + "devServerTarget": "demo:build", + "browser": "chrome" } } }