From 6b7c9394b1e8e36b2387de6cbd9c74f4a17a0bad Mon Sep 17 00:00:00 2001 From: Playwright Service <89237858+playwrightmachine@users.noreply.github.com> Date: Sat, 21 Sep 2024 03:17:52 -0700 Subject: [PATCH] feat(roll): roll to ToT Playwright (21-09-24) (#1527) --- dotnet/docs/actionability.mdx | 1 + dotnet/docs/api-testing.mdx | 1 + dotnet/docs/api/class-accessibility.mdx | 1 + dotnet/docs/api/class-apirequest.mdx | 5 +- dotnet/docs/api/class-apirequestcontext.mdx | 1 + dotnet/docs/api/class-apiresponse.mdx | 1 + .../docs/api/class-apiresponseassertions.mdx | 1 + dotnet/docs/api/class-browser.mdx | 9 +- dotnet/docs/api/class-browsercontext.mdx | 37 +++ dotnet/docs/api/class-browsertype.mdx | 5 +- dotnet/docs/api/class-cdpsession.mdx | 1 + dotnet/docs/api/class-cdpsessionevent.mdx | 1 + dotnet/docs/api/class-clock.mdx | 1 + dotnet/docs/api/class-consolemessage.mdx | 1 + dotnet/docs/api/class-dialog.mdx | 1 + dotnet/docs/api/class-download.mdx | 1 + dotnet/docs/api/class-elementhandle.mdx | 1 + dotnet/docs/api/class-filechooser.mdx | 1 + dotnet/docs/api/class-formdata.mdx | 1 + dotnet/docs/api/class-frame.mdx | 1 + dotnet/docs/api/class-framelocator.mdx | 134 ++++---- dotnet/docs/api/class-jshandle.mdx | 1 + dotnet/docs/api/class-keyboard.mdx | 1 + dotnet/docs/api/class-locator.mdx | 5 +- dotnet/docs/api/class-locatorassertions.mdx | 1 + dotnet/docs/api/class-mouse.mdx | 1 + dotnet/docs/api/class-page.mdx | 37 +++ dotnet/docs/api/class-pageassertions.mdx | 1 + dotnet/docs/api/class-playwright.mdx | 1 + .../docs/api/class-playwrightassertions.mdx | 1 + dotnet/docs/api/class-request.mdx | 1 + dotnet/docs/api/class-response.mdx | 1 + dotnet/docs/api/class-route.mdx | 1 + dotnet/docs/api/class-selectors.mdx | 1 + dotnet/docs/api/class-timeouterror.mdx | 1 + dotnet/docs/api/class-touchscreen.mdx | 1 + dotnet/docs/api/class-tracing.mdx | 9 +- dotnet/docs/api/class-video.mdx | 1 + dotnet/docs/api/class-weberror.mdx | 1 + dotnet/docs/api/class-websocket.mdx | 1 + dotnet/docs/api/class-websocketframe.mdx | 1 + dotnet/docs/api/class-websocketroute.mdx | 268 ++++++++++++++++ dotnet/docs/api/class-worker.mdx | 1 + dotnet/docs/auth.mdx | 1 + dotnet/docs/browser-contexts.mdx | 1 + dotnet/docs/browsers.mdx | 1 + dotnet/docs/ci-intro.mdx | 5 +- dotnet/docs/ci.mdx | 1 + dotnet/docs/clock.mdx | 1 + dotnet/docs/codegen-intro.mdx | 1 + dotnet/docs/codegen.mdx | 1 + dotnet/docs/debug.mdx | 1 + dotnet/docs/dialogs.mdx | 1 + dotnet/docs/docker.mdx | 1 + dotnet/docs/downloads.mdx | 1 + dotnet/docs/emulation.mdx | 1 + dotnet/docs/evaluating.mdx | 1 + dotnet/docs/events.mdx | 1 + dotnet/docs/extensibility.mdx | 1 + dotnet/docs/frames.mdx | 1 + dotnet/docs/handles.mdx | 1 + dotnet/docs/input.mdx | 1 + dotnet/docs/intro.mdx | 1 + dotnet/docs/languages.mdx | 1 + dotnet/docs/library.mdx | 1 + dotnet/docs/locators.mdx | 1 + dotnet/docs/mock.mdx | 1 + dotnet/docs/navigations.mdx | 1 + dotnet/docs/network.mdx | 1 + dotnet/docs/other-locators.mdx | 1 + dotnet/docs/pages.mdx | 1 + dotnet/docs/pom.mdx | 1 + dotnet/docs/release-notes.mdx | 1 + dotnet/docs/running-tests.mdx | 1 + dotnet/docs/screenshots.mdx | 1 + dotnet/docs/selenium-grid.mdx | 1 + dotnet/docs/test-assertions.mdx | 1 + dotnet/docs/test-runners.mdx | 1 + dotnet/docs/trace-viewer-intro.mdx | 1 + dotnet/docs/trace-viewer.mdx | 7 +- dotnet/docs/videos.mdx | 1 + dotnet/docs/webview2.mdx | 1 + dotnet/docs/writing-tests.mdx | 1 + java/docs/accessibility-testing.mdx | 1 + java/docs/actionability.mdx | 1 + java/docs/api-testing.mdx | 1 + java/docs/api/class-apirequest.mdx | 5 +- java/docs/api/class-apirequestcontext.mdx | 1 + java/docs/api/class-apiresponse.mdx | 1 + java/docs/api/class-apiresponseassertions.mdx | 1 + java/docs/api/class-browser.mdx | 9 +- java/docs/api/class-browsercontext.mdx | 37 +++ java/docs/api/class-browsertype.mdx | 5 +- java/docs/api/class-cdpsession.mdx | 1 + java/docs/api/class-clock.mdx | 1 + java/docs/api/class-consolemessage.mdx | 1 + java/docs/api/class-dialog.mdx | 1 + java/docs/api/class-download.mdx | 1 + java/docs/api/class-elementhandle.mdx | 1 + java/docs/api/class-filechooser.mdx | 1 + java/docs/api/class-formdata.mdx | 1 + java/docs/api/class-frame.mdx | 1 + java/docs/api/class-framelocator.mdx | 134 ++++---- java/docs/api/class-jshandle.mdx | 1 + java/docs/api/class-keyboard.mdx | 1 + java/docs/api/class-locator.mdx | 5 +- java/docs/api/class-locatorassertions.mdx | 1 + java/docs/api/class-mouse.mdx | 1 + java/docs/api/class-page.mdx | 37 +++ java/docs/api/class-pageassertions.mdx | 1 + java/docs/api/class-playwright.mdx | 1 + java/docs/api/class-playwrightassertions.mdx | 1 + java/docs/api/class-playwrightexception.mdx | 1 + java/docs/api/class-request.mdx | 1 + java/docs/api/class-requestoptions.mdx | 1 + java/docs/api/class-response.mdx | 1 + java/docs/api/class-route.mdx | 1 + java/docs/api/class-selectors.mdx | 1 + java/docs/api/class-timeouterror.mdx | 1 + java/docs/api/class-touchscreen.mdx | 1 + java/docs/api/class-tracing.mdx | 9 +- java/docs/api/class-video.mdx | 1 + java/docs/api/class-weberror.mdx | 1 + java/docs/api/class-websocket.mdx | 1 + java/docs/api/class-websocketframe.mdx | 1 + java/docs/api/class-websocketroute.mdx | 271 ++++++++++++++++ java/docs/api/class-worker.mdx | 1 + java/docs/auth.mdx | 1 + java/docs/browser-contexts.mdx | 1 + java/docs/browsers.mdx | 1 + java/docs/ci-intro.mdx | 5 +- java/docs/ci.mdx | 1 + java/docs/clock.mdx | 1 + java/docs/codegen-intro.mdx | 1 + java/docs/codegen.mdx | 1 + java/docs/debug.mdx | 1 + java/docs/dialogs.mdx | 1 + java/docs/docker.mdx | 1 + java/docs/downloads.mdx | 1 + java/docs/emulation.mdx | 1 + java/docs/evaluating.mdx | 1 + java/docs/events.mdx | 1 + java/docs/extensibility.mdx | 1 + java/docs/frames.mdx | 1 + java/docs/handles.mdx | 1 + java/docs/input.mdx | 1 + java/docs/intro.mdx | 1 + java/docs/junit.mdx | 1 + java/docs/languages.mdx | 1 + java/docs/locators.mdx | 1 + java/docs/mock.mdx | 1 + java/docs/navigations.mdx | 1 + java/docs/network.mdx | 1 + java/docs/other-locators.mdx | 1 + java/docs/pages.mdx | 1 + java/docs/pom.mdx | 1 + java/docs/release-notes.mdx | 1 + java/docs/running-tests.mdx | 1 + java/docs/screenshots.mdx | 1 + java/docs/selenium-grid.mdx | 1 + java/docs/test-assertions.mdx | 1 + java/docs/test-runners.mdx | 1 + java/docs/threading.mdx | 1 + java/docs/trace-viewer-intro.mdx | 7 +- java/docs/trace-viewer.mdx | 11 +- java/docs/videos.mdx | 1 + java/docs/webview2.mdx | 1 + java/docs/writing-tests.mdx | 1 + nodejs/docs/accessibility-testing.mdx | 3 +- nodejs/docs/actionability.mdx | 3 +- nodejs/docs/api-testing.mdx | 3 +- nodejs/docs/api/class-accessibility.mdx | 3 +- nodejs/docs/api/class-android.mdx | 3 +- nodejs/docs/api/class-androiddevice.mdx | 3 +- nodejs/docs/api/class-androidinput.mdx | 3 +- nodejs/docs/api/class-androidsocket.mdx | 3 +- nodejs/docs/api/class-androidwebview.mdx | 3 +- nodejs/docs/api/class-apirequest.mdx | 7 +- nodejs/docs/api/class-apirequestcontext.mdx | 3 +- nodejs/docs/api/class-apiresponse.mdx | 3 +- .../docs/api/class-apiresponseassertions.mdx | 3 +- nodejs/docs/api/class-browser.mdx | 11 +- nodejs/docs/api/class-browsercontext.mdx | 39 ++- nodejs/docs/api/class-browserserver.mdx | 3 +- nodejs/docs/api/class-browsertype.mdx | 7 +- nodejs/docs/api/class-cdpsession.mdx | 3 +- nodejs/docs/api/class-clock.mdx | 3 +- nodejs/docs/api/class-consolemessage.mdx | 3 +- nodejs/docs/api/class-coverage.mdx | 3 +- nodejs/docs/api/class-dialog.mdx | 3 +- nodejs/docs/api/class-download.mdx | 3 +- nodejs/docs/api/class-electron.mdx | 3 +- nodejs/docs/api/class-electronapplication.mdx | 3 +- nodejs/docs/api/class-elementhandle.mdx | 3 +- nodejs/docs/api/class-filechooser.mdx | 3 +- nodejs/docs/api/class-fixtures.mdx | 3 +- nodejs/docs/api/class-frame.mdx | 3 +- nodejs/docs/api/class-framelocator.mdx | 136 ++++---- nodejs/docs/api/class-fullconfig.mdx | 3 +- nodejs/docs/api/class-fullproject.mdx | 3 +- nodejs/docs/api/class-genericassertions.mdx | 3 +- nodejs/docs/api/class-jshandle.mdx | 3 +- nodejs/docs/api/class-keyboard.mdx | 3 +- nodejs/docs/api/class-location.mdx | 3 +- nodejs/docs/api/class-locator.mdx | 7 +- nodejs/docs/api/class-locatorassertions.mdx | 3 +- nodejs/docs/api/class-logger.mdx | 3 +- nodejs/docs/api/class-mouse.mdx | 3 +- nodejs/docs/api/class-page.mdx | 39 ++- nodejs/docs/api/class-pageassertions.mdx | 3 +- nodejs/docs/api/class-playwright.mdx | 3 +- .../docs/api/class-playwrightassertions.mdx | 3 +- nodejs/docs/api/class-reporter.mdx | 3 +- nodejs/docs/api/class-request.mdx | 3 +- nodejs/docs/api/class-response.mdx | 3 +- nodejs/docs/api/class-route.mdx | 3 +- nodejs/docs/api/class-selectors.mdx | 3 +- nodejs/docs/api/class-snapshotassertions.mdx | 3 +- nodejs/docs/api/class-suite.mdx | 3 +- nodejs/docs/api/class-test.mdx | 4 +- nodejs/docs/api/class-testcase.mdx | 3 +- nodejs/docs/api/class-testconfig.mdx | 3 +- nodejs/docs/api/class-testerror.mdx | 3 +- nodejs/docs/api/class-testinfo.mdx | 3 +- nodejs/docs/api/class-testinfoerror.mdx | 3 +- nodejs/docs/api/class-testoptions.mdx | 7 +- nodejs/docs/api/class-testproject.mdx | 3 +- nodejs/docs/api/class-testresult.mdx | 3 +- nodejs/docs/api/class-teststep.mdx | 3 +- nodejs/docs/api/class-timeouterror.mdx | 3 +- nodejs/docs/api/class-touchscreen.mdx | 3 +- nodejs/docs/api/class-tracing.mdx | 11 +- nodejs/docs/api/class-video.mdx | 3 +- nodejs/docs/api/class-weberror.mdx | 3 +- nodejs/docs/api/class-websocket.mdx | 3 +- nodejs/docs/api/class-websocketroute.mdx | 298 ++++++++++++++++++ nodejs/docs/api/class-worker.mdx | 3 +- nodejs/docs/api/class-workerinfo.mdx | 3 +- nodejs/docs/auth.mdx | 3 +- nodejs/docs/best-practices.mdx | 3 +- nodejs/docs/browser-contexts.mdx | 3 +- nodejs/docs/browsers.mdx | 3 +- nodejs/docs/canary-releases.mdx | 3 +- nodejs/docs/chrome-extensions.mdx | 3 +- nodejs/docs/ci-intro.mdx | 7 +- nodejs/docs/ci.mdx | 23 +- nodejs/docs/clock.mdx | 3 +- nodejs/docs/codegen-intro.mdx | 3 +- nodejs/docs/codegen.mdx | 3 +- nodejs/docs/debug.mdx | 3 +- nodejs/docs/dialogs.mdx | 3 +- nodejs/docs/docker.mdx | 19 +- nodejs/docs/downloads.mdx | 3 +- nodejs/docs/emulation.mdx | 3 +- nodejs/docs/evaluating.mdx | 3 +- nodejs/docs/events.mdx | 3 +- nodejs/docs/extensibility.mdx | 3 +- nodejs/docs/frames.mdx | 3 +- nodejs/docs/getting-started-vscode.mdx | 3 +- nodejs/docs/handles.mdx | 3 +- nodejs/docs/input.mdx | 3 +- nodejs/docs/intro.mdx | 3 +- nodejs/docs/languages.mdx | 3 +- nodejs/docs/library.mdx | 3 +- nodejs/docs/locators.mdx | 3 +- nodejs/docs/mock-browser.mdx | 3 +- nodejs/docs/mock.mdx | 3 +- nodejs/docs/navigations.mdx | 3 +- nodejs/docs/network.mdx | 3 +- nodejs/docs/other-locators.mdx | 3 +- nodejs/docs/pages.mdx | 3 +- nodejs/docs/pom.mdx | 3 +- nodejs/docs/protractor.mdx | 3 +- nodejs/docs/puppeteer.mdx | 3 +- nodejs/docs/release-notes.mdx | 3 +- nodejs/docs/running-tests.mdx | 3 +- nodejs/docs/screenshots.mdx | 3 +- nodejs/docs/selenium-grid.mdx | 3 +- ...ce-workers-experimental-network-events.mdx | 3 +- nodejs/docs/test-annotations.mdx | 3 +- nodejs/docs/test-assertions.mdx | 3 +- nodejs/docs/test-cli.mdx | 3 +- nodejs/docs/test-components.mdx | 3 +- nodejs/docs/test-configuration.mdx | 3 +- nodejs/docs/test-fixtures.mdx | 3 +- nodejs/docs/test-global-setup-teardown.mdx | 7 +- nodejs/docs/test-parallel.mdx | 3 +- nodejs/docs/test-parameterize.mdx | 3 +- nodejs/docs/test-projects.mdx | 3 +- nodejs/docs/test-reporters.mdx | 3 +- nodejs/docs/test-retries.mdx | 3 +- nodejs/docs/test-sharding.mdx | 3 +- nodejs/docs/test-snapshots.mdx | 3 +- nodejs/docs/test-timeouts.mdx | 3 +- nodejs/docs/test-typescript.mdx | 3 +- nodejs/docs/test-ui-mode.mdx | 3 +- nodejs/docs/test-use-options.mdx | 3 +- nodejs/docs/test-webserver.mdx | 3 +- nodejs/docs/testing-library.mdx | 3 +- nodejs/docs/trace-viewer-intro.mdx | 5 +- nodejs/docs/trace-viewer.mdx | 13 +- nodejs/docs/videos.mdx | 3 +- nodejs/docs/webview2.mdx | 3 +- nodejs/docs/writing-tests.mdx | 3 +- python/docs/actionability.mdx | 1 + python/docs/api-testing.mdx | 1 + python/docs/api/class-accessibility.mdx | 1 + python/docs/api/class-apirequest.mdx | 5 +- python/docs/api/class-apirequestcontext.mdx | 1 + python/docs/api/class-apiresponse.mdx | 1 + .../docs/api/class-apiresponseassertions.mdx | 1 + python/docs/api/class-browser.mdx | 9 +- python/docs/api/class-browsercontext.mdx | 68 ++++ python/docs/api/class-browsertype.mdx | 5 +- python/docs/api/class-cdpsession.mdx | 1 + python/docs/api/class-clock.mdx | 1 + python/docs/api/class-consolemessage.mdx | 1 + python/docs/api/class-dialog.mdx | 1 + python/docs/api/class-download.mdx | 1 + python/docs/api/class-elementhandle.mdx | 1 + python/docs/api/class-error.mdx | 1 + python/docs/api/class-filechooser.mdx | 1 + python/docs/api/class-frame.mdx | 1 + python/docs/api/class-framelocator.mdx | 120 ++++--- python/docs/api/class-jshandle.mdx | 1 + python/docs/api/class-keyboard.mdx | 1 + python/docs/api/class-locator.mdx | 5 +- python/docs/api/class-locatorassertions.mdx | 1 + python/docs/api/class-mouse.mdx | 1 + python/docs/api/class-page.mdx | 68 ++++ python/docs/api/class-pageassertions.mdx | 1 + python/docs/api/class-playwright.mdx | 1 + python/docs/api/class-request.mdx | 1 + python/docs/api/class-response.mdx | 1 + python/docs/api/class-route.mdx | 1 + python/docs/api/class-selectors.mdx | 1 + python/docs/api/class-timeouterror.mdx | 1 + python/docs/api/class-touchscreen.mdx | 1 + python/docs/api/class-tracing.mdx | 17 +- python/docs/api/class-video.mdx | 1 + python/docs/api/class-weberror.mdx | 1 + python/docs/api/class-websocket.mdx | 1 + python/docs/api/class-websocketroute.mdx | 294 +++++++++++++++++ python/docs/api/class-worker.mdx | 1 + python/docs/auth.mdx | 1 + python/docs/browser-contexts.mdx | 1 + python/docs/browsers.mdx | 1 + python/docs/chrome-extensions.mdx | 1 + python/docs/ci-intro.mdx | 5 +- python/docs/ci.mdx | 1 + python/docs/clock.mdx | 1 + python/docs/codegen-intro.mdx | 1 + python/docs/codegen.mdx | 1 + python/docs/debug.mdx | 1 + python/docs/dialogs.mdx | 1 + python/docs/docker.mdx | 1 + python/docs/downloads.mdx | 1 + python/docs/emulation.mdx | 1 + python/docs/evaluating.mdx | 1 + python/docs/events.mdx | 1 + python/docs/extensibility.mdx | 1 + python/docs/frames.mdx | 1 + python/docs/handles.mdx | 1 + python/docs/input.mdx | 1 + python/docs/intro.mdx | 1 + python/docs/languages.mdx | 1 + python/docs/library.mdx | 1 + python/docs/locators.mdx | 1 + python/docs/mock.mdx | 1 + python/docs/navigations.mdx | 1 + python/docs/network.mdx | 1 + python/docs/other-locators.mdx | 1 + python/docs/pages.mdx | 1 + python/docs/pom.mdx | 1 + python/docs/release-notes.mdx | 1 + python/docs/running-tests.mdx | 1 + python/docs/screenshots.mdx | 1 + python/docs/selenium-grid.mdx | 1 + python/docs/test-assertions.mdx | 1 + python/docs/test-runners.mdx | 1 + python/docs/trace-viewer-intro.mdx | 9 +- python/docs/trace-viewer.mdx | 13 +- python/docs/videos.mdx | 1 + python/docs/webview2.mdx | 1 + python/docs/writing-tests.mdx | 1 + 385 files changed, 2390 insertions(+), 495 deletions(-) create mode 100644 dotnet/docs/api/class-websocketroute.mdx create mode 100644 java/docs/api/class-websocketroute.mdx create mode 100644 nodejs/docs/api/class-websocketroute.mdx create mode 100644 python/docs/api/class-websocketroute.mdx diff --git a/dotnet/docs/actionability.mdx b/dotnet/docs/actionability.mdx index a8f40510cc..a3c4dd04af 100644 --- a/dotnet/docs/actionability.mdx +++ b/dotnet/docs/actionability.mdx @@ -153,6 +153,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api-testing.mdx b/dotnet/docs/api-testing.mdx index 972c711b5c..ee11ed6ae4 100644 --- a/dotnet/docs/api-testing.mdx +++ b/dotnet/docs/api-testing.mdx @@ -454,6 +454,7 @@ var context = await Browser.NewContextAsync(new() { StorageState = state }); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-accessibility.mdx b/dotnet/docs/api/class-accessibility.mdx index d800e5a56e..299337b21c 100644 --- a/dotnet/docs/api/class-accessibility.mdx +++ b/dotnet/docs/api/class-accessibility.mdx @@ -105,6 +105,7 @@ Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapsho [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-apirequest.mdx b/dotnet/docs/api/class-apirequest.mdx index 4a111b83bc..b03c2e3a9e 100644 --- a/dotnet/docs/api/class-apirequest.mdx +++ b/dotnet/docs/api/class-apirequest.mdx @@ -66,10 +66,6 @@ await ApiRequest.NewContextAsync(options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -166,6 +162,7 @@ await ApiRequest.NewContextAsync(options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-apirequestcontext.mdx b/dotnet/docs/api/class-apirequestcontext.mdx index 8b098bb503..920ff19596 100644 --- a/dotnet/docs/api/class-apirequestcontext.mdx +++ b/dotnet/docs/api/class-apirequestcontext.mdx @@ -602,6 +602,7 @@ await ApiRequestContext.StorageStateAsync(options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-apiresponse.mdx b/dotnet/docs/api/class-apiresponse.mdx index 16d6526359..ed72084067 100644 --- a/dotnet/docs/api/class-apiresponse.mdx +++ b/dotnet/docs/api/class-apiresponse.mdx @@ -230,6 +230,7 @@ ApiResponse.Url [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-apiresponseassertions.mdx b/dotnet/docs/api/class-apiresponseassertions.mdx index ce70f954c1..1b327b23d9 100644 --- a/dotnet/docs/api/class-apiresponseassertions.mdx +++ b/dotnet/docs/api/class-apiresponseassertions.mdx @@ -84,6 +84,7 @@ Expect(Response).Not [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-browser.mdx b/dotnet/docs/api/class-browser.mdx index bd0d3f0655..74b978161c 100644 --- a/dotnet/docs/api/class-browser.mdx +++ b/dotnet/docs/api/class-browser.mdx @@ -204,10 +204,6 @@ await browser.CloseAsync(); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -421,10 +417,6 @@ await Browser.NewPageAsync(options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -654,6 +646,7 @@ Browser.Disconnected += async (_, browser) => {}; [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-browsercontext.mdx b/dotnet/docs/api/class-browsercontext.mdx index 93bddd411c..2e669b0da1 100644 --- a/dotnet/docs/api/class-browsercontext.mdx +++ b/dotnet/docs/api/class-browsercontext.mdx @@ -609,6 +609,42 @@ await BrowserContext.RouteFromHARAsync(har, options); --- +### RouteWebSocketAsync {#browser-context-route-web-socket} + +Added in: v1.48browserContext.RouteWebSocketAsync + +This method allows to modify websocket connections that are made by any page in the browser context. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before creating any pages. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + +```csharp +await context.RouteWebSocketAsync("/ws", async ws => { + ws.RouteSend(message => { + if (message == "to-be-blocked") + return; + ws.Send(message); + }); + await ws.ConnectAsync(); +}); +``` + +**Arguments** +- `url` [string] | [Regex] | [Func]<[string], bool># + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options. +- `handler` [Action]<[WebSocketRoute]># + + Handler function to route the WebSocket. + +**Returns** +- [void]# + +--- + ### RunAndWaitForConsoleMessageAsync {#browser-context-wait-for-console-message} Added in: v1.34browserContext.RunAndWaitForConsoleMessageAsync @@ -1239,6 +1275,7 @@ BrowserContext.WebError += async (_, webError) => {}; [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-browsertype.mdx b/dotnet/docs/api/class-browsertype.mdx index fca537b35c..90f7e06798 100644 --- a/dotnet/docs/api/class-browsertype.mdx +++ b/dotnet/docs/api/class-browsertype.mdx @@ -316,10 +316,6 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -569,6 +565,7 @@ BrowserType.Name [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-cdpsession.mdx b/dotnet/docs/api/class-cdpsession.mdx index 0d88bd5a18..bc6ba77d1b 100644 --- a/dotnet/docs/api/class-cdpsession.mdx +++ b/dotnet/docs/api/class-cdpsession.mdx @@ -130,6 +130,7 @@ await CdpSession.SendAsync(method, params); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-cdpsessionevent.mdx b/dotnet/docs/api/class-cdpsessionevent.mdx index 6bc8d440a1..4f50774b42 100644 --- a/dotnet/docs/api/class-cdpsessionevent.mdx +++ b/dotnet/docs/api/class-cdpsessionevent.mdx @@ -86,6 +86,7 @@ CdpSessionEvent.OnEvent += async (_, jsonElement) => {}; [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-clock.mdx b/dotnet/docs/api/class-clock.mdx index 93eddd8993..e98611ab96 100644 --- a/dotnet/docs/api/class-clock.mdx +++ b/dotnet/docs/api/class-clock.mdx @@ -225,6 +225,7 @@ await page.Clock.SetSystemTimeAsync("2020-02-02"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-consolemessage.mdx b/dotnet/docs/api/class-consolemessage.mdx index 139d69f3a7..33b643692f 100644 --- a/dotnet/docs/api/class-consolemessage.mdx +++ b/dotnet/docs/api/class-consolemessage.mdx @@ -157,6 +157,7 @@ ConsoleMessage.Type [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-dialog.mdx b/dotnet/docs/api/class-dialog.mdx index e0586ad191..6fec1cac37 100644 --- a/dotnet/docs/api/class-dialog.mdx +++ b/dotnet/docs/api/class-dialog.mdx @@ -188,6 +188,7 @@ Dialog.Type [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-download.mdx b/dotnet/docs/api/class-download.mdx index 2aa0af19e1..86e6e7a467 100644 --- a/dotnet/docs/api/class-download.mdx +++ b/dotnet/docs/api/class-download.mdx @@ -226,6 +226,7 @@ Download.Url [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-elementhandle.mdx b/dotnet/docs/api/class-elementhandle.mdx index ca22b35936..684c1e6c64 100644 --- a/dotnet/docs/api/class-elementhandle.mdx +++ b/dotnet/docs/api/class-elementhandle.mdx @@ -1608,6 +1608,7 @@ This method does not work across navigations, use [Page.WaitForSelectorAsync()]( [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-filechooser.mdx b/dotnet/docs/api/class-filechooser.mdx index a57d137261..c7050d71b3 100644 --- a/dotnet/docs/api/class-filechooser.mdx +++ b/dotnet/docs/api/class-filechooser.mdx @@ -152,6 +152,7 @@ await FileChooser.SetFilesAsync(files, options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-formdata.mdx b/dotnet/docs/api/class-formdata.mdx index 8dffa5c530..73ba84bd08 100644 --- a/dotnet/docs/api/class-formdata.mdx +++ b/dotnet/docs/api/class-formdata.mdx @@ -158,6 +158,7 @@ FormData.Set(name, value); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-frame.mdx b/dotnet/docs/api/class-frame.mdx index 3b73018e57..9cdd05271c 100644 --- a/dotnet/docs/api/class-frame.mdx +++ b/dotnet/docs/api/class-frame.mdx @@ -2719,6 +2719,7 @@ await Frame.WaitForTimeoutAsync(timeout); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-framelocator.mdx b/dotnet/docs/api/class-framelocator.mdx index 1f39887ecd..7e9829ef15 100644 --- a/dotnet/docs/api/class-framelocator.mdx +++ b/dotnet/docs/api/class-framelocator.mdx @@ -7,10 +7,10 @@ import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; -FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [Page.FrameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.FrameLocator()](/api/class-locator.mdx#locator-frame-locator) method. +FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame), [Page.FrameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.FrameLocator()](/api/class-locator.mdx#locator-frame-locator) method. ```csharp -var locator = page.FrameLocator("#my-frame").GetByText("Submit"); +var locator = page.Locator("#my-frame").ContentFrame.GetByText("Submit"); await locator.ClickAsync(); ``` @@ -20,10 +20,10 @@ Frame locators are strict. This means that all operations on frame locators will ```csharp // Throws if there are several frames in DOM: -await page.FrameLocator(".result-frame").GetByRole(AriaRole.Button).ClickAsync(); +await page.Locator(".result-frame").ContentFrame.GetByRole(AriaRole.Button).ClickAsync(); // Works because we explicitly tell locator to pick the first frame: -await page.FrameLocator(".result-frame").First.getByRole(AriaRole.Button).ClickAsync(); +await page.Locator(".result-frame").First.ContentFrame.getByRole(AriaRole.Button).ClickAsync(); ``` **Converting Locator to FrameLocator** @@ -39,23 +39,6 @@ If you have a [FrameLocator] object it can be converted to [Locator] pointing to ## Methods -### First {#frame-locator-first} - -Added in: v1.17frameLocator.First - -Returns locator to the first matching frame. - -**Usage** - -```csharp -FrameLocator.First -``` - -**Returns** -- [FrameLocator]# - ---- - ### FrameLocator {#frame-locator-frame-locator} Added in: v1.17frameLocator.FrameLocator @@ -405,23 +388,6 @@ await Expect(Page.GetByTitle("Issues count")).toHaveText("25 issues"); --- -### Last {#frame-locator-last} - -Added in: v1.17frameLocator.Last - -Returns locator to the last matching frame. - -**Usage** - -```csharp -FrameLocator.Last -``` - -**Returns** -- [FrameLocator]# - ---- - ### Locator {#frame-locator-locator} Added in: v1.17frameLocator.Locator @@ -465,47 +431,104 @@ FrameLocator.Locator(selectorOrLocator, options); --- -### Nth {#frame-locator-nth} +### Owner {#frame-locator-owner} -Added in: v1.17frameLocator.Nth +Added in: v1.43frameLocator.Owner -Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. +Returns a [Locator] object pointing to the same `iframe` as this frame locator. + +Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. + +For a reverse operation, use [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame). **Usage** ```csharp -FrameLocator.Nth(index); +var frameLocator = Page.Locator("iframe[name=\"embedded\"]").ContentFrame; +// ... +var locator = frameLocator.Owner; +await Expect(locator).ToBeVisibleAsync(); ``` -**Arguments** -- `index` [int]# +**Returns** +- [Locator]# + +--- + +## Deprecated + +### First {#frame-locator-first} + +Added in: v1.17frameLocator.First + +:::warning Deprecated + +Use [Locator.First](/api/class-locator.mdx#locator-first) followed by [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + +Returns locator to the first matching frame. + +**Usage** + +```csharp +FrameLocator.First +``` **Returns** -- [FrameLocator]# +- [FrameLocator]# --- -### Owner {#frame-locator-owner} +### Last {#frame-locator-last} -Added in: v1.43frameLocator.Owner +Added in: v1.17frameLocator.Last -Returns a [Locator] object pointing to the same `iframe` as this frame locator. +:::warning Deprecated -Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. +Use [Locator.Last](/api/class-locator.mdx#locator-last) followed by [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame) instead. -For a reverse operation, use [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame). +::: + + +Returns locator to the last matching frame. **Usage** ```csharp -var frameLocator = Page.FrameLocator("iframe[name=\"embedded\"]"); -// ... -var locator = frameLocator.Owner; -await Expect(locator).ToBeVisibleAsync(); +FrameLocator.Last ``` **Returns** -- [Locator]# +- [FrameLocator]# + +--- + +### Nth {#frame-locator-nth} + +Added in: v1.17frameLocator.Nth + +:::warning Deprecated + +Use [Locator.Nth()](/api/class-locator.mdx#locator-nth) followed by [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + +Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. + +**Usage** + +```csharp +FrameLocator.Nth(index); +``` + +**Arguments** +- `index` [int]# + +**Returns** +- [FrameLocator]# [Accessibility]: /api/class-accessibility.mdx "Accessibility" @@ -547,6 +570,7 @@ await Expect(locator).ToBeVisibleAsync(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-jshandle.mdx b/dotnet/docs/api/class-jshandle.mdx index bd3a7cb3f5..9c7bef8680 100644 --- a/dotnet/docs/api/class-jshandle.mdx +++ b/dotnet/docs/api/class-jshandle.mdx @@ -221,6 +221,7 @@ await JsHandle.JsonValueAsync(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-keyboard.mdx b/dotnet/docs/api/class-keyboard.mdx index db9035bc1c..e9c1bf3048 100644 --- a/dotnet/docs/api/class-keyboard.mdx +++ b/dotnet/docs/api/class-keyboard.mdx @@ -265,6 +265,7 @@ await Keyboard.UpAsync(key); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-locator.mdx b/dotnet/docs/api/class-locator.mdx index 5be319fff0..cf6ccf34e6 100644 --- a/dotnet/docs/api/class-locator.mdx +++ b/dotnet/docs/api/class-locator.mdx @@ -1622,7 +1622,9 @@ var banana = await page.GetByRole(AriaRole.Listitem).Nth(2); Added in: v1.33locator.Or -Creates a locator that matches either of the two locators. +Creates a locator matching all elements that match one or both of the two locators. + +Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.mdx#strictness) guidelines. **Usage** @@ -2409,6 +2411,7 @@ To press a special key, like `Control` or `ArrowDown`, use [Locator.PressAsync() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-locatorassertions.mdx b/dotnet/docs/api/class-locatorassertions.mdx index 959b19fcd5..98daf78c07 100644 --- a/dotnet/docs/api/class-locatorassertions.mdx +++ b/dotnet/docs/api/class-locatorassertions.mdx @@ -837,6 +837,7 @@ Expect(Locator).Not [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-mouse.mdx b/dotnet/docs/api/class-mouse.mdx index 97f0b2ce40..ff849e2d4e 100644 --- a/dotnet/docs/api/class-mouse.mdx +++ b/dotnet/docs/api/class-mouse.mdx @@ -241,6 +241,7 @@ await Mouse.WheelAsync(deltaX, deltaY); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-page.mdx b/dotnet/docs/api/class-page.mdx index e08187fee4..d5e3846ad6 100644 --- a/dotnet/docs/api/class-page.mdx +++ b/dotnet/docs/api/class-page.mdx @@ -1634,6 +1634,42 @@ await Page.RouteFromHARAsync(har, options); --- +### RouteWebSocketAsync {#page-route-web-socket} + +Added in: v1.48page.RouteWebSocketAsync + +This method allows to modify websocket connections that are made by the page. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before navigating the page. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + +```csharp +await page.RouteWebSocketAsync("/ws", async ws => { + ws.RouteSend(message => { + if (message == "to-be-blocked") + return; + ws.Send(message); + }); + await ws.ConnectAsync(); +}); +``` + +**Arguments** +- `url` [string] | [Regex] | [Func]<[string], bool># + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options. +- `handler` [Action]<[WebSocketRoute]># + + Handler function to route the WebSocket. + +**Returns** +- [void]# + +--- + ### RunAndWaitForConsoleMessageAsync {#page-wait-for-console-message} Added in: v1.9page.RunAndWaitForConsoleMessageAsync @@ -4838,6 +4874,7 @@ await page.WaitForTimeoutAsync(1000); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-pageassertions.mdx b/dotnet/docs/api/class-pageassertions.mdx index 35e273b479..9833178fec 100644 --- a/dotnet/docs/api/class-pageassertions.mdx +++ b/dotnet/docs/api/class-pageassertions.mdx @@ -149,6 +149,7 @@ Expect(Page).Not [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-playwright.mdx b/dotnet/docs/api/class-playwright.mdx index 5b10f12130..81a1683c49 100644 --- a/dotnet/docs/api/class-playwright.mdx +++ b/dotnet/docs/api/class-playwright.mdx @@ -191,6 +191,7 @@ Playwright.Webkit [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-playwrightassertions.mdx b/dotnet/docs/api/class-playwrightassertions.mdx index cd6166e053..a3331b0964 100644 --- a/dotnet/docs/api/class-playwrightassertions.mdx +++ b/dotnet/docs/api/class-playwrightassertions.mdx @@ -138,6 +138,7 @@ await Expect(Page).ToHaveTitleAsync("News"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-request.mdx b/dotnet/docs/api/class-request.mdx index 31f5351f41..73e205a94e 100644 --- a/dotnet/docs/api/class-request.mdx +++ b/dotnet/docs/api/class-request.mdx @@ -454,6 +454,7 @@ Request.Url [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-response.mdx b/dotnet/docs/api/class-response.mdx index d3246ff377..8ad2d4adde 100644 --- a/dotnet/docs/api/class-response.mdx +++ b/dotnet/docs/api/class-response.mdx @@ -396,6 +396,7 @@ Response.Url [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-route.mdx b/dotnet/docs/api/class-route.mdx index 718da42d68..51bfb67e56 100644 --- a/dotnet/docs/api/class-route.mdx +++ b/dotnet/docs/api/class-route.mdx @@ -342,6 +342,7 @@ Route.Request [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-selectors.mdx b/dotnet/docs/api/class-selectors.mdx index f16a31c75e..de4e2a332f 100644 --- a/dotnet/docs/api/class-selectors.mdx +++ b/dotnet/docs/api/class-selectors.mdx @@ -131,6 +131,7 @@ Selectors.SetTestIdAttribute(attributeName); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-timeouterror.mdx b/dotnet/docs/api/class-timeouterror.mdx index c60f605586..7cb65c0860 100644 --- a/dotnet/docs/api/class-timeouterror.mdx +++ b/dotnet/docs/api/class-timeouterror.mdx @@ -67,6 +67,7 @@ catch (TimeoutException) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-touchscreen.mdx b/dotnet/docs/api/class-touchscreen.mdx index 0a7f03a88b..2a8ad96a49 100644 --- a/dotnet/docs/api/class-touchscreen.mdx +++ b/dotnet/docs/api/class-touchscreen.mdx @@ -81,6 +81,7 @@ await Touchscreen.TapAsync(x, y); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-tracing.mdx b/dotnet/docs/api/class-tracing.mdx index b93a40536e..e306c8c517 100644 --- a/dotnet/docs/api/class-tracing.mdx +++ b/dotnet/docs/api/class-tracing.mdx @@ -24,7 +24,7 @@ var page = await context.NewPageAsync(); await page.GotoAsync("https://playwright.dev"); await context.Tracing.StopAsync(new() { - Path = "trace.pwtrace.zip" + Path = "trace.zip" }); ``` @@ -54,7 +54,7 @@ var page = await context.NewPageAsync(); await page.GotoAsync("https://playwright.dev"); await context.Tracing.StopAsync(new() { - Path = "trace.pwtrace.zip" + Path = "trace.zip" }); ``` @@ -108,7 +108,7 @@ await page.GetByText("Get Started").ClickAsync(); // Everything between StartChunkAsync and StopChunkAsync will be recorded in the trace. await context.Tracing.StopChunkAsync(new() { - Path = "trace1.pwtrace.zip" + Path = "trace1.zip" }); await context.Tracing.StartChunkAsync(); @@ -116,7 +116,7 @@ await page.GotoAsync("http://example.com"); // Save a second trace file with different actions. await context.Tracing.StopChunkAsync(new() { - Path = "trace2.pwtrace.zip" + Path = "trace2.zip" }); ``` @@ -218,6 +218,7 @@ await Tracing.StopChunkAsync(options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-video.mdx b/dotnet/docs/api/class-video.mdx index 2659cfe82f..0e68567e60 100644 --- a/dotnet/docs/api/class-video.mdx +++ b/dotnet/docs/api/class-video.mdx @@ -112,6 +112,7 @@ await Video.SaveAsAsync(path); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-weberror.mdx b/dotnet/docs/api/class-weberror.mdx index 3b267d5e8d..d07601c59a 100644 --- a/dotnet/docs/api/class-weberror.mdx +++ b/dotnet/docs/api/class-weberror.mdx @@ -94,6 +94,7 @@ WebError.Page [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-websocket.mdx b/dotnet/docs/api/class-websocket.mdx index 6904accad9..ecf7edf5de 100644 --- a/dotnet/docs/api/class-websocket.mdx +++ b/dotnet/docs/api/class-websocket.mdx @@ -156,6 +156,7 @@ WebSocket.SocketError += async (_, value) => {}; [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-websocketframe.mdx b/dotnet/docs/api/class-websocketframe.mdx index 5c531f788b..78474c2596 100644 --- a/dotnet/docs/api/class-websocketframe.mdx +++ b/dotnet/docs/api/class-websocketframe.mdx @@ -86,6 +86,7 @@ WebSocketFrame.Text [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/api/class-websocketroute.mdx b/dotnet/docs/api/class-websocketroute.mdx new file mode 100644 index 0000000000..4ceb31df44 --- /dev/null +++ b/dotnet/docs/api/class-websocketroute.mdx @@ -0,0 +1,268 @@ +--- +id: class-websocketroute +title: "WebSocketRoute" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +Whenever a [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) route is set up with [Page.RouteWebSocketAsync()](/api/class-page.mdx#page-route-web-socket) or [BrowserContext.RouteWebSocketAsync()](/api/class-browsercontext.mdx#browser-context-route-web-socket), the `WebSocketRoute` object allows to handle the WebSocket. + +By default, the routed WebSocket will not actually connect to the server. This way, you can mock entire communcation over the WebSocket. Here is an example that responds to a `"query"` with a `"result"`. + +```csharp +await page.RouteWebSocketAsync("/ws", async ws => { + ws.RouteSend(message => { + if (message == "query") + ws.receive("result"); + }); +}); +``` + + +--- + +## Methods + +### CloseAsync {#web-socket-route-close} + +Added in: v1.48webSocketRoute.CloseAsync + +Closes the server connection and the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page. + +**Usage** + +```csharp +await WebSocketRoute.CloseAsync(options); +``` + +**Arguments** +- `options` `WebSocketRouteCloseOptions?` *(optional)* + - `Code` [int]? *(optional)*# + + Optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code). + - `Reason` [string]? *(optional)*# + + Optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). + +**Returns** +- [void]# + +--- + +### ConnectAsync {#web-socket-route-connect} + +Added in: v1.48webSocketRoute.ConnectAsync + +By default, routed WebSocket does not connect to the server, so you can mock entire WebSocket communication. This method connects to the actual WebSocket server, giving the ability to send and receive messages from the server. + +Once connected: +* Messages received from the server will be automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, unless [WebSocketRoute.RouteReceiveAsync()](/api/class-websocketroute.mdx#web-socket-route-route-receive) is called. +* Messages sent by the `WebSocket.send()` call in the page will be automatically sent to the server, unless [WebSocketRoute.RouteSendAsync()](/api/class-websocketroute.mdx#web-socket-route-route-send) is called. + +**Usage** + +```csharp +await WebSocketRoute.ConnectAsync(); +``` + +**Returns** +- [void]# + +--- + +### Receive {#web-socket-route-receive} + +Added in: v1.48webSocketRoute.Receive + +Dispatches a message to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, like it was received from the server. + +**Usage** + +```csharp +WebSocketRoute.Receive(message); +``` + +**Arguments** +- `message` [string] | [byte][]# + + Message to receive. + +--- + +### RouteReceiveAsync {#web-socket-route-route-receive} + +Added in: v1.48webSocketRoute.RouteReceiveAsync + +This method allows to route messages that are received by the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page from the server. This method only makes sense if you are also calling [WebSocketRoute.ConnectAsync()](/api/class-websocketroute.mdx#web-socket-route-connect). + +Once this method is called, received messages are not automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page - you should do that manually by calling [WebSocketRoute.Receive()](/api/class-websocketroute.mdx#web-socket-route-receive). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```csharp +await WebSocketRoute.RouteReceiveAsync(handler); +``` + +**Arguments** +- `handler` [Action]<[WebSocketFrame]># + + Handler function to route received messages. + +**Returns** +- [void]# + +--- + +### RouteSendAsync {#web-socket-route-route-send} + +Added in: v1.48webSocketRoute.RouteSendAsync + +This method allows to route messages that are sent by `WebSocket.send()` call in the page, instead of actually sending them to the server. Once this method is called, sent messages **are not** automatically forwarded to the server - you should do that manually by calling [WebSocketRoute.Send()](/api/class-websocketroute.mdx#web-socket-route-send). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```csharp +await WebSocketRoute.RouteSendAsync(handler); +``` + +**Arguments** +- `handler` [Action]<[WebSocketFrame]># + + Handler function to route sent messages. + +**Returns** +- [void]# + +--- + +### Send {#web-socket-route-send} + +Added in: v1.48webSocketRoute.Send + +Sends a message to the server, like it was sent in the page with `WebSocket.send()`. + +**Usage** + +```csharp +WebSocketRoute.Send(message); +``` + +**Arguments** +- `message` [string] | [byte][]# + + Message to send. + +--- + +### Url {#web-socket-route-url} + +Added in: v1.48webSocketRoute.Url + +URL of the WebSocket created in the page. + +**Usage** + +```csharp +WebSocketRoute.Url +``` + +**Returns** +- [string]# + +--- + +## Events + +### event Close {#web-socket-route-event-close} + +Added in: v1.48webSocketRoute.event Close + +Emitted when the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) closes. + +**Usage** + +```csharp +WebSocketRoute.Close += async (_, void) => {}; +``` + + +[Accessibility]: /api/class-accessibility.mdx "Accessibility" +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[FormData]: /api/class-formdata.mdx "FormData" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Selectors]: /api/class-selectors.mdx "Selectors" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[bool]: https://docs.microsoft.com/en-us/dotnet/api/system.boolean "bool" +[Date]: https://learn.microsoft.com/en-us/dotnet/api/system.datetime "DateTime" +[double]: https://docs.microsoft.com/en-us/dotnet/api/system.double "double" +[byte]: https://docs.microsoft.com/en-us/dotnet/api/system.byte "byte" +[int]: https://docs.microsoft.com/en-us/dotnet/api/system.int32 "int" +[long]: https://docs.microsoft.com/en-us/dotnet/api/system.int64 "long" +[void]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/void "void" +[string]: https://docs.microsoft.com/en-us/dotnet/api/system.string "string" +[URL]: https://nodejs.org/api/url.html "URL" +[Regex]: https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex "Regex" + +[Action]: https://docs.microsoft.com/en-us/dotnet/api/system.action-1 "Action" +[Func]: https://docs.microsoft.com/en-us/dotnet/api/system.func-2 "Func" +[IEnumerable]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable "IEnumerable" +[IDictionary]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.idictionary "IDictionary" +[Task]: https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task?view=net-5.0 "Task" +[IReadOnlyDictionary]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 "IReadOnlyDictionary" +[JsonElement]: https://docs.microsoft.com/en-us/dotnet/api/system.text.json.jsonelement "JsonElement" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/dotnet/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/dotnet/about "Microsoft Artifact Registry" +[Dockerfile.jammy]: https://github.com/microsoft/playwright-dotnet/blob/main/utils/docker/Dockerfile.jammy "Dockerfile.jammy" diff --git a/dotnet/docs/api/class-worker.mdx b/dotnet/docs/api/class-worker.mdx index eb94bd9843..47b0fd5ff0 100644 --- a/dotnet/docs/api/class-worker.mdx +++ b/dotnet/docs/api/class-worker.mdx @@ -158,6 +158,7 @@ Worker.Close += async (_, worker) => {}; [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/auth.mdx b/dotnet/docs/auth.mdx index dfae689cd9..06b675c410 100644 --- a/dotnet/docs/auth.mdx +++ b/dotnet/docs/auth.mdx @@ -158,6 +158,7 @@ await context.AddInitScriptAsync(@"(storage => { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/browser-contexts.mdx b/dotnet/docs/browser-contexts.mdx index ddba80a831..202758fdfc 100644 --- a/dotnet/docs/browser-contexts.mdx +++ b/dotnet/docs/browser-contexts.mdx @@ -98,6 +98,7 @@ class Program [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/browsers.mdx b/dotnet/docs/browsers.mdx index a6d84f0403..76ad6d8238 100644 --- a/dotnet/docs/browsers.mdx +++ b/dotnet/docs/browsers.mdx @@ -517,6 +517,7 @@ pwsh bin/Debug/netX/playwright.ps1 uninstall --all [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/ci-intro.mdx b/dotnet/docs/ci-intro.mdx index 89bbbac391..aeb528ff1e 100644 --- a/dotnet/docs/ci-intro.mdx +++ b/dotnet/docs/ci-intro.mdx @@ -86,8 +86,8 @@ You can upload Traces which get created on your CI like GitHub Actions as artifa - [Learn how to perform Actions](./input.mdx) - [Learn how to write Assertions](./test-assertions.mdx) - [Learn more about the Trace Viewer](/trace-viewer.mdx) -- [Learn more ways of running tests on GitHub Actions](/ci.mdx) -- [Learn more about running tests on other CI providers](/ci.mdx#github-actions) // TODO: is this link correct? +- [Learn more ways of running tests on GitHub Actions](/ci.mdx#github-actions) +- [Learn more about running tests on other CI providers](/ci.mdx) [Accessibility]: /api/class-accessibility.mdx "Accessibility" @@ -129,6 +129,7 @@ You can upload Traces which get created on your CI like GitHub Actions as artifa [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/ci.mdx b/dotnet/docs/ci.mdx index 04d94999a4..bd77813848 100644 --- a/dotnet/docs/ci.mdx +++ b/dotnet/docs/ci.mdx @@ -286,6 +286,7 @@ xvfb-run dotnet test [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/clock.mdx b/dotnet/docs/clock.mdx index db031192b7..d47cba9db3 100644 --- a/dotnet/docs/clock.mdx +++ b/dotnet/docs/clock.mdx @@ -198,6 +198,7 @@ await Expect(locator).ToHaveTextAsync("2/2/2024, 10:00:02 AM"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/codegen-intro.mdx b/dotnet/docs/codegen-intro.mdx index 5fc8404714..bdd195238b 100644 --- a/dotnet/docs/codegen-intro.mdx +++ b/dotnet/docs/codegen-intro.mdx @@ -102,6 +102,7 @@ You can also generate tests using emulation so as to generate a test for a speci [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/codegen.mdx b/dotnet/docs/codegen.mdx index 804957e43e..48cb4d4bd1 100644 --- a/dotnet/docs/codegen.mdx +++ b/dotnet/docs/codegen.mdx @@ -195,6 +195,7 @@ await page.PauseAsync(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/debug.mdx b/dotnet/docs/debug.mdx index 1a9aa679bf..1df033b486 100644 --- a/dotnet/docs/debug.mdx +++ b/dotnet/docs/debug.mdx @@ -304,6 +304,7 @@ await using var browser = await playwright.Chromium.LaunchAsync(new() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/dialogs.mdx b/dotnet/docs/dialogs.mdx index e41b06ccf3..85b9a5c661 100644 --- a/dotnet/docs/dialogs.mdx +++ b/dotnet/docs/dialogs.mdx @@ -111,6 +111,7 @@ This will wait for the print dialog to be opened after the button is clicked. Ma [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/docker.mdx b/dotnet/docs/docker.mdx index 55c14bf189..0f6030e60b 100644 --- a/dotnet/docs/docker.mdx +++ b/dotnet/docs/docker.mdx @@ -142,6 +142,7 @@ curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --install-dir / [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/downloads.mdx b/dotnet/docs/downloads.mdx index a98faf2cbf..87202cfef6 100644 --- a/dotnet/docs/downloads.mdx +++ b/dotnet/docs/downloads.mdx @@ -82,6 +82,7 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/emulation.mdx b/dotnet/docs/emulation.mdx index 7c175018e3..039b95096b 100644 --- a/dotnet/docs/emulation.mdx +++ b/dotnet/docs/emulation.mdx @@ -214,6 +214,7 @@ var context = await browser.NewContextAsync(new() { JavaScriptEnabled = false }) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/evaluating.mdx b/dotnet/docs/evaluating.mdx index c67d6cfce6..7c17103144 100644 --- a/dotnet/docs/evaluating.mdx +++ b/dotnet/docs/evaluating.mdx @@ -146,6 +146,7 @@ await Page.AddInitScriptAsync(scriptPath: "mocks/preload.js"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/events.mdx b/dotnet/docs/events.mdx index 55960b4e73..66ad7628f7 100644 --- a/dotnet/docs/events.mdx +++ b/dotnet/docs/events.mdx @@ -91,6 +91,7 @@ await page.GotoAsync("https://www.openstreetmap.org/"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/extensibility.mdx b/dotnet/docs/extensibility.mdx index 89950c26b7..56880c7e71 100644 --- a/dotnet/docs/extensibility.mdx +++ b/dotnet/docs/extensibility.mdx @@ -86,6 +86,7 @@ await page.Locator("tag=div").GetByText("Click me").ClickAsync(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/frames.mdx b/dotnet/docs/frames.mdx index fd1f24e325..ab86d8d9db 100644 --- a/dotnet/docs/frames.mdx +++ b/dotnet/docs/frames.mdx @@ -80,6 +80,7 @@ await frame.FillAsync("#username-input", "John"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/handles.mdx b/dotnet/docs/handles.mdx index be631064b9..10ad2bae22 100644 --- a/dotnet/docs/handles.mdx +++ b/dotnet/docs/handles.mdx @@ -152,6 +152,7 @@ await locator.ClickAsync(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/input.mdx b/dotnet/docs/input.mdx index e5ccfa992d..dcaacda32e 100644 --- a/dotnet/docs/input.mdx +++ b/dotnet/docs/input.mdx @@ -301,6 +301,7 @@ await page.GetByTestId("scrolling-container").EvaluateAsync("e => e.scrollTop += [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/intro.mdx b/dotnet/docs/intro.mdx index 57bcb4ee9b..0c04e63934 100644 --- a/dotnet/docs/intro.mdx +++ b/dotnet/docs/intro.mdx @@ -220,6 +220,7 @@ See our doc on [Running and Debugging Tests](./running-tests.mdx) to learn more [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/languages.mdx b/dotnet/docs/languages.mdx index 8358c65c58..cd4723968d 100644 --- a/dotnet/docs/languages.mdx +++ b/dotnet/docs/languages.mdx @@ -74,6 +74,7 @@ Playwright for .NET comes with [MSTest base classes](https://playwright.dev/dotn [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/library.mdx b/dotnet/docs/library.mdx index 6d5805cc07..68e822fad6 100644 --- a/dotnet/docs/library.mdx +++ b/dotnet/docs/library.mdx @@ -137,6 +137,7 @@ or: [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/locators.mdx b/dotnet/docs/locators.mdx index f26d273507..45cfe81279 100644 --- a/dotnet/docs/locators.mdx +++ b/dotnet/docs/locators.mdx @@ -971,6 +971,7 @@ For less commonly used locators, look at the [other locators](./other-locators.m [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/mock.mdx b/dotnet/docs/mock.mdx index 821decf58a..ac0112feb0 100644 --- a/dotnet/docs/mock.mdx +++ b/dotnet/docs/mock.mdx @@ -193,6 +193,7 @@ Read more about [advanced networking](./network.mdx). [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/navigations.mdx b/dotnet/docs/navigations.mdx index 85e18d411f..a760bdb318 100644 --- a/dotnet/docs/navigations.mdx +++ b/dotnet/docs/navigations.mdx @@ -115,6 +115,7 @@ Playwright splits the process of showing a new document in a page into **navigat [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/network.mdx b/dotnet/docs/network.mdx index 5241e608fc..e6e24316d4 100644 --- a/dotnet/docs/network.mdx +++ b/dotnet/docs/network.mdx @@ -241,6 +241,7 @@ Playwright's built-in [BrowserContext.RouteAsync()](/api/class-browsercontext.md [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/other-locators.mdx b/dotnet/docs/other-locators.mdx index 6f91c38b76..3d8dc58edd 100644 --- a/dotnet/docs/other-locators.mdx +++ b/dotnet/docs/other-locators.mdx @@ -493,6 +493,7 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/pages.mdx b/dotnet/docs/pages.mdx index 59d4efa026..a9ca64e49a 100644 --- a/dotnet/docs/pages.mdx +++ b/dotnet/docs/pages.mdx @@ -132,6 +132,7 @@ page.Popup += async (_, popup) => { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/pom.mdx b/dotnet/docs/pom.mdx index 783907746d..727b7ad01a 100644 --- a/dotnet/docs/pom.mdx +++ b/dotnet/docs/pom.mdx @@ -99,6 +99,7 @@ await page.SearchAsync("search query"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/release-notes.mdx b/dotnet/docs/release-notes.mdx index beafbe2b23..89b3f56afe 100644 --- a/dotnet/docs/release-notes.mdx +++ b/dotnet/docs/release-notes.mdx @@ -1292,6 +1292,7 @@ This version of Playwright was also tested against the following stable channels [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/running-tests.mdx b/dotnet/docs/running-tests.mdx index 97767d7467..8196e68e43 100644 --- a/dotnet/docs/running-tests.mdx +++ b/dotnet/docs/running-tests.mdx @@ -257,6 +257,7 @@ Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/screenshots.mdx b/dotnet/docs/screenshots.mdx index fc3d18b756..d612362b61 100644 --- a/dotnet/docs/screenshots.mdx +++ b/dotnet/docs/screenshots.mdx @@ -88,6 +88,7 @@ await page.Locator(".header").ScreenshotAsync(new() { Path = "screenshot.png" }) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/selenium-grid.mdx b/dotnet/docs/selenium-grid.mdx index ef8ceeede9..f9b9c3a3d3 100644 --- a/dotnet/docs/selenium-grid.mdx +++ b/dotnet/docs/selenium-grid.mdx @@ -163,6 +163,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/test-assertions.mdx b/dotnet/docs/test-assertions.mdx index 51a0853f6c..109c1f91af 100644 --- a/dotnet/docs/test-assertions.mdx +++ b/dotnet/docs/test-assertions.mdx @@ -140,6 +140,7 @@ await Expect(Page.GetByText("Name")).ToBeVisibleAsync(new() { Timeout = 10_000 } [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/test-runners.mdx b/dotnet/docs/test-runners.mdx index 54ce36d9b1..2287e092b6 100644 --- a/dotnet/docs/test-runners.mdx +++ b/dotnet/docs/test-runners.mdx @@ -299,6 +299,7 @@ While using xUnit is also supported, we do not support running parallel tests. T [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/trace-viewer-intro.mdx b/dotnet/docs/trace-viewer-intro.mdx index 517f5b9da0..6a5e526d68 100644 --- a/dotnet/docs/trace-viewer-intro.mdx +++ b/dotnet/docs/trace-viewer-intro.mdx @@ -171,6 +171,7 @@ Check out our detailed guide on [Trace Viewer](/trace-viewer.mdx) to learn more [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/trace-viewer.mdx b/dotnet/docs/trace-viewer.mdx index bf62013e11..2285e3c697 100644 --- a/dotnet/docs/trace-viewer.mdx +++ b/dotnet/docs/trace-viewer.mdx @@ -312,10 +312,10 @@ public class ExampleTest : PageTest ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. ```bash -pwsh bin/Debug/netX/playwright.ps1 show-trace trace.pwtrace.zip +pwsh bin/Debug/netX/playwright.ps1 show-trace trace.zip ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -329,7 +329,7 @@ pwsh bin/Debug/netX/playwright.ps1 show-trace trace.pwtrace.zip You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -pwsh bin/Debug/netX/playwright.ps1 show-trace https://example.com/trace.pwtrace.zip +pwsh bin/Debug/netX/playwright.ps1 show-trace https://example.com/trace.zip ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. @@ -378,6 +378,7 @@ https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/ [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/videos.mdx b/dotnet/docs/videos.mdx index c11fe0f87b..8b0de9077e 100644 --- a/dotnet/docs/videos.mdx +++ b/dotnet/docs/videos.mdx @@ -85,6 +85,7 @@ Note that the video is only available after the page or browser context is close [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/webview2.mdx b/dotnet/docs/webview2.mdx index c7f4279b9c..dddb2af04c 100644 --- a/dotnet/docs/webview2.mdx +++ b/dotnet/docs/webview2.mdx @@ -180,6 +180,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/dotnet/docs/writing-tests.mdx b/dotnet/docs/writing-tests.mdx index ad92e95c4a..1dc5edc80a 100644 --- a/dotnet/docs/writing-tests.mdx +++ b/dotnet/docs/writing-tests.mdx @@ -348,6 +348,7 @@ public class ExampleTest : PageTest [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/accessibility-testing.mdx b/java/docs/accessibility-testing.mdx index 5f71f759b2..3d8cc9a233 100644 --- a/java/docs/accessibility-testing.mdx +++ b/java/docs/accessibility-testing.mdx @@ -281,6 +281,7 @@ See experimental [JUnit integration](./junit.mdx) to automatically initialize Pl [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/actionability.mdx b/java/docs/actionability.mdx index b56d41ca65..d601f8cffd 100644 --- a/java/docs/actionability.mdx +++ b/java/docs/actionability.mdx @@ -153,6 +153,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api-testing.mdx b/java/docs/api-testing.mdx index c14b08e253..f0adcbd1d3 100644 --- a/java/docs/api-testing.mdx +++ b/java/docs/api-testing.mdx @@ -474,6 +474,7 @@ BrowserContext context = browser.newContext(new Browser.NewContextOptions().setS [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-apirequest.mdx b/java/docs/api/class-apirequest.mdx index 51874581c3..cccfcb1f8e 100644 --- a/java/docs/api/class-apirequest.mdx +++ b/java/docs/api/class-apirequest.mdx @@ -67,10 +67,6 @@ APIRequest.newContext(options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -167,6 +163,7 @@ APIRequest.newContext(options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-apirequestcontext.mdx b/java/docs/api/class-apirequestcontext.mdx index 56665e0d71..112938636d 100644 --- a/java/docs/api/class-apirequestcontext.mdx +++ b/java/docs/api/class-apirequestcontext.mdx @@ -343,6 +343,7 @@ APIRequestContext.storageState(options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-apiresponse.mdx b/java/docs/api/class-apiresponse.mdx index 03ba3c8c40..c7ba728fd1 100644 --- a/java/docs/api/class-apiresponse.mdx +++ b/java/docs/api/class-apiresponse.mdx @@ -211,6 +211,7 @@ APIResponse.url(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-apiresponseassertions.mdx b/java/docs/api/class-apiresponseassertions.mdx index fa860b20fd..ed7a92943e 100644 --- a/java/docs/api/class-apiresponseassertions.mdx +++ b/java/docs/api/class-apiresponseassertions.mdx @@ -107,6 +107,7 @@ assertThat(response).not() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-browser.mdx b/java/docs/api/class-browser.mdx index 7735f33361..60e11aef9c 100644 --- a/java/docs/api/class-browser.mdx +++ b/java/docs/api/class-browser.mdx @@ -208,10 +208,6 @@ browser.close(); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -426,10 +422,6 @@ Browser.newPage(options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -719,6 +711,7 @@ Browser.onDisconnected(handler) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-browsercontext.mdx b/java/docs/api/class-browsercontext.mdx index a862fe8e2a..38613947b1 100644 --- a/java/docs/api/class-browsercontext.mdx +++ b/java/docs/api/class-browsercontext.mdx @@ -619,6 +619,42 @@ BrowserContext.routeFromHAR(har, options); --- +### routeWebSocket {#browser-context-route-web-socket} + +Added in: v1.48browserContext.routeWebSocket + +This method allows to modify websocket connections that are made by any page in the browser context. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before creating any pages. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + +```java +context.routeWebSocket("/ws", ws -> { + ws.routeSend(message -> { + if ("to-be-blocked".equals(message)) + return; + ws.send(message); + }); + ws.connect(); +}); +``` + +**Arguments** +- `url` [String] | [Pattern] | [Predicate]<[String]># + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options. +- `handler` [Consumer]<[WebSocketRoute]># + + Handler function to route the WebSocket. + +**Returns** +- [void]# + +--- + ### setDefaultNavigationTimeout {#browser-context-set-default-navigation-timeout} Added before v1.9browserContext.setDefaultNavigationTimeout @@ -1218,6 +1254,7 @@ BrowserContext.onWebError(handler) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-browsertype.mdx b/java/docs/api/class-browsertype.mdx index 1578d9faef..dcf5ef0999 100644 --- a/java/docs/api/class-browsertype.mdx +++ b/java/docs/api/class-browsertype.mdx @@ -316,10 +316,6 @@ BrowserType.launchPersistentContext(userDataDir, options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -569,6 +565,7 @@ BrowserType.name(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-cdpsession.mdx b/java/docs/api/class-cdpsession.mdx index 5994288d7f..a950679aa1 100644 --- a/java/docs/api/class-cdpsession.mdx +++ b/java/docs/api/class-cdpsession.mdx @@ -158,6 +158,7 @@ CDPSession.send(method, args); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-clock.mdx b/java/docs/api/class-clock.mdx index c35bdecb0c..9cf49970df 100644 --- a/java/docs/api/class-clock.mdx +++ b/java/docs/api/class-clock.mdx @@ -227,6 +227,7 @@ page.clock().setSystemTime("2020-02-02"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-consolemessage.mdx b/java/docs/api/class-consolemessage.mdx index dcb2be2db4..2414d50e3f 100644 --- a/java/docs/api/class-consolemessage.mdx +++ b/java/docs/api/class-consolemessage.mdx @@ -158,6 +158,7 @@ ConsoleMessage.type(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-dialog.mdx b/java/docs/api/class-dialog.mdx index 59f4943031..fc2cc46e14 100644 --- a/java/docs/api/class-dialog.mdx +++ b/java/docs/api/class-dialog.mdx @@ -186,6 +186,7 @@ Dialog.type(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-download.mdx b/java/docs/api/class-download.mdx index f74add0c12..0b2695ff1e 100644 --- a/java/docs/api/class-download.mdx +++ b/java/docs/api/class-download.mdx @@ -227,6 +227,7 @@ Download.url(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-elementhandle.mdx b/java/docs/api/class-elementhandle.mdx index 5c427b3322..1678925f71 100644 --- a/java/docs/api/class-elementhandle.mdx +++ b/java/docs/api/class-elementhandle.mdx @@ -1619,6 +1619,7 @@ This method does not work across navigations, use [Page.waitForSelector()](/api/ [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-filechooser.mdx b/java/docs/api/class-filechooser.mdx index b023988d3e..0dbb4426da 100644 --- a/java/docs/api/class-filechooser.mdx +++ b/java/docs/api/class-filechooser.mdx @@ -150,6 +150,7 @@ FileChooser.setFiles(files, options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-formdata.mdx b/java/docs/api/class-formdata.mdx index 4b8ddbe448..8aa66d7740 100644 --- a/java/docs/api/class-formdata.mdx +++ b/java/docs/api/class-formdata.mdx @@ -176,6 +176,7 @@ FormData.set(name, value); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-frame.mdx b/java/docs/api/class-frame.mdx index 519338ac08..6d0cd40833 100644 --- a/java/docs/api/class-frame.mdx +++ b/java/docs/api/class-frame.mdx @@ -2690,6 +2690,7 @@ Frame.waitForTimeout(timeout); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-framelocator.mdx b/java/docs/api/class-framelocator.mdx index 65335fabb8..e0d0aac402 100644 --- a/java/docs/api/class-framelocator.mdx +++ b/java/docs/api/class-framelocator.mdx @@ -7,10 +7,10 @@ import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; -FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [Page.frameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.frameLocator()](/api/class-locator.mdx#locator-frame-locator) method. +FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame), [Page.frameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.frameLocator()](/api/class-locator.mdx#locator-frame-locator) method. ```java -Locator locator = page.frameLocator("#my-frame").getByText("Submit"); +Locator locator = page.locator("#my-frame").contentFrame().getByText("Submit"); locator.click(); ``` @@ -20,10 +20,10 @@ Frame locators are strict. This means that all operations on frame locators will ```java // Throws if there are several frames in DOM: -page.frame_locator(".result-frame").getByRole(AriaRole.BUTTON).click(); +page.locator(".result-frame").contentFrame().getByRole(AriaRole.BUTTON).click(); // Works because we explicitly tell locator to pick the first frame: -page.frame_locator(".result-frame").first().getByRole(AriaRole.BUTTON).click(); +page.locator(".result-frame").first().contentFrame().getByRole(AriaRole.BUTTON).click(); ``` **Converting Locator to FrameLocator** @@ -39,23 +39,6 @@ If you have a [FrameLocator] object it can be converted to [Locator] pointing to ## Methods -### first {#frame-locator-first} - -Added in: v1.17frameLocator.first - -Returns locator to the first matching frame. - -**Usage** - -```java -FrameLocator.first(); -``` - -**Returns** -- [FrameLocator]# - ---- - ### frameLocator {#frame-locator-frame-locator} Added in: v1.17frameLocator.frameLocator @@ -403,23 +386,6 @@ assertThat(page.getByTitle("Issues count")).hasText("25 issues"); --- -### last {#frame-locator-last} - -Added in: v1.17frameLocator.last - -Returns locator to the last matching frame. - -**Usage** - -```java -FrameLocator.last(); -``` - -**Returns** -- [FrameLocator]# - ---- - ### locator {#frame-locator-locator} Added in: v1.17frameLocator.locator @@ -464,47 +430,104 @@ FrameLocator.locator(selectorOrLocator, options); --- -### nth {#frame-locator-nth} +### owner {#frame-locator-owner} -Added in: v1.17frameLocator.nth +Added in: v1.43frameLocator.owner -Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. +Returns a [Locator] object pointing to the same `iframe` as this frame locator. + +Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. + +For a reverse operation, use [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame). **Usage** ```java -FrameLocator.nth(index); +FrameLocator frameLocator = page.locator("iframe[name=\"embedded\"]").contentFrame(); +// ... +Locator locator = frameLocator.owner(); +assertThat(locator).isVisible(); ``` -**Arguments** -- `index` [int]# +**Returns** +- [Locator]# + +--- + +## Deprecated + +### first {#frame-locator-first} + +Added in: v1.17frameLocator.first + +:::warning Deprecated + +Use [Locator.first()](/api/class-locator.mdx#locator-first) followed by [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + +Returns locator to the first matching frame. + +**Usage** + +```java +FrameLocator.first(); +``` **Returns** -- [FrameLocator]# +- [FrameLocator]# --- -### owner {#frame-locator-owner} +### last {#frame-locator-last} -Added in: v1.43frameLocator.owner +Added in: v1.17frameLocator.last -Returns a [Locator] object pointing to the same `iframe` as this frame locator. +:::warning Deprecated -Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. +Use [Locator.last()](/api/class-locator.mdx#locator-last) followed by [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. -For a reverse operation, use [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame). +::: + + +Returns locator to the last matching frame. **Usage** ```java -FrameLocator frameLocator = page.frameLocator("iframe[name=\"embedded\"]"); -// ... -Locator locator = frameLocator.owner(); -assertThat(locator).isVisible(); +FrameLocator.last(); ``` **Returns** -- [Locator]# +- [FrameLocator]# + +--- + +### nth {#frame-locator-nth} + +Added in: v1.17frameLocator.nth + +:::warning Deprecated + +Use [Locator.nth()](/api/class-locator.mdx#locator-nth) followed by [Locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + +Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. + +**Usage** + +```java +FrameLocator.nth(index); +``` + +**Arguments** +- `index` [int]# + +**Returns** +- [FrameLocator]# [APIRequest]: /api/class-apirequest.mdx "APIRequest" @@ -546,6 +569,7 @@ assertThat(locator).isVisible(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-jshandle.mdx b/java/docs/api/class-jshandle.mdx index 4404490a4c..6f5e9393a7 100644 --- a/java/docs/api/class-jshandle.mdx +++ b/java/docs/api/class-jshandle.mdx @@ -223,6 +223,7 @@ JSHandle.jsonValue(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-keyboard.mdx b/java/docs/api/class-keyboard.mdx index ca88365dfc..44706e4729 100644 --- a/java/docs/api/class-keyboard.mdx +++ b/java/docs/api/class-keyboard.mdx @@ -265,6 +265,7 @@ Keyboard.up(key); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-locator.mdx b/java/docs/api/class-locator.mdx index 15fbe2709a..824dd0935f 100644 --- a/java/docs/api/class-locator.mdx +++ b/java/docs/api/class-locator.mdx @@ -1624,7 +1624,9 @@ Locator banana = page.getByRole(AriaRole.LISTITEM).nth(2); Added in: v1.33locator.or -Creates a locator that matches either of the two locators. +Creates a locator matching all elements that match one or both of the two locators. + +Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.mdx#strictness) guidelines. **Usage** @@ -2411,6 +2413,7 @@ To press a special key, like `Control` or `ArrowDown`, use [Locator.press()](/ap [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-locatorassertions.mdx b/java/docs/api/class-locatorassertions.mdx index bf80db8f8b..f2302c72d1 100644 --- a/java/docs/api/class-locatorassertions.mdx +++ b/java/docs/api/class-locatorassertions.mdx @@ -814,6 +814,7 @@ assertThat(locator).not() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-mouse.mdx b/java/docs/api/class-mouse.mdx index 1cfdfe480c..94eb56e2a3 100644 --- a/java/docs/api/class-mouse.mdx +++ b/java/docs/api/class-mouse.mdx @@ -247,6 +247,7 @@ Mouse.wheel(deltaX, deltaY); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-page.mdx b/java/docs/api/class-page.mdx index cc4b1b1a6a..2a4233f425 100644 --- a/java/docs/api/class-page.mdx +++ b/java/docs/api/class-page.mdx @@ -1690,6 +1690,42 @@ Page.routeFromHAR(har, options); --- +### routeWebSocket {#page-route-web-socket} + +Added in: v1.48page.routeWebSocket + +This method allows to modify websocket connections that are made by the page. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before navigating the page. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + +```java +page.routeWebSocket("/ws", ws -> { + ws.routeSend(message -> { + if ("to-be-blocked".equals(message)) + return; + ws.send(message); + }); + ws.connect(); +}); +``` + +**Arguments** +- `url` [String] | [Pattern] | [Predicate]<[String]># + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options. +- `handler` [Consumer]<[WebSocketRoute]># + + Handler function to route the WebSocket. + +**Returns** +- [void]# + +--- + ### screenshot {#page-screenshot} Added before v1.9page.screenshot @@ -4645,6 +4681,7 @@ page.waitForTimeout(1000); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-pageassertions.mdx b/java/docs/api/class-pageassertions.mdx index 9579a5732a..c1dc3cb599 100644 --- a/java/docs/api/class-pageassertions.mdx +++ b/java/docs/api/class-pageassertions.mdx @@ -145,6 +145,7 @@ assertThat(page).not() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-playwright.mdx b/java/docs/api/class-playwright.mdx index e8aa96c2a0..ffa901f029 100644 --- a/java/docs/api/class-playwright.mdx +++ b/java/docs/api/class-playwright.mdx @@ -202,6 +202,7 @@ Playwright.webkit() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-playwrightassertions.mdx b/java/docs/api/class-playwrightassertions.mdx index cae0dd176f..030b17f88e 100644 --- a/java/docs/api/class-playwrightassertions.mdx +++ b/java/docs/api/class-playwrightassertions.mdx @@ -158,6 +158,7 @@ PlaywrightAssertions.setDefaultAssertionTimeout(30_000); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-playwrightexception.mdx b/java/docs/api/class-playwrightexception.mdx index 0d54d30920..0c182765e4 100644 --- a/java/docs/api/class-playwrightexception.mdx +++ b/java/docs/api/class-playwrightexception.mdx @@ -51,6 +51,7 @@ PlaywrightException is thrown whenever certain operations are terminated abnorma [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-request.mdx b/java/docs/api/class-request.mdx index 53842cfcb4..cc2f6a29c5 100644 --- a/java/docs/api/class-request.mdx +++ b/java/docs/api/class-request.mdx @@ -434,6 +434,7 @@ Request.url(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-requestoptions.mdx b/java/docs/api/class-requestoptions.mdx index bb8d3a22b9..f9007e3570 100644 --- a/java/docs/api/class-requestoptions.mdx +++ b/java/docs/api/class-requestoptions.mdx @@ -345,6 +345,7 @@ RequestOptions.setTimeout(timeout); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-response.mdx b/java/docs/api/class-response.mdx index 728198b263..8dacc91479 100644 --- a/java/docs/api/class-response.mdx +++ b/java/docs/api/class-response.mdx @@ -377,6 +377,7 @@ Response.url(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-route.mdx b/java/docs/api/class-route.mdx index 998e50c1c0..3672ae60ce 100644 --- a/java/docs/api/class-route.mdx +++ b/java/docs/api/class-route.mdx @@ -345,6 +345,7 @@ Note that any overrides such as `url` or `headers` only apply to the request bei [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-selectors.mdx b/java/docs/api/class-selectors.mdx index 7038fc8a8c..d8522ce47a 100644 --- a/java/docs/api/class-selectors.mdx +++ b/java/docs/api/class-selectors.mdx @@ -124,6 +124,7 @@ Selectors.setTestIdAttribute(attributeName); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-timeouterror.mdx b/java/docs/api/class-timeouterror.mdx index bef84b15ed..24e8e815ed 100644 --- a/java/docs/api/class-timeouterror.mdx +++ b/java/docs/api/class-timeouterror.mdx @@ -72,6 +72,7 @@ public class TimeoutErrorExample { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-touchscreen.mdx b/java/docs/api/class-touchscreen.mdx index 7d87ba228d..c61d202ef7 100644 --- a/java/docs/api/class-touchscreen.mdx +++ b/java/docs/api/class-touchscreen.mdx @@ -81,6 +81,7 @@ Touchscreen.tap(x, y); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-tracing.mdx b/java/docs/api/class-tracing.mdx index 79398c909b..0db9c1c252 100644 --- a/java/docs/api/class-tracing.mdx +++ b/java/docs/api/class-tracing.mdx @@ -20,7 +20,7 @@ context.tracing().start(new Tracing.StartOptions() Page page = context.newPage(); page.navigate("https://playwright.dev"); context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.pwtrace.zip"))); + .setPath(Paths.get("trace.zip"))); ``` @@ -43,7 +43,7 @@ context.tracing().start(new Tracing.StartOptions() Page page = context.newPage(); page.navigate("https://playwright.dev"); context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.pwtrace.zip"))); + .setPath(Paths.get("trace.zip"))); ``` **Arguments** @@ -90,13 +90,13 @@ context.tracing().startChunk(); page.getByText("Get Started").click(); // Everything between startChunk and stopChunk will be recorded in the trace. context.tracing().stopChunk(new Tracing.StopChunkOptions() - .setPath(Paths.get("trace1.pwtrace.zip"))); + .setPath(Paths.get("trace1.zip"))); context.tracing().startChunk(); page.navigate("http://example.com"); // Save a second trace file with different actions. context.tracing().stopChunk(new Tracing.StopChunkOptions() - .setPath(Paths.get("trace2.pwtrace.zip"))); + .setPath(Paths.get("trace2.zip"))); ``` **Arguments** @@ -199,6 +199,7 @@ Tracing.stopChunk(options); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-video.mdx b/java/docs/api/class-video.mdx index c0fe90406d..f97d1015f4 100644 --- a/java/docs/api/class-video.mdx +++ b/java/docs/api/class-video.mdx @@ -112,6 +112,7 @@ Video.saveAs(path); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-weberror.mdx b/java/docs/api/class-weberror.mdx index b2fb5b988a..0829bd4c07 100644 --- a/java/docs/api/class-weberror.mdx +++ b/java/docs/api/class-weberror.mdx @@ -96,6 +96,7 @@ WebError.page(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-websocket.mdx b/java/docs/api/class-websocket.mdx index 3a2669a795..5f00c065d6 100644 --- a/java/docs/api/class-websocket.mdx +++ b/java/docs/api/class-websocket.mdx @@ -216,6 +216,7 @@ WebSocket.onSocketError(handler) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-websocketframe.mdx b/java/docs/api/class-websocketframe.mdx index 7198db69a2..26408d9164 100644 --- a/java/docs/api/class-websocketframe.mdx +++ b/java/docs/api/class-websocketframe.mdx @@ -86,6 +86,7 @@ WebSocketFrame.text(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/api/class-websocketroute.mdx b/java/docs/api/class-websocketroute.mdx new file mode 100644 index 0000000000..3d076096f6 --- /dev/null +++ b/java/docs/api/class-websocketroute.mdx @@ -0,0 +1,271 @@ +--- +id: class-websocketroute +title: "WebSocketRoute" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +Whenever a [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) route is set up with [Page.routeWebSocket()](/api/class-page.mdx#page-route-web-socket) or [BrowserContext.routeWebSocket()](/api/class-browsercontext.mdx#browser-context-route-web-socket), the `WebSocketRoute` object allows to handle the WebSocket. + +By default, the routed WebSocket will not actually connect to the server. This way, you can mock entire communcation over the WebSocket. Here is an example that responds to a `"query"` with a `"result"`. + +```java +page.routeWebSocket("/ws", ws -> { + ws.routeSend(message -> { + if ("query".equals(message)) + ws.receive("result"); + }); +}); +``` + + +--- + +## Methods + +### close {#web-socket-route-close} + +Added in: v1.48webSocketRoute.close + +Closes the server connection and the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page. + +**Usage** + +```java +WebSocketRoute.close(); +WebSocketRoute.close(options); +``` + +**Arguments** +- `options` `WebSocketRoute.CloseOptions` *(optional)* + - `setCode` [int] *(optional)*# + + Optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code). + - `setReason` [String] *(optional)*# + + Optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). + +**Returns** +- [void]# + +--- + +### connect {#web-socket-route-connect} + +Added in: v1.48webSocketRoute.connect + +By default, routed WebSocket does not connect to the server, so you can mock entire WebSocket communication. This method connects to the actual WebSocket server, giving the ability to send and receive messages from the server. + +Once connected: +* Messages received from the server will be automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, unless [WebSocketRoute.routeReceive()](/api/class-websocketroute.mdx#web-socket-route-route-receive) is called. +* Messages sent by the `WebSocket.send()` call in the page will be automatically sent to the server, unless [WebSocketRoute.routeSend()](/api/class-websocketroute.mdx#web-socket-route-route-send) is called. + +**Usage** + +```java +WebSocketRoute.connect(); +``` + +**Returns** +- [void]# + +--- + +### receive {#web-socket-route-receive} + +Added in: v1.48webSocketRoute.receive + +Dispatches a message to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, like it was received from the server. + +**Usage** + +```java +WebSocketRoute.receive(message); +``` + +**Arguments** +- `message` [String] | [byte[]]# + + Message to receive. + +--- + +### routeReceive {#web-socket-route-route-receive} + +Added in: v1.48webSocketRoute.routeReceive + +This method allows to route messages that are received by the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page from the server. This method only makes sense if you are also calling [WebSocketRoute.connect()](/api/class-websocketroute.mdx#web-socket-route-connect). + +Once this method is called, received messages are not automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page - you should do that manually by calling [WebSocketRoute.receive()](/api/class-websocketroute.mdx#web-socket-route-receive). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```java +WebSocketRoute.routeReceive(handler); +``` + +**Arguments** +- `handler` [Consumer]<[WebSocketFrame]># + + Handler function to route received messages. + +**Returns** +- [void]# + +--- + +### routeSend {#web-socket-route-route-send} + +Added in: v1.48webSocketRoute.routeSend + +This method allows to route messages that are sent by `WebSocket.send()` call in the page, instead of actually sending them to the server. Once this method is called, sent messages **are not** automatically forwarded to the server - you should do that manually by calling [WebSocketRoute.send()](/api/class-websocketroute.mdx#web-socket-route-send). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```java +WebSocketRoute.routeSend(handler); +``` + +**Arguments** +- `handler` [Consumer]<[WebSocketFrame]># + + Handler function to route sent messages. + +**Returns** +- [void]# + +--- + +### send {#web-socket-route-send} + +Added in: v1.48webSocketRoute.send + +Sends a message to the server, like it was sent in the page with `WebSocket.send()`. + +**Usage** + +```java +WebSocketRoute.send(message); +``` + +**Arguments** +- `message` [String] | [byte[]]# + + Message to send. + +--- + +### url {#web-socket-route-url} + +Added in: v1.48webSocketRoute.url + +URL of the WebSocket created in the page. + +**Usage** + +```java +WebSocketRoute.url(); +``` + +**Returns** +- [String]# + +--- + +## Events + +### onClose(handler) {#web-socket-route-event-close} + +Added in: v1.48webSocketRoute.onClose(handler) + +Emitted when the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) closes. + +**Usage** + +```java +WebSocketRoute.onClose(handler) +``` + + +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[FormData]: /api/class-formdata.mdx "FormData" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[PlaywrightException]: /api/class-playwrightexception.mdx "PlaywrightException" +[Request]: /api/class-request.mdx "Request" +[RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Selectors]: /api/class-selectors.mdx "Selectors" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[boolean]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "boolean" +[byte[]]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "byte[]" +[Consumer]: https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html "Consumer" +[Date]: https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date" +[double]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "double" +[InputStream]: https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream" +[int]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "int" +[long]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "long" +[JsonObject]: https://www.javadoc.io/doc/com.google.code.gson/gson/latest/com.google.gson/com/google/gson/JsonObject.html "JsonObject" +[List]: https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List" +[Map]: https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map" +[null]: https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.7 "null" +[Object]: https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object" +[Path]: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path" +[Pattern]: https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html "Pattern" +[Predicate]: https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html "Predicate" +[void]: https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html "void" +[Runnable]: https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html "Runnable" +[RuntimeException]: https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException" +[String]: https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/java/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/java/about "Microsoft Artifact Registry" +[Dockerfile.jammy]: https://github.com/microsoft/playwright-java/blob/main/utils/docker/Dockerfile.jammy "Dockerfile.jammy" diff --git a/java/docs/api/class-worker.mdx b/java/docs/api/class-worker.mdx index 25ee0467f4..5a21d26e7c 100644 --- a/java/docs/api/class-worker.mdx +++ b/java/docs/api/class-worker.mdx @@ -183,6 +183,7 @@ Worker.onClose(handler) [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/auth.mdx b/java/docs/auth.mdx index 783b0ebae6..852de1edfa 100644 --- a/java/docs/auth.mdx +++ b/java/docs/auth.mdx @@ -153,6 +153,7 @@ context.addInitScript("(storage => {\n" + [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/browser-contexts.mdx b/java/docs/browser-contexts.mdx index b00345cea7..d79364dca4 100644 --- a/java/docs/browser-contexts.mdx +++ b/java/docs/browser-contexts.mdx @@ -97,6 +97,7 @@ public class Example { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/browsers.mdx b/java/docs/browsers.mdx index 76ae281242..c52e1e1a4f 100644 --- a/java/docs/browsers.mdx +++ b/java/docs/browsers.mdx @@ -562,6 +562,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="un [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/ci-intro.mdx b/java/docs/ci-intro.mdx index a7c43437db..7a211d4cd2 100644 --- a/java/docs/ci-intro.mdx +++ b/java/docs/ci-intro.mdx @@ -81,8 +81,8 @@ Clicking on the workflow run will show you the all the actions that GitHub perfo - [Learn how to perform Actions](./input.mdx) - [Learn how to write Assertions](./test-assertions.mdx) - [Learn more about the Trace Viewer](/trace-viewer.mdx) -- [Learn more ways of running tests on GitHub Actions](/ci.mdx) -- [Learn more about running tests on other CI providers](/ci.mdx#github-actions) // TODO: is this link correct? +- [Learn more ways of running tests on GitHub Actions](/ci.mdx#github-actions) +- [Learn more about running tests on other CI providers](/ci.mdx) [APIRequest]: /api/class-apirequest.mdx "APIRequest" @@ -124,6 +124,7 @@ Clicking on the workflow run will show you the all the actions that GitHub perfo [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/ci.mdx b/java/docs/ci.mdx index 0fb0f7cdab..07835b35f0 100644 --- a/java/docs/ci.mdx +++ b/java/docs/ci.mdx @@ -298,6 +298,7 @@ xvfb-run mvn test [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/clock.mdx b/java/docs/clock.mdx index 3305f4af1c..2f59ad17c5 100644 --- a/java/docs/clock.mdx +++ b/java/docs/clock.mdx @@ -197,6 +197,7 @@ assertThat(locator).hasText("2/2/2024, 10:00:02 AM"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/codegen-intro.mdx b/java/docs/codegen-intro.mdx index 9736916b6c..9be4c5939f 100644 --- a/java/docs/codegen-intro.mdx +++ b/java/docs/codegen-intro.mdx @@ -102,6 +102,7 @@ You can also generate tests using emulation so as to generate a test for a speci [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/codegen.mdx b/java/docs/codegen.mdx index 0923e1e24e..748965a7e6 100644 --- a/java/docs/codegen.mdx +++ b/java/docs/codegen.mdx @@ -198,6 +198,7 @@ public class Example { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/debug.mdx b/java/docs/debug.mdx index f566dd18c2..1e92f2faaa 100644 --- a/java/docs/debug.mdx +++ b/java/docs/debug.mdx @@ -316,6 +316,7 @@ chromium.launch(new BrowserType.LaunchOptions() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/dialogs.mdx b/java/docs/dialogs.mdx index a241e8c368..fbe381578a 100644 --- a/java/docs/dialogs.mdx +++ b/java/docs/dialogs.mdx @@ -107,6 +107,7 @@ This will wait for the print dialog to be opened after the button is clicked. Ma [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/docker.mdx b/java/docs/docker.mdx index 154d7795a9..bad38da144 100644 --- a/java/docs/docker.mdx +++ b/java/docs/docker.mdx @@ -134,6 +134,7 @@ Browser builds for Firefox and WebKit are built for the [glibc](https://en.wikip [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/downloads.mdx b/java/docs/downloads.mdx index 704d0206c7..1a9baa67c0 100644 --- a/java/docs/downloads.mdx +++ b/java/docs/downloads.mdx @@ -83,6 +83,7 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/emulation.mdx b/java/docs/emulation.mdx index 4157b9d4b6..9bfa5a90fe 100644 --- a/java/docs/emulation.mdx +++ b/java/docs/emulation.mdx @@ -188,6 +188,7 @@ BrowserContext context = browser.newContext(new Browser.NewContextOptions() [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/evaluating.mdx b/java/docs/evaluating.mdx index 86f1122291..f3f3ae2bc9 100644 --- a/java/docs/evaluating.mdx +++ b/java/docs/evaluating.mdx @@ -164,6 +164,7 @@ page.addInitScript(Paths.get("mocks/preload.js")); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/events.mdx b/java/docs/events.mdx index d417a19110..47b179f55a 100644 --- a/java/docs/events.mdx +++ b/java/docs/events.mdx @@ -100,6 +100,7 @@ page.evaluate("prompt('Enter a number:')"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/extensibility.mdx b/java/docs/extensibility.mdx index 90e146c40d..555c56b99c 100644 --- a/java/docs/extensibility.mdx +++ b/java/docs/extensibility.mdx @@ -88,6 +88,7 @@ int buttonCount = (int) page.locator("tag=button").count(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/frames.mdx b/java/docs/frames.mdx index fae21a32cd..5c4e9029f4 100644 --- a/java/docs/frames.mdx +++ b/java/docs/frames.mdx @@ -73,6 +73,7 @@ frame.fill("#username-input", "John"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/handles.mdx b/java/docs/handles.mdx index 8290ea3170..81db1d2cf5 100644 --- a/java/docs/handles.mdx +++ b/java/docs/handles.mdx @@ -154,6 +154,7 @@ locator.click(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/input.mdx b/java/docs/input.mdx index f42aec9b4b..664a9b9780 100644 --- a/java/docs/input.mdx +++ b/java/docs/input.mdx @@ -296,6 +296,7 @@ page.getByTestId("scrolling-container").evaluate("e => e.scrollTop += 100"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/intro.mdx b/java/docs/intro.mdx index 624b5e3c71..c942772050 100644 --- a/java/docs/intro.mdx +++ b/java/docs/intro.mdx @@ -178,6 +178,7 @@ By default browsers launched with Playwright run headless, meaning no browser UI [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/junit.mdx b/java/docs/junit.mdx index 116a35b85c..3c35592ba0 100644 --- a/java/docs/junit.mdx +++ b/java/docs/junit.mdx @@ -214,6 +214,7 @@ junit.jupiter.execution.parallel.config.dynamic.factor=0.5 [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/languages.mdx b/java/docs/languages.mdx index 0a9894833d..6fcc639fa0 100644 --- a/java/docs/languages.mdx +++ b/java/docs/languages.mdx @@ -74,6 +74,7 @@ Playwright for .NET comes with [MSTest base classes](https://playwright.dev/dotn [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/locators.mdx b/java/docs/locators.mdx index 220790540d..5fdd596586 100644 --- a/java/docs/locators.mdx +++ b/java/docs/locators.mdx @@ -974,6 +974,7 @@ For less commonly used locators, look at the [other locators](./other-locators.m [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/mock.mdx b/java/docs/mock.mdx index 0d80e48c59..49e03926e9 100644 --- a/java/docs/mock.mdx +++ b/java/docs/mock.mdx @@ -189,6 +189,7 @@ Read more about [advanced networking](./network.mdx). [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/navigations.mdx b/java/docs/navigations.mdx index 857732816e..5b612648d4 100644 --- a/java/docs/navigations.mdx +++ b/java/docs/navigations.mdx @@ -115,6 +115,7 @@ Playwright splits the process of showing a new document in a page into **navigat [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/network.mdx b/java/docs/network.mdx index 01b8ca2f18..d35127e195 100644 --- a/java/docs/network.mdx +++ b/java/docs/network.mdx @@ -235,6 +235,7 @@ Playwright's built-in [BrowserContext.route()](/api/class-browsercontext.mdx#bro [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/other-locators.mdx b/java/docs/other-locators.mdx index de55213e1e..468250ce68 100644 --- a/java/docs/other-locators.mdx +++ b/java/docs/other-locators.mdx @@ -493,6 +493,7 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/pages.mdx b/java/docs/pages.mdx index 4131952436..7d4dfdd999 100644 --- a/java/docs/pages.mdx +++ b/java/docs/pages.mdx @@ -130,6 +130,7 @@ page.onPopup(popup -> { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/pom.mdx b/java/docs/pom.mdx index edadc05471..243fba6c3a 100644 --- a/java/docs/pom.mdx +++ b/java/docs/pom.mdx @@ -97,6 +97,7 @@ searchPage.search("search query"); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/release-notes.mdx b/java/docs/release-notes.mdx index 30be65312d..680a04c9bf 100644 --- a/java/docs/release-notes.mdx +++ b/java/docs/release-notes.mdx @@ -1475,6 +1475,7 @@ This version of Playwright was also tested against the following stable channels [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/running-tests.mdx b/java/docs/running-tests.mdx index b077e9a9bd..49bac7bbe3 100644 --- a/java/docs/running-tests.mdx +++ b/java/docs/running-tests.mdx @@ -135,6 +135,7 @@ If you prefer, you can run your tests in headed mode by using the `launch(new Br [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/screenshots.mdx b/java/docs/screenshots.mdx index ce624544d5..2c4b33a176 100644 --- a/java/docs/screenshots.mdx +++ b/java/docs/screenshots.mdx @@ -84,6 +84,7 @@ page.locator(".header").screenshot(new Locator.ScreenshotOptions().setPath(Paths [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/selenium-grid.mdx b/java/docs/selenium-grid.mdx index 273cbec378..4acdf1c8bb 100644 --- a/java/docs/selenium-grid.mdx +++ b/java/docs/selenium-grid.mdx @@ -163,6 +163,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/test-assertions.mdx b/java/docs/test-assertions.mdx index cb9e77ec77..2fad4ca010 100644 --- a/java/docs/test-assertions.mdx +++ b/java/docs/test-assertions.mdx @@ -77,6 +77,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/test-runners.mdx b/java/docs/test-runners.mdx index c0cd3e294e..4a2399a1f9 100644 --- a/java/docs/test-runners.mdx +++ b/java/docs/test-runners.mdx @@ -380,6 +380,7 @@ public class TestExample { [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/threading.mdx b/java/docs/threading.mdx index 5a01cea46d..d23361a6b6 100644 --- a/java/docs/threading.mdx +++ b/java/docs/threading.mdx @@ -120,6 +120,7 @@ page.waitForTimeout(60_000); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/trace-viewer-intro.mdx b/java/docs/trace-viewer-intro.mdx index 97eb9d9e01..4289d2801f 100644 --- a/java/docs/trace-viewer-intro.mdx +++ b/java/docs/trace-viewer-intro.mdx @@ -33,17 +33,17 @@ page.navigate("https://playwright.dev"); // Stop tracing and export it into a zip archive. context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.pwtrace.zip"))); + .setPath(Paths.get("trace.zip"))); ``` -This will record the trace and place it into the file named `trace.pwtrace.zip`. +This will record the trace and place it into the file named `trace.zip`. ## Opening the trace You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your trace's zip file is located. Once opened you can click on each action or use the timeline to see the state of the page before and after each action. You can also inspect the log, source and network during each step of the test. The trace viewer creates a DOM snapshot so you can fully interact with it, open devtools etc. ```bash -mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.pwtrace.zip" +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.zip" ``` ###### @@ -95,6 +95,7 @@ To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/trace-viewer.mdx b/java/docs/trace-viewer.mdx index a0e2272bd3..1e41627f3a 100644 --- a/java/docs/trace-viewer.mdx +++ b/java/docs/trace-viewer.mdx @@ -120,17 +120,17 @@ page.navigate("https://playwright.dev"); // Stop tracing and export it into a zip archive. context.tracing().stop(new Tracing.StopOptions() - .setPath(Paths.get("trace.pwtracezip"))); + .setPath(Paths.get("trace.zip"))); ``` -This will record the trace and place it into the file named `trace.pwtrace.zip`. +This will record the trace and place it into the file named `trace.zip`. ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. ```bash -mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.pwtrace.zip" +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace trace.zip" ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -144,7 +144,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="sh You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace https://example.com/trace.pwtrace.zip" +mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="show-trace https://example.com/trace.zip" ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. @@ -193,6 +193,7 @@ https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/ [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/videos.mdx b/java/docs/videos.mdx index 27a853db36..5ef0e36ab6 100644 --- a/java/docs/videos.mdx +++ b/java/docs/videos.mdx @@ -78,6 +78,7 @@ Note that the video is only available after the page or browser context is close [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/webview2.mdx b/java/docs/webview2.mdx index 9ba2c45777..5b2d897038 100644 --- a/java/docs/webview2.mdx +++ b/java/docs/webview2.mdx @@ -216,6 +216,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/java/docs/writing-tests.mdx b/java/docs/writing-tests.mdx index 3d1890dc46..e29b3e3b05 100644 --- a/java/docs/writing-tests.mdx +++ b/java/docs/writing-tests.mdx @@ -135,6 +135,7 @@ Page page = context.newPage(); [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" [WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/nodejs/docs/accessibility-testing.mdx b/nodejs/docs/accessibility-testing.mdx index 1191f9bb0f..b80c6c4d7b 100644 --- a/nodejs/docs/accessibility-testing.mdx +++ b/nodejs/docs/accessibility-testing.mdx @@ -379,10 +379,12 @@ test('example using custom fixture', async ({ page, makeAxeBuilder }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -390,7 +392,6 @@ test('example using custom fixture', async ({ page, makeAxeBuilder }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/actionability.mdx b/nodejs/docs/actionability.mdx index 7e77631cf8..6aee6fe9e9 100644 --- a/nodejs/docs/actionability.mdx +++ b/nodejs/docs/actionability.mdx @@ -162,10 +162,12 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -173,7 +175,6 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api-testing.mdx b/nodejs/docs/api-testing.mdx index 20e97ce948..107b792ecd 100644 --- a/nodejs/docs/api-testing.mdx +++ b/nodejs/docs/api-testing.mdx @@ -422,10 +422,12 @@ test('global context request has isolated cookie storage', async ({ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -433,7 +435,6 @@ test('global context request has isolated cookie storage', async ({ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-accessibility.mdx b/nodejs/docs/api/class-accessibility.mdx index 806f492436..70cd8d4ae2 100644 --- a/nodejs/docs/api/class-accessibility.mdx +++ b/nodejs/docs/api/class-accessibility.mdx @@ -204,10 +204,12 @@ function findFocusedNode(node) { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -215,7 +217,6 @@ function findFocusedNode(node) { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-android.mdx b/nodejs/docs/api/class-android.mdx index 30ffe69450..5786a7b983 100644 --- a/nodejs/docs/api/class-android.mdx +++ b/nodejs/docs/api/class-android.mdx @@ -291,10 +291,12 @@ android.setDefaultTimeout(timeout); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -302,7 +304,6 @@ android.setDefaultTimeout(timeout); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-androiddevice.mdx b/nodejs/docs/api/class-androiddevice.mdx index a53a5f485a..144e76156e 100644 --- a/nodejs/docs/api/class-androiddevice.mdx +++ b/nodejs/docs/api/class-androiddevice.mdx @@ -976,10 +976,12 @@ androidDevice.on('webview', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -987,7 +989,6 @@ androidDevice.on('webview', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-androidinput.mdx b/nodejs/docs/api/class-androidinput.mdx index ad92ff9cd2..d4462c073b 100644 --- a/nodejs/docs/api/class-androidinput.mdx +++ b/nodejs/docs/api/class-androidinput.mdx @@ -206,10 +206,12 @@ await androidInput.type(text); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -217,7 +219,6 @@ await androidInput.type(text); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-androidsocket.mdx b/nodejs/docs/api/class-androidsocket.mdx index ee8113c841..62128848a1 100644 --- a/nodejs/docs/api/class-androidsocket.mdx +++ b/nodejs/docs/api/class-androidsocket.mdx @@ -133,10 +133,12 @@ androidSocket.on('data', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -144,7 +146,6 @@ androidSocket.on('data', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-androidwebview.mdx b/nodejs/docs/api/class-androidwebview.mdx index 3e49149e54..85afba7890 100644 --- a/nodejs/docs/api/class-androidwebview.mdx +++ b/nodejs/docs/api/class-androidwebview.mdx @@ -128,10 +128,12 @@ androidWebView.on('close', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -139,7 +141,6 @@ androidWebView.on('close', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-apirequest.mdx b/nodejs/docs/api/class-apirequest.mdx index 8576ad52e2..729ffcea31 100644 --- a/nodejs/docs/api/class-apirequest.mdx +++ b/nodejs/docs/api/class-apirequest.mdx @@ -67,10 +67,6 @@ await apiRequest.newContext(options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -211,10 +207,12 @@ await apiRequest.newContext(options); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -222,7 +220,6 @@ await apiRequest.newContext(options); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-apirequestcontext.mdx b/nodejs/docs/api/class-apirequestcontext.mdx index d8c02a87ce..81ddb48b3b 100644 --- a/nodejs/docs/api/class-apirequestcontext.mdx +++ b/nodejs/docs/api/class-apirequestcontext.mdx @@ -670,10 +670,12 @@ await apiRequestContext.storageState(options); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -681,7 +683,6 @@ await apiRequestContext.storageState(options); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-apiresponse.mdx b/nodejs/docs/api/class-apiresponse.mdx index e110beec70..0d9da3293c 100644 --- a/nodejs/docs/api/class-apiresponse.mdx +++ b/nodejs/docs/api/class-apiresponse.mdx @@ -239,10 +239,12 @@ apiResponse.url(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -250,7 +252,6 @@ apiResponse.url(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-apiresponseassertions.mdx b/nodejs/docs/api/class-apiresponseassertions.mdx index cea353af28..2f43f84cb6 100644 --- a/nodejs/docs/api/class-apiresponseassertions.mdx +++ b/nodejs/docs/api/class-apiresponseassertions.mdx @@ -111,10 +111,12 @@ expect(response).not [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -122,7 +124,6 @@ expect(response).not [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-browser.mdx b/nodejs/docs/api/class-browser.mdx index 8da1105f30..d3799dca5d 100644 --- a/nodejs/docs/api/class-browser.mdx +++ b/nodejs/docs/api/class-browser.mdx @@ -206,10 +206,6 @@ If directly using this method to create [BrowserContext]s, it is best practice t An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -492,10 +488,6 @@ await browser.newPage(options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -889,10 +881,12 @@ browser.on('disconnected', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -900,7 +894,6 @@ browser.on('disconnected', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx index 13a0655ad2..eecaf035b7 100644 --- a/nodejs/docs/api/class-browsercontext.mdx +++ b/nodejs/docs/api/class-browsercontext.mdx @@ -640,6 +640,42 @@ await browserContext.routeFromHAR(har, options); --- +### routeWebSocket {#browser-context-route-web-socket} + +Added in: v1.48browserContext.routeWebSocket + +This method allows to modify websocket connections that are made by any page in the browser context. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before creating any pages. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + +```js +await context.routeWebSocket('/ws', async ws => { + ws.routeSend(message => { + if (message === 'to-be-blocked') + return; + ws.send(message); + }); + await ws.connect(); +}); +``` + +**Arguments** +- `url` [string] | [RegExp] | [function]\([URL]\):[boolean]# + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options. +- `handler` [function]\([WebSocketRoute]\):[Promise]<[Object]> | [Object]# + + Handler function to route the WebSocket. + +**Returns** +- [Promise]<[void]># + +--- + ### serviceWorkers {#browser-context-service-workers} Added in: v1.11browserContext.serviceWorkers @@ -1311,10 +1347,12 @@ await browserContext.setHTTPCredentials(httpCredentials); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1322,7 +1360,6 @@ await browserContext.setHTTPCredentials(httpCredentials); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-browserserver.mdx b/nodejs/docs/api/class-browserserver.mdx index 13641ba5d9..846400d075 100644 --- a/nodejs/docs/api/class-browserserver.mdx +++ b/nodejs/docs/api/class-browserserver.mdx @@ -147,10 +147,12 @@ browserServer.on('close', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -158,7 +160,6 @@ browserServer.on('close', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-browsertype.mdx b/nodejs/docs/api/class-browsertype.mdx index b32e767646..28c66544eb 100644 --- a/nodejs/docs/api/class-browsertype.mdx +++ b/nodejs/docs/api/class-browsertype.mdx @@ -320,10 +320,6 @@ await browserType.launchPersistentContext(userDataDir, options); An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -724,10 +720,12 @@ browserType.name(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -735,7 +733,6 @@ browserType.name(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-cdpsession.mdx b/nodejs/docs/api/class-cdpsession.mdx index 1d7b032261..ffbb16041c 100644 --- a/nodejs/docs/api/class-cdpsession.mdx +++ b/nodejs/docs/api/class-cdpsession.mdx @@ -119,10 +119,12 @@ await cdpSession.send(method, params); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -130,7 +132,6 @@ await cdpSession.send(method, params); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-clock.mdx b/nodejs/docs/api/class-clock.mdx index ee69f558f3..1caa8634a0 100644 --- a/nodejs/docs/api/class-clock.mdx +++ b/nodejs/docs/api/class-clock.mdx @@ -235,10 +235,12 @@ await page.clock.setSystemTime('2020-02-02'); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -246,7 +248,6 @@ await page.clock.setSystemTime('2020-02-02'); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-consolemessage.mdx b/nodejs/docs/api/class-consolemessage.mdx index c7e7c4854b..c9597870b0 100644 --- a/nodejs/docs/api/class-consolemessage.mdx +++ b/nodejs/docs/api/class-consolemessage.mdx @@ -175,10 +175,12 @@ consoleMessage.type(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -186,7 +188,6 @@ consoleMessage.type(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-coverage.mdx b/nodejs/docs/api/class-coverage.mdx index a48089ce5d..404c09d5f4 100644 --- a/nodejs/docs/api/class-coverage.mdx +++ b/nodejs/docs/api/class-coverage.mdx @@ -227,10 +227,12 @@ await coverage.stopJSCoverage(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -238,7 +240,6 @@ await coverage.stopJSCoverage(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-dialog.mdx b/nodejs/docs/api/class-dialog.mdx index 5b16b332f9..66d78bde62 100644 --- a/nodejs/docs/api/class-dialog.mdx +++ b/nodejs/docs/api/class-dialog.mdx @@ -190,10 +190,12 @@ dialog.type(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -201,7 +203,6 @@ dialog.type(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-download.mdx b/nodejs/docs/api/class-download.mdx index 61346f7be5..5dffb5f3b9 100644 --- a/nodejs/docs/api/class-download.mdx +++ b/nodejs/docs/api/class-download.mdx @@ -235,10 +235,12 @@ download.url(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -246,7 +248,6 @@ download.url(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-electron.mdx b/nodejs/docs/api/class-electron.mdx index 0a1267d1eb..e847ec97cb 100644 --- a/nodejs/docs/api/class-electron.mdx +++ b/nodejs/docs/api/class-electron.mdx @@ -228,10 +228,12 @@ await electron.launch(options); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -239,7 +241,6 @@ await electron.launch(options); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-electronapplication.mdx b/nodejs/docs/api/class-electronapplication.mdx index de167322fb..9449c7bab2 100644 --- a/nodejs/docs/api/class-electronapplication.mdx +++ b/nodejs/docs/api/class-electronapplication.mdx @@ -359,10 +359,12 @@ electronApplication.on('window', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -370,7 +372,6 @@ electronApplication.on('window', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-elementhandle.mdx b/nodejs/docs/api/class-elementhandle.mdx index 5fe3dab04c..3d36492a57 100644 --- a/nodejs/docs/api/class-elementhandle.mdx +++ b/nodejs/docs/api/class-elementhandle.mdx @@ -1631,10 +1631,12 @@ This method does not work across navigations, use [page.waitForSelector()](/api/ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1642,7 +1644,6 @@ This method does not work across navigations, use [page.waitForSelector()](/api/ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-filechooser.mdx b/nodejs/docs/api/class-filechooser.mdx index 809fa87d7b..7aced77a57 100644 --- a/nodejs/docs/api/class-filechooser.mdx +++ b/nodejs/docs/api/class-filechooser.mdx @@ -162,10 +162,12 @@ await fileChooser.setFiles(files, options); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -173,7 +175,6 @@ await fileChooser.setFiles(files, options); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-fixtures.mdx b/nodejs/docs/api/class-fixtures.mdx index 3dd9f98166..97845aea97 100644 --- a/nodejs/docs/api/class-fixtures.mdx +++ b/nodejs/docs/api/class-fixtures.mdx @@ -195,10 +195,12 @@ test('basic test', async ({ request }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -206,7 +208,6 @@ test('basic test', async ({ request }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-frame.mdx b/nodejs/docs/api/class-frame.mdx index 263b4c7b61..435d544efd 100644 --- a/nodejs/docs/api/class-frame.mdx +++ b/nodejs/docs/api/class-frame.mdx @@ -2690,10 +2690,12 @@ await frame.waitForTimeout(timeout); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -2701,7 +2703,6 @@ await frame.waitForTimeout(timeout); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-framelocator.mdx b/nodejs/docs/api/class-framelocator.mdx index 2bdaf2834c..fdcc43d498 100644 --- a/nodejs/docs/api/class-framelocator.mdx +++ b/nodejs/docs/api/class-framelocator.mdx @@ -7,10 +7,10 @@ import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; -FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [page.frameLocator()](/api/class-page.mdx#page-frame-locator) or [locator.frameLocator()](/api/class-locator.mdx#locator-frame-locator) method. +FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame), [page.frameLocator()](/api/class-page.mdx#page-frame-locator) or [locator.frameLocator()](/api/class-locator.mdx#locator-frame-locator) method. ```js -const locator = page.frameLocator('#my-frame').getByText('Submit'); +const locator = page.locator('#my-frame').contentFrame().getByText('Submit'); await locator.click(); ``` @@ -20,10 +20,10 @@ Frame locators are strict. This means that all operations on frame locators will ```js // Throws if there are several frames in DOM: -await page.frameLocator('.result-frame').getByRole('button').click(); +await page.locator('.result-frame').contentFrame().getByRole('button').click(); // Works because we explicitly tell locator to pick the first frame: -await page.frameLocator('.result-frame').first().getByRole('button').click(); +await page.locator('.result-frame').contentFrame().first().getByRole('button').click(); ``` **Converting Locator to FrameLocator** @@ -39,23 +39,6 @@ If you have a [FrameLocator] object it can be converted to [Locator] pointing to ## Methods -### first {#frame-locator-first} - -Added in: v1.17frameLocator.first - -Returns locator to the first matching frame. - -**Usage** - -```js -frameLocator.first(); -``` - -**Returns** -- [FrameLocator]# - ---- - ### frameLocator {#frame-locator-frame-locator} Added in: v1.17frameLocator.frameLocator @@ -408,23 +391,6 @@ await expect(page.getByTitle('Issues count')).toHaveText('25 issues'); --- -### last {#frame-locator-last} - -Added in: v1.17frameLocator.last - -Returns locator to the last matching frame. - -**Usage** - -```js -frameLocator.last(); -``` - -**Returns** -- [FrameLocator]# - ---- - ### locator {#frame-locator-locator} Added in: v1.17frameLocator.locator @@ -469,47 +435,104 @@ frameLocator.locator(selectorOrLocator, options); --- -### nth {#frame-locator-nth} +### owner {#frame-locator-owner} -Added in: v1.17frameLocator.nth +Added in: v1.43frameLocator.owner -Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. +Returns a [Locator] object pointing to the same `iframe` as this frame locator. + +Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. + +For a reverse operation, use [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame). **Usage** ```js -frameLocator.nth(index); +const frameLocator = page.locator('iframe[name="embedded"]').contentFrame(); +// ... +const locator = frameLocator.owner(); +await expect(locator).toBeVisible(); ``` -**Arguments** -- `index` [number]# +**Returns** +- [Locator]# + +--- + +## Deprecated + +### first {#frame-locator-first} + +Added in: v1.17frameLocator.first + +:::warning Deprecated + +Use [locator.first()](/api/class-locator.mdx#locator-first) followed by [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + +Returns locator to the first matching frame. + +**Usage** + +```js +frameLocator.first(); +``` **Returns** -- [FrameLocator]# +- [FrameLocator]# --- -### owner {#frame-locator-owner} +### last {#frame-locator-last} -Added in: v1.43frameLocator.owner +Added in: v1.17frameLocator.last -Returns a [Locator] object pointing to the same `iframe` as this frame locator. +:::warning Deprecated -Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. +Use [locator.last()](/api/class-locator.mdx#locator-last) followed by [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. -For a reverse operation, use [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame). +::: + + +Returns locator to the last matching frame. **Usage** ```js -const frameLocator = page.frameLocator('iframe[name="embedded"]'); -// ... -const locator = frameLocator.owner(); -await expect(locator).toBeVisible(); +frameLocator.last(); ``` **Returns** -- [Locator]# +- [FrameLocator]# + +--- + +### nth {#frame-locator-nth} + +Added in: v1.17frameLocator.nth + +:::warning Deprecated + +Use [locator.nth()](/api/class-locator.mdx#locator-nth) followed by [locator.contentFrame()](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + +Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. + +**Usage** + +```js +frameLocator.nth(index); +``` + +**Arguments** +- `index` [number]# + +**Returns** +- [FrameLocator]# [Accessibility]: /api/class-accessibility.mdx "Accessibility" @@ -560,10 +583,12 @@ await expect(locator).toBeVisible(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -571,7 +596,6 @@ await expect(locator).toBeVisible(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-fullconfig.mdx b/nodejs/docs/api/class-fullconfig.mdx index 9dc945afee..7b7f72ab46 100644 --- a/nodejs/docs/api/class-fullconfig.mdx +++ b/nodejs/docs/api/class-fullconfig.mdx @@ -436,10 +436,12 @@ fullConfig.workers [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -447,7 +449,6 @@ fullConfig.workers [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-fullproject.mdx b/nodejs/docs/api/class-fullproject.mdx index ae0fccd43b..c2a693f094 100644 --- a/nodejs/docs/api/class-fullproject.mdx +++ b/nodejs/docs/api/class-fullproject.mdx @@ -316,10 +316,12 @@ fullProject.use [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -327,7 +329,6 @@ fullProject.use [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-genericassertions.mdx b/nodejs/docs/api/class-genericassertions.mdx index 786350898b..86f582cd65 100644 --- a/nodejs/docs/api/class-genericassertions.mdx +++ b/nodejs/docs/api/class-genericassertions.mdx @@ -808,10 +808,12 @@ expect(value).not [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -819,7 +821,6 @@ expect(value).not [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-jshandle.mdx b/nodejs/docs/api/class-jshandle.mdx index f5f3fafb53..1db4b3ca08 100644 --- a/nodejs/docs/api/class-jshandle.mdx +++ b/nodejs/docs/api/class-jshandle.mdx @@ -232,10 +232,12 @@ await jsHandle.jsonValue(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -243,7 +245,6 @@ await jsHandle.jsonValue(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-keyboard.mdx b/nodejs/docs/api/class-keyboard.mdx index 37c85ad245..e1ad785664 100644 --- a/nodejs/docs/api/class-keyboard.mdx +++ b/nodejs/docs/api/class-keyboard.mdx @@ -274,10 +274,12 @@ await keyboard.up(key); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -285,7 +287,6 @@ await keyboard.up(key); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-location.mdx b/nodejs/docs/api/class-location.mdx index 98d76d006c..9a62ab1c05 100644 --- a/nodejs/docs/api/class-location.mdx +++ b/nodejs/docs/api/class-location.mdx @@ -112,10 +112,12 @@ location.line [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -123,7 +125,6 @@ location.line [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-locator.mdx b/nodejs/docs/api/class-locator.mdx index 19311f5434..226d3e1ce1 100644 --- a/nodejs/docs/api/class-locator.mdx +++ b/nodejs/docs/api/class-locator.mdx @@ -1628,7 +1628,9 @@ const banana = await page.getByRole('listitem').nth(2); Added in: v1.33locator.or -Creates a locator that matches either of the two locators. +Creates a locator matching all elements that match one or both of the two locators. + +Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.mdx#strictness) guidelines. **Usage** @@ -2430,10 +2432,12 @@ To press a special key, like `Control` or `ArrowDown`, use [locator.press()](/ap [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -2441,7 +2445,6 @@ To press a special key, like `Control` or `ArrowDown`, use [locator.press()](/ap [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-locatorassertions.mdx b/nodejs/docs/api/class-locatorassertions.mdx index f9cabfe831..5f6ea653f7 100644 --- a/nodejs/docs/api/class-locatorassertions.mdx +++ b/nodejs/docs/api/class-locatorassertions.mdx @@ -998,10 +998,12 @@ expect(locator).not [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1009,7 +1011,6 @@ expect(locator).not [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-logger.mdx b/nodejs/docs/api/class-logger.mdx index 0278b56abb..a5ac9728e4 100644 --- a/nodejs/docs/api/class-logger.mdx +++ b/nodejs/docs/api/class-logger.mdx @@ -128,10 +128,12 @@ logger.log(name, severity, message, args, hints); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -139,7 +141,6 @@ logger.log(name, severity, message, args, hints); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-mouse.mdx b/nodejs/docs/api/class-mouse.mdx index f0c973c4d1..6cb28102fa 100644 --- a/nodejs/docs/api/class-mouse.mdx +++ b/nodejs/docs/api/class-mouse.mdx @@ -256,10 +256,12 @@ await mouse.wheel(deltaX, deltaY); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -267,7 +269,6 @@ await mouse.wheel(deltaX, deltaY); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx index 46f92eba33..d45d8a181e 100644 --- a/nodejs/docs/api/class-page.mdx +++ b/nodejs/docs/api/class-page.mdx @@ -1661,6 +1661,42 @@ await page.routeFromHAR(har, options); --- +### routeWebSocket {#page-route-web-socket} + +Added in: v1.48page.routeWebSocket + +This method allows to modify websocket connections that are made by the page. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before navigating the page. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + +```js +await page.routeWebSocket('/ws', async ws => { + ws.routeSend(message => { + if (message === 'to-be-blocked') + return; + ws.send(message); + }); + await ws.connect(); +}); +``` + +**Arguments** +- `url` [string] | [RegExp] | [function]\([URL]\):[boolean]# + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options. +- `handler` [function]\([WebSocketRoute]\):[Promise]<[Object]> | [Object]# + + Handler function to route the WebSocket. + +**Returns** +- [Promise]<[void]># + +--- + ### screenshot {#page-screenshot} Added before v1.9page.screenshot @@ -4442,10 +4478,12 @@ await page.waitForTimeout(1000); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -4453,7 +4491,6 @@ await page.waitForTimeout(1000); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-pageassertions.mdx b/nodejs/docs/api/class-pageassertions.mdx index 30f2914a1f..366eca1e47 100644 --- a/nodejs/docs/api/class-pageassertions.mdx +++ b/nodejs/docs/api/class-pageassertions.mdx @@ -310,10 +310,12 @@ expect(page).not [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -321,7 +323,6 @@ expect(page).not [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-playwright.mdx b/nodejs/docs/api/class-playwright.mdx index 4a27539b1e..794269eafb 100644 --- a/nodejs/docs/api/class-playwright.mdx +++ b/nodejs/docs/api/class-playwright.mdx @@ -225,10 +225,12 @@ playwright.webkit [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -236,7 +238,6 @@ playwright.webkit [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-playwrightassertions.mdx b/nodejs/docs/api/class-playwrightassertions.mdx index 900bcf5a16..e2ee71eb49 100644 --- a/nodejs/docs/api/class-playwrightassertions.mdx +++ b/nodejs/docs/api/class-playwrightassertions.mdx @@ -153,10 +153,12 @@ Creates a [PageAssertions] object for the given [Page]. [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -164,7 +166,6 @@ Creates a [PageAssertions] object for the given [Page]. [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-reporter.mdx b/nodejs/docs/api/class-reporter.mdx index cce0d8ab42..c41afeebb4 100644 --- a/nodejs/docs/api/class-reporter.mdx +++ b/nodejs/docs/api/class-reporter.mdx @@ -420,10 +420,12 @@ reporter.printsToStdio(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -431,7 +433,6 @@ reporter.printsToStdio(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-request.mdx b/nodejs/docs/api/class-request.mdx index c63065bd2a..5a54100566 100644 --- a/nodejs/docs/api/class-request.mdx +++ b/nodejs/docs/api/class-request.mdx @@ -496,10 +496,12 @@ request.url(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -507,7 +509,6 @@ request.url(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-response.mdx b/nodejs/docs/api/class-response.mdx index 9e11a105aa..523b61a8ec 100644 --- a/nodejs/docs/api/class-response.mdx +++ b/nodejs/docs/api/class-response.mdx @@ -405,10 +405,12 @@ response.url(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -416,7 +418,6 @@ response.url(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-route.mdx b/nodejs/docs/api/class-route.mdx index 97085a575b..2a9591f0e0 100644 --- a/nodejs/docs/api/class-route.mdx +++ b/nodejs/docs/api/class-route.mdx @@ -353,10 +353,12 @@ route.request(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -364,7 +366,6 @@ route.request(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-selectors.mdx b/nodejs/docs/api/class-selectors.mdx index 57bcd110d2..e47ee99e33 100644 --- a/nodejs/docs/api/class-selectors.mdx +++ b/nodejs/docs/api/class-selectors.mdx @@ -148,10 +148,12 @@ selectors.setTestIdAttribute(attributeName); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -159,7 +161,6 @@ selectors.setTestIdAttribute(attributeName); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-snapshotassertions.mdx b/nodejs/docs/api/class-snapshotassertions.mdx index 466d2e58ed..a93fb7a3a1 100644 --- a/nodejs/docs/api/class-snapshotassertions.mdx +++ b/nodejs/docs/api/class-snapshotassertions.mdx @@ -164,10 +164,12 @@ Note that matching snapshots only work with Playwright test runner. [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -175,7 +177,6 @@ Note that matching snapshots only work with Playwright test runner. [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-suite.mdx b/nodejs/docs/api/class-suite.mdx index 1e24a66c1d..00a01b7693 100644 --- a/nodejs/docs/api/class-suite.mdx +++ b/nodejs/docs/api/class-suite.mdx @@ -252,10 +252,12 @@ suite.type [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -263,7 +265,6 @@ suite.type [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-test.mdx b/nodejs/docs/api/class-test.mdx index e6c1182c43..91c3b56312 100644 --- a/nodejs/docs/api/class-test.mdx +++ b/nodejs/docs/api/class-test.mdx @@ -1323,6 +1323,7 @@ test('test', async ({ page }) => { - `box` [boolean] *(optional)* Added in: v1.39# Whether to box the step in the report. Defaults to `false`. When the step is boxed, errors thrown from the step internals point to the step call site. See below for more details. + - `location` [Location] *(optional)* Added in: v1.48# **Returns** - [Promise]<[Object]># @@ -1811,10 +1812,12 @@ test.describe.serial.only(() => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1822,7 +1825,6 @@ test.describe.serial.only(() => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testcase.mdx b/nodejs/docs/api/class-testcase.mdx index bfb6f65e62..dd10d7074c 100644 --- a/nodejs/docs/api/class-testcase.mdx +++ b/nodejs/docs/api/class-testcase.mdx @@ -342,10 +342,12 @@ testCase.type [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -353,7 +355,6 @@ testCase.type [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testconfig.mdx b/nodejs/docs/api/class-testconfig.mdx index a0451921c1..de3b2eb471 100644 --- a/nodejs/docs/api/class-testconfig.mdx +++ b/nodejs/docs/api/class-testconfig.mdx @@ -1072,10 +1072,12 @@ This path will serve as the base directory for each test file snapshot directory [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1083,7 +1085,6 @@ This path will serve as the base directory for each test file snapshot directory [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testerror.mdx b/nodejs/docs/api/class-testerror.mdx index 4dd3b7e3a1..1d19172042 100644 --- a/nodejs/docs/api/class-testerror.mdx +++ b/nodejs/docs/api/class-testerror.mdx @@ -146,10 +146,12 @@ testError.value [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -157,7 +159,6 @@ testError.value [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testinfo.mdx b/nodejs/docs/api/class-testinfo.mdx index 0744b22df9..df795d33f7 100644 --- a/nodejs/docs/api/class-testinfo.mdx +++ b/nodejs/docs/api/class-testinfo.mdx @@ -882,10 +882,12 @@ testInfo.workerIndex [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -893,7 +895,6 @@ testInfo.workerIndex [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testinfoerror.mdx b/nodejs/docs/api/class-testinfoerror.mdx index 031b344b97..6ac3687582 100644 --- a/nodejs/docs/api/class-testinfoerror.mdx +++ b/nodejs/docs/api/class-testinfoerror.mdx @@ -112,10 +112,12 @@ testInfoError.value [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -123,7 +125,6 @@ testInfoError.value [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx index 806a7e9944..aad5947162 100644 --- a/nodejs/docs/api/class-testoptions.mdx +++ b/nodejs/docs/api/class-testoptions.mdx @@ -248,10 +248,6 @@ export default defineConfig({ An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. -:::note -Using Client Certificates in combination with Proxy Servers is not supported. -::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -1124,10 +1120,12 @@ export default defineConfig({ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1135,7 +1133,6 @@ export default defineConfig({ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testproject.mdx b/nodejs/docs/api/class-testproject.mdx index 7296981ef6..87b63a143d 100644 --- a/nodejs/docs/api/class-testproject.mdx +++ b/nodejs/docs/api/class-testproject.mdx @@ -748,10 +748,12 @@ testProject.use [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -759,7 +761,6 @@ testProject.use [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-testresult.mdx b/nodejs/docs/api/class-testresult.mdx index d30df45513..36e409701c 100644 --- a/nodejs/docs/api/class-testresult.mdx +++ b/nodejs/docs/api/class-testresult.mdx @@ -281,10 +281,12 @@ testResult.workerIndex [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -292,7 +294,6 @@ testResult.workerIndex [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-teststep.mdx b/nodejs/docs/api/class-teststep.mdx index 4f5077c9da..8f26e3c10f 100644 --- a/nodejs/docs/api/class-teststep.mdx +++ b/nodejs/docs/api/class-teststep.mdx @@ -220,10 +220,12 @@ testStep.title [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -231,7 +233,6 @@ testStep.title [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-timeouterror.mdx b/nodejs/docs/api/class-timeouterror.mdx index 62a4e8e477..ada4d5aa8f 100644 --- a/nodejs/docs/api/class-timeouterror.mdx +++ b/nodejs/docs/api/class-timeouterror.mdx @@ -79,10 +79,12 @@ const playwright = require('playwright'); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -90,7 +92,6 @@ const playwright = require('playwright'); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-touchscreen.mdx b/nodejs/docs/api/class-touchscreen.mdx index 9963ec086d..b5349f3276 100644 --- a/nodejs/docs/api/class-touchscreen.mdx +++ b/nodejs/docs/api/class-touchscreen.mdx @@ -90,10 +90,12 @@ await touchscreen.tap(x, y); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -101,7 +103,6 @@ await touchscreen.tap(x, y); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-tracing.mdx b/nodejs/docs/api/class-tracing.mdx index e32d303fc1..7eda783c2d 100644 --- a/nodejs/docs/api/class-tracing.mdx +++ b/nodejs/docs/api/class-tracing.mdx @@ -17,7 +17,7 @@ const context = await browser.newContext(); await context.tracing.start({ screenshots: true, snapshots: true }); const page = await context.newPage(); await page.goto('https://playwright.dev'); -await context.tracing.stop({ path: 'trace.pwtrace.zip' }); +await context.tracing.stop({ path: 'trace.zip' }); ``` @@ -37,7 +37,7 @@ Start tracing. await context.tracing.start({ screenshots: true, snapshots: true }); const page = await context.newPage(); await page.goto('https://playwright.dev'); -await context.tracing.stop({ path: 'trace.pwtrace.zip' }); +await context.tracing.stop({ path: 'trace.zip' }); ``` **Arguments** @@ -81,12 +81,12 @@ await page.goto('https://playwright.dev'); await context.tracing.startChunk(); await page.getByText('Get Started').click(); // Everything between startChunk and stopChunk will be recorded in the trace. -await context.tracing.stopChunk({ path: 'trace1.pwtrace.zip' }); +await context.tracing.stopChunk({ path: 'trace1.zip' }); await context.tracing.startChunk(); await page.goto('http://example.com'); // Save a second trace file with different actions. -await context.tracing.stopChunk({ path: 'trace2.pwtrace.zip' }); +await context.tracing.stopChunk({ path: 'trace2.zip' }); ``` **Arguments** @@ -198,10 +198,12 @@ await tracing.stopChunk(options); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -209,7 +211,6 @@ await tracing.stopChunk(options); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-video.mdx b/nodejs/docs/api/class-video.mdx index 49f2c31eae..6385c8f2fc 100644 --- a/nodejs/docs/api/class-video.mdx +++ b/nodejs/docs/api/class-video.mdx @@ -121,10 +121,12 @@ await video.saveAs(path); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -132,7 +134,6 @@ await video.saveAs(path); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-weberror.mdx b/nodejs/docs/api/class-weberror.mdx index b007161495..338fe28ca3 100644 --- a/nodejs/docs/api/class-weberror.mdx +++ b/nodejs/docs/api/class-weberror.mdx @@ -105,10 +105,12 @@ webError.page(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -116,7 +118,6 @@ webError.page(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-websocket.mdx b/nodejs/docs/api/class-websocket.mdx index 4783dcd5ac..eb2c000600 100644 --- a/nodejs/docs/api/class-websocket.mdx +++ b/nodejs/docs/api/class-websocket.mdx @@ -207,10 +207,12 @@ webSocket.on('socketerror', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -218,7 +220,6 @@ webSocket.on('socketerror', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-websocketroute.mdx b/nodejs/docs/api/class-websocketroute.mdx new file mode 100644 index 0000000000..64e1dc9191 --- /dev/null +++ b/nodejs/docs/api/class-websocketroute.mdx @@ -0,0 +1,298 @@ +--- +id: class-websocketroute +title: "WebSocketRoute" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +Whenever a [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) route is set up with [page.routeWebSocket()](/api/class-page.mdx#page-route-web-socket) or [browserContext.routeWebSocket()](/api/class-browsercontext.mdx#browser-context-route-web-socket), the `WebSocketRoute` object allows to handle the WebSocket. + +By default, the routed WebSocket will not actually connect to the server. This way, you can mock entire communcation over the WebSocket. Here is an example that responds to a `"query"` with a `"result"`. + +```js +await page.routeWebSocket('/ws', async ws => { + ws.routeSend(message => { + if (message === 'query') + ws.receive('result'); + }); +}); +``` + + +--- + +## Methods + +### close {#web-socket-route-close} + +Added in: v1.48webSocketRoute.close + +Closes the server connection and the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page. + +**Usage** + +```js +await webSocketRoute.close(); +await webSocketRoute.close(options); +``` + +**Arguments** +- `options` [Object] *(optional)* + - `code` [number] *(optional)*# + + Optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code). + - `reason` [string] *(optional)*# + + Optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). + +**Returns** +- [Promise]<[void]># + +--- + +### connect {#web-socket-route-connect} + +Added in: v1.48webSocketRoute.connect + +By default, routed WebSocket does not connect to the server, so you can mock entire WebSocket communication. This method connects to the actual WebSocket server, giving the ability to send and receive messages from the server. + +Once connected: +* Messages received from the server will be automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, unless [webSocketRoute.routeReceive()](/api/class-websocketroute.mdx#web-socket-route-route-receive) is called. +* Messages sent by the `WebSocket.send()` call in the page will be automatically sent to the server, unless [webSocketRoute.routeSend()](/api/class-websocketroute.mdx#web-socket-route-route-send) is called. + +**Usage** + +```js +await webSocketRoute.connect(); +``` + +**Returns** +- [Promise]<[void]># + +--- + +### receive {#web-socket-route-receive} + +Added in: v1.48webSocketRoute.receive + +Dispatches a message to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, like it was received from the server. + +**Usage** + +```js +webSocketRoute.receive(message); +``` + +**Arguments** +- `message` [string] | [Buffer]# + + Message to receive. + +--- + +### routeReceive {#web-socket-route-route-receive} + +Added in: v1.48webSocketRoute.routeReceive + +This method allows to route messages that are received by the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page from the server. This method only makes sense if you are also calling [webSocketRoute.connect()](/api/class-websocketroute.mdx#web-socket-route-connect). + +Once this method is called, received messages are not automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page - you should do that manually by calling [webSocketRoute.receive()](/api/class-websocketroute.mdx#web-socket-route-receive). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```js +await webSocketRoute.routeReceive(handler); +``` + +**Arguments** +- `handler` [function]\([string]\):[Promise]<[Object]> | [Object]# + + Handler function to route received messages. + +**Returns** +- [Promise]<[void]># + +--- + +### routeSend {#web-socket-route-route-send} + +Added in: v1.48webSocketRoute.routeSend + +This method allows to route messages that are sent by `WebSocket.send()` call in the page, instead of actually sending them to the server. Once this method is called, sent messages **are not** automatically forwarded to the server - you should do that manually by calling [webSocketRoute.send()](/api/class-websocketroute.mdx#web-socket-route-send). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```js +await webSocketRoute.routeSend(handler); +``` + +**Arguments** +- `handler` [function]\([string] | [Buffer]\):[Promise]<[Object]> | [Object]# + + Handler function to route sent messages. + +**Returns** +- [Promise]<[void]># + +--- + +### send {#web-socket-route-send} + +Added in: v1.48webSocketRoute.send + +Sends a message to the server, like it was sent in the page with `WebSocket.send()`. + +**Usage** + +```js +webSocketRoute.send(message); +``` + +**Arguments** +- `message` [string] | [Buffer]# + + Message to send. + +--- + +### url {#web-socket-route-url} + +Added in: v1.48webSocketRoute.url + +URL of the WebSocket created in the page. + +**Usage** + +```js +webSocketRoute.url(); +``` + +**Returns** +- [string]# + +--- + +## Events + +### on('close') {#web-socket-route-event-close} + +Added in: v1.48webSocketRoute.on('close') + +Emitted when the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) closes. + +**Usage** + +```js +webSocketRoute.on('close', data => {}); +``` + + +[Accessibility]: /api/class-accessibility.mdx "Accessibility" +[Android]: /api/class-android.mdx "Android" +[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice" +[AndroidInput]: /api/class-androidinput.mdx "AndroidInput" +[AndroidSocket]: /api/class-androidsocket.mdx "AndroidSocket" +[AndroidWebView]: /api/class-androidwebview.mdx "AndroidWebView" +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserServer]: /api/class-browserserver.mdx "BrowserServer" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Coverage]: /api/class-coverage.mdx "Coverage" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[Electron]: /api/class-electron.mdx "Electron" +[ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Logger]: /api/class-logger.mdx "Logger" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Selectors]: /api/class-selectors.mdx "Selectors" +[SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Fixtures]: /api/class-fixtures.mdx "Fixtures" +[FullConfig]: /api/class-fullconfig.mdx "FullConfig" +[FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" +[Test]: /api/class-test.mdx "Test" +[TestConfig]: /api/class-testconfig.mdx "TestConfig" +[TestInfo]: /api/class-testinfo.mdx "TestInfo" +[TestInfoError]: /api/class-testinfoerror.mdx "TestInfoError" +[TestOptions]: /api/class-testoptions.mdx "TestOptions" +[TestProject]: /api/class-testproject.mdx "TestProject" +[WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" +[Reporter]: /api/class-reporter.mdx "Reporter" +[Suite]: /api/class-suite.mdx "Suite" +[TestCase]: /api/class-testcase.mdx "TestCase" +[TestError]: /api/class-testerror.mdx "TestError" +[TestResult]: /api/class-testresult.mdx "TestResult" +[TestStep]: /api/class-teststep.mdx "TestStep" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array" +[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean" +[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer" +[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess" +[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error" +[EventEmitter]: https://nodejs.org/api/events.html#events_class_eventemitter "EventEmitter" +[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function" +[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData "FormData" +[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map" +[Metadata]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object<string, any>" +[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null" +[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number" +[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable" +[ReadStream]: https://nodejs.org/api/fs.html#class-fsreadstream "ReadStream" +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp" +[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string" +[void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined "void" +[URL]: https://nodejs.org/api/url.html "URL" +[URLSearchParams]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams "URLSearchParams" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/about "Microsoft Artifact Registry" +[Dockerfile.jammy]: https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.jammy "Dockerfile.jammy" diff --git a/nodejs/docs/api/class-worker.mdx b/nodejs/docs/api/class-worker.mdx index 142ed1e7d9..4ef999a7ff 100644 --- a/nodejs/docs/api/class-worker.mdx +++ b/nodejs/docs/api/class-worker.mdx @@ -166,10 +166,12 @@ worker.on('close', data => {}); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -177,7 +179,6 @@ worker.on('close', data => {}); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/api/class-workerinfo.mdx b/nodejs/docs/api/class-workerinfo.mdx index 9d965da510..42037751b7 100644 --- a/nodejs/docs/api/class-workerinfo.mdx +++ b/nodejs/docs/api/class-workerinfo.mdx @@ -133,10 +133,12 @@ workerInfo.workerIndex [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -144,7 +146,6 @@ workerInfo.workerIndex [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/auth.mdx b/nodejs/docs/auth.mdx index 602b45dc1f..ec22cb02b3 100644 --- a/nodejs/docs/auth.mdx +++ b/nodejs/docs/auth.mdx @@ -570,10 +570,12 @@ test('not signed in test', async ({ page }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -581,7 +583,6 @@ test('not signed in test', async ({ page }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/best-practices.mdx b/nodejs/docs/best-practices.mdx index 85997bbc81..8f1fa3af78 100644 --- a/nodejs/docs/best-practices.mdx +++ b/nodejs/docs/best-practices.mdx @@ -353,10 +353,12 @@ await page.getByRole('link', { name: 'next page' }).click(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -364,7 +366,6 @@ await page.getByRole('link', { name: 'next page' }).click(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/browser-contexts.mdx b/nodejs/docs/browser-contexts.mdx index 7016ad2605..9255c2c9c1 100644 --- a/nodejs/docs/browser-contexts.mdx +++ b/nodejs/docs/browser-contexts.mdx @@ -163,10 +163,12 @@ const userPage = await userContext.newPage(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -174,7 +176,6 @@ const userPage = await userContext.newPage(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/browsers.mdx b/nodejs/docs/browsers.mdx index 3c90273771..7122e9647d 100644 --- a/nodejs/docs/browsers.mdx +++ b/nodejs/docs/browsers.mdx @@ -633,10 +633,12 @@ npx playwright uninstall --all [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -644,7 +646,6 @@ npx playwright uninstall --all [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/canary-releases.mdx b/nodejs/docs/canary-releases.mdx index e481673916..4e7710e0da 100644 --- a/nodejs/docs/canary-releases.mdx +++ b/nodejs/docs/canary-releases.mdx @@ -90,10 +90,12 @@ The stable and the `next` documentation is published on [playwright.dev](https:/ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -101,7 +103,6 @@ The stable and the `next` documentation is published on [playwright.dev](https:/ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/chrome-extensions.mdx b/nodejs/docs/chrome-extensions.mdx index f366bd0d24..96e4e0638f 100644 --- a/nodejs/docs/chrome-extensions.mdx +++ b/nodejs/docs/chrome-extensions.mdx @@ -170,10 +170,12 @@ const context = await chromium.launchPersistentContext('', { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -181,7 +183,6 @@ const context = await chromium.launchPersistentContext('', { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/ci-intro.mdx b/nodejs/docs/ci-intro.mdx index d47b584155..509eeada1f 100644 --- a/nodejs/docs/ci-intro.mdx +++ b/nodejs/docs/ci-intro.mdx @@ -150,8 +150,8 @@ This step will not work for pull requests created from a forked repository becau - [Learn how to perform Actions](./input.mdx) - [Learn how to write Assertions](./test-assertions.mdx) - [Learn more about the Trace Viewer](/trace-viewer.mdx) -- [Learn more ways of running tests on GitHub Actions](/ci.mdx) -- [Learn more about running tests on other CI providers](/ci.mdx#github-actions) // TODO: is this link correct? +- [Learn more ways of running tests on GitHub Actions](/ci.mdx#github-actions) +- [Learn more about running tests on other CI providers](/ci.mdx) [Accessibility]: /api/class-accessibility.mdx "Accessibility" @@ -202,10 +202,12 @@ This step will not work for pull requests created from a forked repository becau [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -213,7 +215,6 @@ This step will not work for pull requests created from a forked repository becau [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/ci.mdx b/nodejs/docs/ci.mdx index 1e54567b35..44a221c2ff 100644 --- a/nodejs/docs/ci.mdx +++ b/nodejs/docs/ci.mdx @@ -101,7 +101,7 @@ jobs: name: 'Playwright Tests' runs-on: ubuntu-latest container: - image: mcr.microsoft.com/playwright:v1.47.1-jammy + image: mcr.microsoft.com/playwright:v1.47.2-jammy options: --user 1001 steps: - uses: actions/checkout@v4 @@ -340,7 +340,7 @@ trigger: pool: vmImage: ubuntu-latest -container: mcr.microsoft.com/playwright:v1.47.1-noble +container: mcr.microsoft.com/playwright:v1.47.2-noble steps: - task: NodeTool@0 @@ -364,7 +364,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In executors: pw-jammy-development: docker: - - image: mcr.microsoft.com/playwright:v1.47.1-noble + - image: mcr.microsoft.com/playwright:v1.47.2-noble ``` Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures. @@ -387,7 +387,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image]( ```groovy pipeline { - agent { docker { image 'mcr.microsoft.com/playwright:v1.47.1-noble' } } + agent { docker { image 'mcr.microsoft.com/playwright:v1.47.2-noble' } } stages { stage('e2e-tests') { steps { @@ -404,7 +404,7 @@ pipeline { Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)). ```yml -image: mcr.microsoft.com/playwright:v1.47.1-noble +image: mcr.microsoft.com/playwright:v1.47.2-noble ``` ### GitLab CI @@ -417,7 +417,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.47.1-noble + image: mcr.microsoft.com/playwright:v1.47.2-noble script: ... ``` @@ -432,7 +432,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.47.1-noble + image: mcr.microsoft.com/playwright:v1.47.2-noble parallel: 7 script: - npm ci @@ -447,7 +447,7 @@ stages: tests: stage: test - image: mcr.microsoft.com/playwright:v1.47.1-noble + image: mcr.microsoft.com/playwright:v1.47.2-noble parallel: matrix: - PROJECT: ['chromium', 'webkit'] @@ -463,7 +463,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see ```yml steps: -- name: mcr.microsoft.com/playwright:v1.47.1-noble +- name: mcr.microsoft.com/playwright:v1.47.2-noble script: ... env: @@ -481,7 +481,7 @@ type: docker steps: - name: test - image: mcr.microsoft.com/playwright:v1.47.1-jammy + image: mcr.microsoft.com/playwright:v1.47.2-jammy commands: - npx playwright test ``` @@ -559,10 +559,12 @@ xvfb-run npx playwright test [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -570,7 +572,6 @@ xvfb-run npx playwright test [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/clock.mdx b/nodejs/docs/clock.mdx index 5b7d908b4d..a4d467d905 100644 --- a/nodejs/docs/clock.mdx +++ b/nodejs/docs/clock.mdx @@ -209,10 +209,12 @@ await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:02 AM [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -220,7 +222,6 @@ await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:02 AM [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/codegen-intro.mdx b/nodejs/docs/codegen-intro.mdx index f26214b24d..f2612b0938 100644 --- a/nodejs/docs/codegen-intro.mdx +++ b/nodejs/docs/codegen-intro.mdx @@ -111,10 +111,12 @@ You can also generate tests using emulation so as to generate a test for a speci [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -122,7 +124,6 @@ You can also generate tests using emulation so as to generate a test for a speci [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/codegen.mdx b/nodejs/docs/codegen.mdx index 811e1df78c..e0896f936c 100644 --- a/nodejs/docs/codegen.mdx +++ b/nodejs/docs/codegen.mdx @@ -254,10 +254,12 @@ const { chromium } = require('@playwright/test'); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -265,7 +267,6 @@ const { chromium } = require('@playwright/test'); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/debug.mdx b/nodejs/docs/debug.mdx index 5aa49be746..f83da342b1 100644 --- a/nodejs/docs/debug.mdx +++ b/nodejs/docs/debug.mdx @@ -361,10 +361,12 @@ await chromium.launch({ headless: false, slowMo: 100 }); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -372,7 +374,6 @@ await chromium.launch({ headless: false, slowMo: 100 }); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/dialogs.mdx b/nodejs/docs/dialogs.mdx index bfe4f6494f..89b64f5057 100644 --- a/nodejs/docs/dialogs.mdx +++ b/nodejs/docs/dialogs.mdx @@ -116,10 +116,12 @@ This will wait for the print dialog to be opened after the button is clicked. Ma [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -127,7 +129,6 @@ This will wait for the print dialog to be opened after the button is clicked. Ma [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx index 7a98a63315..abf8164eab 100644 --- a/nodejs/docs/docker.mdx +++ b/nodejs/docs/docker.mdx @@ -21,7 +21,7 @@ This Docker image is intended to be used for testing and development purposes on ### Pull the image ```bash -docker pull mcr.microsoft.com/playwright:v1.47.1-noble +docker pull mcr.microsoft.com/playwright:v1.47.2-noble ``` ### Run the image @@ -33,7 +33,7 @@ By default, the Docker image will use the `root` user to run the browsers. This On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers. ```bash -docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.47.1-noble /bin/bash +docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.47.2-noble /bin/bash ``` #### Crawling and scraping @@ -41,7 +41,7 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v1.47.1-noble /bin/b On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it. ```bash -docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.47.1-noble /bin/bash +docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v1.47.2-noble /bin/bash ``` [`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions: @@ -74,10 +74,10 @@ See our [Continuous Integration guides](./ci.mdx) for sample configs. See [all available image tags]. We currently publish images with the following tags: -- `:v1.47.1` - Playwright v1.47.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.47.1-noble` - Playwright v1.47.1 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). -- `:v1.47.1-jammy` - Playwright v1.47.1 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). -- `:v1.47.1-focal` - Playwright v1.47.1 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). +- `:v1.47.2` - Playwright v1.47.2 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.2-noble` - Playwright v1.47.2 release docker image based on Ubuntu 24.04 LTS (Noble Numbat). +- `:v1.47.2-jammy` - Playwright v1.47.2 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish). +- `:v1.47.2-focal` - Playwright v1.47.2 release docker image based on Ubuntu 20.04 LTS (Focal Fossa). :::note It is recommended to always pin your Docker image to a specific version if possible. If the Playwright version in your Docker image does not match the version in your project/tests, Playwright will be unable to locate browser executables. @@ -101,7 +101,7 @@ To run Playwright inside Docker, you need to have Node.js, [Playwright browsers] ```Dockerfile FROM node:20-bookworm -RUN npx -y playwright@1.47.1 install --with-deps +RUN npx -y playwright@1.47.2 install --with-deps ``` @@ -153,10 +153,12 @@ RUN npx -y playwright@1.47.1 install --with-deps [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -164,7 +166,6 @@ RUN npx -y playwright@1.47.1 install --with-deps [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/downloads.mdx b/nodejs/docs/downloads.mdx index a0d5a74134..909620ada9 100644 --- a/nodejs/docs/downloads.mdx +++ b/nodejs/docs/downloads.mdx @@ -91,10 +91,12 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -102,7 +104,6 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/emulation.mdx b/nodejs/docs/emulation.mdx index 909bd62538..abb9d4016c 100644 --- a/nodejs/docs/emulation.mdx +++ b/nodejs/docs/emulation.mdx @@ -640,10 +640,12 @@ const context = await browser.newContext({ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -651,7 +653,6 @@ const context = await browser.newContext({ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/evaluating.mdx b/nodejs/docs/evaluating.mdx index 855257d1d0..bc104fe046 100644 --- a/nodejs/docs/evaluating.mdx +++ b/nodejs/docs/evaluating.mdx @@ -186,10 +186,12 @@ test.beforeEach(async ({ page }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -197,7 +199,6 @@ test.beforeEach(async ({ page }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/events.mdx b/nodejs/docs/events.mdx index 4050164945..ed227f1de5 100644 --- a/nodejs/docs/events.mdx +++ b/nodejs/docs/events.mdx @@ -106,10 +106,12 @@ await page.evaluate("prompt('Enter a number:')"); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -117,7 +119,6 @@ await page.evaluate("prompt('Enter a number:')"); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/extensibility.mdx b/nodejs/docs/extensibility.mdx index 6d7bc16b20..cbeca00d88 100644 --- a/nodejs/docs/extensibility.mdx +++ b/nodejs/docs/extensibility.mdx @@ -113,10 +113,12 @@ test('selector engine test', async ({ page }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -124,7 +126,6 @@ test('selector engine test', async ({ page }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/frames.mdx b/nodejs/docs/frames.mdx index 63ec7d0b86..c8d2586775 100644 --- a/nodejs/docs/frames.mdx +++ b/nodejs/docs/frames.mdx @@ -82,10 +82,12 @@ await frame.fill('#username-input', 'John'); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -93,7 +95,6 @@ await frame.fill('#username-input', 'John'); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/getting-started-vscode.mdx b/nodejs/docs/getting-started-vscode.mdx index c88c8b47c4..3419518237 100644 --- a/nodejs/docs/getting-started-vscode.mdx +++ b/nodejs/docs/getting-started-vscode.mdx @@ -267,10 +267,12 @@ You can easily toggle back and forth between configurations by clicking on the c [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -278,7 +280,6 @@ You can easily toggle back and forth between configurations by clicking on the c [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/handles.mdx b/nodejs/docs/handles.mdx index 026868d780..fe5f3f3761 100644 --- a/nodejs/docs/handles.mdx +++ b/nodejs/docs/handles.mdx @@ -164,10 +164,12 @@ await locator.click(); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -175,7 +177,6 @@ await locator.click(); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/input.mdx b/nodejs/docs/input.mdx index b0ed729940..4afe476685 100644 --- a/nodejs/docs/input.mdx +++ b/nodejs/docs/input.mdx @@ -312,10 +312,12 @@ await page.getByTestId('scrolling-container').evaluate(e => e.scrollTop += 100); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -323,7 +325,6 @@ await page.getByTestId('scrolling-container').evaluate(e => e.scrollTop += 100); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/intro.mdx b/nodejs/docs/intro.mdx index 7e6940e017..86c602cc89 100644 --- a/nodejs/docs/intro.mdx +++ b/nodejs/docs/intro.mdx @@ -305,10 +305,12 @@ pnpm exec playwright --version [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -316,7 +318,6 @@ pnpm exec playwright --version [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/languages.mdx b/nodejs/docs/languages.mdx index 4eb6603824..1117cb6204 100644 --- a/nodejs/docs/languages.mdx +++ b/nodejs/docs/languages.mdx @@ -83,10 +83,12 @@ Playwright for .NET comes with [MSTest base classes](https://playwright.dev/dotn [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -94,7 +96,6 @@ Playwright for .NET comes with [MSTest base classes](https://playwright.dev/dotn [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/library.mdx b/nodejs/docs/library.mdx index a07c852a3d..6eba4dd77a 100644 --- a/nodejs/docs/library.mdx +++ b/nodejs/docs/library.mdx @@ -469,10 +469,12 @@ let page: import('playwright').Page; [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -480,7 +482,6 @@ let page: import('playwright').Page; [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/locators.mdx b/nodejs/docs/locators.mdx index 7a5b30fef9..551c0a6d83 100644 --- a/nodejs/docs/locators.mdx +++ b/nodejs/docs/locators.mdx @@ -961,10 +961,12 @@ For less commonly used locators, look at the [other locators](./other-locators.m [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -972,7 +974,6 @@ For less commonly used locators, look at the [other locators](./other-locators.m [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/mock-browser.mdx b/nodejs/docs/mock-browser.mdx index 6a6a2d901a..71329e323f 100644 --- a/nodejs/docs/mock-browser.mdx +++ b/nodejs/docs/mock-browser.mdx @@ -215,10 +215,12 @@ test('update battery status (no golden)', async ({ page }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -226,7 +228,6 @@ test('update battery status (no golden)', async ({ page }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/mock.mdx b/nodejs/docs/mock.mdx index d2f28b493b..1f8e02c7e3 100644 --- a/nodejs/docs/mock.mdx +++ b/nodejs/docs/mock.mdx @@ -200,10 +200,12 @@ Read more about [advanced networking](./network.mdx). [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -211,7 +213,6 @@ Read more about [advanced networking](./network.mdx). [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/navigations.mdx b/nodejs/docs/navigations.mdx index 96036ab73e..f477112d98 100644 --- a/nodejs/docs/navigations.mdx +++ b/nodejs/docs/navigations.mdx @@ -124,10 +124,12 @@ Playwright splits the process of showing a new document in a page into **navigat [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -135,7 +137,6 @@ Playwright splits the process of showing a new document in a page into **navigat [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/network.mdx b/nodejs/docs/network.mdx index 4395b174ce..2d8acac329 100644 --- a/nodejs/docs/network.mdx +++ b/nodejs/docs/network.mdx @@ -363,10 +363,12 @@ Playwright's built-in [browserContext.route()](/api/class-browsercontext.mdx#bro [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -374,7 +376,6 @@ Playwright's built-in [browserContext.route()](/api/class-browsercontext.mdx#bro [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/other-locators.mdx b/nodejs/docs/other-locators.mdx index b9339845b1..88e36f6b0d 100644 --- a/nodejs/docs/other-locators.mdx +++ b/nodejs/docs/other-locators.mdx @@ -504,10 +504,12 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -515,7 +517,6 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/pages.mdx b/nodejs/docs/pages.mdx index 704c9e9abf..519c6af58e 100644 --- a/nodejs/docs/pages.mdx +++ b/nodejs/docs/pages.mdx @@ -139,10 +139,12 @@ page.on('popup', async popup => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -150,7 +152,6 @@ page.on('popup', async popup => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/pom.mdx b/nodejs/docs/pom.mdx index 0a9f29ccd3..d161de0f32 100644 --- a/nodejs/docs/pom.mdx +++ b/nodejs/docs/pom.mdx @@ -287,10 +287,12 @@ await expect(playwrightDev.tocList).toHaveText([ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -298,7 +300,6 @@ await expect(playwrightDev.tocList).toHaveText([ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/protractor.mdx b/nodejs/docs/protractor.mdx index 01484180d7..046a1f2b63 100644 --- a/nodejs/docs/protractor.mdx +++ b/nodejs/docs/protractor.mdx @@ -215,10 +215,12 @@ Learn more about Playwright Test runner: [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -226,7 +228,6 @@ Learn more about Playwright Test runner: [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/puppeteer.mdx b/nodejs/docs/puppeteer.mdx index 8fb964cdf9..2eaf0b0efe 100644 --- a/nodejs/docs/puppeteer.mdx +++ b/nodejs/docs/puppeteer.mdx @@ -220,10 +220,12 @@ Learn more about Playwright Test runner: [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -231,7 +233,6 @@ Learn more about Playwright Test runner: [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/release-notes.mdx b/nodejs/docs/release-notes.mdx index c8f4e44a76..208e1696a2 100644 --- a/nodejs/docs/release-notes.mdx +++ b/nodejs/docs/release-notes.mdx @@ -2642,10 +2642,12 @@ This version of Playwright was also tested against the following stable channels [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -2653,7 +2655,6 @@ This version of Playwright was also tested against the following stable channels [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/running-tests.mdx b/nodejs/docs/running-tests.mdx index cabf65eeed..c53535a5e1 100644 --- a/nodejs/docs/running-tests.mdx +++ b/nodejs/docs/running-tests.mdx @@ -220,10 +220,12 @@ You can filter and search for tests as well as click on each test to see the tes [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -231,7 +233,6 @@ You can filter and search for tests as well as click on each test to see the tes [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/screenshots.mdx b/nodejs/docs/screenshots.mdx index a6c7087aeb..22ee74bef1 100644 --- a/nodejs/docs/screenshots.mdx +++ b/nodejs/docs/screenshots.mdx @@ -90,10 +90,12 @@ await page.locator('.header').screenshot({ path: 'screenshot.png' }); [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -101,7 +103,6 @@ await page.locator('.header').screenshot({ path: 'screenshot.png' }); [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/selenium-grid.mdx b/nodejs/docs/selenium-grid.mdx index eee653468a..e3f5db7981 100644 --- a/nodejs/docs/selenium-grid.mdx +++ b/nodejs/docs/selenium-grid.mdx @@ -172,10 +172,12 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -183,7 +185,6 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/service-workers-experimental-network-events.mdx b/nodejs/docs/service-workers-experimental-network-events.mdx index 0282eed1de..79a579105d 100644 --- a/nodejs/docs/service-workers-experimental-network-events.mdx +++ b/nodejs/docs/service-workers-experimental-network-events.mdx @@ -277,10 +277,12 @@ Requests for updated Service Worker main script code currently cannot be routed [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -288,7 +290,6 @@ Requests for updated Service Worker main script code currently cannot be routed [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-annotations.mdx b/nodejs/docs/test-annotations.mdx index 604c3ab888..2a4ca49875 100644 --- a/nodejs/docs/test-annotations.mdx +++ b/nodejs/docs/test-annotations.mdx @@ -366,10 +366,12 @@ test('example test', async ({ page, browser }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -377,7 +379,6 @@ test('example test', async ({ page, browser }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-assertions.mdx b/nodejs/docs/test-assertions.mdx index b28e6bf2a8..67584e61c6 100644 --- a/nodejs/docs/test-assertions.mdx +++ b/nodejs/docs/test-assertions.mdx @@ -380,10 +380,12 @@ test('passes', async ({ database }) => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -391,7 +393,6 @@ test('passes', async ({ database }) => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-cli.mdx b/nodejs/docs/test-cli.mdx index 632bd232a3..513a153d8b 100644 --- a/nodejs/docs/test-cli.mdx +++ b/nodejs/docs/test-cli.mdx @@ -171,10 +171,12 @@ Complete set of Playwright Test options is available in the [configuration file] [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -182,7 +184,6 @@ Complete set of Playwright Test options is available in the [configuration file] [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-components.mdx b/nodejs/docs/test-components.mdx index 0d4a0d3656..c3bee63282 100644 --- a/nodejs/docs/test-components.mdx +++ b/nodejs/docs/test-components.mdx @@ -1057,10 +1057,12 @@ Accessing a component's internal methods or its instance within test code is nei [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -1068,7 +1070,6 @@ Accessing a component's internal methods or its instance within test code is nei [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-configuration.mdx b/nodejs/docs/test-configuration.mdx index d5f452ca55..55e5f50202 100644 --- a/nodejs/docs/test-configuration.mdx +++ b/nodejs/docs/test-configuration.mdx @@ -202,10 +202,12 @@ export default defineConfig({ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -213,7 +215,6 @@ export default defineConfig({ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-fixtures.mdx b/nodejs/docs/test-fixtures.mdx index 2e8c018cdf..fe50774883 100644 --- a/nodejs/docs/test-fixtures.mdx +++ b/nodejs/docs/test-fixtures.mdx @@ -848,10 +848,12 @@ Note that the fixtures will still run once per [worker process](./test-parallel. [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -859,7 +861,6 @@ Note that the fixtures will still run once per [worker process](./test-parallel. [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-global-setup-teardown.mdx b/nodejs/docs/test-global-setup-teardown.mdx index 90a0053880..89f93f0e15 100644 --- a/nodejs/docs/test-global-setup-teardown.mdx +++ b/nodejs/docs/test-global-setup-teardown.mdx @@ -242,12 +242,12 @@ async function globalSetup(config: FullConfig) { await page.getByText('Sign in').click(); await context.storageState({ path: storageState as string }); await context.tracing.stop({ - path: './test-results/setup-trace.pwtrace.zip', + path: './test-results/setup-trace.zip', }); await browser.close(); } catch (error) { await context.tracing.stop({ - path: './test-results/failed-setup-trace.pwtrace.zip', + path: './test-results/failed-setup-trace.zip', }); await browser.close(); throw error; @@ -306,10 +306,12 @@ export default globalSetup; [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -317,7 +319,6 @@ export default globalSetup; [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-parallel.mdx b/nodejs/docs/test-parallel.mdx index a320727ed3..c401226f11 100644 --- a/nodejs/docs/test-parallel.mdx +++ b/nodejs/docs/test-parallel.mdx @@ -317,10 +317,12 @@ Do not define your tests directly in a helper file. This could lead to unexpecte [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -328,7 +330,6 @@ Do not define your tests directly in a helper file. This could lead to unexpecte [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-parameterize.mdx b/nodejs/docs/test-parameterize.mdx index 631fb44c47..32286f469c 100644 --- a/nodejs/docs/test-parameterize.mdx +++ b/nodejs/docs/test-parameterize.mdx @@ -467,10 +467,12 @@ for (const record of records) { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -478,7 +480,6 @@ for (const record of records) { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-projects.mdx b/nodejs/docs/test-projects.mdx index 902e2e1378..8693c9e658 100644 --- a/nodejs/docs/test-projects.mdx +++ b/nodejs/docs/test-projects.mdx @@ -273,10 +273,12 @@ Projects can be also used to parametrize tests with your custom configuration - [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -284,7 +286,6 @@ Projects can be also used to parametrize tests with your custom configuration - [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-reporters.mdx b/nodejs/docs/test-reporters.mdx index 431e43a11c..e8cb70b062 100644 --- a/nodejs/docs/test-reporters.mdx +++ b/nodejs/docs/test-reporters.mdx @@ -524,10 +524,12 @@ npx playwright test --reporter="./myreporter/my-awesome-reporter.ts" [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -535,7 +537,6 @@ npx playwright test --reporter="./myreporter/my-awesome-reporter.ts" [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-retries.mdx b/nodejs/docs/test-retries.mdx index 9003ebe10b..23f629cdfa 100644 --- a/nodejs/docs/test-retries.mdx +++ b/nodejs/docs/test-retries.mdx @@ -290,10 +290,12 @@ test('runs second', async () => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -301,7 +303,6 @@ test('runs second', async () => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-sharding.mdx b/nodejs/docs/test-sharding.mdx index 4797f490d8..a289aec341 100644 --- a/nodejs/docs/test-sharding.mdx +++ b/nodejs/docs/test-sharding.mdx @@ -226,10 +226,12 @@ Supported options: [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -237,7 +239,6 @@ Supported options: [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-snapshots.mdx b/nodejs/docs/test-snapshots.mdx index d82a3b81af..4fbe70735f 100644 --- a/nodejs/docs/test-snapshots.mdx +++ b/nodejs/docs/test-snapshots.mdx @@ -184,10 +184,12 @@ Snapshots are stored next to the test file, in a separate directory. For example [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -195,7 +197,6 @@ Snapshots are stored next to the test file, in a separate directory. For example [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-timeouts.mdx b/nodejs/docs/test-timeouts.mdx index 9bbb8de93f..d062fafe90 100644 --- a/nodejs/docs/test-timeouts.mdx +++ b/nodejs/docs/test-timeouts.mdx @@ -289,10 +289,12 @@ API reference: [test.extend()](/api/class-test.mdx#test-extend). [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -300,7 +302,6 @@ API reference: [test.extend()](/api/class-test.mdx#test-extend). [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-typescript.mdx b/nodejs/docs/test-typescript.mdx index b6eee7a0b1..f82a63c83c 100644 --- a/nodejs/docs/test-typescript.mdx +++ b/nodejs/docs/test-typescript.mdx @@ -178,10 +178,12 @@ Then `npm run test` will build the tests and run them. [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -189,7 +191,6 @@ Then `npm run test` will build the tests and run them. [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-ui-mode.mdx b/nodejs/docs/test-ui-mode.mdx index f905e5b354..023ee2496d 100644 --- a/nodejs/docs/test-ui-mode.mdx +++ b/nodejs/docs/test-ui-mode.mdx @@ -179,10 +179,12 @@ Be aware that when specifying the `--ui-host=0.0.0.0` flag, UI Mode with your tr [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -190,7 +192,6 @@ Be aware that when specifying the `--ui-host=0.0.0.0` flag, UI Mode with your tr [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-use-options.mdx b/nodejs/docs/test-use-options.mdx index 1d425aa169..de0edc4071 100644 --- a/nodejs/docs/test-use-options.mdx +++ b/nodejs/docs/test-use-options.mdx @@ -344,10 +344,12 @@ test.describe('french language block', () => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -355,7 +357,6 @@ test.describe('french language block', () => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/test-webserver.mdx b/nodejs/docs/test-webserver.mdx index 6b6b2702a7..62d2fe3cfe 100644 --- a/nodejs/docs/test-webserver.mdx +++ b/nodejs/docs/test-webserver.mdx @@ -173,10 +173,12 @@ export default defineConfig({ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -184,7 +186,6 @@ export default defineConfig({ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/testing-library.mdx b/nodejs/docs/testing-library.mdx index d639d6b411..b14a91c01d 100644 --- a/nodejs/docs/testing-library.mdx +++ b/nodejs/docs/testing-library.mdx @@ -202,10 +202,12 @@ Learn more about Playwright Test runner: [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -213,7 +215,6 @@ Learn more about Playwright Test runner: [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/trace-viewer-intro.mdx b/nodejs/docs/trace-viewer-intro.mdx index d274ff11b9..3f66a0f5b9 100644 --- a/nodejs/docs/trace-viewer-intro.mdx +++ b/nodejs/docs/trace-viewer-intro.mdx @@ -21,7 +21,7 @@ Playwright Trace Viewer is a GUI tool that lets you explore recorded Playwright ## Recording a Trace -By default the [playwright.config](./trace-viewer.mdx#recording-a-trace-on-ci) file will contain the configuration needed to create a `trace.pwtrace.zip` file for each test. Traces are setup to run `on-first-retry` meaning they will be run on the first retry of a failed test. Also `retries` are set to 2 when running on CI and 0 locally. This means the traces will be recorded on the first retry of a failed test but not on the first run and not on the second retry. +By default the [playwright.config](./trace-viewer.mdx#recording-a-trace-on-ci) file will contain the configuration needed to create a `trace.zip` file for each test. Traces are setup to run `on-first-retry` meaning they will be run on the first retry of a failed test. Also `retries` are set to 2 when running on CI and 0 locally. This means the traces will be recorded on the first retry of a failed test but not on the first run and not on the second retry. ```js title="playwright.config.ts" import { defineConfig } from '@playwright/test'; @@ -123,10 +123,12 @@ To learn more about traces check out our detailed guide on [Trace Viewer](/trace [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -134,7 +136,6 @@ To learn more about traces check out our detailed guide on [Trace Viewer](/trace [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/trace-viewer.mdx b/nodejs/docs/trace-viewer.mdx index 6add354ec9..b280a471fa 100644 --- a/nodejs/docs/trace-viewer.mdx +++ b/nodejs/docs/trace-viewer.mdx @@ -126,7 +126,7 @@ npx playwright show-report ## Recording a trace on CI -Traces should be run on continuous integration on the first retry of a failed test by setting the `trace: 'on-first-retry'` option in the test configuration file. This will produce a `trace.pwtrace.zip` file for each test that was retried. +Traces should be run on continuous integration on the first retry of a failed test by setting the `trace: 'on-first-retry'` option in the test configuration file. This will produce a `trace.zip` file for each test that was retried. @@ -183,10 +183,10 @@ If you are not using Playwright as a Test Runner, use the [browserContext.tracin ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. ```bash -npx playwright show-trace path/to/trace.pwtrace.zip +npx playwright show-trace path/to/trace.zip ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -200,7 +200,7 @@ npx playwright show-trace path/to/trace.pwtrace.zip You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -npx playwright show-trace https://example.com/trace.pwtrace.zip +npx playwright show-trace https://example.com/trace.zip ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. @@ -258,10 +258,12 @@ https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -269,7 +271,6 @@ https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/ [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/videos.mdx b/nodejs/docs/videos.mdx index c09a9ba41f..2c518ceebc 100644 --- a/nodejs/docs/videos.mdx +++ b/nodejs/docs/videos.mdx @@ -151,10 +151,12 @@ Note that the video is only available after the page or browser context is close [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -162,7 +164,6 @@ Note that the video is only available after the page or browser context is close [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/webview2.mdx b/nodejs/docs/webview2.mdx index 566036a9c7..f32776e839 100644 --- a/nodejs/docs/webview2.mdx +++ b/nodejs/docs/webview2.mdx @@ -166,10 +166,12 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -177,7 +179,6 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/nodejs/docs/writing-tests.mdx b/nodejs/docs/writing-tests.mdx index 17970c2cdd..6fa36900a9 100644 --- a/nodejs/docs/writing-tests.mdx +++ b/nodejs/docs/writing-tests.mdx @@ -223,10 +223,12 @@ test.describe('navigation', () => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Fixtures]: /api/class-fixtures.mdx "Fixtures" [FullConfig]: /api/class-fullconfig.mdx "FullConfig" [FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" [Test]: /api/class-test.mdx "Test" [TestConfig]: /api/class-testconfig.mdx "TestConfig" [TestInfo]: /api/class-testinfo.mdx "TestInfo" @@ -234,7 +236,6 @@ test.describe('navigation', () => { [TestOptions]: /api/class-testoptions.mdx "TestOptions" [TestProject]: /api/class-testproject.mdx "TestProject" [WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" -[Location]: /api/class-location.mdx "Location" [Reporter]: /api/class-reporter.mdx "Reporter" [Suite]: /api/class-suite.mdx "Suite" [TestCase]: /api/class-testcase.mdx "TestCase" diff --git a/python/docs/actionability.mdx b/python/docs/actionability.mdx index 1c20e2c3cf..2221f39dcf 100644 --- a/python/docs/actionability.mdx +++ b/python/docs/actionability.mdx @@ -150,6 +150,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api-testing.mdx b/python/docs/api-testing.mdx index aa86e162be..bae4f4e57b 100644 --- a/python/docs/api-testing.mdx +++ b/python/docs/api-testing.mdx @@ -319,6 +319,7 @@ context = browser.new_context(storage_state=state) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-accessibility.mdx b/python/docs/api/class-accessibility.mdx index d27df23622..d9c5a4400c 100644 --- a/python/docs/api/class-accessibility.mdx +++ b/python/docs/api/class-accessibility.mdx @@ -243,6 +243,7 @@ if node: [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-apirequest.mdx b/python/docs/api/class-apirequest.mdx index 467c1f6472..f2310a646b 100644 --- a/python/docs/api/class-apirequest.mdx +++ b/python/docs/api/class-apirequest.mdx @@ -66,10 +66,6 @@ api_request.new_context(**kwargs) An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -198,6 +194,7 @@ api_request.new_context(**kwargs) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-apirequestcontext.mdx b/python/docs/api/class-apirequestcontext.mdx index a0668ee385..f65005d548 100644 --- a/python/docs/api/class-apirequestcontext.mdx +++ b/python/docs/api/class-apirequestcontext.mdx @@ -748,6 +748,7 @@ api_request_context.storage_state(**kwargs) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-apiresponse.mdx b/python/docs/api/class-apiresponse.mdx index d6e3427f39..0db0500ef7 100644 --- a/python/docs/api/class-apiresponse.mdx +++ b/python/docs/api/class-apiresponse.mdx @@ -279,6 +279,7 @@ api_response.url [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-apiresponseassertions.mdx b/python/docs/api/class-apiresponseassertions.mdx index 7d9b009178..4f915a57b0 100644 --- a/python/docs/api/class-apiresponseassertions.mdx +++ b/python/docs/api/class-apiresponseassertions.mdx @@ -144,6 +144,7 @@ await expect(response).to_be_ok() [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-browser.mdx b/python/docs/api/class-browser.mdx index c3b7dcd885..239e0d289b 100644 --- a/python/docs/api/class-browser.mdx +++ b/python/docs/api/class-browser.mdx @@ -212,10 +212,6 @@ await browser.close() An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -467,10 +463,6 @@ browser.new_page(**kwargs) An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -894,6 +886,7 @@ browser.on("disconnected", handler) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-browsercontext.mdx b/python/docs/api/class-browsercontext.mdx index 74c16bbff6..08d951bd7b 100644 --- a/python/docs/api/class-browsercontext.mdx +++ b/python/docs/api/class-browsercontext.mdx @@ -939,6 +939,73 @@ browser_context.route_from_har(har, **kwargs) --- +### route_web_socket {#browser-context-route-web-socket} + +Added in: v1.48browserContext.route_web_socket + +This method allows to modify websocket connections that are made by any page in the browser context. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before creating any pages. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + + + + +```py +def message_handler(ws: WebSocketRoute, message: Union[str, bytes]): + if message == "to-be-blocked": + return + ws.send(message) + +def handler(ws: WebSocketRoute): + ws.route_send(lambda message: message_handler(ws, message)) + ws.connect() + +context.route_web_socket("/ws", handler) +``` + + + + +```py +def message_handler(ws: WebSocketRoute, message: Union[str, bytes]): + if message == "to-be-blocked": + return + ws.send(message) + +async def handler(ws: WebSocketRoute): + ws.route_send(lambda message: message_handler(ws, message)) + await ws.connect() + +await context.route_web_socket("/ws", handler) +``` + + + + +**Arguments** +- `url` [str] | [Pattern] | [Callable]\[[URL]\]:[bool]# + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `base_url` from the context options. +- `handler` [Callable]\[[WebSocketRoute]\]:[Promise]\[[Any]\] | [Any]# + + Handler function to route the WebSocket. + +**Returns** +- [NoneType]# + +--- + ### set_default_navigation_timeout {#browser-context-set-default-navigation-timeout} Added before v1.9browserContext.set_default_navigation_timeout @@ -1702,6 +1769,7 @@ browser_context.on("weberror", handler) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-browsertype.mdx b/python/docs/api/class-browsertype.mdx index fd133fdd2b..40a642f57f 100644 --- a/python/docs/api/class-browsertype.mdx +++ b/python/docs/api/class-browsertype.mdx @@ -368,10 +368,6 @@ browser_type.launch_persistent_context(user_data_dir, **kwargs) An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for. - :::note - Using Client Certificates in combination with Proxy Servers is not supported. - ::: - :::note When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`. ::: @@ -633,6 +629,7 @@ browser_type.name [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-cdpsession.mdx b/python/docs/api/class-cdpsession.mdx index c37a199801..419fb9f6b0 100644 --- a/python/docs/api/class-cdpsession.mdx +++ b/python/docs/api/class-cdpsession.mdx @@ -134,6 +134,7 @@ cdp_session.send(method, **kwargs) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-clock.mdx b/python/docs/api/class-clock.mdx index 0390109470..c87cc25576 100644 --- a/python/docs/api/class-clock.mdx +++ b/python/docs/api/class-clock.mdx @@ -329,6 +329,7 @@ await page.clock.set_system_time("2020-02-02") [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-consolemessage.mdx b/python/docs/api/class-consolemessage.mdx index 550c31e405..1a7588162b 100644 --- a/python/docs/api/class-consolemessage.mdx +++ b/python/docs/api/class-consolemessage.mdx @@ -193,6 +193,7 @@ console_message.type [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-dialog.mdx b/python/docs/api/class-dialog.mdx index ebc3b35fa1..764fa15b86 100644 --- a/python/docs/api/class-dialog.mdx +++ b/python/docs/api/class-dialog.mdx @@ -222,6 +222,7 @@ dialog.type [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-download.mdx b/python/docs/api/class-download.mdx index 1110e6d255..433282b519 100644 --- a/python/docs/api/class-download.mdx +++ b/python/docs/api/class-download.mdx @@ -256,6 +256,7 @@ download.url [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-elementhandle.mdx b/python/docs/api/class-elementhandle.mdx index d3029a130d..3e74d083f7 100644 --- a/python/docs/api/class-elementhandle.mdx +++ b/python/docs/api/class-elementhandle.mdx @@ -1814,6 +1814,7 @@ This method does not work across navigations, use [page.wait_for_selector()](/ap [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-error.mdx b/python/docs/api/class-error.mdx index 2896271ddf..e961f410f1 100644 --- a/python/docs/api/class-error.mdx +++ b/python/docs/api/class-error.mdx @@ -101,6 +101,7 @@ error.stack [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-filechooser.mdx b/python/docs/api/class-filechooser.mdx index 965afbf45a..380fca8e78 100644 --- a/python/docs/api/class-filechooser.mdx +++ b/python/docs/api/class-filechooser.mdx @@ -173,6 +173,7 @@ file_chooser.page [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-frame.mdx b/python/docs/api/class-frame.mdx index b4a6d01d66..25e54f78dc 100644 --- a/python/docs/api/class-frame.mdx +++ b/python/docs/api/class-frame.mdx @@ -3255,6 +3255,7 @@ frame.wait_for_timeout(timeout) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-framelocator.mdx b/python/docs/api/class-framelocator.mdx index 9e73209735..84ef63388f 100644 --- a/python/docs/api/class-framelocator.mdx +++ b/python/docs/api/class-framelocator.mdx @@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem'; import HTMLCard from '@site/src/components/HTMLCard'; -FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [page.frame_locator()](/api/class-page.mdx#page-frame-locator) or [locator.frame_locator()](/api/class-locator.mdx#locator-frame-locator) method. +FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [locator.content_frame](/api/class-locator.mdx#locator-content-frame), [page.frame_locator()](/api/class-page.mdx#page-frame-locator) or [locator.frame_locator()](/api/class-locator.mdx#locator-frame-locator) method. ```py -locator = page.frame_locator("my-frame").get_by_text("Submit") +locator = page.locator("my-frame").content_frame.get_by_text("Submit") locator.click() ``` @@ -28,7 +28,7 @@ locator.click() ```py -locator = page.frame_locator("#my-frame").get_by_text("Submit") +locator = page.locator("#my-frame").content_frame.get_by_text("Submit") await locator.click() ``` @@ -51,10 +51,10 @@ Frame locators are strict. This means that all operations on frame locators will ```py # Throws if there are several frames in DOM: -page.frame_locator('.result-frame').get_by_role('button').click() +page.locator('.result-frame').content_frame.get_by_role('button').click() # Works because we explicitly tell locator to pick the first frame: -page.frame_locator('.result-frame').first.get_by_role('button').click() +page.locator('.result-frame').first.content_frame.get_by_role('button').click() ``` @@ -62,10 +62,10 @@ page.frame_locator('.result-frame').first.get_by_role('button').click() ```py # Throws if there are several frames in DOM: -await page.frame_locator('.result-frame').get_by_role('button').click() +await page.locator('.result-frame').content_frame.get_by_role('button').click() # Works because we explicitly tell locator to pick the first frame: -await page.frame_locator('.result-frame').first.get_by_role('button').click() +await page.locator('.result-frame').first.content_frame.get_by_role('button').click() ``` @@ -618,32 +618,68 @@ frame_locator.locator(selector_or_locator, **kwargs) --- -### nth {#frame-locator-nth} +## Properties -Added in: v1.17frameLocator.nth +### owner {#frame-locator-owner} -Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. +Added in: v1.43frameLocator.owner + +Returns a [Locator] object pointing to the same `iframe` as this frame locator. + +Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. + +For a reverse operation, use [locator.content_frame](/api/class-locator.mdx#locator-content-frame). **Usage** -```python -frame_locator.nth(index) + + + +```py +frame_locator = page.locator("iframe[name=\"embedded\"]").content_frame +# ... +locator = frame_locator.owner +expect(locator).to_be_visible() ``` -**Arguments** -- `index` [int]# + + + +```py +frame_locator = page.locator("iframe[name=\"embedded\"]").content_frame +# ... +locator = frame_locator.owner +await expect(locator).to_be_visible() +``` + + + **Returns** -- [FrameLocator]# +- [Locator]# --- -## Properties +## Deprecated ### first {#frame-locator-first} Added in: v1.17frameLocator.first +:::warning Deprecated + +Use [locator.first](/api/class-locator.mdx#locator-first) followed by [locator.content_frame](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + Returns locator to the first matching frame. **Usage** @@ -661,6 +697,13 @@ frame_locator.first Added in: v1.17frameLocator.last +:::warning Deprecated + +Use [locator.last](/api/class-locator.mdx#locator-last) followed by [locator.content_frame](/api/class-locator.mdx#locator-content-frame) instead. + +::: + + Returns locator to the last matching frame. **Usage** @@ -674,50 +717,30 @@ frame_locator.last --- -### owner {#frame-locator-owner} +### nth {#frame-locator-nth} -Added in: v1.43frameLocator.owner +Added in: v1.17frameLocator.nth -Returns a [Locator] object pointing to the same `iframe` as this frame locator. +:::warning Deprecated -Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element. +Use [locator.nth()](/api/class-locator.mdx#locator-nth) followed by [locator.content_frame](/api/class-locator.mdx#locator-content-frame) instead. -For a reverse operation, use [locator.content_frame](/api/class-locator.mdx#locator-content-frame). +::: -**Usage** - - - -```py -frame_locator = page.frame_locator("iframe[name=\"embedded\"]") -# ... -locator = frame_locator.owner -expect(locator).to_be_visible() -``` +Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. - - +**Usage** -```py -frame_locator = page.frame_locator("iframe[name=\"embedded\"]") -# ... -locator = frame_locator.owner -await expect(locator).to_be_visible() +```python +frame_locator.nth(index) ``` - - +**Arguments** +- `index` [int]# **Returns** -- [Locator]# +- [FrameLocator]# [Accessibility]: /api/class-accessibility.mdx "Accessibility" @@ -756,6 +779,7 @@ await expect(locator).to_be_visible() [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-jshandle.mdx b/python/docs/api/class-jshandle.mdx index 78cadf5bc5..589ee9f1f3 100644 --- a/python/docs/api/class-jshandle.mdx +++ b/python/docs/api/class-jshandle.mdx @@ -288,6 +288,7 @@ js_handle.as_element() [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-keyboard.mdx b/python/docs/api/class-keyboard.mdx index 98d67a7170..3e6c523bf6 100644 --- a/python/docs/api/class-keyboard.mdx +++ b/python/docs/api/class-keyboard.mdx @@ -399,6 +399,7 @@ keyboard.up(key) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-locator.mdx b/python/docs/api/class-locator.mdx index 8f3a15b616..165b735c03 100644 --- a/python/docs/api/class-locator.mdx +++ b/python/docs/api/class-locator.mdx @@ -2245,7 +2245,9 @@ banana = await page.get_by_role("listitem").nth(2) Added in: v1.33locator.or_ -Creates a locator that matches either of the two locators. +Creates a locator matching all elements that match one or both of the two locators. + +Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.mdx#strictness) guidelines. **Usage** @@ -3370,6 +3372,7 @@ To press a special key, like `Control` or `ArrowDown`, use [locator.press()](/ap [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-locatorassertions.mdx b/python/docs/api/class-locatorassertions.mdx index c9fa7e1933..c75052b4dd 100644 --- a/python/docs/api/class-locatorassertions.mdx +++ b/python/docs/api/class-locatorassertions.mdx @@ -2080,6 +2080,7 @@ await expect(locator).to_have_values([re.compile(r"R"), re.compile(r"G")]) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-mouse.mdx b/python/docs/api/class-mouse.mdx index 30c817eb09..5e4a67087c 100644 --- a/python/docs/api/class-mouse.mdx +++ b/python/docs/api/class-mouse.mdx @@ -266,6 +266,7 @@ mouse.wheel(delta_x, delta_y) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-page.mdx b/python/docs/api/class-page.mdx index 7f3b8e6b52..af318468e0 100644 --- a/python/docs/api/class-page.mdx +++ b/python/docs/api/class-page.mdx @@ -2613,6 +2613,73 @@ page.route_from_har(har, **kwargs) --- +### route_web_socket {#page-route-web-socket} + +Added in: v1.48page.route_web_socket + +This method allows to modify websocket connections that are made by the page. + +Note that only `WebSocket`s created after this method was called will be routed. It is recommended to call this method before navigating the page. + +**Usage** + +Below is an example of a simple handler that blocks some websocket messages. See [WebSocketRoute] for more details and examples. + + + + +```py +def message_handler(ws: WebSocketRoute, message: Union[str, bytes]): + if message == "to-be-blocked": + return + ws.send(message) + +def handler(ws: WebSocketRoute): + ws.route_send(lambda message: message_handler(ws, message)) + ws.connect() + +page.route_web_socket("/ws", handler) +``` + + + + +```py +def message_handler(ws: WebSocketRoute, message: Union[str, bytes]): + if message == "to-be-blocked": + return + ws.send(message) + +async def handler(ws: WebSocketRoute): + ws.route_send(lambda message: message_handler(ws, message)) + await ws.connect() + +await page.route_web_socket("/ws", handler) +``` + + + + +**Arguments** +- `url` [str] | [Pattern] | [Callable]\[[URL]\]:[bool]# + + Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `base_url` from the context options. +- `handler` [Callable]\[[WebSocketRoute]\]:[Promise]\[[Any]\] | [Any]# + + Handler function to route the WebSocket. + +**Returns** +- [NoneType]# + +--- + ### screenshot {#page-screenshot} Added before v1.9page.screenshot @@ -5767,6 +5834,7 @@ await page.wait_for_timeout(1000) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-pageassertions.mdx b/python/docs/api/class-pageassertions.mdx index 275611c0e3..1602274b6f 100644 --- a/python/docs/api/class-pageassertions.mdx +++ b/python/docs/api/class-pageassertions.mdx @@ -249,6 +249,7 @@ await expect(page).to_have_url(re.compile(".*checkout")) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-playwright.mdx b/python/docs/api/class-playwright.mdx index 420c8ec96d..9ead79ba34 100644 --- a/python/docs/api/class-playwright.mdx +++ b/python/docs/api/class-playwright.mdx @@ -286,6 +286,7 @@ playwright.webkit [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-request.mdx b/python/docs/api/class-request.mdx index 91eb525a2e..9b40fcec69 100644 --- a/python/docs/api/class-request.mdx +++ b/python/docs/api/class-request.mdx @@ -514,6 +514,7 @@ request.url [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-response.mdx b/python/docs/api/class-response.mdx index 517e531fdc..f57ca41f0d 100644 --- a/python/docs/api/class-response.mdx +++ b/python/docs/api/class-response.mdx @@ -395,6 +395,7 @@ response.url [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-route.mdx b/python/docs/api/class-route.mdx index a563675a78..cdc41f3468 100644 --- a/python/docs/api/class-route.mdx +++ b/python/docs/api/class-route.mdx @@ -515,6 +515,7 @@ route.request [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-selectors.mdx b/python/docs/api/class-selectors.mdx index 57777436df..db37618165 100644 --- a/python/docs/api/class-selectors.mdx +++ b/python/docs/api/class-selectors.mdx @@ -187,6 +187,7 @@ selectors.set_test_id_attribute(attribute_name) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-timeouterror.mdx b/python/docs/api/class-timeouterror.mdx index 754a1a15aa..071dea773c 100644 --- a/python/docs/api/class-timeouterror.mdx +++ b/python/docs/api/class-timeouterror.mdx @@ -97,6 +97,7 @@ asyncio.run(main()) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-touchscreen.mdx b/python/docs/api/class-touchscreen.mdx index e0c739d374..89cf1f2520 100644 --- a/python/docs/api/class-touchscreen.mdx +++ b/python/docs/api/class-touchscreen.mdx @@ -78,6 +78,7 @@ touchscreen.tap(x, y) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-tracing.mdx b/python/docs/api/class-tracing.mdx index 93a7555f86..e877d89a84 100644 --- a/python/docs/api/class-tracing.mdx +++ b/python/docs/api/class-tracing.mdx @@ -27,7 +27,7 @@ context = browser.new_context() context.tracing.start(screenshots=True, snapshots=True) page = context.new_page() page.goto("https://playwright.dev") -context.tracing.stop(path = "trace.pwtrace.zip") +context.tracing.stop(path = "trace.zip") ``` @@ -39,7 +39,7 @@ context = await browser.new_context() await context.tracing.start(screenshots=True, snapshots=True) page = await context.new_page() await page.goto("https://playwright.dev") -await context.tracing.stop(path = "trace.pwtrace.zip") +await context.tracing.stop(path = "trace.zip") ``` @@ -72,7 +72,7 @@ Start tracing. context.tracing.start(screenshots=True, snapshots=True) page = context.new_page() page.goto("https://playwright.dev") -context.tracing.stop(path = "trace.pwtrace.zip") +context.tracing.stop(path = "trace.zip") ``` @@ -82,7 +82,7 @@ context.tracing.stop(path = "trace.pwtrace.zip") await context.tracing.start(screenshots=True, snapshots=True) page = await context.new_page() await page.goto("https://playwright.dev") -await context.tracing.stop(path = "trace.pwtrace.zip") +await context.tracing.stop(path = "trace.zip") ``` @@ -138,12 +138,12 @@ page.goto("https://playwright.dev") context.tracing.start_chunk() page.get_by_text("Get Started").click() # Everything between start_chunk and stop_chunk will be recorded in the trace. -context.tracing.stop_chunk(path = "trace1.pwtrace.zip") +context.tracing.stop_chunk(path = "trace1.zip") context.tracing.start_chunk() page.goto("http://example.com") # Save a second trace file with different actions. -context.tracing.stop_chunk(path = "trace2.pwtrace.zip") +context.tracing.stop_chunk(path = "trace2.zip") ``` @@ -157,12 +157,12 @@ await page.goto("https://playwright.dev") await context.tracing.start_chunk() await page.get_by_text("Get Started").click() # Everything between start_chunk and stop_chunk will be recorded in the trace. -await context.tracing.stop_chunk(path = "trace1.pwtrace.zip") +await context.tracing.stop_chunk(path = "trace1.zip") await context.tracing.start_chunk() await page.goto("http://example.com") # Save a second trace file with different actions. -await context.tracing.stop_chunk(path = "trace2.pwtrace.zip") +await context.tracing.stop_chunk(path = "trace2.zip") ``` @@ -262,6 +262,7 @@ tracing.stop_chunk(**kwargs) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-video.mdx b/python/docs/api/class-video.mdx index 4fd2a93eda..a563db8692 100644 --- a/python/docs/api/class-video.mdx +++ b/python/docs/api/class-video.mdx @@ -129,6 +129,7 @@ video.save_as(path) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-weberror.mdx b/python/docs/api/class-weberror.mdx index 8d5ed14225..3286b3d339 100644 --- a/python/docs/api/class-weberror.mdx +++ b/python/docs/api/class-weberror.mdx @@ -115,6 +115,7 @@ web_error.page [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-websocket.mdx b/python/docs/api/class-websocket.mdx index bc457dcadc..4e652208bf 100644 --- a/python/docs/api/class-websocket.mdx +++ b/python/docs/api/class-websocket.mdx @@ -217,6 +217,7 @@ web_socket.on("socketerror", handler) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/api/class-websocketroute.mdx b/python/docs/api/class-websocketroute.mdx new file mode 100644 index 0000000000..0bbaf40a51 --- /dev/null +++ b/python/docs/api/class-websocketroute.mdx @@ -0,0 +1,294 @@ +--- +id: class-websocketroute +title: "WebSocketRoute" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +Whenever a [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) route is set up with [page.route_web_socket()](/api/class-page.mdx#page-route-web-socket) or [browser_context.route_web_socket()](/api/class-browsercontext.mdx#browser-context-route-web-socket), the `WebSocketRoute` object allows to handle the WebSocket. + +By default, the routed WebSocket will not actually connect to the server. This way, you can mock entire communcation over the WebSocket. Here is an example that responds to a `"query"` with a `"result"`. + + + + +```py +def message_handler(ws, message): + if message == "query": + ws.receive("result") + +page.route_web_socket("/ws", lambda ws: ws.route_send( + lambda message: message_handler(ws, message) +)) +``` + + + + +```py +def message_handler(ws, message): + if message == "query": + ws.receive("result") + +await page.route_web_socket("/ws", lambda ws: ws.route_send( + lambda message: message_handler(ws, message) +)) +``` + + + + + +--- + +## Methods + +### close {#web-socket-route-close} + +Added in: v1.48webSocketRoute.close + +Closes the server connection and the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page. + +**Usage** + +```python +web_socket_route.close() +web_socket_route.close(**kwargs) +``` + +**Arguments** +- `code` [int] *(optional)*# + + Optional [close code](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#code). +- `reason` [str] *(optional)*# + + Optional [close reason](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close#reason). + +**Returns** +- [NoneType]# + +--- + +### connect {#web-socket-route-connect} + +Added in: v1.48webSocketRoute.connect + +By default, routed WebSocket does not connect to the server, so you can mock entire WebSocket communication. This method connects to the actual WebSocket server, giving the ability to send and receive messages from the server. + +Once connected: +* Messages received from the server will be automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, unless [web_socket_route.route_receive()](/api/class-websocketroute.mdx#web-socket-route-route-receive) is called. +* Messages sent by the `WebSocket.send()` call in the page will be automatically sent to the server, unless [web_socket_route.route_send()](/api/class-websocketroute.mdx#web-socket-route-route-send) is called. + +**Usage** + +```python +web_socket_route.connect() +``` + +**Returns** +- [NoneType]# + +--- + +### receive {#web-socket-route-receive} + +Added in: v1.48webSocketRoute.receive + +Dispatches a message to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page, like it was received from the server. + +**Usage** + +```python +web_socket_route.receive(message) +``` + +**Arguments** +- `message` [str] | [bytes]# + + Message to receive. + +--- + +### route_receive {#web-socket-route-route-receive} + +Added in: v1.48webSocketRoute.route_receive + +This method allows to route messages that are received by the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page from the server. This method only makes sense if you are also calling [web_socket_route.connect()](/api/class-websocketroute.mdx#web-socket-route-connect). + +Once this method is called, received messages are not automatically dispatched to the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object in the page - you should do that manually by calling [web_socket_route.receive()](/api/class-websocketroute.mdx#web-socket-route-receive). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```python +web_socket_route.route_receive(handler) +``` + +**Arguments** +- `handler` [Callable]\[[str]\]:[Promise]\[[Any]\] | [Any]# + + Handler function to route received messages. + +**Returns** +- [NoneType]# + +--- + +### route_send {#web-socket-route-route-send} + +Added in: v1.48webSocketRoute.route_send + +This method allows to route messages that are sent by `WebSocket.send()` call in the page, instead of actually sending them to the server. Once this method is called, sent messages **are not** automatically forwarded to the server - you should do that manually by calling [web_socket_route.send()](/api/class-websocketroute.mdx#web-socket-route-send). + +Calling this method again times will override the handler with a new one. + +**Usage** + +```python +web_socket_route.route_send(handler) +``` + +**Arguments** +- `handler` [Callable]\[[str] | [bytes]\]:[Promise]\[[Any]\] | [Any]# + + Handler function to route sent messages. + +**Returns** +- [NoneType]# + +--- + +### send {#web-socket-route-send} + +Added in: v1.48webSocketRoute.send + +Sends a message to the server, like it was sent in the page with `WebSocket.send()`. + +**Usage** + +```python +web_socket_route.send(message) +``` + +**Arguments** +- `message` [str] | [bytes]# + + Message to send. + +--- + +## Properties + +### url {#web-socket-route-url} + +Added in: v1.48webSocketRoute.url + +URL of the WebSocket created in the page. + +**Usage** + +```python +web_socket_route.url +``` + +**Returns** +- [str]# + +--- + +## Events + +### on("close") {#web-socket-route-event-close} + +Added in: v1.48webSocketRoute.on("close") + +Emitted when the [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) closes. + +**Usage** + +```python +web_socket_route.on("close", handler) +``` + + +[Accessibility]: /api/class-accessibility.mdx "Accessibility" +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[Error]: /api/class-error.mdx "Error" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Selectors]: /api/class-selectors.mdx "Selectors" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[Any]: https://docs.python.org/3/library/typing.html#typing.Any "Any" +[bool]: https://docs.python.org/3/library/stdtypes.html "bool" +[bytes]: https://docs.python.org/3/library/stdtypes.html#bytes "bytes" +[Callable]: https://docs.python.org/3/library/typing.html#typing.Callable "Callable" +[EventContextManager]: https://docs.python.org/3/reference/datamodel.html#context-managers "Event context manager" +[EventEmitter]: https://pyee.readthedocs.io/en/latest/#pyee.BaseEventEmitter "EventEmitter" +[Exception]: https://docs.python.org/3/library/exceptions.html#Exception "Exception" +[Dict]: https://docs.python.org/3/library/typing.html#typing.Dict "Dict" +[float]: https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex "float" +[int]: https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex "int" +[List]: https://docs.python.org/3/library/typing.html#typing.List "List" +[NoneType]: https://docs.python.org/3/library/constants.html#None "None" +[Pattern]: https://docs.python.org/3/library/re.html "Pattern" +[URL]: https://en.wikipedia.org/wiki/URL "URL" +[pathlib.Path]: https://realpython.com/python-pathlib/ "pathlib.Path" +[str]: https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str "str" +[Union]: https://docs.python.org/3/library/typing.html#typing.Union "Union" +[datetime]: https://docs.python.org/3/library/datetime.html#datetime.datetime "datetime" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/python/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/python/about "Microsoft Artifact Registry" +[Dockerfile.jammy]: https://github.com/microsoft/playwright-python/blob/main/utils/docker/Dockerfile.jammy "Dockerfile.jammy" diff --git a/python/docs/api/class-worker.mdx b/python/docs/api/class-worker.mdx index 307883de88..6c77a33d20 100644 --- a/python/docs/api/class-worker.mdx +++ b/python/docs/api/class-worker.mdx @@ -157,6 +157,7 @@ worker.on("close", handler) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/auth.mdx b/python/docs/auth.mdx index 9dd897b52c..c0a3bc0aa7 100644 --- a/python/docs/auth.mdx +++ b/python/docs/auth.mdx @@ -235,6 +235,7 @@ await context.add_init_script("""(storage => { [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/browser-contexts.mdx b/python/docs/browser-contexts.mdx index 5395ba529d..1405914f2b 100644 --- a/python/docs/browser-contexts.mdx +++ b/python/docs/browser-contexts.mdx @@ -153,6 +153,7 @@ asyncio.run(main()) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/browsers.mdx b/python/docs/browsers.mdx index 9e75b874ed..6bf8d1bb95 100644 --- a/python/docs/browsers.mdx +++ b/python/docs/browsers.mdx @@ -507,6 +507,7 @@ playwright uninstall --all [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/chrome-extensions.mdx b/python/docs/chrome-extensions.mdx index a8818d553a..8459406389 100644 --- a/python/docs/chrome-extensions.mdx +++ b/python/docs/chrome-extensions.mdx @@ -213,6 +213,7 @@ context = playwright.chromium.launch_persistent_context( [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/ci-intro.mdx b/python/docs/ci-intro.mdx index 57442637ad..cfb9d2c914 100644 --- a/python/docs/ci-intro.mdx +++ b/python/docs/ci-intro.mdx @@ -88,8 +88,8 @@ Clicking on the workflow run will show you the all the actions that GitHub perfo - [Learn how to perform Actions](./input.mdx) - [Learn how to write Assertions](./test-assertions.mdx) - [Learn more about the Trace Viewer](/trace-viewer.mdx) -- [Learn more ways of running tests on GitHub Actions](/ci.mdx) -- [Learn more about running tests on other CI providers](/ci.mdx#github-actions) // TODO: is this link correct? +- [Learn more ways of running tests on GitHub Actions](/ci.mdx#github-actions) +- [Learn more about running tests on other CI providers](/ci.mdx) [Accessibility]: /api/class-accessibility.mdx "Accessibility" @@ -128,6 +128,7 @@ Clicking on the workflow run will show you the all the actions that GitHub perfo [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/ci.mdx b/python/docs/ci.mdx index ad9eb0b823..9bcce6b1b1 100644 --- a/python/docs/ci.mdx +++ b/python/docs/ci.mdx @@ -309,6 +309,7 @@ xvfb-run pytest [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/clock.mdx b/python/docs/clock.mdx index 1b68662dea..2fbc63b53e 100644 --- a/python/docs/clock.mdx +++ b/python/docs/clock.mdx @@ -291,6 +291,7 @@ await expect(locator).to_have_text("2/2/2024, 10:00:02 AM") [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/codegen-intro.mdx b/python/docs/codegen-intro.mdx index 3f8c88fc6c..dbdd10c71f 100644 --- a/python/docs/codegen-intro.mdx +++ b/python/docs/codegen-intro.mdx @@ -99,6 +99,7 @@ You can also generate tests using emulation so as to generate a test for a speci [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/codegen.mdx b/python/docs/codegen.mdx index ea8a3d3388..1b11c90e6f 100644 --- a/python/docs/codegen.mdx +++ b/python/docs/codegen.mdx @@ -227,6 +227,7 @@ asyncio.run(main()) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/debug.mdx b/python/docs/debug.mdx index 0a1927bb2c..788ace6942 100644 --- a/python/docs/debug.mdx +++ b/python/docs/debug.mdx @@ -358,6 +358,7 @@ await chromium.launch(headless=False, slow_mo=100) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/dialogs.mdx b/python/docs/dialogs.mdx index e6a5e4e1ef..2118df66f1 100644 --- a/python/docs/dialogs.mdx +++ b/python/docs/dialogs.mdx @@ -197,6 +197,7 @@ This will wait for the print dialog to be opened after the button is clicked. Ma [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/docker.mdx b/python/docs/docker.mdx index 34b7f81b86..8bff0e45c6 100644 --- a/python/docs/docker.mdx +++ b/python/docs/docker.mdx @@ -142,6 +142,7 @@ RUN pip install playwright==@1.47.0 && \ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/downloads.mdx b/python/docs/downloads.mdx index 5cdbd8fe1c..096e4fb5d3 100644 --- a/python/docs/downloads.mdx +++ b/python/docs/downloads.mdx @@ -129,6 +129,7 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/emulation.mdx b/python/docs/emulation.mdx index 378b3d9265..e2bb2245ad 100644 --- a/python/docs/emulation.mdx +++ b/python/docs/emulation.mdx @@ -526,6 +526,7 @@ context = await browser.new_context( [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/evaluating.mdx b/python/docs/evaluating.mdx index 092ba6eb1a..ba950167d0 100644 --- a/python/docs/evaluating.mdx +++ b/python/docs/evaluating.mdx @@ -323,6 +323,7 @@ await page.add_init_script(path="mocks/preload.js") [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/events.mdx b/python/docs/events.mdx index 3e6c3df0b6..912faa244a 100644 --- a/python/docs/events.mdx +++ b/python/docs/events.mdx @@ -193,6 +193,7 @@ await page.evaluate("prompt('Enter a number:')") [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/extensibility.mdx b/python/docs/extensibility.mdx index 2f3c03195c..ccca9f4b29 100644 --- a/python/docs/extensibility.mdx +++ b/python/docs/extensibility.mdx @@ -131,6 +131,7 @@ button_count = await page.locator("tag=button").count() [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/frames.mdx b/python/docs/frames.mdx index 4497f40811..8e30ba86af 100644 --- a/python/docs/frames.mdx +++ b/python/docs/frames.mdx @@ -120,6 +120,7 @@ await frame.fill('#username-input', 'John') [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/handles.mdx b/python/docs/handles.mdx index dc55762d13..12a5c8a342 100644 --- a/python/docs/handles.mdx +++ b/python/docs/handles.mdx @@ -280,6 +280,7 @@ await locator.click() [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/input.mdx b/python/docs/input.mdx index 8c6cbb65ea..eb9d49545c 100644 --- a/python/docs/input.mdx +++ b/python/docs/input.mdx @@ -718,6 +718,7 @@ await page.get_by_test_id("scrolling-container").evaluate("e => e.scrollTop += 1 [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/intro.mdx b/python/docs/intro.mdx index a7ba8391b9..c65a446672 100644 --- a/python/docs/intro.mdx +++ b/python/docs/intro.mdx @@ -145,6 +145,7 @@ pip install pytest-playwright playwright -U [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/languages.mdx b/python/docs/languages.mdx index e5d916e4c7..74c62e816d 100644 --- a/python/docs/languages.mdx +++ b/python/docs/languages.mdx @@ -71,6 +71,7 @@ Playwright for .NET comes with [MSTest base classes](https://playwright.dev/dotn [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/library.mdx b/python/docs/library.mdx index 8e43f10772..fff414aa7f 100644 --- a/python/docs/library.mdx +++ b/python/docs/library.mdx @@ -235,6 +235,7 @@ Playwright's API is not thread-safe. If you are using Playwright in a multi-thre [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/locators.mdx b/python/docs/locators.mdx index 9236775a8b..bc2e07e975 100644 --- a/python/docs/locators.mdx +++ b/python/docs/locators.mdx @@ -1887,6 +1887,7 @@ For less commonly used locators, look at the [other locators](./other-locators.m [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/mock.mdx b/python/docs/mock.mdx index 8a67b1a7e8..b83d7c3442 100644 --- a/python/docs/mock.mdx +++ b/python/docs/mock.mdx @@ -307,6 +307,7 @@ Read more about [advanced networking](./network.mdx). [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/navigations.mdx b/python/docs/navigations.mdx index 6092b625b3..7a2621cb32 100644 --- a/python/docs/navigations.mdx +++ b/python/docs/navigations.mdx @@ -177,6 +177,7 @@ Playwright splits the process of showing a new document in a page into **navigat [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/network.mdx b/python/docs/network.mdx index 46836d29fe..8b6c7a4e1b 100644 --- a/python/docs/network.mdx +++ b/python/docs/network.mdx @@ -516,6 +516,7 @@ Playwright's built-in [browser_context.route()](/api/class-browsercontext.mdx#br [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/other-locators.mdx b/python/docs/other-locators.mdx index 51867e05d5..50478600ea 100644 --- a/python/docs/other-locators.mdx +++ b/python/docs/other-locators.mdx @@ -989,6 +989,7 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/pages.mdx b/python/docs/pages.mdx index 6c205de533..1ac2240cfa 100644 --- a/python/docs/pages.mdx +++ b/python/docs/pages.mdx @@ -289,6 +289,7 @@ page.on("popup", handle_popup) [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/pom.mdx b/python/docs/pom.mdx index 94b206a562..2166e76c63 100644 --- a/python/docs/pom.mdx +++ b/python/docs/pom.mdx @@ -137,6 +137,7 @@ await search_page.search("search query") [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/release-notes.mdx b/python/docs/release-notes.mdx index 186dd6f4f2..923411556b 100644 --- a/python/docs/release-notes.mdx +++ b/python/docs/release-notes.mdx @@ -1618,6 +1618,7 @@ This version of Playwright was also tested against the following stable channels [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/running-tests.mdx b/python/docs/running-tests.mdx index a6a1eb96e0..9ecc97c807 100644 --- a/python/docs/running-tests.mdx +++ b/python/docs/running-tests.mdx @@ -240,6 +240,7 @@ Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/screenshots.mdx b/python/docs/screenshots.mdx index f77f875c15..2e786671cf 100644 --- a/python/docs/screenshots.mdx +++ b/python/docs/screenshots.mdx @@ -160,6 +160,7 @@ await page.locator(".header").screenshot(path="screenshot.png") [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/selenium-grid.mdx b/python/docs/selenium-grid.mdx index fec6d21599..ceb2d91b28 100644 --- a/python/docs/selenium-grid.mdx +++ b/python/docs/selenium-grid.mdx @@ -160,6 +160,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/test-assertions.mdx b/python/docs/test-assertions.mdx index 417ee20545..cdb9609f38 100644 --- a/python/docs/test-assertions.mdx +++ b/python/docs/test-assertions.mdx @@ -118,6 +118,7 @@ def test_foobar(page: Page) -> None: [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/test-runners.mdx b/python/docs/test-runners.mdx index 1a15adc38a..fcdbd74eac 100644 --- a/python/docs/test-runners.mdx +++ b/python/docs/test-runners.mdx @@ -285,6 +285,7 @@ See the [guides for CI providers](./ci.mdx) to deploy your tests to CI/CD. [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/trace-viewer-intro.mdx b/python/docs/trace-viewer-intro.mdx index f3a72c35c9..9434384794 100644 --- a/python/docs/trace-viewer-intro.mdx +++ b/python/docs/trace-viewer-intro.mdx @@ -27,7 +27,7 @@ Options for tracing are: - `off`: Do not record trace. (default) - `retain-on-failure`: Record trace for each test, but remove all traces from successful test runs. -This will record the trace and place it into the file named `trace.pwtrace.zip` in your `test-results` directory. +This will record the trace and place it into the file named `trace.zip` in your `test-results` directory.
@@ -54,7 +54,7 @@ page = context.new_page() page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -context.tracing.stop(path = "trace.pwtrace.zip") +context.tracing.stop(path = "trace.zip") ``` @@ -71,7 +71,7 @@ page = await context.new_page() await page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -await context.tracing.stop(path = "trace.pwtrace.zip") +await context.tracing.stop(path = "trace.zip") ``` @@ -84,7 +84,7 @@ await context.tracing.stop(path = "trace.pwtrace.zip") You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your trace's zip file is located. Once opened you can click on each action or use the timeline to see the state of the page before and after each action. You can also inspect the log, source and network during each step of the test. The trace viewer creates a DOM snapshot so you can fully interact with it, open devtools etc. ```bash -playwright show-trace trace.pwtrace.zip +playwright show-trace trace.zip ``` ###### @@ -133,6 +133,7 @@ To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/trace-viewer.mdx b/python/docs/trace-viewer.mdx index 1bf84b1a9f..636d02c5a9 100644 --- a/python/docs/trace-viewer.mdx +++ b/python/docs/trace-viewer.mdx @@ -114,7 +114,7 @@ Options for tracing are: - `off`: Do not record trace. (default) - `retain-on-failure`: Record trace for each test, but remove all traces from successful test runs. -This will record the trace and place it into the file named `trace.pwtrace.zip` in your `test-results` directory. +This will record the trace and place it into the file named `trace.zip` in your `test-results` directory.
@@ -141,7 +141,7 @@ page = context.new_page() page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -context.tracing.stop(path = "trace.pwtrace.zip") +context.tracing.stop(path = "trace.zip") ``` @@ -158,7 +158,7 @@ page = await context.new_page() await page.goto("https://playwright.dev") # Stop tracing and export it into a zip archive. -await context.tracing.stop(path = "trace.pwtrace.zip") +await context.tracing.stop(path = "trace.zip") ``` @@ -168,10 +168,10 @@ await context.tracing.stop(path = "trace.pwtrace.zip") ## Opening the trace -You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.pwtrace.zip` file is located. +You can open the saved trace using the Playwright CLI or in your browser on [`trace.playwright.dev`](https://trace.playwright.dev). Make sure to add the full path to where your `trace.zip` file is located. ```bash -playwright show-trace trace.pwtrace.zip +playwright show-trace trace.zip ``` ## Using [trace.playwright.dev](https://trace.playwright.dev) @@ -185,7 +185,7 @@ playwright show-trace trace.pwtrace.zip You can open remote traces using its URL. They could be generated on a CI run which makes it easy to view the remote trace without having to manually download the file. ```bash -playwright show-trace https://example.com/trace.pwtrace.zip +playwright show-trace https://example.com/trace.zip ``` You can also pass the URL of your uploaded trace (e.g. inside your CI) from some accessible storage as a parameter. CORS (Cross-Origin Resource Sharing) rules might apply. @@ -231,6 +231,7 @@ https://trace.playwright.dev/?trace=https://demo.playwright.dev/reports/todomvc/ [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/videos.mdx b/python/docs/videos.mdx index 207c5f5e16..71930055be 100644 --- a/python/docs/videos.mdx +++ b/python/docs/videos.mdx @@ -141,6 +141,7 @@ Note that the video is only available after the page or browser context is close [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/webview2.mdx b/python/docs/webview2.mdx index 5643d6f56d..8eafdf6fc1 100644 --- a/python/docs/webview2.mdx +++ b/python/docs/webview2.mdx @@ -206,6 +206,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" diff --git a/python/docs/writing-tests.mdx b/python/docs/writing-tests.mdx index c0df69b0e5..873d564fe5 100644 --- a/python/docs/writing-tests.mdx +++ b/python/docs/writing-tests.mdx @@ -204,6 +204,7 @@ def test_main_navigation(page: Page): [Video]: /api/class-video.mdx "Video" [WebError]: /api/class-weberror.mdx "WebError" [WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" [Worker]: /api/class-worker.mdx "Worker" [Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" [EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument"