Skip to content

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

test: adjust bidi browser name in browsertype-connect.spec (#34758)

Yury Semikhatskybab197b49385
diff --git a/tests/library/browsertype-connect.spec.ts b/tests/library/browsertype-connect.spec.ts
index e4118e489f..c0475ab57e 100644
--- a/tests/library/browsertype-connect.spec.ts
+++ b/tests/library/browsertype-connect.spec.ts
@@ -258,7 +258,9 @@ for (const kind of ['launchServer', 'run-server'] as const) {
}).catch(() => {})
]);
expect(request.headers['user-agent']).toBe(getUserAgent());
- expect(request.headers['x-playwright-browser']).toBe(browserName);
+ // _bidiFirefox and _bidiChromium are initialized with 'bidi' as browser name.
+ const bidiAwareBrowserName = browserName.startsWith('_bidi') ? 'bidi' : browserName;
+ expect(request.headers['x-playwright-browser']).toBe(bidiAwareBrowserName);
expect(request.headers['foo']).toBe('bar');
});