Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: add a regression test for pointer media queries (#40629)

Andrey Lushnikov92e694bdd300
diff --git a/tests/page/page-emulate-media.spec.ts b/tests/page/page-emulate-media.spec.ts
index 2cfd5cff52..63c9ec0894 100644
--- a/tests/page/page-emulate-media.spec.ts
+++ b/tests/page/page-emulate-media.spec.ts
@@ -192,3 +192,9 @@ it('should emulate contrast ', async ({ page }) => {
await page.emulateMedia({ contrast: null });
await expect(page).toMatchMedia('(prefers-contrast: no-preference)');
});
+
+it('should report hover and fine pointer for desktop', async ({ page, browserName, headless, isLinux }) => {
+ it.fail(browserName === 'firefox' && isLinux && headless, 'https://github.com/microsoft/playwright/issues/38835');
+ await expect(page).toMatchMedia('(hover: hover)');
+ await expect(page).toMatchMedia('(pointer: fine)');
+});