Skip to content

Commit f440a38

Browse files
authored
fix: Enabled pointer capabilities for Firefox in Playwright (#1589)
- Added Playwright Firefox user preferences to enable pointer capabilities - Updated 2 screenshots (note that these now match the other browser screen shots where the hover menu is hidden as it should be) fixes #1588
1 parent 94cc82c commit f440a38

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

playwright.config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ const config: PlaywrightTestConfig = {
6565
name: 'firefox',
6666
use: {
6767
...devices['Desktop Firefox'],
68+
// https://playwright.dev/docs/test-use-options#more-browser-and-context-options
69+
launchOptions: {
70+
// https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-firefox-user-prefs
71+
firefoxUserPrefs: {
72+
// By default, headless Firefox runs as though no pointers capabilities
73+
// are available.
74+
// https://github.com/microsoft/playwright/issues/7769#issuecomment-966098074
75+
//
76+
// This impacts React Spectrum which uses an '(any-pointer: fine)'
77+
// media query to determine font size. It also causes certain chart
78+
// elements to always be visible that should only be visible on
79+
// hover.
80+
//
81+
// Available values for pointer capabilities:
82+
// NO_POINTER = 0x00;
83+
// COARSE_POINTER = 0x01;
84+
// FINE_POINTER = 0x02;
85+
// HOVER_CAPABLE_POINTER = 0x04;
86+
//
87+
// Setting to 0x02 | 0x04 says the system supports a mouse
88+
'ui.primaryPointerCapabilities': 0x02 | 0x04,
89+
'ui.allPointerCapabilities': 0x02 | 0x04,
90+
},
91+
},
6892
},
6993
},
7094

-1.51 KB
Loading
-5.54 KB
Loading

0 commit comments

Comments
 (0)