Skip to content

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

test(bidi): unskip or add expectations to some tests that work with BiDi (#37475)

Holger Benlcb3d18da7bbf
diff --git a/tests/library/browsercontext-network-event.spec.ts b/tests/library/browsercontext-network-event.spec.ts
index 45d42c41bf..e1a60c8a4f 100644
--- a/tests/library/browsercontext-network-event.spec.ts
+++ b/tests/library/browsercontext-network-event.spec.ts
@@ -105,7 +105,7 @@ 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.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons');
+ 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');
const favicon = `/no-cache/favicon.ico`;
const hashedFaviconUrl = `/favicon-hashed.ico`;
diff --git a/tests/library/favicon.spec.ts b/tests/library/favicon.spec.ts
index f3e318a60f..d267fdb186 100644
--- a/tests/library/favicon.spec.ts
+++ b/tests/library/favicon.spec.ts
@@ -18,7 +18,7 @@
import { contextTest as it } from '../config/browserTest';
it('should load svg favicon with prefer-color-scheme', async ({ page, server, browserName, channel, headless, asset }) => {
- it.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons');
+ 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');
// Browsers aggressively cache favicons, so force bust with the
diff --git a/tests/library/har.spec.ts b/tests/library/har.spec.ts
index 6d420e87cc..d0d97b0854 100644
--- a/tests/library/har.spec.ts
+++ b/tests/library/har.spec.ts
@@ -699,7 +699,7 @@ it('should contain http2 for http2 requests', async ({ contextFactory }, testInf
});
it('should filter favicon and favicon redirects', async ({ server, browserName, channel, headless, asset, contextFactory }, testInfo) => {
- it.skip(headless && browserName !== 'firefox', 'headless browsers, except firefox, do not request favicons');
+ 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');
const { page, getLog } = await pageWithHar(contextFactory, testInfo);
diff --git a/tests/page/page-event-console.spec.ts b/tests/page/page-event-console.spec.ts
index 2609a6cc27..081f743937 100644
--- a/tests/page/page-event-console.spec.ts
+++ b/tests/page/page-event-console.spec.ts
@@ -199,7 +199,9 @@ it('should use object previews for errors', async ({ page, browserName }) => {
await page.evaluate(() => console.log(new Error('Exception')));
if (browserName === 'chromium')
expect(text).toContain('.evaluate');
- if (browserName === 'webkit')
+ if (browserName as any === '_bidiChromium')
+ expect(text).toEqual('error');
+ if (browserName === 'webkit' || browserName as any === '_bidiFirefox')
expect(text).toEqual('Error: Exception');
if (browserName === 'firefox')
expect(text).toEqual('Error');
diff --git a/tests/page/page-route.spec.ts b/tests/page/page-route.spec.ts
index 592d4957cf..00b9754bd9 100644
--- a/tests/page/page-route.spec.ts
+++ b/tests/page/page-route.spec.ts
@@ -634,11 +634,11 @@ it('should support cors with GET', async ({ page, server, browserName }) => {
const response = await fetch('https://example.com/cars?reject', { mode: 'cors' });
return response.json();
}).catch(e => e);
- if (browserName === 'chromium')
+ if (browserName === 'chromium' || browserName === '_bidiChromium')
expect(error.message).toContain('Failed');
if (browserName === 'webkit')
expect(error.message).toContain('TypeError');
- if (browserName === 'firefox')
+ if (browserName === 'firefox' || browserName === '_bidiFirefox')
expect(error.message).toContain('NetworkError');
}
});