diff --git a/packages/puppeteer-core/src/common/Connection.ts b/packages/puppeteer-core/src/common/Connection.ts index f9ea618c422..a25fdfdc890 100644 --- a/packages/puppeteer-core/src/common/Connection.ts +++ b/packages/puppeteer-core/src/common/Connection.ts @@ -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; diff --git a/test/TestExpectations.json b/test/TestExpectations.json index 71661fdf6e6..f08febaa58f 100644 --- a/test/TestExpectations.json +++ b/test/TestExpectations.json @@ -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", @@ -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", @@ -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] *", @@ -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", @@ -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"],