Skip to content

Commit dcff914

Browse files
authored
chore(bidi): make browserType.connect work (#34461)
1 parent c44590a commit dcff914

File tree

4 files changed

+11
-36
lines changed

4 files changed

+11
-36
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ test-results
3535
.cache/
3636
.eslintcache
3737
playwright.env
38+
/firefox/

packages/playwright-core/src/remote/playwrightConnection.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ export class PlaywrightConnection {
118118
const playwright = createPlaywright({ sdkLanguage: options.sdkLanguage, isServer: true });
119119

120120
const ownedSocksProxy = await this._createOwnedSocksProxy(playwright);
121-
const browser = await playwright[this._options.browserName as 'chromium'].launch(serverSideCallMetadata(), this._options.launchOptions);
121+
let browserName = this._options.browserName;
122+
if ('bidi' === browserName) {
123+
if (this._options.launchOptions?.channel?.toLocaleLowerCase().includes('firefox'))
124+
browserName = 'bidiFirefox';
125+
else
126+
browserName = 'bidiChromium';
127+
}
128+
const browser = await playwright[browserName as 'chromium'].launch(serverSideCallMetadata(), this._options.launchOptions);
122129

123130
this._cleanups.push(async () => {
124131
for (const browser of playwright.allBrowsers())

tests/bidi/expectationReporter.ts

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class ExpectationReporter implements Reporter {
5858
const key = test.titlePath().slice(2).join(' › ');
5959
if (outcome === 'timeout')
6060
expectations.set(key, outcome);
61+
else if (expectations.has(key) && test.outcome() !== 'skipped')
62+
expectations.delete(key); // Remove tests that no longer timeout.
6163
}
6264
const keys = Array.from(expectations.keys());
6365
keys.sort();

tests/bidi/expectations/bidi-firefox-nightly-library.txt

-35
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,8 @@ library/browsercontext-page-event.spec.ts › should have about:blank for empty
1515
library/browsercontext-proxy.spec.ts › should use proxy for https urls [timeout]
1616
library/browsercontext-service-worker-policy.spec.ts › block › blocks service worker registration [timeout]
1717
library/browsercontext-timezone-id.spec.ts › should work for multiple pages sharing same process [timeout]
18-
library/browsertype-connect.spec.ts › launchServer only › should be able to reconnect to a browser 12 times without warnings [timeout]
19-
library/browsertype-connect.spec.ts › launchServer only › should properly disconnect when connection closes from the server side [timeout]
20-
library/browsertype-connect.spec.ts › launchServer only › should work with cluster [timeout]
21-
library/browsertype-connect.spec.ts › launchServer › disconnected event should be emitted when browser is closed or server is closed [timeout]
22-
library/browsertype-connect.spec.ts › launchServer › disconnected event should have browser as argument [timeout]
23-
library/browsertype-connect.spec.ts › launchServer › setInputFiles should preserve lastModified timestamp [timeout]
2418
library/browsertype-connect.spec.ts › launchServer › should be able to connect 20 times to a single server without warnings [timeout]
25-
library/browsertype-connect.spec.ts › launchServer › should be able to connect two browsers at the same time [timeout]
26-
library/browsertype-connect.spec.ts › launchServer › should be able to connect when the wsEndpoint is passed as an option [timeout]
27-
library/browsertype-connect.spec.ts › launchServer › should be able to reconnect to a browser [timeout]
28-
library/browsertype-connect.spec.ts › launchServer › should be able to visit ipv6 [timeout]
29-
library/browsertype-connect.spec.ts › launchServer › should be able to visit ipv6 through localhost [timeout]
30-
library/browsertype-connect.spec.ts › launchServer › should connect over http [timeout]
31-
library/browsertype-connect.spec.ts › launchServer › should connect over wss [timeout]
32-
library/browsertype-connect.spec.ts › launchServer › should emit close events on pages and contexts [timeout]
33-
library/browsertype-connect.spec.ts › launchServer › should error when saving download after deletion [timeout]
34-
library/browsertype-connect.spec.ts › launchServer › should filter launch options [timeout]
35-
library/browsertype-connect.spec.ts › launchServer › should fulfill with global fetch result [timeout]
36-
library/browsertype-connect.spec.ts › launchServer › should handle exceptions during connect [timeout]
37-
library/browsertype-connect.spec.ts › launchServer › should ignore page.pause when headed [timeout]
38-
library/browsertype-connect.spec.ts › launchServer › should not throw on close after disconnect [timeout]
39-
library/browsertype-connect.spec.ts › launchServer › should properly disconnect when connection closes from the client side [timeout]
40-
library/browsertype-connect.spec.ts › launchServer › should record trace with sources [timeout]
41-
library/browsertype-connect.spec.ts › launchServer › should reject navigation when browser closes [timeout]
42-
library/browsertype-connect.spec.ts › launchServer › should reject waitForEvent before browser.close finishes [timeout]
43-
library/browsertype-connect.spec.ts › launchServer › should reject waitForEvent before browser.onDisconnect fires [timeout]
44-
library/browsertype-connect.spec.ts › launchServer › should reject waitForSelector when browser closes [timeout]
45-
library/browsertype-connect.spec.ts › launchServer › should respect selectors [timeout]
46-
library/browsertype-connect.spec.ts › launchServer › should save download [timeout]
47-
library/browsertype-connect.spec.ts › launchServer › should save har [timeout]
4819
library/browsertype-connect.spec.ts › launchServer › should saveAs videos from remote browser [timeout]
49-
library/browsertype-connect.spec.ts › launchServer › should set the browser connected state [timeout]
50-
library/browsertype-connect.spec.ts › launchServer › should support slowmo option [timeout]
51-
library/browsertype-connect.spec.ts › launchServer › should terminate network waiters [timeout]
52-
library/browsertype-connect.spec.ts › launchServer › should throw when calling waitForNavigation after disconnect [timeout]
53-
library/browsertype-connect.spec.ts › launchServer › should throw when used after isConnected returns false [timeout]
54-
library/browsertype-connect.spec.ts › launchServer › should upload large file [timeout]
5520
library/channels.spec.ts › should work with the domain module [timeout]
5621
library/chromium/chromium.spec.ts › PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1 › serviceWorker(), and fromServiceWorker() work [timeout]
5722
library/chromium/chromium.spec.ts › PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1 › setExtraHTTPHeaders [timeout]

0 commit comments

Comments
 (0)