From 9a730c806d36be5fb746b2f63804a54b10a12611 Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Thu, 19 Oct 2023 18:03:26 -0500 Subject: [PATCH] Playwright fixes - Pinning to 1.37.1 - Firefox pointer fixes #1543 --- package-lock.json | 2 +- package.json | 2 +- playwright.config.ts | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9392a357d9..d468647688 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "@deephaven/tsconfig": "file:../tsconfig", "@deephaven/utils": "file:../utils", "@fortawesome/fontawesome-common-types": "^6.1.1", - "@playwright/test": "^1.37.1", + "@playwright/test": "1.37.1", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.3", "@testing-library/react-hooks": "^8.0.1", diff --git a/package.json b/package.json index 4e41456ff5..58898ea2fc 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@deephaven/tsconfig": "file:../tsconfig", "@deephaven/utils": "file:../utils", "@fortawesome/fontawesome-common-types": "^6.1.1", - "@playwright/test": "^1.37.1", + "@playwright/test": "1.37.1", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.3", "@testing-library/react-hooks": "^8.0.1", diff --git a/playwright.config.ts b/playwright.config.ts index 280b040043..6940d4608d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -65,6 +65,23 @@ 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: { + // These settings fix an issue with '(any-pointer: fine)' media queries + // used by React Spectrum. In headless Firefox, this query seems to + // always return false which causes Spectrum to use the "large" scale. + // Other browsers properly return true which triggers "medium" scale. + // https://github.com/microsoft/playwright/issues/7769#issuecomment-966098074 + // const NO_POINTER = 0x00; + // const COARSE_POINTER = 0x01; + // const FINE_POINTER = 0x02; + // const HOVER_CAPABLE_POINTER = 0x04; + 'ui.primaryPointerCapabilities': 0x02 | 0x04, + 'ui.allPointerCapabilities': 0x02 | 0x04, + }, + }, }, },