Skip to content

Commit

Permalink
chore: fix error in Connection for Firefox (#10422)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Jun 20, 2023
1 parent 3ba7fba commit 0556799
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
8 changes: 7 additions & 1 deletion packages/puppeteer-core/src/common/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,13 @@ function createProtocolErrorMessage(object: {
error: {message: string; data: any; code: number};
}): string {
let message = `${object.error.message}`;
if ('data' in object.error) {
// TODO: remove the type checks when we stop connecting to BiDi with a CDP
// client.
if (
object.error &&
typeof object.error === 'object' &&
'data' in object.error
) {
message += ` ${object.error.data}`;
}
return message;
Expand Down
22 changes: 17 additions & 5 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,13 @@
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Browser.disconnect should reject navigation when browser closes",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Browser.disconnect should reject waitForSelector when browser closes",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.executablePath returns executablePath for channel",
Expand Down Expand Up @@ -891,7 +891,7 @@
"testIdPattern": "[locator.spec] Locator Locator.change should work for contenteditable",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[locator.spec] Locator Locator.change should work for inputs",
Expand Down Expand Up @@ -1125,7 +1125,7 @@
"testIdPattern": "[page.spec] Page Page.waitForNetworkIdle should work with aborted requests",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"]
"expectations": ["FAIL", "PASS", "TIMEOUT"]
},
{
"testIdPattern": "[proxy.spec] *",
Expand Down Expand Up @@ -1463,11 +1463,17 @@
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[chromiumonly.spec] Chromium-Specific Launcher tests Puppeteer.launch |browserURL| option should be able to connect using browserUrl, with and without trailing slash",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[click.spec] Page.click should click offscreen buttons",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["TIMEOUT", "FAIL"]
"expectations": ["FAIL", "TIMEOUT"]
},
{
"testIdPattern": "[click.spec] Page.click should click on checkbox label and toggle",
Expand Down Expand Up @@ -2135,6 +2141,12 @@
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch userDataDir option should restore cookies",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL", "PASS", "TIMEOUT"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch userDataDir option should restore state",
"platforms": ["darwin", "linux", "win32"],
Expand Down

0 comments on commit 0556799

Please sign in to comment.