Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Puppeteer tests from CDP to WebDriver BiDi #17172

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,10 @@ async function startBrowser({ browserName, headless, startUrl }) {
}

if (browserName === "firefox") {
// Run tests with the WebDriver BiDi protocol enabled only for Firefox for
// now given that for Chrome further fixes are needed first.
options.protocol = "webDriverBiDi";

options.extraPrefsFirefox = {
// avoid to have a prompt when leaving a page with a form
"dom.disable_beforeunload": true,
Expand Down Expand Up @@ -1052,9 +1056,6 @@ async function closeSession(browser) {
continue;
}
if (session.browser !== undefined) {
for (const page of await session.browser.pages()) {
await page.close();
}
await session.browser.close();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OrKoN this actually fixes an issue with browsingContext.close() in puppeteer with Firefox when the context as passed into the BiDi call is null. Could this be a bug in Puppeteer? Or will some internal state change for other tabs as well when trying to close them all via such a loop?

}
session.closed = true;
Expand Down
Loading