From 7384dde3cdd3e100634db2b1ec7b5a01ab85a2ad Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:13:19 +0000 Subject: [PATCH] feat(roll): roll to 1.48 Playwright --- .../version-stable/actionability.mdx | 1 + .../version-stable/api-testing.mdx | 1 + .../api/class-accessibility.mdx | 4 +- .../version-stable/api/class-apirequest.mdx | 4 +- .../api/class-apirequestcontext.mdx | 19 +- .../version-stable/api/class-apiresponse.mdx | 1 + .../api/class-apiresponseassertions.mdx | 1 + .../version-stable/api/class-browser.mdx | 20 +- .../api/class-browsercontext.mdx | 75 +++- .../version-stable/api/class-browsertype.mdx | 38 +- .../version-stable/api/class-cdpsession.mdx | 1 + .../api/class-cdpsessionevent.mdx | 1 + .../version-stable/api/class-clock.mdx | 3 +- .../api/class-consolemessage.mdx | 1 + .../version-stable/api/class-dialog.mdx | 1 + .../version-stable/api/class-download.mdx | 1 + .../api/class-elementhandle.mdx | 84 ++-- .../version-stable/api/class-filechooser.mdx | 1 + .../version-stable/api/class-formdata.mdx | 1 + .../version-stable/api/class-frame.mdx | 160 ++++---- .../version-stable/api/class-framelocator.mdx | 145 ++++--- .../version-stable/api/class-jshandle.mdx | 16 +- .../version-stable/api/class-keyboard.mdx | 18 +- .../version-stable/api/class-locator.mdx | 137 ++++--- .../api/class-locatorassertions.mdx | 11 +- .../version-stable/api/class-mouse.mdx | 2 + .../version-stable/api/class-page.mdx | 306 +++++++++----- .../api/class-pageassertions.mdx | 9 +- .../version-stable/api/class-playwright.mdx | 1 + .../api/class-playwrightassertions.mdx | 1 + .../version-stable/api/class-request.mdx | 2 + .../version-stable/api/class-response.mdx | 1 + .../version-stable/api/class-route.mdx | 5 +- .../version-stable/api/class-selectors.mdx | 1 + .../version-stable/api/class-timeouterror.mdx | 1 + .../version-stable/api/class-touchscreen.mdx | 6 +- .../version-stable/api/class-tracing.mdx | 5 +- .../version-stable/api/class-video.mdx | 1 + .../version-stable/api/class-weberror.mdx | 1 + .../version-stable/api/class-websocket.mdx | 1 + .../api/class-websocketframe.mdx | 1 + .../api/class-websocketroute.mdx | 278 +++++++++++++ .../version-stable/api/class-worker.mdx | 9 +- dotnet/versioned_docs/version-stable/auth.mdx | 1 + .../version-stable/browser-contexts.mdx | 1 + .../version-stable/browsers.mdx | 9 +- .../version-stable/ci-intro.mdx | 5 +- dotnet/versioned_docs/version-stable/ci.mdx | 4 +- .../versioned_docs/version-stable/clock.mdx | 15 +- .../version-stable/codegen-intro.mdx | 1 + .../versioned_docs/version-stable/codegen.mdx | 1 + .../versioned_docs/version-stable/debug.mdx | 4 +- .../versioned_docs/version-stable/dialogs.mdx | 4 +- .../versioned_docs/version-stable/docker.mdx | 3 + .../version-stable/downloads.mdx | 5 +- .../version-stable/emulation.mdx | 1 + .../version-stable/evaluating.mdx | 1 + .../versioned_docs/version-stable/events.mdx | 1 + .../version-stable/extensibility.mdx | 1 + .../versioned_docs/version-stable/frames.mdx | 1 + .../versioned_docs/version-stable/handles.mdx | 3 + .../versioned_docs/version-stable/input.mdx | 2 + .../versioned_docs/version-stable/intro.mdx | 1 + .../version-stable/languages.mdx | 1 + .../versioned_docs/version-stable/library.mdx | 3 +- .../version-stable/locators.mdx | 4 + dotnet/versioned_docs/version-stable/mock.mdx | 1 + .../version-stable/navigations.mdx | 2 + .../versioned_docs/version-stable/network.mdx | 22 +- .../version-stable/other-locators.mdx | 17 + .../versioned_docs/version-stable/pages.mdx | 1 + dotnet/versioned_docs/version-stable/pom.mdx | 1 + .../version-stable/release-notes.mdx | 62 ++- .../version-stable/running-tests.mdx | 1 + .../version-stable/screenshots.mdx | 1 + .../version-stable/selenium-grid.mdx | 16 +- .../version-stable/test-assertions.mdx | 1 + .../version-stable/test-runners.mdx | 1 + .../version-stable/trace-viewer-intro.mdx | 1 + .../version-stable/trace-viewer.mdx | 7 +- .../versioned_docs/version-stable/videos.mdx | 1 + .../version-stable/webview2.mdx | 1 + .../version-stable/writing-tests.mdx | 1 + .../version-stable-sidebars.json | 4 + .../version-stable/accessibility-testing.mdx | 1 + .../version-stable/actionability.mdx | 1 + .../version-stable/api-testing.mdx | 1 + .../version-stable/api/class-apirequest.mdx | 4 +- .../api/class-apirequestcontext.mdx | 5 +- .../version-stable/api/class-apiresponse.mdx | 1 + .../api/class-apiresponseassertions.mdx | 1 + .../version-stable/api/class-browser.mdx | 18 +- .../api/class-browsercontext.mdx | 67 +++- .../version-stable/api/class-browsertype.mdx | 36 +- .../version-stable/api/class-cdpsession.mdx | 1 + .../version-stable/api/class-clock.mdx | 1 + .../api/class-consolemessage.mdx | 1 + .../version-stable/api/class-dialog.mdx | 1 + .../version-stable/api/class-download.mdx | 1 + .../api/class-elementhandle.mdx | 82 ++-- .../version-stable/api/class-filechooser.mdx | 1 + .../version-stable/api/class-formdata.mdx | 1 + .../version-stable/api/class-frame.mdx | 148 +++---- .../version-stable/api/class-framelocator.mdx | 139 ++++--- .../version-stable/api/class-jshandle.mdx | 16 +- .../version-stable/api/class-keyboard.mdx | 18 +- .../version-stable/api/class-locator.mdx | 125 +++--- .../api/class-locatorassertions.mdx | 11 +- .../version-stable/api/class-mouse.mdx | 2 + .../version-stable/api/class-page.mdx | 287 +++++++++----- .../api/class-pageassertions.mdx | 3 +- .../version-stable/api/class-playwright.mdx | 1 + .../api/class-playwrightassertions.mdx | 1 + .../api/class-playwrightexception.mdx | 1 + .../version-stable/api/class-request.mdx | 2 + .../api/class-requestoptions.mdx | 1 + .../version-stable/api/class-response.mdx | 1 + .../version-stable/api/class-route.mdx | 5 +- .../version-stable/api/class-selectors.mdx | 1 + .../version-stable/api/class-timeouterror.mdx | 1 + .../version-stable/api/class-touchscreen.mdx | 6 +- .../version-stable/api/class-tracing.mdx | 5 +- .../version-stable/api/class-video.mdx | 1 + .../version-stable/api/class-weberror.mdx | 1 + .../version-stable/api/class-websocket.mdx | 1 + .../api/class-websocketframe.mdx | 1 + .../api/class-websocketroute.mdx | 281 +++++++++++++ .../version-stable/api/class-worker.mdx | 9 +- java/versioned_docs/version-stable/auth.mdx | 1 + .../version-stable/browser-contexts.mdx | 1 + .../version-stable/browsers.mdx | 9 +- .../version-stable/ci-intro.mdx | 5 +- java/versioned_docs/version-stable/ci.mdx | 16 +- java/versioned_docs/version-stable/clock.mdx | 15 +- .../version-stable/codegen-intro.mdx | 1 + .../versioned_docs/version-stable/codegen.mdx | 1 + java/versioned_docs/version-stable/debug.mdx | 4 +- .../versioned_docs/version-stable/dialogs.mdx | 4 +- java/versioned_docs/version-stable/docker.mdx | 17 +- .../version-stable/downloads.mdx | 5 +- .../version-stable/emulation.mdx | 1 + .../version-stable/evaluating.mdx | 1 + java/versioned_docs/version-stable/events.mdx | 1 + .../version-stable/extensibility.mdx | 1 + java/versioned_docs/version-stable/frames.mdx | 1 + .../versioned_docs/version-stable/handles.mdx | 3 + java/versioned_docs/version-stable/input.mdx | 2 + java/versioned_docs/version-stable/intro.mdx | 5 +- java/versioned_docs/version-stable/junit.mdx | 1 + .../version-stable/languages.mdx | 1 + .../version-stable/locators.mdx | 4 + java/versioned_docs/version-stable/mock.mdx | 1 + .../version-stable/navigations.mdx | 2 + .../versioned_docs/version-stable/network.mdx | 22 +- .../version-stable/other-locators.mdx | 17 + java/versioned_docs/version-stable/pages.mdx | 1 + java/versioned_docs/version-stable/pom.mdx | 1 + .../version-stable/release-notes.mdx | 62 ++- .../version-stable/running-tests.mdx | 1 + .../version-stable/screenshots.mdx | 1 + .../version-stable/selenium-grid.mdx | 16 +- .../version-stable/test-assertions.mdx | 1 + .../version-stable/test-runners.mdx | 5 +- .../version-stable/threading.mdx | 1 + .../version-stable/trace-viewer-intro.mdx | 1 + .../version-stable/trace-viewer.mdx | 7 +- java/versioned_docs/version-stable/videos.mdx | 1 + .../version-stable/webview2.mdx | 1 + .../version-stable/writing-tests.mdx | 1 + .../version-stable-sidebars.json | 4 + .../version-stable/accessibility-testing.mdx | 8 +- .../version-stable/actionability.mdx | 3 +- .../version-stable/api-testing.mdx | 3 +- .../api/class-accessibility.mdx | 6 +- .../version-stable/api/class-android.mdx | 6 +- .../api/class-androiddevice.mdx | 45 ++- .../version-stable/api/class-androidinput.mdx | 15 +- .../api/class-androidsocket.mdx | 5 +- .../api/class-androidwebview.mdx | 3 +- .../version-stable/api/class-apirequest.mdx | 6 +- .../api/class-apirequestcontext.mdx | 21 +- .../version-stable/api/class-apiresponse.mdx | 3 +- .../api/class-apiresponseassertions.mdx | 3 +- .../version-stable/api/class-browser.mdx | 32 +- .../api/class-browsercontext.mdx | 73 +++- .../api/class-browserserver.mdx | 3 +- .../version-stable/api/class-browsertype.mdx | 50 +-- .../version-stable/api/class-cdpsession.mdx | 3 +- .../version-stable/api/class-clock.mdx | 3 +- .../api/class-consolemessage.mdx | 3 +- .../version-stable/api/class-coverage.mdx | 9 +- .../version-stable/api/class-dialog.mdx | 3 +- .../version-stable/api/class-download.mdx | 3 +- .../version-stable/api/class-electron.mdx | 7 +- .../api/class-electronapplication.mdx | 11 +- .../api/class-elementhandle.mdx | 84 ++-- .../version-stable/api/class-filechooser.mdx | 3 +- .../version-stable/api/class-fixtures.mdx | 3 +- .../version-stable/api/class-frame.mdx | 150 +++---- .../version-stable/api/class-framelocator.mdx | 141 ++++--- .../version-stable/api/class-fullconfig.mdx | 3 +- .../version-stable/api/class-fullproject.mdx | 3 +- .../api/class-genericassertions.mdx | 19 +- .../version-stable/api/class-jshandle.mdx | 18 +- .../version-stable/api/class-keyboard.mdx | 20 +- .../version-stable/api/class-location.mdx | 3 +- .../version-stable/api/class-locator.mdx | 127 +++--- .../api/class-locatorassertions.mdx | 17 +- .../version-stable/api/class-logger.mdx | 3 +- .../version-stable/api/class-mouse.mdx | 4 +- .../version-stable/api/class-page.mdx | 286 +++++++++----- .../api/class-pageassertions.mdx | 9 +- .../version-stable/api/class-playwright.mdx | 3 +- .../api/class-playwrightassertions.mdx | 3 +- .../version-stable/api/class-reporter.mdx | 3 +- .../version-stable/api/class-request.mdx | 4 +- .../version-stable/api/class-response.mdx | 3 +- .../version-stable/api/class-route.mdx | 7 +- .../version-stable/api/class-selectors.mdx | 3 +- .../api/class-snapshotassertions.mdx | 5 +- .../version-stable/api/class-suite.mdx | 3 +- .../version-stable/api/class-test.mdx | 9 +- .../version-stable/api/class-testcase.mdx | 3 +- .../version-stable/api/class-testconfig.mdx | 12 +- .../version-stable/api/class-testerror.mdx | 3 +- .../version-stable/api/class-testinfo.mdx | 19 +- .../api/class-testinfoerror.mdx | 3 +- .../version-stable/api/class-testoptions.mdx | 10 +- .../version-stable/api/class-testproject.mdx | 11 +- .../version-stable/api/class-testresult.mdx | 3 +- .../version-stable/api/class-teststep.mdx | 3 +- .../version-stable/api/class-timeouterror.mdx | 3 +- .../version-stable/api/class-touchscreen.mdx | 8 +- .../version-stable/api/class-tracing.mdx | 7 +- .../version-stable/api/class-video.mdx | 3 +- .../version-stable/api/class-weberror.mdx | 3 +- .../version-stable/api/class-websocket.mdx | 3 +- .../api/class-websocketroute.mdx | 308 +++++++++++++++ .../version-stable/api/class-worker.mdx | 11 +- .../version-stable/api/class-workerinfo.mdx | 3 +- nodejs/versioned_docs/version-stable/auth.mdx | 3 +- .../version-stable/best-practices.mdx | 3 +- .../version-stable/browser-contexts.mdx | 3 +- .../version-stable/browsers.mdx | 12 +- .../version-stable/canary-releases.mdx | 8 +- .../version-stable/chrome-extensions.mdx | 5 +- .../version-stable/ci-intro.mdx | 8 +- nodejs/versioned_docs/version-stable/ci.mdx | 34 +- .../versioned_docs/version-stable/clock.mdx | 17 +- .../version-stable/codegen-intro.mdx | 3 +- .../versioned_docs/version-stable/codegen.mdx | 3 +- .../versioned_docs/version-stable/debug.mdx | 6 +- .../versioned_docs/version-stable/dialogs.mdx | 6 +- .../versioned_docs/version-stable/docker.mdx | 21 +- .../version-stable/downloads.mdx | 7 +- .../version-stable/emulation.mdx | 3 +- .../version-stable/evaluating.mdx | 3 +- .../versioned_docs/version-stable/events.mdx | 3 +- .../version-stable/extensibility.mdx | 3 +- .../versioned_docs/version-stable/frames.mdx | 3 +- .../version-stable/getting-started-vscode.mdx | 3 +- .../versioned_docs/version-stable/handles.mdx | 5 +- .../versioned_docs/version-stable/input.mdx | 4 +- .../versioned_docs/version-stable/intro.mdx | 3 +- .../version-stable/languages.mdx | 3 +- .../versioned_docs/version-stable/library.mdx | 3 +- .../version-stable/locators.mdx | 6 +- .../version-stable/mock-browser.mdx | 3 +- nodejs/versioned_docs/version-stable/mock.mdx | 3 +- .../version-stable/navigations.mdx | 4 +- .../versioned_docs/version-stable/network.mdx | 24 +- .../version-stable/other-locators.mdx | 19 +- .../versioned_docs/version-stable/pages.mdx | 3 +- nodejs/versioned_docs/version-stable/pom.mdx | 3 +- .../version-stable/protractor.mdx | 3 +- .../version-stable/puppeteer.mdx | 3 +- .../version-stable/release-notes.mdx | 66 +++- .../version-stable/running-tests.mdx | 3 +- .../version-stable/screenshots.mdx | 3 +- .../version-stable/selenium-grid.mdx | 18 +- ...ce-workers-experimental-network-events.mdx | 5 +- .../version-stable/test-annotations.mdx | 3 +- .../version-stable/test-assertions.mdx | 4 +- .../version-stable/test-cli.mdx | 3 +- .../version-stable/test-components.mdx | 183 ++++++--- .../version-stable/test-configuration.mdx | 3 +- .../version-stable/test-fixtures.mdx | 3 +- .../test-global-setup-teardown.mdx | 4 +- .../version-stable/test-parallel.mdx | 5 +- .../version-stable/test-parameterize.mdx | 4 +- .../version-stable/test-projects.mdx | 3 +- .../version-stable/test-reporters.mdx | 3 +- .../version-stable/test-retries.mdx | 4 +- .../version-stable/test-sharding.mdx | 7 +- .../version-stable/test-snapshots.mdx | 3 +- .../version-stable/test-timeouts.mdx | 3 +- .../version-stable/test-typescript.mdx | 3 +- .../version-stable/test-ui-mode.mdx | 3 +- .../version-stable/test-use-options.mdx | 4 +- .../version-stable/test-webserver.mdx | 3 +- .../version-stable/testing-library.mdx | 4 +- .../version-stable/trace-viewer-intro.mdx | 3 +- .../version-stable/trace-viewer.mdx | 9 +- .../versioned_docs/version-stable/videos.mdx | 3 +- .../version-stable/webview2.mdx | 3 +- .../version-stable/writing-tests.mdx | 3 +- .../version-stable-sidebars.json | 4 + .../version-stable/actionability.mdx | 1 + .../version-stable/api-testing.mdx | 1 + .../api/class-accessibility.mdx | 4 +- .../version-stable/api/class-apirequest.mdx | 4 +- .../api/class-apirequestcontext.mdx | 5 +- .../version-stable/api/class-apiresponse.mdx | 1 + .../api/class-apiresponseassertions.mdx | 1 + .../version-stable/api/class-browser.mdx | 16 +- .../api/class-browsercontext.mdx | 104 ++++- .../version-stable/api/class-browsertype.mdx | 31 +- .../version-stable/api/class-cdpsession.mdx | 1 + .../version-stable/api/class-clock.mdx | 1 + .../api/class-consolemessage.mdx | 1 + .../version-stable/api/class-dialog.mdx | 2 + .../version-stable/api/class-download.mdx | 1 + .../api/class-elementhandle.mdx | 83 ++-- .../version-stable/api/class-error.mdx | 1 + .../version-stable/api/class-filechooser.mdx | 1 + .../version-stable/api/class-frame.mdx | 149 +++---- .../version-stable/api/class-framelocator.mdx | 125 +++--- .../version-stable/api/class-jshandle.mdx | 16 +- .../version-stable/api/class-keyboard.mdx | 20 +- .../version-stable/api/class-locator.mdx | 125 +++--- .../api/class-locatorassertions.mdx | 21 +- .../version-stable/api/class-mouse.mdx | 2 + .../version-stable/api/class-page.mdx | 341 +++++++++++----- .../api/class-pageassertions.mdx | 5 +- .../version-stable/api/class-playwright.mdx | 1 + .../version-stable/api/class-request.mdx | 2 + .../version-stable/api/class-response.mdx | 1 + .../version-stable/api/class-route.mdx | 5 +- .../version-stable/api/class-selectors.mdx | 1 + .../version-stable/api/class-timeouterror.mdx | 1 + .../version-stable/api/class-touchscreen.mdx | 6 +- .../version-stable/api/class-tracing.mdx | 5 +- .../version-stable/api/class-video.mdx | 1 + .../version-stable/api/class-weberror.mdx | 1 + .../version-stable/api/class-websocket.mdx | 2 + .../api/class-websocketroute.mdx | 372 ++++++++++++++++++ .../version-stable/api/class-worker.mdx | 9 +- python/versioned_docs/version-stable/auth.mdx | 1 + .../version-stable/browser-contexts.mdx | 1 + .../version-stable/browsers.mdx | 9 +- .../version-stable/chrome-extensions.mdx | 3 + .../version-stable/ci-intro.mdx | 5 +- python/versioned_docs/version-stable/ci.mdx | 4 +- .../versioned_docs/version-stable/clock.mdx | 15 +- .../version-stable/codegen-intro.mdx | 1 + .../versioned_docs/version-stable/codegen.mdx | 1 + .../versioned_docs/version-stable/debug.mdx | 4 +- .../versioned_docs/version-stable/dialogs.mdx | 6 +- .../versioned_docs/version-stable/docker.mdx | 3 + .../version-stable/downloads.mdx | 5 +- .../version-stable/emulation.mdx | 1 + .../version-stable/evaluating.mdx | 1 + .../versioned_docs/version-stable/events.mdx | 1 + .../version-stable/extensibility.mdx | 1 + .../versioned_docs/version-stable/frames.mdx | 1 + .../versioned_docs/version-stable/handles.mdx | 3 + .../versioned_docs/version-stable/input.mdx | 3 + .../versioned_docs/version-stable/intro.mdx | 1 + .../version-stable/languages.mdx | 1 + .../versioned_docs/version-stable/library.mdx | 4 +- .../version-stable/locators.mdx | 12 + python/versioned_docs/version-stable/mock.mdx | 1 + .../version-stable/navigations.mdx | 2 + .../versioned_docs/version-stable/network.mdx | 22 +- .../version-stable/other-locators.mdx | 20 + .../versioned_docs/version-stable/pages.mdx | 1 + python/versioned_docs/version-stable/pom.mdx | 1 + .../version-stable/release-notes.mdx | 63 ++- .../version-stable/running-tests.mdx | 1 + .../version-stable/screenshots.mdx | 1 + .../version-stable/selenium-grid.mdx | 16 +- .../version-stable/test-assertions.mdx | 1 + .../version-stable/test-runners.mdx | 1 + .../version-stable/trace-viewer-intro.mdx | 1 + .../version-stable/trace-viewer.mdx | 7 +- .../versioned_docs/version-stable/videos.mdx | 2 + .../version-stable/webview2.mdx | 1 + .../version-stable/writing-tests.mdx | 1 + .../version-stable-sidebars.json | 4 + 389 files changed, 5134 insertions(+), 1993 deletions(-) create mode 100644 dotnet/versioned_docs/version-stable/api/class-websocketroute.mdx create mode 100644 java/versioned_docs/version-stable/api/class-websocketroute.mdx create mode 100644 nodejs/versioned_docs/version-stable/api/class-websocketroute.mdx create mode 100644 python/versioned_docs/version-stable/api/class-websocketroute.mdx diff --git a/dotnet/versioned_docs/version-stable/actionability.mdx b/dotnet/versioned_docs/version-stable/actionability.mdx index a8f40510cc..a3c4dd04af 100644 --- a/dotnet/versioned_docs/version-stable/actionability.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api-testing.mdx b/dotnet/versioned_docs/version-stable/api-testing.mdx index 972c711b5c..ee11ed6ae4 100644 --- a/dotnet/versioned_docs/version-stable/api-testing.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-accessibility.mdx b/dotnet/versioned_docs/version-stable/api/class-accessibility.mdx index d800e5a56e..fd17197b10 100644 --- a/dotnet/versioned_docs/version-stable/api/class-accessibility.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-accessibility.mdx @@ -34,7 +34,8 @@ This method is deprecated. Please use other libraries such as [Axe](https://www. Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. :::note -The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`. + +The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless [InterestingOnly](/api/class-accessibility.mdx#accessibility-snapshot-option-interesting-only) is set to `false`. ::: **Usage** @@ -105,6 +106,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/versioned_docs/version-stable/api/class-apirequest.mdx b/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx index 4a111b83bc..786cc84283 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx @@ -67,10 +67,7 @@ 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 +163,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/versioned_docs/version-stable/api/class-apirequestcontext.mdx b/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx index 8b098bb503..27df4c8142 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx @@ -56,7 +56,7 @@ await ApiRequestContext.DeleteAsync(url, options); Target URL. - `options` `ApiRequestContextDeleteOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)* Added in: v1.17# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)* Added in: v1.17# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -140,7 +140,7 @@ var data = new Dictionary() { await Request.FetchAsync("https://example.com/api/createBook", new() { Method = "post", DataObject = data }); ``` -The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. Use [FormData] to construct request body and pass it to the request as `multipart` parameter: +The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding, by specifiying the `multipart` parameter: ```csharp var file = new FilePayload() @@ -159,7 +159,7 @@ await Request.FetchAsync("https://example.com/api/uploadScript", new() { Method Target URL or Request to get all parameters from. - `options` `ApiRequestContextFetchOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -229,7 +229,7 @@ await request.GetAsync("https://example.com/api/getText", new() { Params = query Target URL. - `options` `ApiRequestContextGetOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)* Added in: v1.26# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)* Added in: v1.26# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -289,7 +289,7 @@ await ApiRequestContext.HeadAsync(url, options); Target URL. - `options` `ApiRequestContextHeadOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)* Added in: v1.26# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)* Added in: v1.26# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -349,7 +349,7 @@ await ApiRequestContext.PatchAsync(url, options); Target URL. - `options` `ApiRequestContextPatchOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -438,7 +438,7 @@ await request.PostAsync("https://example.com/api/uploadScript", new() { Multipar Target URL. - `options` `ApiRequestContextPostOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -498,7 +498,7 @@ await ApiRequestContext.PutAsync(url, options); Target URL. - `options` `ApiRequestContextPutOptions?` *(optional)* - - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# + - `Data|DataByte|DataObject` [string]? | [byte][]? | [object]? *(optional)*# Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be set to `application/octet-stream` if not explicitly set. - `FailOnStatusCode` [bool]? *(optional)*# @@ -557,7 +557,7 @@ await ApiRequestContext.StorageStateAsync(options); - `options` `ApiRequestContextStorageStateOptions?` *(optional)* - `Path` [string]? *(optional)*# - The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. + The file path to save the storage state to. If [Path](/api/class-apirequestcontext.mdx#api-request-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. **Returns** - [string]# @@ -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/versioned_docs/version-stable/api/class-apiresponse.mdx b/dotnet/versioned_docs/version-stable/api/class-apiresponse.mdx index 16d6526359..ed72084067 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apiresponse.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-apiresponseassertions.mdx b/dotnet/versioned_docs/version-stable/api/class-apiresponseassertions.mdx index ce70f954c1..1b327b23d9 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apiresponseassertions.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-browser.mdx b/dotnet/versioned_docs/version-stable/api/class-browser.mdx index bd0d3f0655..39641cbc10 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browser.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browser.mdx @@ -51,6 +51,7 @@ In case this browser is obtained using [BrowserType.LaunchAsync()](/api/class-br In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the browser server. :::note + This is similar to force quitting the browser. Therefore, you should call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) on any [BrowserContext]'s you explicitly created earlier with [Browser.NewContextAsync()](/api/class-browser.mdx#browser-new-context) **before** calling [Browser.CloseAsync()](/api/class-browser.mdx#browser-close). ::: @@ -116,6 +117,7 @@ Browser.IsConnected Added in: v1.11browser.NewBrowserCDPSessionAsync :::note + CDP Sessions are only supported on Chromium-based browsers. ::: @@ -139,6 +141,7 @@ await Browser.NewBrowserCDPSessionAsync(); Creates a new browser context. It won't share cookies/cache with other browser contexts. :::note + If directly using this method to create [BrowserContext]s, it is best practice to explicitly close the returned context via [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) when your code is done with the [BrowserContext], and before calling [Browser.CloseAsync()](/api/class-browser.mdx#browser-close). This will ensure the `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved. ::: @@ -205,10 +208,7 @@ 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`. ::: @@ -297,7 +297,7 @@ await browser.CloseAsync(); - `RecordHarPath` [string]? *(optional)*# Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - - `RecordHarUrlFilter|RecordHarUrlFilterRegex` [string]? | [Regex]? *(optional)*# + - `RecordHarUrlFilter|RecordHarUrlFilterRegex` [string]? | [Regex]? *(optional)*# - `RecordVideoDir` [string]? *(optional)*# Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. @@ -321,7 +321,7 @@ await browser.CloseAsync(); page height in pixels. - Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set. + Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the [ViewportSize](/api/class-browser.mdx#browser-new-context-option-viewport) is set. - `ServiceWorkers` `enum ServiceWorkerPolicy { Allow, Block }?` *(optional)*# Whether to allow sites to register Service workers. Defaults to `'allow'`. @@ -353,6 +353,7 @@ await browser.CloseAsync(); Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.mdx#viewport). :::note + The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host window size defined by the operating system. It makes the execution of the tests non-deterministic. ::: @@ -422,10 +423,7 @@ 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`. ::: @@ -514,7 +512,7 @@ await Browser.NewPageAsync(options); - `RecordHarPath` [string]? *(optional)*# Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - - `RecordHarUrlFilter|RecordHarUrlFilterRegex` [string]? | [Regex]? *(optional)*# + - `RecordHarUrlFilter|RecordHarUrlFilterRegex` [string]? | [Regex]? *(optional)*# - `RecordVideoDir` [string]? *(optional)*# Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. @@ -538,7 +536,7 @@ await Browser.NewPageAsync(options); page height in pixels. - Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set. + Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the [ViewportSize](/api/class-browser.mdx#browser-new-page-option-viewport) is set. - `ServiceWorkers` `enum ServiceWorkerPolicy { Allow, Block }?` *(optional)*# Whether to allow sites to register Service workers. Defaults to `'allow'`. @@ -570,6 +568,7 @@ await Browser.NewPageAsync(options); Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.mdx#viewport). :::note + The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host window size defined by the operating system. It makes the execution of the tests non-deterministic. ::: @@ -654,6 +653,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/versioned_docs/version-stable/api/class-browsercontext.mdx b/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx index 93bddd411c..52c3809a3c 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx @@ -119,6 +119,7 @@ The order of evaluation of multiple scripts installed via [BrowserContext.AddIni Added in: v1.11browserContext.BackgroundPages :::note + Background pages are only supported on Chromium-based browsers. ::: @@ -170,13 +171,13 @@ await context.ClearCookiesAsync(new() { Name = "session-id", Domain = "my-origin **Arguments** - `options` `BrowserContextClearCookiesOptions?` *(optional)* - - `Domain|DomainRegex` [string]? | [Regex]? *(optional)* Added in: v1.43# + - `Domain|DomainRegex` [string]? | [Regex]? *(optional)* Added in: v1.43# Only removes cookies with the given domain. - - `Name|NameRegex` [string]? | [Regex]? *(optional)* Added in: v1.43# + - `Name|NameRegex` [string]? | [Regex]? *(optional)* Added in: v1.43# Only removes cookies with the given name. - - `Path|PathRegex` [string]? | [Regex]? *(optional)* Added in: v1.43# + - `Path|PathRegex` [string]? | [Regex]? *(optional)* Added in: v1.43# Only removes cookies with the given path. @@ -214,6 +215,7 @@ await context.ClearPermissionsAsync(); Closes the browser context. All the pages that belong to the browser context will be closed. :::note + The default browser context cannot be closed. ::: @@ -283,9 +285,9 @@ await BrowserContext.CookiesAsync(urls); Added before v1.9browserContext.ExposeBindingAsync -The method adds a function called `name` on the `window` object of every frame in every page in the context. When called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the `callback` returns a [Promise], it will be awaited. +The method adds a function called [name](/api/class-browsercontext.mdx#browser-context-expose-binding-option-name) on the `window` object of every frame in every page in the context. When called, the function executes [callback](/api/class-browsercontext.mdx#browser-context-expose-binding-option-callback) and returns a [Promise] which resolves to the return value of [callback](/api/class-browsercontext.mdx#browser-context-expose-binding-option-callback). If the [callback](/api/class-browsercontext.mdx#browser-context-expose-binding-option-callback) returns a [Promise], it will be awaited. -The first argument of the `callback` function contains information about the caller: `{ browserContext: BrowserContext, page: Page, frame: Frame }`. +The first argument of the [callback](/api/class-browsercontext.mdx#browser-context-expose-binding-option-callback) function contains information about the caller: `{ browserContext: BrowserContext, page: Page, frame: Frame }`. See [Page.ExposeBindingAsync()](/api/class-page.mdx#page-expose-binding) for page-only version. @@ -338,9 +340,9 @@ await page.GetByRole(AriaRole.Button).ClickAsync(); Added before v1.9browserContext.ExposeFunctionAsync -The method adds a function called `name` on the `window` object of every frame in every page in the context. When called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. +The method adds a function called [name](/api/class-browsercontext.mdx#browser-context-expose-function-option-name) on the `window` object of every frame in every page in the context. When called, the function executes [callback](/api/class-browsercontext.mdx#browser-context-expose-function-option-callback) and returns a [Promise] which resolves to the return value of [callback](/api/class-browsercontext.mdx#browser-context-expose-function-option-callback). -If the `callback` returns a [Promise], it will be awaited. +If the [callback](/api/class-browsercontext.mdx#browser-context-expose-function-option-callback) returns a [Promise], it will be awaited. See [Page.ExposeFunctionAsync()](/api/class-page.mdx#page-expose-function) for page-only version. @@ -443,6 +445,7 @@ await BrowserContext.GrantPermissionsAsync(permissions, options); Added in: v1.11browserContext.NewCDPSessionAsync :::note + CDP sessions are only supported on Chromium-based browsers. ::: @@ -505,7 +508,8 @@ BrowserContext.Pages Routing provides the capability to modify network requests that are made by any page in the browser context. Once route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. :::note -[BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route) will not intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`. + +[BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route) will not intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting [ServiceWorkers](/api/class-browser.mdx#browser-new-context-option-service-workers) to `'block'`. ::: **Usage** @@ -547,13 +551,14 @@ Page routes (set up with [Page.RouteAsync()](/api/class-page.mdx#page-route)) ta To remove a route with its handler you can use [BrowserContext.UnrouteAsync()](/api/class-browsercontext.mdx#browser-context-unroute). :::note + Enabling routing disables http cache. ::: **Arguments** - `url` [string] | [Regex] | [Func]<[string], bool># - A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. + A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a [BaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. - `handler` [Action]<[Route]># handler function to route the request. @@ -573,7 +578,7 @@ Enabling routing disables http cache. If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../mock.mdx#replaying-from-har). -Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`. +Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting [ServiceWorkers](/api/class-browser.mdx#browser-new-context-option-service-workers) to `'block'`. **Usage** @@ -600,7 +605,7 @@ await BrowserContext.RouteFromHARAsync(har, options); - `UpdateMode` `enum HarMode { Full, Minimal }?` *(optional)* Added in: v1.32# When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `minimal`. - - `Url|UrlRegex` [string]? | [Regex]? *(optional)*# + - `Url|UrlRegex` [string]? | [Regex]? *(optional)*# A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file. @@ -609,6 +614,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](/api/class-browser.mdx#browser-new-context-option-base-url) context option. +- `handler` [Action]<[WebSocketRoute]># + + Handler function to route the WebSocket. + +**Returns** +- [void]# + +--- + ### RunAndWaitForConsoleMessageAsync {#browser-context-wait-for-console-message} Added in: v1.34browserContext.RunAndWaitForConsoleMessageAsync @@ -732,6 +773,7 @@ This setting will change the default maximum navigation time for the following m * [Page.RunAndWaitForNavigationAsync()](/api/class-page.mdx#page-wait-for-navigation) :::note + [Page.SetDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) and [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) take priority over [BrowserContext.SetDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout). ::: @@ -752,9 +794,10 @@ BrowserContext.SetDefaultNavigationTimeout(timeout); Added before v1.9browserContext.SetDefaultTimeout -This setting will change the default maximum time for all the methods accepting `timeout` option. +This setting will change the default maximum time for all the methods accepting [timeout](/api/class-browsercontext.mdx#browser-context-set-default-timeout-option-timeout) option. :::note + [Page.SetDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout), [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) and [BrowserContext.SetDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout) take priority over [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout). ::: @@ -778,6 +821,7 @@ BrowserContext.SetDefaultTimeout(timeout); The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged with page-specific extra HTTP headers set with [Page.SetExtraHTTPHeadersAsync()](/api/class-page.mdx#page-set-extra-http-headers). If page overrides a particular header, page-specific header value will be used instead of the browser context header value. :::note + [BrowserContext.SetExtraHTTPHeadersAsync()](/api/class-browsercontext.mdx#browser-context-set-extra-http-headers) does not guarantee the order of headers in the outgoing requests. ::: @@ -870,7 +914,7 @@ await BrowserContext.StorageStateAsync(options); - `options` `BrowserContextStorageStateOptions?` *(optional)* - `Path` [string]? *(optional)*# - The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. + The file path to save the storage state to. If [Path](/api/class-browsercontext.mdx#browser-context-storage-state-option-path) is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. **Returns** - [string]# @@ -881,7 +925,7 @@ await BrowserContext.StorageStateAsync(options); Added before v1.9browserContext.UnrouteAsync -Removes a route created with [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route). When `handler` is not specified, removes all routes for the `url`. +Removes a route created with [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route). When [handler](/api/class-browsercontext.mdx#browser-context-unroute-option-handler) is not specified, removes all routes for the [url](/api/class-browsercontext.mdx#browser-context-unroute-option-url). **Usage** @@ -986,6 +1030,7 @@ BrowserContext.Tracing Added in: v1.11browserContext.event BackgroundPage :::note + Only works with Chromium browser's persistent context. ::: @@ -1136,6 +1181,7 @@ BrowserContext.Request += async (_, request) => {}; Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use [Page.RequestFailed](/api/class-page.mdx#page-event-request-failed). :::note + HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete with [BrowserContext.RequestFinished](/api/class-browsercontext.mdx#browser-context-event-request-finished) event and not with [BrowserContext.RequestFailed](/api/class-browsercontext.mdx#browser-context-event-request-failed). ::: @@ -1239,6 +1285,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/versioned_docs/version-stable/api/class-browsertype.mdx b/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx index fca537b35c..a11a73a8a3 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx @@ -87,6 +87,7 @@ This method attaches Playwright to an existing browser instance using the Chrome The default browser context is accessible via [Browser.Contexts](/api/class-browser.mdx#browser-contexts). :::note + Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. ::: @@ -143,7 +144,7 @@ Returns the browser instance. **Usage** -You can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments: +You can use [IgnoreDefaultArgs](/api/class-browsertype.mdx#browser-type-launch-option-ignore-default-args) to filter out `--mute-audio` from default arguments: ```csharp var browser = await playwright.Chromium.LaunchAsync(new() { @@ -151,7 +152,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() { }); ``` -> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use `executablePath` option with extreme caution. +> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use [ExecutablePath](/api/class-browsertype.mdx#browser-type-launch-option-executable-path) option with extreme caution. > > If Google Chrome (rather than Chromium) is preferred, a [Chrome Canary](https://www.google.com/chrome/browser/canary.html) or [Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested. > @@ -162,6 +163,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() { - `Args` [IEnumerable]?<[string]> *(optional)*# :::warning + Use custom browser args at your own risk, as some of them may break Playwright functionality. ::: @@ -179,7 +181,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() { ::: - **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`. + **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the [Headless](/api/class-browsertype.mdx#browser-type-launch-option-headless) option will be set `false`. - `DownloadsPath` [string]? *(optional)*# If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in is closed. @@ -188,7 +190,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() { Specify environment variables that will be visible to the browser. Defaults to `process.env`. - `ExecutablePath` [string]? *(optional)*# - Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk. + Path to a browser executable to run instead of the bundled one. If [ExecutablePath](/api/class-browsertype.mdx#browser-type-launch-option-executable-path) is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk. - `FirefoxUserPrefs` [IDictionary]?<[string], [object]> *(optional)*# Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox). @@ -203,13 +205,13 @@ var browser = await playwright.Chromium.LaunchAsync(new() { Close the browser process on SIGTERM. Defaults to `true`. - `Headless` [bool]? *(optional)*# - Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`. + Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the [Devtools](/api/class-browsertype.mdx#browser-type-launch-option-devtools) option is `true`. - `IgnoreAllDefaultArgs` [bool]? *(optional)* Added in: v1.9# - If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. Defaults to `false`. + If `true`, Playwright does not pass its own configurations args and only uses the ones from [Args](/api/class-browsertype.mdx#browser-type-launch-option-args). Dangerous option; use with care. Defaults to `false`. - `IgnoreDefaultArgs` [IEnumerable]?<[string]> *(optional)*# - If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. + If `true`, Playwright does not pass its own configurations args and only uses the ones from [Args](/api/class-browsertype.mdx#browser-type-launch-option-args). Dangerous option; use with care. - `Proxy` Proxy? *(optional)*# - `Server` [string] @@ -246,7 +248,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() { Returns the persistent browser context instance. -Launches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing this context will automatically close the browser. +Launches browser that uses persistent storage located at [userDataDir](/api/class-browsertype.mdx#browser-type-launch-persistent-context-option-user-data-dir) and returns the only context. Closing this context will automatically close the browser. **Usage** @@ -265,6 +267,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); - `Args` [IEnumerable]?<[string]> *(optional)*# :::warning + Use custom browser args at your own risk, as some of them may break Playwright functionality. ::: @@ -317,10 +320,7 @@ 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`. ::: @@ -337,7 +337,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); ::: - **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`. + **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the [Headless](/api/class-browsertype.mdx#browser-type-launch-persistent-context-option-headless) option will be set `false`. - `DownloadsPath` [string]? *(optional)*# If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in is closed. @@ -346,7 +346,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); Specify environment variables that will be visible to the browser. Defaults to `process.env`. - `ExecutablePath` [string]? *(optional)*# - Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk. + Path to a browser executable to run instead of the bundled one. If [ExecutablePath](/api/class-browsertype.mdx#browser-type-launch-persistent-context-option-executable-path) is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk. - `ExtraHTTPHeaders` [IDictionary]?<[string], [string]> *(optional)*# An object containing additional HTTP headers to be sent with every request. Defaults to none. @@ -380,7 +380,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.mdx#devices). - `Headless` [bool]? *(optional)*# - Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`. + Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the [Devtools](/api/class-browsertype.mdx#browser-type-launch-option-devtools) option is `true`. - `HttpCredentials` HttpCredentials? *(optional)*# - `Username` [string] @@ -398,10 +398,10 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no origin is specified, the username and password are sent to any servers upon unauthorized responses. - `IgnoreAllDefaultArgs` [bool]? *(optional)* Added in: v1.9# - If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. Defaults to `false`. + If `true`, Playwright does not pass its own configurations args and only uses the ones from [Args](/api/class-browsertype.mdx#browser-type-launch-persistent-context-option-args). Dangerous option; use with care. Defaults to `false`. - `IgnoreDefaultArgs` [IEnumerable]?<[string]> *(optional)*# - If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. + If `true`, Playwright does not pass its own configurations args and only uses the ones from [Args](/api/class-browsertype.mdx#browser-type-launch-persistent-context-option-args). Dangerous option; use with care. - `IgnoreHTTPSErrors` [bool]? *(optional)*# Whether to ignore HTTPS errors when sending network requests. Defaults to `false`. @@ -447,7 +447,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); - `RecordHarPath` [string]? *(optional)*# Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - - `RecordHarUrlFilter|RecordHarUrlFilterRegex` [string]? | [Regex]? *(optional)*# + - `RecordHarUrlFilter|RecordHarUrlFilterRegex` [string]? | [Regex]? *(optional)*# - `RecordVideoDir` [string]? *(optional)*# Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure to call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. @@ -471,7 +471,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); page height in pixels. - Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set. + Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the [ViewportSize](/api/class-browsertype.mdx#browser-type-launch-persistent-context-option-viewport) is set. - `ServiceWorkers` `enum ServiceWorkerPolicy { Allow, Block }?` *(optional)*# Whether to allow sites to register Service workers. Defaults to `'allow'`. @@ -506,6 +506,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.mdx#viewport). :::note + The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host window size defined by the operating system. It makes the execution of the tests non-deterministic. ::: @@ -569,6 +570,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/versioned_docs/version-stable/api/class-cdpsession.mdx b/dotnet/versioned_docs/version-stable/api/class-cdpsession.mdx index 0d88bd5a18..bc6ba77d1b 100644 --- a/dotnet/versioned_docs/version-stable/api/class-cdpsession.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-cdpsessionevent.mdx b/dotnet/versioned_docs/version-stable/api/class-cdpsessionevent.mdx index 6bc8d440a1..4f50774b42 100644 --- a/dotnet/versioned_docs/version-stable/api/class-cdpsessionevent.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-clock.mdx b/dotnet/versioned_docs/version-stable/api/class-clock.mdx index 93eddd8993..b90f597108 100644 --- a/dotnet/versioned_docs/version-stable/api/class-clock.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-clock.mdx @@ -65,7 +65,7 @@ await Clock.InstallAsync(options); **Arguments** - `options` `ClockInstallOptions?` *(optional)* - - `Time|TimeDate` [string]? | [Date]? *(optional)*# + - `Time|TimeDate` [string]? | [Date]? *(optional)*# Time to initialize with, current system time by default. @@ -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/versioned_docs/version-stable/api/class-consolemessage.mdx b/dotnet/versioned_docs/version-stable/api/class-consolemessage.mdx index 139d69f3a7..33b643692f 100644 --- a/dotnet/versioned_docs/version-stable/api/class-consolemessage.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-dialog.mdx b/dotnet/versioned_docs/version-stable/api/class-dialog.mdx index e0586ad191..6fec1cac37 100644 --- a/dotnet/versioned_docs/version-stable/api/class-dialog.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-download.mdx b/dotnet/versioned_docs/version-stable/api/class-download.mdx index 2aa0af19e1..86e6e7a467 100644 --- a/dotnet/versioned_docs/version-stable/api/class-download.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-elementhandle.mdx b/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx index ca22b35936..c4472b5197 100644 --- a/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx @@ -11,6 +11,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; ElementHandle represents an in-page DOM element. ElementHandles can be created with the [Page.QuerySelectorAsync()](/api/class-page.mdx#page-query-selector) method. :::warning[Discouraged] + The use of ElementHandle is discouraged, use [Locator] objects and web-first assertions instead. ::: @@ -120,9 +121,9 @@ await ElementHandle.OwnerFrameAsync(); Added before v1.9elementHandle.WaitForElementStateAsync -Returns when the element satisfies the `state`. +Returns when the element satisfies the [state](/api/class-elementhandle.mdx#element-handle-wait-for-element-state-option-state). -Depending on the `state` parameter, this method waits for one of the [actionability](../actionability.mdx) checks to pass. This method throws when the element is detached while waiting, unless waiting for the `"hidden"` state. +Depending on the [state](/api/class-elementhandle.mdx#element-handle-wait-for-element-state-option-state) parameter, this method waits for one of the [actionability](../actionability.mdx) checks to pass. This method throws when the element is detached while waiting, unless waiting for the `"hidden"` state. * `"visible"` Wait until the element is [visible](../actionability.mdx#visible). * `"hidden"` Wait until the element is [not visible](../actionability.mdx#visible) or not attached. Note that waiting for hidden does not throw when the element detaches. * `"stable"` Wait until the element is both [visible](../actionability.mdx#visible) and [stable](../actionability.mdx#stable). @@ -130,7 +131,7 @@ Depending on the `state` parameter, this method waits for one of the [actionabil * `"disabled"` Wait until the element is [not enabled](../actionability.mdx#enabled). * `"editable"` Wait until the element is [editable](../actionability.mdx#editable). -If the element does not satisfy the condition for the `timeout` milliseconds, this method will throw. +If the element does not satisfy the condition for the [Timeout](/api/class-elementhandle.mdx#element-handle-wait-for-element-state-option-timeout) milliseconds, this method will throw. **Usage** @@ -167,14 +168,14 @@ Use locator-based [Locator.CheckAsync()](/api/class-locator.mdx#locator-check) i This method checks the element by performing the following steps: 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already checked, this method returns immediately. -1. Wait for [actionability](../actionability.mdx) checks on the element, unless `force` option is set. +1. Wait for [actionability](../actionability.mdx) checks on the element, unless [Force](/api/class-elementhandle.mdx#element-handle-check-option-force) option is set. 1. Scroll the element into view if needed. 1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element. 1. Ensure that the element is now checked. If not, this method throws. If the element is detached from the DOM at any moment during the action, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-check-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -227,14 +228,14 @@ Use locator-based [Locator.ClickAsync()](/api/class-locator.mdx#locator-click) i This method clicks the element by performing the following steps: -1. Wait for [actionability](../actionability.mdx) checks on the element, unless `force` option is set. +1. Wait for [actionability](../actionability.mdx) checks on the element, unless [Force](/api/class-elementhandle.mdx#element-handle-click-option-force) option is set. 1. Scroll the element into view if needed. -1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element, or the specified `position`. -1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. +1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element, or the specified [Position](/api/class-elementhandle.mdx#element-handle-click-option-position). +1. Wait for initiated navigations to either succeed or fail, unless [NoWaitAfter](/api/class-elementhandle.mdx#element-handle-click-option-no-wait-after) option is set. If the element is detached from the DOM at any moment during the action, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-click-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -299,15 +300,16 @@ Use locator-based [Locator.DblClickAsync()](/api/class-locator.mdx#locator-dblcl This method double clicks the element by performing the following steps: -1. Wait for [actionability](../actionability.mdx) checks on the element, unless `force` option is set. +1. Wait for [actionability](../actionability.mdx) checks on the element, unless [Force](/api/class-elementhandle.mdx#element-handle-dblclick-option-force) option is set. 1. Scroll the element into view if needed. -1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to double click in the center of the element, or the specified `position`. +1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to double click in the center of the element, or the specified [Position](/api/class-elementhandle.mdx#element-handle-dblclick-option-position). If the element is detached from the DOM at any moment during the action, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-dblclick-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. :::note + `elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event. ::: @@ -378,9 +380,9 @@ The snippet below dispatches the `click` event on the element. Regardless of the await elementHandle.DispatchEventAsync("click"); ``` -Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default. +Under the hood, it creates an instance of an event based on the given [type](/api/class-elementhandle.mdx#element-handle-dispatch-event-option-type), initializes it with [eventInit](/api/class-elementhandle.mdx#element-handle-dispatch-event-option-event-init) properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default. -Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties: +Since [eventInit](/api/class-elementhandle.mdx#element-handle-dispatch-event-option-event-init) is event-specific, please refer to the events documentation for the lists of initial properties: * [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent) * [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent) * [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent) @@ -426,11 +428,11 @@ This method does not wait for the element to pass actionability checks and there ::: -Returns the return value of `expression`. +Returns the return value of [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-option-expression). -The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first argument to `expression`. If no elements match the selector, the method throws an error. +The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first argument to [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-option-expression). If no elements match the selector, the method throws an error. -If `expression` returns a [Promise], then [ElementHandle.EvalOnSelectorAsync()](/api/class-elementhandle.mdx#element-handle-eval-on-selector) would wait for the promise to resolve and return its value. +If [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-option-expression) returns a [Promise], then [ElementHandle.EvalOnSelectorAsync()](/api/class-elementhandle.mdx#element-handle-eval-on-selector) would wait for the promise to resolve and return its value. **Usage** @@ -449,7 +451,7 @@ Assert.AreEqual("10", await tweetHandle.EvalOnSelectorAsync(".retweets", "node = JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-option-expression). **Returns** - [object]# @@ -467,11 +469,11 @@ In most cases, [Locator.EvaluateAllAsync()](/api/class-locator.mdx#locator-evalu ::: -Returns the return value of `expression`. +Returns the return value of [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-all-option-expression). -The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of matched elements as a first argument to `expression`. +The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of matched elements as a first argument to [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-all-option-expression). -If `expression` returns a [Promise], then [ElementHandle.EvalOnSelectorAllAsync()](/api/class-elementhandle.mdx#element-handle-eval-on-selector-all) would wait for the promise to resolve and return its value. +If [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-all-option-expression) returns a [Promise], then [ElementHandle.EvalOnSelectorAllAsync()](/api/class-elementhandle.mdx#element-handle-eval-on-selector-all) would wait for the promise to resolve and return its value. **Usage** @@ -496,7 +498,7 @@ Assert.AreEqual(new [] { "Hello!", "Hi!" }, await feedHandle.EvalOnSelectorAllAs JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-elementhandle.mdx#element-handle-eval-on-selector-all-option-expression). **Returns** - [object]# @@ -616,13 +618,13 @@ Use locator-based [Locator.HoverAsync()](/api/class-locator.mdx#locator-hover) i This method hovers over the element by performing the following steps: -1. Wait for [actionability](../actionability.mdx) checks on the element, unless `force` option is set. +1. Wait for [actionability](../actionability.mdx) checks on the element, unless [Force](/api/class-elementhandle.mdx#element-handle-hover-option-force) option is set. 1. Scroll the element into view if needed. -1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to hover over the center of the element, or the specified `position`. +1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to hover over the center of the element, or the specified [Position](/api/class-elementhandle.mdx#element-handle-hover-option-position). If the element is detached from the DOM at any moment during the action, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-hover-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -903,15 +905,15 @@ Use locator-based [Locator.PressAsync()](/api/class-locator.mdx#locator-press) i Focuses the element, and then uses [Keyboard.DownAsync()](/api/class-keyboard.mdx#keyboard-down) and [Keyboard.UpAsync()](/api/class-keyboard.mdx#keyboard-up). -`key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to generate the text for. A superset of the `key` values can be found [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are: +[key](/api/class-elementhandle.mdx#element-handle-press-option-key) can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to generate the text for. A superset of the [key](/api/class-elementhandle.mdx#element-handle-press-option-key) values can be found [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are: `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`, `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc. Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`. -Holding down `Shift` will type the text that corresponds to the `key` in the upper case. +Holding down `Shift` will type the text that corresponds to the [key](/api/class-elementhandle.mdx#element-handle-press-option-key) in the upper case. -If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts. +If [key](/api/class-elementhandle.mdx#element-handle-press-option-key) is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective texts. Shortcuts such as `key: "Control+o"`, `key: "Control++` or `key: "Control+Shift+T"` are supported as well. When specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed. @@ -1041,7 +1043,7 @@ await ElementHandle.ScreenshotAsync(options); When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed. Defaults to `"hide"`. - `Mask` [IEnumerable]?<[Locator]> *(optional)*# - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box. + Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box `#FF00FF` (customized by [MaskColor](/api/class-elementhandle.mdx#element-handle-screenshot-option-mask-color)) that completely covers its bounding box. - `MaskColor` [string]? *(optional)* Added in: v1.35# Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`. @@ -1050,7 +1052,7 @@ await ElementHandle.ScreenshotAsync(options); Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`. - `Path` [string]? *(optional)*# - The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk. + The file path to save the image to. The screenshot type will be inferred from file extension. If [Path](/api/class-elementhandle.mdx#element-handle-screenshot-option-path) is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk. - `Quality` [int]? *(optional)*# The quality of the image, between 0-100. Not applicable to `png` images. @@ -1144,7 +1146,7 @@ await handle.SelectOptionAsync(new[] { ``` **Arguments** -- `values` [string]? | [ElementHandle]? | [IEnumerable]?<[string]> | `SelectOption` | [IEnumerable]?<[ElementHandle]> | [IEnumerable]?<`SelectOption`># +- `values` [string] | [ElementHandle] | [IEnumerable] | `SelectOption` | [IEnumerable] | [IEnumerable]?# - `Value` [string]? *(optional)* Matches by `option.value`. Optional. @@ -1226,12 +1228,12 @@ Use locator-based [Locator.SetCheckedAsync()](/api/class-locator.mdx#locator-set This method checks or unchecks an element by performing the following steps: 1. Ensure that element is a checkbox or a radio input. If not, this method throws. 1. If the element already has the right checked state, this method returns immediately. -1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried. +1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless [Force](/api/class-elementhandle.mdx#element-handle-set-checked-option-force) option is set. If the element is detached during the checks, the whole action is retried. 1. Scroll the element into view if needed. 1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element. 1. Ensure that the element is now checked or unchecked. If not, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-set-checked-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -1337,15 +1339,16 @@ Use locator-based [Locator.TapAsync()](/api/class-locator.mdx#locator-tap) inste This method taps the element by performing the following steps: -1. Wait for [actionability](../actionability.mdx) checks on the element, unless `force` option is set. +1. Wait for [actionability](../actionability.mdx) checks on the element, unless [Force](/api/class-elementhandle.mdx#element-handle-tap-option-force) option is set. 1. Scroll the element into view if needed. -1. Use [Page.Touchscreen](/api/class-page.mdx#page-touchscreen) to tap the center of the element, or the specified `position`. +1. Use [Page.Touchscreen](/api/class-page.mdx#page-touchscreen) to tap the center of the element, or the specified [Position](/api/class-elementhandle.mdx#element-handle-tap-option-position). If the element is detached from the DOM at any moment during the action, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-tap-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. :::note + `elementHandle.tap()` requires that the `hasTouch` option of the browser context be set to true. ::: @@ -1470,14 +1473,14 @@ Use locator-based [Locator.UncheckAsync()](/api/class-locator.mdx#locator-unchec This method checks the element by performing the following steps: 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already unchecked, this method returns immediately. -1. Wait for [actionability](../actionability.mdx) checks on the element, unless `force` option is set. +1. Wait for [actionability](../actionability.mdx) checks on the element, unless [Force](/api/class-elementhandle.mdx#element-handle-uncheck-option-force) option is set. 1. Scroll the element into view if needed. 1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element. 1. Ensure that the element is now unchecked. If not, this method throws. If the element is detached from the DOM at any moment during the action, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-elementhandle.mdx#element-handle-uncheck-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -1529,9 +1532,9 @@ Use web assertions that assert visibility or a locator-based [Locator.WaitForAsy ::: -Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or `detached`. +Returns element specified by selector when it satisfies [State](/api/class-elementhandle.mdx#element-handle-wait-for-selector-option-state) option. Returns `null` if waiting for `hidden` or `detached`. -Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw. +Wait for the [selector](/api/class-elementhandle.mdx#element-handle-wait-for-selector-option-selector) relative to the element handle to satisfy [State](/api/class-elementhandle.mdx#element-handle-wait-for-selector-option-state) option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method [selector](/api/class-elementhandle.mdx#element-handle-wait-for-selector-option-selector) already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the [Timeout](/api/class-elementhandle.mdx#element-handle-wait-for-selector-option-timeout) milliseconds, the function will throw. **Usage** @@ -1608,6 +1611,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/versioned_docs/version-stable/api/class-filechooser.mdx b/dotnet/versioned_docs/version-stable/api/class-filechooser.mdx index a57d137261..c7050d71b3 100644 --- a/dotnet/versioned_docs/version-stable/api/class-filechooser.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-formdata.mdx b/dotnet/versioned_docs/version-stable/api/class-formdata.mdx index 8dffa5c530..73ba84bd08 100644 --- a/dotnet/versioned_docs/version-stable/api/class-formdata.mdx +++ b/dotnet/versioned_docs/version-stable/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/versioned_docs/version-stable/api/class-frame.mdx b/dotnet/versioned_docs/version-stable/api/class-frame.mdx index 3b73018e57..fa9dd74c8a 100644 --- a/dotnet/versioned_docs/version-stable/api/class-frame.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-frame.mdx @@ -208,7 +208,7 @@ await Frame.DragAndDropAsync(source, target, options); Added before v1.9frame.EvaluateAsync -Returns the return value of `expression`. +Returns the return value of [expression](/api/class-frame.mdx#frame-evaluate-option-expression). If the function passed to the [Frame.EvaluateAsync()](/api/class-frame.mdx#frame-evaluate) returns a [Promise], then [Frame.EvaluateAsync()](/api/class-frame.mdx#frame-evaluate) would wait for the promise to resolve and return its value. @@ -241,7 +241,7 @@ await bodyHandle.DisposeAsync(); JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-frame.mdx#frame-evaluate-option-expression). **Returns** - [object]# @@ -252,7 +252,7 @@ await bodyHandle.DisposeAsync(); Added before v1.9frame.EvaluateHandleAsync -Returns the return value of `expression` as a [JSHandle]. +Returns the return value of [expression](/api/class-frame.mdx#frame-evaluate-handle-option-expression) as a [JSHandle]. The only difference between [Frame.EvaluateAsync()](/api/class-frame.mdx#frame-evaluate) and [Frame.EvaluateHandleAsync()](/api/class-frame.mdx#frame-evaluate-handle) is that [Frame.EvaluateHandleAsync()](/api/class-frame.mdx#frame-evaluate-handle) returns [JSHandle]. @@ -286,7 +286,7 @@ await resultHandle.DisposeAsync(); JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-frame.mdx#frame-evaluate-handle-option-expression). **Returns** - [JSHandle]# @@ -496,12 +496,13 @@ await page An attribute that is usually set by `aria-disabled` or `disabled`. :::note + Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about [`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled). ::: - `Exact` [bool]? *(optional)* Added in: v1.28# - Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a regular expression. Note that exact match still trims whitespace. + Whether [Name|NameRegex](/api/class-frame.mdx#frame-get-by-role-option-name) is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when [Name|NameRegex](/api/class-frame.mdx#frame-get-by-role-option-name) is a regular expression. Note that exact match still trims whitespace. - `Expanded` [bool]? *(optional)*# An attribute that is usually set by `aria-expanded`. @@ -517,9 +518,9 @@ await page A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for `

-

` elements. Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level). - - `Name|NameRegex` [string]? | [Regex]? *(optional)*# + - `Name|NameRegex` [string]? | [Regex]? *(optional)*# - Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is case-insensitive and searches for a substring, use `exact` to control this behavior. + Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is case-insensitive and searches for a substring, use [Exact](/api/class-frame.mdx#frame-get-by-role-option-exact) to control this behavior. Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). - `Pressed` [bool]? *(optional)*# @@ -677,13 +678,14 @@ Returns the main resource response. In case of multiple redirects, the navigatio The method will throw an error if: * there's an SSL error (e.g. in case of self-signed certificates). * target URL is invalid. -* the `timeout` is exceeded during navigation. +* the [Timeout](/api/class-frame.mdx#frame-goto-option-timeout) is exceeded during navigation. * the remote server does not respond or is unreachable. * the main resource failed to load. The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling [Response.Status](/api/class-response.mdx#response-status). :::note + The method either throws an error or returns a main resource response. The only exceptions are navigation to `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`. ::: @@ -800,10 +802,10 @@ Frame.Locator(selector, options); Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the outer one. For example, `article` that does not have `div` matches `
Playwright
`. Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s. - - `HasNotText|HasNotTextRegex` [string]? | [Regex]? *(optional)* Added in: v1.33# + - `HasNotText|HasNotTextRegex` [string]? | [Regex]? *(optional)* Added in: v1.33# Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. - - `HasText|HasTextRegex` [string]? | [Regex]? *(optional)*# + - `HasText|HasTextRegex` [string]? | [Regex]? *(optional)*# Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches `
Playwright
`. @@ -821,6 +823,7 @@ Returns frame's name attribute as specified in the tag. If the name is empty, returns the id attribute instead. :::note + This value is calculated once when the frame is created, and will not update if the attribute is changed later. ::: @@ -940,7 +943,7 @@ Frame.Url Added before v1.9frame.WaitForFunctionAsync -Returns when the `expression` returns a truthy value, returns that value. +Returns when the [expression](/api/class-frame.mdx#frame-wait-for-function-option-expression) returns a truthy value, returns that value. **Usage** @@ -976,11 +979,11 @@ await page.MainFrame.WaitForFunctionAsync("selector => !!document.querySelector( JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-frame.mdx#frame-wait-for-function-option-expression). - `options` `FrameWaitForFunctionOptions?` *(optional)* - `PollingInterval` [float]? *(optional)*# - If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if the option is not specified `expression` is executed in `requestAnimationFrame` callback. + If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if the option is not specified [expression](/api/class-frame.mdx#frame-wait-for-function-option-expression) is executed in `requestAnimationFrame` callback. - `Timeout` [float]? *(optional)*# Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. @@ -999,6 +1002,7 @@ Waits for the required load state to be reached. This returns when the frame reaches a required load state, `load` by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately. :::note + Most of the time, this method is not needed because Playwright [auto-waits before every action](../actionability.mdx). ::: @@ -1073,15 +1077,15 @@ Use locator-based [Locator.CheckAsync()](/api/class-locator.mdx#locator-check) i ::: -This method checks an element matching `selector` by performing the following steps: -1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM. +This method checks an element matching [selector](/api/class-frame.mdx#frame-check-option-selector) by performing the following steps: +1. Find an element matching [selector](/api/class-frame.mdx#frame-check-option-selector). If there is none, wait until a matching element is attached to the DOM. 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already checked, this method returns immediately. -1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried. +1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless [Force](/api/class-frame.mdx#frame-check-option-force) option is set. If the element is detached during the checks, the whole action is retried. 1. Scroll the element into view if needed. 1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element. 1. Ensure that the element is now checked. If not, this method throws. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-frame.mdx#frame-check-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -1139,14 +1143,14 @@ Use locator-based [Locator.ClickAsync()](/api/class-locator.mdx#locator-click) i ::: -This method clicks an element matching `selector` by performing the following steps: -1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM. -1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried. +This method clicks an element matching [selector](/api/class-frame.mdx#frame-click-option-selector) by performing the following steps: +1. Find an element matching [selector](/api/class-frame.mdx#frame-click-option-selector). If there is none, wait until a matching element is attached to the DOM. +1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless [Force](/api/class-frame.mdx#frame-click-option-force) option is set. If the element is detached during the checks, the whole action is retried. 1. Scroll the element into view if needed. -1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element, or the specified `position`. -1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. +1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to click in the center of the element, or the specified [Position](/api/class-frame.mdx#frame-click-option-position). +1. Wait for initiated navigations to either succeed or fail, unless [NoWaitAfter](/api/class-frame.mdx#frame-click-option-no-wait-after) option is set. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-frame.mdx#frame-click-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. **Usage** @@ -1198,7 +1202,7 @@ await Frame.ClickAsync(selector, options); Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. - `Trial` [bool]? *(optional)* Added in: v1.11# - When set, this method only performs the [actionability](../actionability.mdx) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. + When set, this method only performs the [actionability](../actionability.mdx) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `modifiers` will be pressed regardless of `trial` to allow testing elements which are only visible when those keys are pressed. **Returns** - [void]# @@ -1216,15 +1220,16 @@ Use locator-based [Locator.DblClickAsync()](/api/class-locator.mdx#locator-dblcl ::: -This method double clicks an element matching `selector` by performing the following steps: -1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM. -1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless `force` option is set. If the element is detached during the checks, the whole action is retried. +This method double clicks an element matching [selector](/api/class-frame.mdx#frame-dblclick-option-selector) by performing the following steps: +1. Find an element matching [selector](/api/class-frame.mdx#frame-dblclick-option-selector). If there is none, wait until a matching element is attached to the DOM. +1. Wait for [actionability](../actionability.mdx) checks on the matched element, unless [Force](/api/class-frame.mdx#frame-dblclick-option-force) option is set. If the element is detached during the checks, the whole action is retried. 1. Scroll the element into view if needed. -1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to double click in the center of the element, or the specified `position`. if the first click of the `dblclick()` triggers a navigation event, this method will throw. +1. Use [Page.Mouse](/api/class-page.mdx#page-mouse) to double click in the center of the element, or the specified [Position](/api/class-frame.mdx#frame-dblclick-option-position). if the first click of the `dblclick()` triggers a navigation event, this method will throw. -When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing zero timeout disables this. +When all steps combined have not finished during the specified [Timeout](/api/class-frame.mdx#frame-dblclick-option-timeout), this method throws a [TimeoutError]. Passing zero timeout disables this. :::note + `frame.dblclick()` dispatches two `click` events and a single `dblclick` event. ::: @@ -1275,7 +1280,7 @@ await Frame.DblClickAsync(selector, options); Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. - `Trial` [bool]? *(optional)* Added in: v1.11# - When set, this method only performs the [actionability](../actionability.mdx) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. + When set, this method only performs the [actionability](../actionability.mdx) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `modifiers` will be pressed regardless of `trial` to allow testing elements which are only visible when those keys are pressed. **Returns** - [void]# @@ -1301,9 +1306,9 @@ The snippet below dispatches the `click` event on the element. Regardless of the await frame.DispatchEventAsync("button#submit", "click"); ``` -Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default. +Under the hood, it creates an instance of an event based on the given [type](/api/class-frame.mdx#frame-dispatch-event-option-type), initializes it with [eventInit](/api/class-frame.mdx#frame-dispatch-event-option-event-init) properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default. -Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties: +Since [eventInit](/api/class-frame.mdx#frame-dispatch-event-option-event-init) is event-specific, please refer to the events documentation for the lists of initial properties: * [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent) * [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent) * [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent) @@ -1357,11 +1362,11 @@ This method does not wait for the element to pass the actionability checks and t ::: -Returns the return value of `expression`. +Returns the return value of [expression](/api/class-frame.mdx#frame-eval-on-selector-option-expression). -The method finds an element matching the specified selector within the frame and passes it as a first argument to `expression`. If no elements match the selector, the method throws an error. +The method finds an element matching the specified selector within the frame and passes it as a first argument to [expression](/api/class-frame.mdx#frame-eval-on-selector-option-expression). If no elements match the selector, the method throws an error. -If `expression` returns a [Promise], then [Frame.EvalOnSelectorAsync()](/api/class-frame.mdx#frame-eval-on-selector) would wait for the promise to resolve and return its value. +If [expression](/api/class-frame.mdx#frame-eval-on-selector-option-expression) returns a [Promise], then [Frame.EvalOnSelectorAsync()](/api/class-frame.mdx#frame-eval-on-selector) would wait for the promise to resolve and return its value. **Usage** @@ -1380,7 +1385,7 @@ var html = await frame.EvalOnSelectorAsync(".main-container", "(e, suffix) => e. JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-frame.mdx#frame-eval-on-selector-option-expression). - `options` `FrameEvalOnSelectorOptions?` *(optional)* - `Strict` [bool]? *(optional)* Added in: v1.14# @@ -1402,11 +1407,11 @@ In most cases, [Locator.EvaluateAllAsync()](/api/class-locator.mdx#locator-evalu ::: -Returns the return value of `expression`. +Returns the return value of [expression](/api/class-frame.mdx#frame-eval-on-selector-all-option-expression). -The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to `expression`. +The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to [expression](/api/class-frame.mdx#frame-eval-on-selector-all-option-expression). -If `expression` returns a [Promise], then [Frame.EvalOnSelectorAllAsync()](/api/class-frame.mdx#frame-eval-on-selector-all) would wait for the promise to resolve and return its value. +If [expression](/api/class-frame.mdx#frame-eval-on-selector-all-option-expression) returns a [Promise], then [Frame.EvalOnSelectorAllAsync()](/api/class-frame.mdx#frame-eval-on-selector-all) would wait for the promise to resolve and return its value. **Usage** @@ -1423,7 +1428,7 @@ var divsCount = await frame.EvalOnSelectorAllAsync("div", "(divs, min) => JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is automatically invoked. - `arg` [EvaluationArgument]? *(optional)*# - Optional argument to pass to `expression`. + Optional argument to pass to [expression](/api/class-frame.mdx#frame-eval-on-selector-all-option-expression). **Returns** - [object]# @@ -1441,7 +1446,7 @@ Use locator-based [Locator.FillAsync()](/api/class-locator.mdx#locator-fill) ins ::: -This method waits for an element matching `selector`, waits for [actionability](../actionability.mdx) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field. +This method waits for an element matching [selector](/api/class-frame.mdx#frame-fill-option-selector), waits for [actionability](../actionability.mdx) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field. If the target element is not an ``, `