diff --git a/playwright.config.ts b/playwright.config.ts index 280b040043..cd6c7c6615 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -65,6 +65,30 @@ const config: PlaywrightTestConfig = { name: 'firefox', use: { ...devices['Desktop Firefox'], + // https://playwright.dev/docs/test-use-options#more-browser-and-context-options + launchOptions: { + // https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-firefox-user-prefs + firefoxUserPrefs: { + // By default, headless Firefox runs as though no pointers capabilities + // are available. + // https://github.com/microsoft/playwright/issues/7769#issuecomment-966098074 + // + // This impacts React Spectrum which uses an '(any-pointer: fine)' + // media query to determine font size. It also causes certain chart + // elements to always be visible that should only be visible on + // hover. + // + // Available values for pointer capabilities: + // NO_POINTER = 0x00; + // COARSE_POINTER = 0x01; + // FINE_POINTER = 0x02; + // HOVER_CAPABLE_POINTER = 0x04; + // + // Setting to 0x02 | 0x04 says the system supports a mouse + 'ui.primaryPointerCapabilities': 0x02 | 0x04, + 'ui.allPointerCapabilities': 0x02 | 0x04, + }, + }, }, }, diff --git a/tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-firefox-linux.png b/tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-firefox-linux.png index 2faf025b43..13f98dd478 100644 Binary files a/tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-firefox-linux.png and b/tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-firefox-linux.png differ diff --git a/tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-firefox-linux.png b/tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-firefox-linux.png index 9d101fbbfb..1cdb88ffc0 100644 Binary files a/tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-firefox-linux.png and b/tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-firefox-linux.png differ