Skip to content

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

chore(bidi): fix console.warn() message type (#39702)

Holger Benl4e00ab73c394
diff --git a/packages/playwright-core/src/server/bidi/bidiPage.ts b/packages/playwright-core/src/server/bidi/bidiPage.ts
index 3911b4517a..f94fe48c1a 100644
--- a/packages/playwright-core/src/server/bidi/bidiPage.ts
+++ b/packages/playwright-core/src/server/bidi/bidiPage.ts
@@ -292,7 +292,8 @@ export class BidiPage implements PageDelegate {
const callFrame = params.stackTrace?.callFrames[0];
const location = callFrame ?? { url: '', lineNumber: 1, columnNumber: 1 };
- this._page.addConsoleMessage(null, entry.method, entry.args.map(arg => createHandle(context, arg)), location, undefined, params.timestamp);
+ const type = entry.method === 'warn' ? 'warning' : entry.method;
+ this._page.addConsoleMessage(null, type, entry.args.map(arg => createHandle(context, arg)), location, undefined, params.timestamp);
}
private async _onFileDialogOpened(params: bidi.Input.FileDialogInfo) {
diff --git a/tests/bidi/expectations/moz-firefox-nightly-page.txt b/tests/bidi/expectations/moz-firefox-nightly-page.txt
index b0237ad336..aaec3f6391 100644
--- a/tests/bidi/expectations/moz-firefox-nightly-page.txt
+++ b/tests/bidi/expectations/moz-firefox-nightly-page.txt
@@ -93,7 +93,6 @@ page/page-emulate-media.spec.ts › should work during navigation [fail]
page/page-event-console.spec.ts › should have location for console API calls [fail]
page/page-event-console.spec.ts › should trigger correct Log [timeout]
page/page-event-console.spec.ts › should work @smoke [flaky]
-page/page-event-console.spec.ts › should work for different console API calls [fail]
page/page-event-request.spec.ts › should report requests and responses handled by service worker [fail]
page/page-event-request.spec.ts › should report requests and responses handled by service worker with routing [fail]
page/page-expose-function.spec.ts › should work with setContent [timeout]