Skip to content

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

test: rebase WebKit WSL headed tests (#37488)

Max Schmitt307421d5b9ad
diff --git a/tests/library/browsercontext-network-event.spec.ts b/tests/library/browsercontext-network-event.spec.ts
index e1a60c8a4f..6eaf9e624b 100644
--- a/tests/library/browsercontext-network-event.spec.ts
+++ b/tests/library/browsercontext-network-event.spec.ts
@@ -104,9 +104,9 @@ it('should fire events in proper order', async ({ context, server }) => {
]);
});
-it('should not fire events for favicon or favicon redirects', async ({ context, page, server, browserName, channel, headless }) => {
+it('should not fire events for favicon or favicon redirects', async ({ context, page, server, browserName, headless }) => {
it.skip(headless && browserName !== 'firefox' && browserName as any !== '_bidiFirefox', 'headless browsers, except firefox, do not request favicons');
- it.skip(!headless && browserName === 'webkit' && !channel, 'headed webkit does not have a favicon feature');
+ it.skip(!headless && browserName === 'webkit', 'headed webkit does not have a favicon feature');
const favicon = `/no-cache/favicon.ico`;
const hashedFaviconUrl = `/favicon-hashed.ico`;
const imagePath = `/fakeimage.png`;
diff --git a/tests/library/favicon.spec.ts b/tests/library/favicon.spec.ts
index d267fdb186..e8c5d56c76 100644
--- a/tests/library/favicon.spec.ts
+++ b/tests/library/favicon.spec.ts
@@ -17,9 +17,9 @@
import { contextTest as it } from '../config/browserTest';
-it('should load svg favicon with prefer-color-scheme', async ({ page, server, browserName, channel, headless, asset }) => {
+it('should load svg favicon with prefer-color-scheme', async ({ page, server, browserName, headless, asset }) => {
it.skip(headless && browserName !== 'firefox' && browserName as any !== '_bidiFirefox', 'headless browsers, except firefox, do not request favicons');
- it.skip(!headless && browserName === 'webkit' && !channel, 'headed webkit does not have a favicon feature');
+ it.skip(!headless && browserName === 'webkit', 'headed webkit does not have a favicon feature');
// Browsers aggressively cache favicons, so force bust with the
// `d` parameter to make iterating on this test more predictable and isolated.
diff --git a/tests/library/har.spec.ts b/tests/library/har.spec.ts
index d0d97b0854..d85ba463c8 100644
--- a/tests/library/har.spec.ts
+++ b/tests/library/har.spec.ts
@@ -698,9 +698,9 @@ it('should contain http2 for http2 requests', async ({ contextFactory }, testInf
server.close();
});
-it('should filter favicon and favicon redirects', async ({ server, browserName, channel, headless, asset, contextFactory }, testInfo) => {
+it('should filter favicon and favicon redirects', async ({ server, browserName, headless, asset, contextFactory }, testInfo) => {
it.skip(headless && browserName !== 'firefox' && browserName as any !== '_bidiFirefox', 'headless browsers, except firefox, do not request favicons');
- it.skip(!headless && browserName === 'webkit' && !channel, 'headed webkit does not have a favicon feature');
+ it.skip(!headless && browserName === 'webkit', 'headed webkit does not have a favicon feature');
const { page, getLog } = await pageWithHar(contextFactory, testInfo);
diff --git a/tests/library/video.spec.ts b/tests/library/video.spec.ts
index 91ce942a67..fc2c89a40c 100644
--- a/tests/library/video.spec.ts
+++ b/tests/library/video.spec.ts
@@ -755,11 +755,11 @@ it.describe('screencast', () => {
expectAll(pixels, isAlmostRed);
});
- it('should capture full viewport on hidpi', async ({ browserType, browserName, headless, isWindows, isLinux, isHeadlessShell }, testInfo) => {
+ it('should capture full viewport on hidpi', async ({ browserType, browserName, headless, isWindows, isLinux, isHeadlessShell, channel }, testInfo) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/22411' });
it.fixme(browserName === 'chromium' && !isHeadlessShell, 'The square is not on the video');
it.fixme(browserName === 'firefox' && isWindows, 'https://github.com/microsoft/playwright/issues/14405');
- it.fixme(browserName === 'webkit' && isLinux && !headless, 'https://github.com/microsoft/playwright/issues/22617');
+ it.fixme(browserName === 'webkit' && !headless && (isLinux || (isWindows && channel === 'webkit-wsl')), 'https://github.com/microsoft/playwright/issues/22617');
const size = { width: 600, height: 400 };
const browser = await browserType.launch();
diff --git a/tests/page/page-screenshot.spec.ts b/tests/page/page-screenshot.spec.ts
index 39dc5e56dc..1be6ce3e04 100644
--- a/tests/page/page-screenshot.spec.ts
+++ b/tests/page/page-screenshot.spec.ts
@@ -280,9 +280,9 @@ it.describe('page screenshot', () => {
expect(screenshot).toMatchSnapshot('screenshot-clip-odd-size.png');
});
- it('should work for canvas', async ({ page, server, isElectron, isMac, isLinux, macVersion, browserName, isHeadlessShell, headless, channel }) => {
+ it('should work for canvas', async ({ page, server, isElectron, isMac, isLinux, isWindows, macVersion, browserName, isHeadlessShell, headless, channel }) => {
it.fixme(isElectron && isMac, 'Fails on the bots');
- it.fixme(browserName === 'webkit' && isLinux && !headless, 'WebKit has slightly different corners on gtk4.');
+ it.fixme(browserName === 'webkit' && !headless && (isLinux || (isWindows && channel === 'webkit-wsl')), 'WebKit has slightly different corners on gtk4.');
await page.setViewportSize({ width: 500, height: 500 });
await page.goto(server.PREFIX + '/screenshots/canvas.html');
const screenshot = await page.screenshot();