diff --git a/dotnet/versioned_docs/images/release-notes-1.59-dashboard.png b/dotnet/versioned_docs/images/release-notes-1.59-dashboard.png new file mode 100644 index 00000000000..b951a63c4ef Binary files /dev/null and b/dotnet/versioned_docs/images/release-notes-1.59-dashboard.png differ diff --git a/dotnet/versioned_docs/images/release-notes-1.59-screencast-demo.gif b/dotnet/versioned_docs/images/release-notes-1.59-screencast-demo.gif new file mode 100644 index 00000000000..90b2e029f5b Binary files /dev/null and b/dotnet/versioned_docs/images/release-notes-1.59-screencast-demo.gif differ diff --git a/dotnet/versioned_docs/version-stable/actionability.mdx b/dotnet/versioned_docs/version-stable/actionability.mdx index a8accf11cee..7f5775c1f21 100644 --- a/dotnet/versioned_docs/version-stable/actionability.mdx +++ b/dotnet/versioned_docs/version-stable/actionability.mdx @@ -134,6 +134,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -153,6 +154,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api-testing.mdx b/dotnet/versioned_docs/version-stable/api-testing.mdx index 7b184eb463f..590d5003a93 100644 --- a/dotnet/versioned_docs/version-stable/api-testing.mdx +++ b/dotnet/versioned_docs/version-stable/api-testing.mdx @@ -426,6 +426,7 @@ var context = await Browser.NewContextAsync(new() { StorageState = state }); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -445,6 +446,7 @@ var context = await Browser.NewContextAsync(new() { StorageState = state }); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx b/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx index 65e10fa309a..3c3be17438f 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-apirequest.mdx @@ -143,6 +143,7 @@ await ApiRequest.NewContextAsync(options); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -162,6 +163,7 @@ await ApiRequest.NewContextAsync(options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx b/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx index 4b0ec00a7a4..6b05b48d151 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-apirequestcontext.mdx @@ -577,6 +577,7 @@ await ApiRequestContext.StorageStateAsync(options); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -596,6 +597,7 @@ await ApiRequestContext.StorageStateAsync(options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-apiresponse.mdx b/dotnet/versioned_docs/version-stable/api/class-apiresponse.mdx index f95eda617e4..6beb295061e 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apiresponse.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-apiresponse.mdx @@ -202,6 +202,7 @@ ApiResponse.Url [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -221,6 +222,7 @@ ApiResponse.Url [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-apiresponseassertions.mdx b/dotnet/versioned_docs/version-stable/api/class-apiresponseassertions.mdx index acc02232408..e7744a6df13 100644 --- a/dotnet/versioned_docs/version-stable/api/class-apiresponseassertions.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-apiresponseassertions.mdx @@ -9,6 +9,24 @@ import HTMLCard from '@site/src/components/HTMLCard'; The [APIResponseAssertions] class provides assertion methods that can be used to make assertions about the [APIResponse] in the tests. +```csharp +using Microsoft.Playwright; +using Microsoft.Playwright.MSTest; + +namespace PlaywrightTests; + +[TestClass] +public class ExampleTests : PageTest +{ + [TestMethod] + public async Task NavigatesToLoginPage() + { + var response = await Page.APIRequest.GetAsync("https://playwright.dev"); + await Expect(response).ToBeOKAsync(); + } +} +``` + --- @@ -22,6 +40,10 @@ Ensures the response status code is within `200..299` range. **Usage** +```csharp +await Expect(response).ToBeOKAsync(); +``` + **Returns** - [void]# @@ -33,12 +55,14 @@ Ensures the response status code is within `200..299` range. Added in: v1.20apiResponseAssertions.Not -Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful: +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the response status is not successful: + ```csharp -Expect(Response).Not +await Expect(response).Not.ToBeOKAsync(); ``` **Type** @@ -56,6 +80,7 @@ Expect(Response).Not [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -75,6 +100,7 @@ Expect(Response).Not [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-browser.mdx b/dotnet/versioned_docs/version-stable/api/class-browser.mdx index 36591afb4b8..1950342de22 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browser.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browser.mdx @@ -25,6 +25,40 @@ await browser.CloseAsync(); ## Methods +### BindAsync {#browser-bind} + +Added in: v1.59browser.BindAsync + +Binds the browser to a named pipe or web socket, making it available for other clients to connect to. + +**Usage** + +```csharp +await Browser.BindAsync(title, options); +``` + +**Arguments** +- `title` [string]# + + Title of the browser server, used for identification. +- `options` `BrowserBindOptions?` *(optional)* + - `Host` [string]? *(optional)*# + + Host to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. + - `Port` [int]? *(optional)*# + + Port to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. Use `0` to let the OS pick an available port. + - `WorkspaceDir` [string]? *(optional)*# + + Working directory associated with this browser server. + +**Returns** +- Bind# + - `endpoint` [string] + + +--- + ### BrowserType {#browser-browser-type} Added in: v1.23browser.BrowserType @@ -587,6 +621,23 @@ await Browser.NewPageAsync(options); --- +### UnbindAsync {#browser-unbind} + +Added in: v1.59browser.UnbindAsync + +Unbinds the browser server previously bound with [Browser.BindAsync()](/api/class-browser.mdx#browser-bind). + +**Usage** + +```csharp +await Browser.UnbindAsync(); +``` + +**Returns** +- [void]# + +--- + ### Version {#browser-version} Added before v1.9browser.Version @@ -635,6 +686,7 @@ Browser.Disconnected += async (_, browser) => {}; [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -654,6 +706,7 @@ Browser.Disconnected += async (_, browser) => {}; [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx b/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx index 81ccef2eb40..e59d575abbd 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browsercontext.mdx @@ -113,7 +113,7 @@ The order of evaluation of multiple scripts installed via [BrowserContext.AddIni Script to be evaluated in all pages in the browser context. **Returns** -- [void]# +- [Disposable]# --- @@ -316,7 +316,7 @@ await page.GetByRole(AriaRole.Button).ClickAsync(); Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported. **Returns** -- [void]# +- [Disposable]# --- @@ -378,7 +378,7 @@ class BrowserContextExamples Callback function that will be called in the Playwright's context. **Returns** -- [void]# +- [Disposable]# --- @@ -422,6 +422,7 @@ await BrowserContext.GrantPermissionsAsync(permissions, options); * `'notifications'` * `'payment-handler'` * `'storage-access'` + * `'screen-wake-lock'` - `options` `BrowserContextGrantPermissionsOptions?` *(optional)* - `Origin` [string]? *(optional)*# @@ -432,6 +433,23 @@ await BrowserContext.GrantPermissionsAsync(permissions, options); --- +### IsClosed {#browser-context-is-closed} + +Added in: v1.59browserContext.IsClosed + +Indicates that the browser context is in the process of closing or has already been closed. + +**Usage** + +```csharp +BrowserContext.IsClosed +``` + +**Returns** +- [bool]# + +--- + ### NewCDPSessionAsync {#browser-context-new-cdp-session} Added in: v1.11browserContext.NewCDPSessionAsync @@ -560,7 +578,7 @@ Enabling routing disables http cache. How often a route should be used. By default it will be used every time. **Returns** -- [void]# +- [Disposable]# --- @@ -890,6 +908,29 @@ await BrowserContext.SetOfflineAsync(offline); --- +### SetStorageStateAsync {#browser-context-set-storage-state} + +Added in: v1.59browserContext.SetStorageStateAsync + +Clears the existing cookies, local storage and IndexedDB entries for all origins and sets the new storage state. + +**Usage** + +```csharp +// Load storage state from a file and apply it to the context. +await context.SetStorageStateAsync("state.json"); +``` + +**Arguments** +- `storageStatePath` [string]# + + Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [BrowserContext.StorageStateAsync()](/api/class-browsercontext.mdx#browser-context-storage-state). Path to the file with saved storage state. + +**Returns** +- [void]# + +--- + ### StorageStateAsync {#browser-context-storage-state} Added before v1.9browserContext.StorageStateAsync @@ -931,7 +972,7 @@ await BrowserContext.UnrouteAsync(url, handler); **Arguments** - `url` [string] | [Regex] | [Func]<[string], bool># - A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route). + A glob pattern, regex pattern, or predicate receiving [URL] used to register a routing with [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route). - `handler` [Action]<[Route]?> *(optional)*# Optional handler function used to register a routing with [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route). @@ -1003,6 +1044,23 @@ BrowserContext.Clock --- +### Debugger {#browser-context-debugger} + +Added in: v1.59browserContext.Debugger + +Debugger allows to pause and resume the execution. + +**Usage** + +```csharp +BrowserContext.Debugger +``` + +**Type** +- [Debugger] + +--- + ### Tracing {#browser-context-tracing} Added in: v1.12browserContext.Tracing @@ -1272,6 +1330,7 @@ BrowserContext.BackgroundPages [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1291,6 +1350,7 @@ BrowserContext.BackgroundPages [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx b/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx index c5c1a16114a..c17c9ca1196 100644 --- a/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-browsertype.mdx @@ -47,11 +47,11 @@ The major and minor version of the Playwright instance that connects needs to ma **Usage** ```csharp -await BrowserType.ConnectAsync(wsEndpoint, options); +await BrowserType.ConnectAsync(endpoint, options); ``` **Arguments** -- `wsEndpoint` [string] Added in: v1.10# +- `endpoint` [string] Added in: v1.10# A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`. - `options` `BrowserTypeConnectOptions?` *(optional)* @@ -180,6 +180,9 @@ var browser = await playwright.Chromium.LaunchAsync(new() { ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `ArtifactsDir` [string]? *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `Channel` [string]? *(optional)*# Browser distribution channel. @@ -292,6 +295,9 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options); ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `ArtifactsDir` [string]? *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `BaseURL` [string]? *(optional)*# When using [Page.GotoAsync()](/api/class-page.mdx#page-goto), [Page.RouteAsync()](/api/class-page.mdx#page-route), [Page.WaitForURLAsync()](/api/class-page.mdx#page-wait-for-url), [Page.RunAndWaitForRequestAsync()](/api/class-page.mdx#page-wait-for-request), or [Page.RunAndWaitForResponseAsync()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples: @@ -565,6 +571,7 @@ BrowserType.Name [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -584,6 +591,7 @@ BrowserType.Name [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-cdpsession.mdx b/dotnet/versioned_docs/version-stable/api/class-cdpsession.mdx index c8072a5d7f9..aebbb0cc232 100644 --- a/dotnet/versioned_docs/version-stable/api/class-cdpsession.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-cdpsession.mdx @@ -90,6 +90,25 @@ await CdpSession.SendAsync(method, params); **Returns** - [JsonElement?]# +--- + +## Events + +### event Close {#cdp-session-event-close} + +Added in: v1.59cdpSession.event Close + +Emitted when the session is closed, either because the target was closed or `session.detach()` was called. + +**Usage** + +```csharp +CdpSession.Close += async (_, cDPSession) => {}; +``` + +**Event data** +- [CDPSession] + [APIRequest]: /api/class-apirequest.mdx "APIRequest" [APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" @@ -102,6 +121,7 @@ await CdpSession.SendAsync(method, params); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -121,6 +141,7 @@ await CdpSession.SendAsync(method, params); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-cdpsessionevent.mdx b/dotnet/versioned_docs/version-stable/api/class-cdpsessionevent.mdx index 7d0f3844af9..6e297e94065 100644 --- a/dotnet/versioned_docs/version-stable/api/class-cdpsessionevent.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-cdpsessionevent.mdx @@ -58,6 +58,7 @@ CdpSessionEvent.OnEvent += async (_, jsonElement) => {}; [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -77,6 +78,7 @@ CdpSessionEvent.OnEvent += async (_, jsonElement) => {}; [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-clock.mdx b/dotnet/versioned_docs/version-stable/api/class-clock.mdx index 0a3df6d9bdd..a444ade6011 100644 --- a/dotnet/versioned_docs/version-stable/api/class-clock.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-clock.mdx @@ -201,6 +201,7 @@ await page.Clock.SetSystemTimeAsync("2020-02-02"); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -220,6 +221,7 @@ await page.Clock.SetSystemTimeAsync("2020-02-02"); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-consolemessage.mdx b/dotnet/versioned_docs/version-stable/api/class-consolemessage.mdx index 5c26fa33df7..b39243d75ff 100644 --- a/dotnet/versioned_docs/version-stable/api/class-consolemessage.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-consolemessage.mdx @@ -102,6 +102,23 @@ ConsoleMessage.Text --- +### Timestamp {#console-message-timestamp} + +Added in: v1.59consoleMessage.Timestamp + +The timestamp of the console message in milliseconds since the Unix epoch. + +**Usage** + +```csharp +ConsoleMessage.Timestamp +``` + +**Returns** +- [float]# + +--- + ### Type {#console-message-type} Added before v1.9consoleMessage.Type @@ -146,6 +163,7 @@ ConsoleMessage.Worker [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -165,6 +183,7 @@ ConsoleMessage.Worker [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-debugger.mdx b/dotnet/versioned_docs/version-stable/api/class-debugger.mdx new file mode 100644 index 00000000000..f1ff02ea9e8 --- /dev/null +++ b/dotnet/versioned_docs/version-stable/api/class-debugger.mdx @@ -0,0 +1,222 @@ +--- +id: class-debugger +title: "Debugger" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +API for controlling the Playwright debugger. The debugger allows pausing script execution and inspecting the page. Obtain the debugger instance via [BrowserContext.Debugger](/api/class-browsercontext.mdx#browser-context-debugger). + + +--- + +## Methods + +### NextAsync {#debugger-next} + +Added in: v1.59debugger.NextAsync + +Resumes script execution and pauses again before the next action. Throws if the debugger is not paused. + +**Usage** + +```csharp +await Debugger.NextAsync(); +``` + +**Returns** +- [void]# + +--- + +### PausedDetails {#debugger-paused-details} + +Added in: v1.59debugger.PausedDetails + +Returns details about the currently paused call. Returns `null` if the debugger is not paused. + +**Usage** + +```csharp +Debugger.PausedDetails +``` + +**Returns** +- PausedDetails?# + - `location` Location + - `file` [string] + + + - `line` [int]? *(optional)* + + + - `column` [int]? *(optional)* + + + + - `title` [string] + + +--- + +### RequestPauseAsync {#debugger-request-pause} + +Added in: v1.59debugger.RequestPauseAsync + +Configures the debugger to pause before the next action is executed. + +Throws if the debugger is already paused. Use [Debugger.NextAsync()](/api/class-debugger.mdx#debugger-next) or [Debugger.RunToAsync()](/api/class-debugger.mdx#debugger-run-to) to step while paused. + +Note that [Page.PauseAsync()](/api/class-page.mdx#page-pause) is equivalent to a "debugger" statement — it pauses execution at the call site immediately. On the contrary, [Debugger.RequestPauseAsync()](/api/class-debugger.mdx#debugger-request-pause) is equivalent to "pause on next statement" — it configures the debugger to pause before the next action is executed. + +**Usage** + +```csharp +await Debugger.RequestPauseAsync(); +``` + +**Returns** +- [void]# + +--- + +### ResumeAsync {#debugger-resume} + +Added in: v1.59debugger.ResumeAsync + +Resumes script execution. Throws if the debugger is not paused. + +**Usage** + +```csharp +await Debugger.ResumeAsync(); +``` + +**Returns** +- [void]# + +--- + +### RunToAsync {#debugger-run-to} + +Added in: v1.59debugger.RunToAsync + +Resumes script execution and pauses when an action originates from the given source location. Throws if the debugger is not paused. + +**Usage** + +```csharp +await Debugger.RunToAsync(location); +``` + +**Arguments** +- `location` Location# + - `File` [string] + + + - `Line` [int]? *(optional)* + + + - `Column` [int]? *(optional)* + + + The source location to pause at. + +**Returns** +- [void]# + +--- + +## Events + +### event PausedStateChanged {#debugger-event-paused-state-changed} + +Added in: v1.59debugger.event PausedStateChanged + +Emitted when the debugger pauses or resumes. + +**Usage** + +```csharp +Debugger.PausedStateChanged += async (_, void) => {}; +``` + + +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[FormData]: /api/class-formdata.mdx "FormData" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" +[Selectors]: /api/class-selectors.mdx "Selectors" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[bool]: https://docs.microsoft.com/en-us/dotnet/api/system.boolean "bool" +[Date]: https://learn.microsoft.com/en-us/dotnet/api/system.datetime "DateTime" +[double]: https://docs.microsoft.com/en-us/dotnet/api/system.double "double" +[byte]: https://docs.microsoft.com/en-us/dotnet/api/system.byte "byte" +[int]: https://docs.microsoft.com/en-us/dotnet/api/system.int32 "int" +[long]: https://docs.microsoft.com/en-us/dotnet/api/system.int64 "long" +[void]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/void "void" +[string]: https://docs.microsoft.com/en-us/dotnet/api/system.string "string" +[URL]: https://nodejs.org/api/url.html "URL" +[Regex]: https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex "Regex" + +[Action]: https://docs.microsoft.com/en-us/dotnet/api/system.action-1 "Action" +[Func]: https://docs.microsoft.com/en-us/dotnet/api/system.func-2 "Func" +[IEnumerable]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable "IEnumerable" +[IReadOnlyList]: https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlylist-1?view=net-9.0 "IReadOnlyList" +[IDictionary]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.idictionary "IDictionary" +[Task]: https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task?view=net-5.0 "Task" +[IReadOnlyDictionary]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 "IReadOnlyDictionary" +[JsonElement]: https://docs.microsoft.com/en-us/dotnet/api/system.text.json.jsonelement "JsonElement" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/dotnet/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/dotnet/about "Microsoft Artifact Registry" +[Dockerfile.noble]: https://github.com/microsoft/playwright-dotnet/blob/main/utils/docker/Dockerfile.noble "Dockerfile.noble" diff --git a/dotnet/versioned_docs/version-stable/api/class-dialog.mdx b/dotnet/versioned_docs/version-stable/api/class-dialog.mdx index b2a5706f9d1..a82f613bc87 100644 --- a/dotnet/versioned_docs/version-stable/api/class-dialog.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-dialog.mdx @@ -160,6 +160,7 @@ Dialog.Type [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -179,6 +180,7 @@ Dialog.Type [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-download.mdx b/dotnet/versioned_docs/version-stable/api/class-download.mdx index f37fddf9b0c..40e27bba723 100644 --- a/dotnet/versioned_docs/version-stable/api/class-download.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-download.mdx @@ -203,6 +203,7 @@ Download.Url [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -222,6 +223,7 @@ Download.Url [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx b/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx index 95f4bdd4615..d822b15a5cf 100644 --- a/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-elementhandle.mdx @@ -1589,6 +1589,7 @@ This method does not work across navigations, use [Page.WaitForSelectorAsync()]( [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1608,6 +1609,7 @@ This method does not work across navigations, use [Page.WaitForSelectorAsync()]( [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-filechooser.mdx b/dotnet/versioned_docs/version-stable/api/class-filechooser.mdx index ccf516d1084..1862ccf44c7 100644 --- a/dotnet/versioned_docs/version-stable/api/class-filechooser.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-filechooser.mdx @@ -124,6 +124,7 @@ await FileChooser.SetFilesAsync(files, options); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -143,6 +144,7 @@ await FileChooser.SetFilesAsync(files, options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-formdata.mdx b/dotnet/versioned_docs/version-stable/api/class-formdata.mdx index e708fef8400..4bf909aa2ab 100644 --- a/dotnet/versioned_docs/version-stable/api/class-formdata.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-formdata.mdx @@ -130,6 +130,7 @@ FormData.Set(name, value); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -149,6 +150,7 @@ FormData.Set(name, value); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-frame.mdx b/dotnet/versioned_docs/version-stable/api/class-frame.mdx index bc77f685fe8..25c39b3e469 100644 --- a/dotnet/versioned_docs/version-stable/api/class-frame.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-frame.mdx @@ -466,7 +466,7 @@ Consider the following DOM structure. ``` -You can locate each element by it's implicit role: +You can locate each element by its implicit role: ```csharp await Expect(Page @@ -562,7 +562,7 @@ Consider the following DOM structure. ``` -You can locate the element by it's test id: +You can locate the element by its test id: ```csharp await page.GetByTestId("directions").ClickAsync(); @@ -1049,7 +1049,7 @@ await frame.WaitForURLAsync("**/target.html"); **Arguments** - `url` [string] | [Regex] | [Func]<[string], bool># - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `options` `FrameWaitForURLOptions?` *(optional)* - `Timeout` [float]? *(optional)*# @@ -2107,7 +2107,7 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [Page.SetDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. - `Url|UrlRegex|UrlFunc` [string]? | [Regex]? | [Func]<[string]?, bool> *(optional)*# - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `WaitUntil` `enum WaitUntilState { Load, DOMContentLoaded, NetworkIdle, Commit }?` *(optional)*# When to consider operation succeeded, defaults to `load`. Events can be either: @@ -2159,7 +2159,7 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.SetDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [BrowserContext.SetDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [Page.SetDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [Page.SetDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. - `Url|UrlRegex|UrlFunc` [string]? | [Regex]? | [Func]<[string]?, bool> *(optional)*# - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `WaitUntil` `enum WaitUntilState { Load, DOMContentLoaded, NetworkIdle, Commit }?` *(optional)*# When to consider operation succeeded, defaults to `load`. Events can be either: @@ -2703,6 +2703,7 @@ await Frame.WaitForTimeoutAsync(timeout); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -2722,6 +2723,7 @@ await Frame.WaitForTimeoutAsync(timeout); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-framelocator.mdx b/dotnet/versioned_docs/version-stable/api/class-framelocator.mdx index e234d847ad9..28a61d113e2 100644 --- a/dotnet/versioned_docs/version-stable/api/class-framelocator.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-framelocator.mdx @@ -183,7 +183,7 @@ Consider the following DOM structure. ``` -You can locate each element by it's implicit role: +You can locate each element by its implicit role: ```csharp await Expect(Page @@ -279,7 +279,7 @@ Consider the following DOM structure. ``` -You can locate the element by it's test id: +You can locate the element by its test id: ```csharp await page.GetByTestId("directions").ClickAsync(); @@ -543,6 +543,7 @@ FrameLocator.Nth(index); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -562,6 +563,7 @@ FrameLocator.Nth(index); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-jshandle.mdx b/dotnet/versioned_docs/version-stable/api/class-jshandle.mdx index 5eb6b5e3338..9e1fa7011f1 100644 --- a/dotnet/versioned_docs/version-stable/api/class-jshandle.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-jshandle.mdx @@ -194,6 +194,7 @@ await JsHandle.JsonValueAsync(); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -213,6 +214,7 @@ await JsHandle.JsonValueAsync(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-keyboard.mdx b/dotnet/versioned_docs/version-stable/api/class-keyboard.mdx index 31cc0608118..6aa4f3aa39a 100644 --- a/dotnet/versioned_docs/version-stable/api/class-keyboard.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-keyboard.mdx @@ -237,6 +237,7 @@ await Keyboard.UpAsync(key); [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -256,6 +257,7 @@ await Keyboard.UpAsync(key); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/api/class-locator.mdx b/dotnet/versioned_docs/version-stable/api/class-locator.mdx index 731b0c27c30..f6ba02c4762 100644 --- a/dotnet/versioned_docs/version-stable/api/class-locator.mdx +++ b/dotnet/versioned_docs/version-stable/api/class-locator.mdx @@ -125,6 +125,12 @@ await page.GetByRole(AriaRole.Link).AriaSnapshotAsync(); **Arguments** - `options` `LocatorAriaSnapshotOptions?` *(optional)* + - `Depth` [int]? *(optional)* Added in: v1.59# + + When specified, limits the depth of the snapshot. + - `Mode` `enum AriaSnapshotMode { Ai, Default }?` *(optional)* Added in: v1.59# + + When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to `"default"`. See details for more information. - `Timeout` [float]? *(optional)*# 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. @@ -158,6 +164,9 @@ Below is the HTML markup and the respective ARIA snapshot: - link "About" ``` +An AI-optimized snapshot, controlled by [Mode](/api/class-locator.mdx#locator-aria-snapshot-option-mode), is different from a default snapshot: +1. Includes element references `[ref=e2]`. 2. Does not wait for an element matching the locator, and throws when no elements match. 3. Includes snapshots of ` - - + ### 🐂 Debian 11 Bullseye Support @@ -1408,7 +1575,7 @@ This version was also tested against the following stable channels: Playwright 1.17 introduces [frame locators](./api/class-framelocator) - a locator to the iframe on the page. Frame locators capture the logic sufficient to retrieve the `iframe` and then locate elements in that iframe. Frame locators are strict by default, will wait for `iframe` to appear and can be used in Web-First assertions. -![Graphics](https://user-images.githubusercontent.com/746130/142082759-2170db38-370d-43ec-8d41-5f9941f57d83.png) +Graphics Frame locators can be created with either [Page.FrameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.FrameLocator()](/api/class-locator.mdx#locator-frame-locator) method. @@ -1429,13 +1596,13 @@ Playwright Trace Viewer is now **available online** at https://trace.playwright. - New trace metadata tab with browser details - Snapshots now have URL bar -![image](https://user-images.githubusercontent.com/746130/141877831-29e37cd1-e574-4bd9-aab5-b13a463bb4ae.png) +image ### HTML Report Update - HTML report now supports dynamic filtering - Report is now a **single static HTML file** that could be sent by e-mail or as a slack attachment. -![image](https://user-images.githubusercontent.com/746130/141877402-e486643d-72c7-4db3-8844-ed2072c5d676.png) +image ### Ubuntu ARM64 support + more - Playwright now supports **Ubuntu 20.04 ARM64**. You can now run Playwright tests inside Docker on Apple M1 and on Raspberry Pi. @@ -1543,7 +1710,7 @@ await locator.ClickAsync(); Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -1552,7 +1719,7 @@ await page.Locator("_react=SubmitButton[enabled=true]").ClickAsync(); await page.Locator("_vue=submit-button[enabled=true]").ClickAsync(); ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. @@ -1627,6 +1794,7 @@ This version of Playwright was also tested against the following stable channels [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1646,6 +1814,7 @@ This version of Playwright was also tested against the following stable channels [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/running-tests.mdx b/dotnet/versioned_docs/version-stable/running-tests.mdx index a396d776f04..0eb848c5f9c 100644 --- a/dotnet/versioned_docs/version-stable/running-tests.mdx +++ b/dotnet/versioned_docs/version-stable/running-tests.mdx @@ -237,7 +237,7 @@ dotnet test -![debugging tests with playwright inspector](https://github.com/microsoft/playwright/assets/13063165/a1e758d3-d379-414f-be0b-7339f12bb635) +debugging tests with playwright inspector Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright Inspector](./debug.mdx#playwright-inspector) as well as debugging with [Browser Developer tools](./debug.mdx#browser-developer-tools). @@ -259,6 +259,7 @@ Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -278,6 +279,7 @@ Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/screenshots.mdx b/dotnet/versioned_docs/version-stable/screenshots.mdx index fce4ba74c04..71efa5a7108 100644 --- a/dotnet/versioned_docs/version-stable/screenshots.mdx +++ b/dotnet/versioned_docs/version-stable/screenshots.mdx @@ -60,6 +60,7 @@ await page.Locator(".header").ScreenshotAsync(new() { Path = "screenshot.png" }) [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -79,6 +80,7 @@ await page.Locator(".header").ScreenshotAsync(new() { Path = "screenshot.png" }) [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/selenium-grid.mdx b/dotnet/versioned_docs/version-stable/selenium-grid.mdx index 994f98217a4..6401dc4025c 100644 --- a/dotnet/versioned_docs/version-stable/selenium-grid.mdx +++ b/dotnet/versioned_docs/version-stable/selenium-grid.mdx @@ -135,6 +135,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -154,6 +155,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/test-assertions.mdx b/dotnet/versioned_docs/version-stable/test-assertions.mdx index 7b84ee2c5f5..00f16f11537 100644 --- a/dotnet/versioned_docs/version-stable/test-assertions.mdx +++ b/dotnet/versioned_docs/version-stable/test-assertions.mdx @@ -154,6 +154,7 @@ await Expect(Page.GetByText("Name")).ToBeVisibleAsync(new() { Timeout = 10_000 } [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -173,6 +174,7 @@ await Expect(Page.GetByText("Name")).ToBeVisibleAsync(new() { Timeout = 10_000 } [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/test-runners.mdx b/dotnet/versioned_docs/version-stable/test-runners.mdx index 857830f8526..05339cc4884 100644 --- a/dotnet/versioned_docs/version-stable/test-runners.mdx +++ b/dotnet/versioned_docs/version-stable/test-runners.mdx @@ -467,6 +467,7 @@ There are a few base classes available to you in `Microsoft.Playwright.Xunit.v3` [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -486,6 +487,7 @@ There are a few base classes available to you in `Microsoft.Playwright.Xunit.v3` [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/touch-events.mdx b/dotnet/versioned_docs/version-stable/touch-events.mdx index 20ff2a00e29..c36383ba526 100644 --- a/dotnet/versioned_docs/version-stable/touch-events.mdx +++ b/dotnet/versioned_docs/version-stable/touch-events.mdx @@ -169,6 +169,7 @@ public class TouchEvents [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -188,6 +189,7 @@ public class TouchEvents [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/trace-viewer-intro.mdx b/dotnet/versioned_docs/version-stable/trace-viewer-intro.mdx index ab33e53f7b8..24220fe82fc 100644 --- a/dotnet/versioned_docs/version-stable/trace-viewer-intro.mdx +++ b/dotnet/versioned_docs/version-stable/trace-viewer-intro.mdx @@ -253,7 +253,7 @@ You can open the saved trace using the Playwright CLI or in your browser on [`tr pwsh bin/Debug/net8.0/playwright.ps1 show-trace bin/Debug/net8.0/playwright-traces/PlaywrightTests.ExampleTest.GetStartedLink.zip ``` -![playwright trace viewer dotnet](https://github.com/microsoft/playwright/assets/13063165/4372d661-5bfa-4e1f-be65-0d2fe165a75c) +playwright trace viewer dotnet Check out our detailed guide on [Trace Viewer](/trace-viewer.mdx) to learn more about the trace viewer and how to setup your tests to record a trace only when the test fails. @@ -273,6 +273,7 @@ Check out our detailed guide on [Trace Viewer](/trace-viewer.mdx) to learn more [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -292,6 +293,7 @@ Check out our detailed guide on [Trace Viewer](/trace-viewer.mdx) to learn more [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/trace-viewer.mdx b/dotnet/versioned_docs/version-stable/trace-viewer.mdx index 71c159fbb91..e01cff1d1ab 100644 --- a/dotnet/versioned_docs/version-stable/trace-viewer.mdx +++ b/dotnet/versioned_docs/version-stable/trace-viewer.mdx @@ -10,7 +10,7 @@ import LiteYouTube from '@site/src/components/LiteYouTube'; ## Introduction -Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. Traces are a great way for debugging your tests when they fail on CI. You can open traces [locally](#opening-the-trace) or in your browser on [trace.playwright.dev](https://trace.playwright.dev). +Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. Traces are a great way for debugging your tests when they fail on CI. You can open traces [locally](#opening-trace-viewer) or in your browser on [trace.playwright.dev](https://trace.playwright.dev). ## Opening Trace Viewer @@ -26,7 +26,7 @@ pwsh bin/Debug/netX/playwright.ps1 show-trace trace.zip Trace Viewer loads the trace entirely in your browser and does not transmit any data externally. -Drop Playwright Trace to load +Drop Playwright Trace to load ### Viewing remote traces @@ -517,7 +517,7 @@ public class WithTestNameAttribute : BeforeAfterTestAttribute In the Actions tab you can see what locator was used for every action and how long each one took to run. Hover over each action of your test and visually see the change in the DOM snapshot. Go back and forward in time and click an action to inspect and debug. Use the Before and After tabs to visually see what happened before and after the action. -![actions tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/948b65cd-f0fd-4c7f-8e53-2c632b5a07f1) +actions tab in trace viewer **Selecting each action reveals:** - Action snapshots @@ -530,7 +530,7 @@ When tracing with the [Screenshots](/api/class-tracing.mdx#tracing-start-option- Double click on an action to see the time range for that action. You can use the slider in the timeline to increase the actions selected and these will be shown in the Actions tab and all console logs and network logs will be filtered to only show the logs for the actions selected. -![timeline view in trace viewer](https://github.com/microsoft/playwright/assets/13063165/b04a7d75-54bb-4ab2-9e30-e76f6f74a2c8) +timeline view in trace viewer ### Snapshots @@ -544,7 +544,7 @@ When tracing with the [Snapshots](/api/class-tracing.mdx#tracing-start-option-sn Here is what the typical Action snapshot looks like: -![action tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/7168d549-eb0a-4964-9c93-483f03711fa9) +action tab in trace viewer Notice how it highlights both, the DOM Node as well as the exact click position. @@ -552,31 +552,31 @@ Notice how it highlights both, the DOM Node as well as the exact click position. When you click on an action in the sidebar, the line of code for that action is highlighted in the source panel. -![showing source code tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/daa8845d-c250-4923-aa7a-5d040da9adc5) +showing source code tab in trace viewer ### Call The call tab shows you information about the action such as the time it took, what locator was used, if in strict mode and what key was used. -![showing call tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/95498580-f9dd-4932-a123-c37fe7cfc3c2) +showing call tab in trace viewer ### Log See a full log of your test to better understand what Playwright is doing behind the scenes such as scrolling into view, waiting for element to be visible, enabled and stable and performing actions such as click, fill, press etc. -![showing log of tests in trace viewer](https://github.com/microsoft/playwright/assets/13063165/de621461-3bab-4140-b39d-9f02d6672dbf) +showing log of tests in trace viewer ### Errors If your test fails you will see the error messages for each test in the Errors tab. The timeline will also show a red line highlighting where the error occurred. You can also click on the source tab to see on which line of the source code the error is. -![showing errors in trace viewer](https://github.com/microsoft/playwright/assets/13063165/e9ef77b3-05d1-4df2-852c-981023723d34) +showing errors in trace viewer ### Console See console logs from the browser as well as from your test. Different icons are displayed to show you if the console log came from the browser or from the test file. -![showing log of tests in trace viewer](https://github.com/microsoft/playwright/assets/13063165/4107c08d-1eaf-421c-bdd4-9dd2aa641d4a) +showing log of tests in trace viewer Double click on an action from your test in the actions sidebar. This will filter the console to only show the logs that were made during that action. Click the *Show all* button to see all console logs again. @@ -586,7 +586,7 @@ Use the timeline to filter actions, by clicking a start point and dragging to an The Network tab shows you all the network requests that were made during your test. You can sort by different types of requests, status code, method, request, content type, duration and size. Click on a request to see more information about it such as the request headers, response headers, request body and response body. -![network requests tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/0a3d1671-8ccd-4f7a-a844-35f5eb37f236) +network requests tab in trace viewer Double click on an action from your test in the actions sidebar. This will filter the network requests to only show the requests that were made during that action. Click the *Show all* button to see all network requests again. @@ -596,7 +596,7 @@ Use the timeline to filter actions, by clicking a start point and dragging to an Next to the Actions tab you will find the Metadata tab which will show you more information on your test such as the Browser, viewport size, test duration and more. -![meta data in trace viewer](https://github.com/microsoft/playwright/assets/13063165/82ab3d33-1ec9-4b8a-9cf2-30a6e2d59091) +meta data in trace viewer [APIRequest]: /api/class-apirequest.mdx "APIRequest" @@ -610,6 +610,7 @@ Next to the Actions tab you will find the Metadata tab which will show you more [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -629,6 +630,7 @@ Next to the Actions tab you will find the Metadata tab which will show you more [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/videos.mdx b/dotnet/versioned_docs/version-stable/videos.mdx index ff032a54401..18c5b8de87d 100644 --- a/dotnet/versioned_docs/version-stable/videos.mdx +++ b/dotnet/versioned_docs/version-stable/videos.mdx @@ -57,6 +57,7 @@ Note that the video is only available after the page or browser context is close [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -76,6 +77,7 @@ Note that the video is only available after the page or browser context is close [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/webview2.mdx b/dotnet/versioned_docs/version-stable/webview2.mdx index 0b720f2ea31..d0465e3577e 100644 --- a/dotnet/versioned_docs/version-stable/webview2.mdx +++ b/dotnet/versioned_docs/version-stable/webview2.mdx @@ -152,6 +152,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -171,6 +172,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_docs/version-stable/writing-tests.mdx b/dotnet/versioned_docs/version-stable/writing-tests.mdx index fc262c32a06..0d251ac9b45 100644 --- a/dotnet/versioned_docs/version-stable/writing-tests.mdx +++ b/dotnet/versioned_docs/version-stable/writing-tests.mdx @@ -504,6 +504,7 @@ public class UnitTest1: PageTest [CDPSessionEvent]: /api/class-cdpsessionevent.mdx "CDPSessionEvent" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -523,6 +524,7 @@ public class UnitTest1: PageTest [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/dotnet/versioned_sidebars/version-stable-sidebars.json b/dotnet/versioned_sidebars/version-stable-sidebars.json index 990feb3f80b..ac71df3345d 100644 --- a/dotnet/versioned_sidebars/version-stable-sidebars.json +++ b/dotnet/versioned_sidebars/version-stable-sidebars.json @@ -251,6 +251,10 @@ "type": "doc", "id": "api/class-consolemessage" }, + { + "type": "doc", + "id": "api/class-debugger" + }, { "type": "doc", "id": "api/class-dialog" @@ -311,6 +315,10 @@ "type": "doc", "id": "api/class-route" }, + { + "type": "doc", + "id": "api/class-screencast" + }, { "type": "doc", "id": "api/class-selectors" diff --git a/java/versioned_docs/images/release-notes-1.59-dashboard.png b/java/versioned_docs/images/release-notes-1.59-dashboard.png new file mode 100644 index 00000000000..b951a63c4ef Binary files /dev/null and b/java/versioned_docs/images/release-notes-1.59-dashboard.png differ diff --git a/java/versioned_docs/images/release-notes-1.59-screencast-demo.gif b/java/versioned_docs/images/release-notes-1.59-screencast-demo.gif new file mode 100644 index 00000000000..90b2e029f5b Binary files /dev/null and b/java/versioned_docs/images/release-notes-1.59-screencast-demo.gif differ diff --git a/java/versioned_docs/version-stable/accessibility-testing.mdx b/java/versioned_docs/version-stable/accessibility-testing.mdx index e6f0cd9d490..939438f5c14 100644 --- a/java/versioned_docs/version-stable/accessibility-testing.mdx +++ b/java/versioned_docs/version-stable/accessibility-testing.mdx @@ -256,6 +256,7 @@ See experimental [JUnit integration](./junit.mdx) to automatically initialize Pl [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -277,6 +278,7 @@ See experimental [JUnit integration](./junit.mdx) to automatically initialize Pl [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/actionability.mdx b/java/versioned_docs/version-stable/actionability.mdx index b56e8201110..2bb69ebedfb 100644 --- a/java/versioned_docs/version-stable/actionability.mdx +++ b/java/versioned_docs/version-stable/actionability.mdx @@ -133,6 +133,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -154,6 +155,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api-testing.mdx b/java/versioned_docs/version-stable/api-testing.mdx index 9e9e31ddaef..7265f5e561e 100644 --- a/java/versioned_docs/version-stable/api-testing.mdx +++ b/java/versioned_docs/version-stable/api-testing.mdx @@ -451,6 +451,7 @@ BrowserContext context = browser.newContext(new Browser.NewContextOptions().setS [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -472,6 +473,7 @@ BrowserContext context = browser.newContext(new Browser.NewContextOptions().setS [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-apirequest.mdx b/java/versioned_docs/version-stable/api/class-apirequest.mdx index 5a02eeabde5..3383f2b544c 100644 --- a/java/versioned_docs/version-stable/api/class-apirequest.mdx +++ b/java/versioned_docs/version-stable/api/class-apirequest.mdx @@ -143,6 +143,7 @@ APIRequest.newContext(options); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -164,6 +165,7 @@ APIRequest.newContext(options); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-apirequestcontext.mdx b/java/versioned_docs/version-stable/api/class-apirequestcontext.mdx index e794937f0c4..3cfc10c8fdd 100644 --- a/java/versioned_docs/version-stable/api/class-apirequestcontext.mdx +++ b/java/versioned_docs/version-stable/api/class-apirequestcontext.mdx @@ -317,6 +317,7 @@ APIRequestContext.storageState(options); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -338,6 +339,7 @@ APIRequestContext.storageState(options); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-apiresponse.mdx b/java/versioned_docs/version-stable/api/class-apiresponse.mdx index 9eab4228ebd..55a4eabff80 100644 --- a/java/versioned_docs/version-stable/api/class-apiresponse.mdx +++ b/java/versioned_docs/version-stable/api/class-apiresponse.mdx @@ -182,6 +182,7 @@ APIResponse.url(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -203,6 +204,7 @@ APIResponse.url(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-apiresponseassertions.mdx b/java/versioned_docs/version-stable/api/class-apiresponseassertions.mdx index b12c477f99c..1fd0ac641cb 100644 --- a/java/versioned_docs/version-stable/api/class-apiresponseassertions.mdx +++ b/java/versioned_docs/version-stable/api/class-apiresponseassertions.mdx @@ -52,16 +52,14 @@ assertThat(response).isOK(); Added in: v1.20apiResponseAssertions.not() -Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful: - -```java -assertThat(response).not().isOK(); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the response status is not successful: + ```java -assertThat(response).not() +assertThat(response).not().isOK(); ``` **Returns** @@ -78,6 +76,7 @@ assertThat(response).not() [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -99,6 +98,7 @@ assertThat(response).not() [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-browser.mdx b/java/versioned_docs/version-stable/api/class-browser.mdx index 36a1463dd9a..d94670ce01c 100644 --- a/java/versioned_docs/version-stable/api/class-browser.mdx +++ b/java/versioned_docs/version-stable/api/class-browser.mdx @@ -30,6 +30,41 @@ public class Example { ## Methods +### bind {#browser-bind} + +Added in: v1.59browser.bind + +Binds the browser to a named pipe or web socket, making it available for other clients to connect to. + +**Usage** + +```java +Browser.bind(title); +Browser.bind(title, options); +``` + +**Arguments** +- `title` [String]# + + Title of the browser server, used for identification. +- `options` `Browser.BindOptions` *(optional)* + - `setHost` [String] *(optional)*# + + Host to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. + - `setPort` [int] *(optional)*# + + Port to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. Use `0` to let the OS pick an available port. + - `setWorkspaceDir` [String] *(optional)*# + + Working directory associated with this browser server. + +**Returns** +- Bind# + - `endpoint` [String] + + +--- + ### browserType {#browser-browser-type} Added in: v1.23browser.browserType @@ -654,6 +689,23 @@ Browser.stopTracing(); --- +### unbind {#browser-unbind} + +Added in: v1.59browser.unbind + +Unbinds the browser server previously bound with [Browser.bind()](/api/class-browser.mdx#browser-bind). + +**Usage** + +```java +Browser.unbind(); +``` + +**Returns** +- [void]# + +--- + ### version {#browser-version} Added before v1.9browser.version @@ -701,6 +753,7 @@ Browser.onDisconnected(handler) [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -722,6 +775,7 @@ Browser.onDisconnected(handler) [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-browsercontext.mdx b/java/versioned_docs/version-stable/api/class-browsercontext.mdx index c99a4695f9a..eb9eb428456 100644 --- a/java/versioned_docs/version-stable/api/class-browsercontext.mdx +++ b/java/versioned_docs/version-stable/api/class-browsercontext.mdx @@ -112,7 +112,7 @@ The order of evaluation of multiple scripts installed via [BrowserContext.addIni Script to be evaluated in all pages in the browser context. **Returns** -- [void]# +- [Disposable]# --- @@ -322,7 +322,7 @@ public class Example { Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported. **Returns** -- [void]# +- [Disposable]# --- @@ -388,7 +388,7 @@ public class Example { Callback function that will be called in the Playwright's context. **Returns** -- [void]# +- [Disposable]# --- @@ -433,6 +433,7 @@ BrowserContext.grantPermissions(permissions, options); * `'notifications'` * `'payment-handler'` * `'storage-access'` + * `'screen-wake-lock'` - `options` `BrowserContext.GrantPermissionsOptions` *(optional)* - `setOrigin` [String] *(optional)*# @@ -443,6 +444,23 @@ BrowserContext.grantPermissions(permissions, options); --- +### isClosed {#browser-context-is-closed} + +Added in: v1.59browserContext.isClosed + +Indicates that the browser context is in the process of closing or has already been closed. + +**Usage** + +```java +BrowserContext.isClosed(); +``` + +**Returns** +- [boolean]# + +--- + ### newCDPSession {#browser-context-new-cdp-session} Added in: v1.11browserContext.newCDPSession @@ -561,7 +579,7 @@ Enabling routing disables http cache. - `url` [String] | [Pattern] | [Predicate]<[String]># A glob pattern, regex pattern, or predicate that receives a [URL] to match during routing. If [setBaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) is set in the context options and the provided URL is a string that does not start with `*`, it is resolved using the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. -- `handler` [Consumer]<[Route]># +- `handler` [Consumer]<Route># handler function to route the request. - `options` `BrowserContext.RouteOptions` *(optional)* @@ -570,7 +588,7 @@ Enabling routing disables http cache. How often a route should be used. By default it will be used every time. **Returns** -- [void]# +- [Disposable]# --- @@ -644,7 +662,7 @@ context.routeWebSocket("/ws", ws -> { - `url` [String] | [Pattern] | [Predicate]<[String]># Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the [setBaseURL](/api/class-browser.mdx#browser-new-context-option-base-url) context option. -- `handler` [Consumer]<[WebSocketRoute]># +- `handler` [Consumer]<WebSocketRoute># Handler function to route the WebSocket. @@ -787,6 +805,29 @@ BrowserContext.setOffline(offline); --- +### setStorageState {#browser-context-set-storage-state} + +Added in: v1.59browserContext.setStorageState + +Clears the existing cookies, local storage and IndexedDB entries for all origins and sets the new storage state. + +**Usage** + +```java +// Load storage state from a file and apply it to the context. +context.setStorageState(Paths.get("state.json")); +``` + +**Arguments** +- `storageStatePath` [Path]# + + Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [BrowserContext.storageState()](/api/class-browsercontext.mdx#browser-context-storage-state). Path to the file with saved storage state. + +**Returns** +- [void]# + +--- + ### storageState {#browser-context-storage-state} Added before v1.9browserContext.storageState @@ -830,8 +871,8 @@ BrowserContext.unroute(url, handler); **Arguments** - `url` [String] | [Pattern] | [Predicate]<[String]># - A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with [BrowserContext.route()](/api/class-browsercontext.mdx#browser-context-route). -- `handler` [Consumer]<[Route]> *(optional)*# + A glob pattern, regex pattern, or predicate receiving [URL] used to register a routing with [BrowserContext.route()](/api/class-browsercontext.mdx#browser-context-route). +- `handler` [Consumer]<Route> *(optional)*# Optional handler function used to register a routing with [BrowserContext.route()](/api/class-browsercontext.mdx#browser-context-route). @@ -972,6 +1013,23 @@ BrowserContext.clock() --- +### debugger() {#browser-context-debugger} + +Added in: v1.59browserContext.debugger() + +Debugger allows to pause and resume the execution. + +**Usage** + +```java +BrowserContext.debugger() +``` + +**Returns** +- [Debugger] + +--- + ### request() {#browser-context-request} Added in: v1.16browserContext.request() @@ -1253,6 +1311,7 @@ BrowserContext.backgroundPages(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1274,6 +1333,7 @@ BrowserContext.backgroundPages(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-browsertype.mdx b/java/versioned_docs/version-stable/api/class-browsertype.mdx index 08bcceedced..b0ec032e545 100644 --- a/java/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/java/versioned_docs/version-stable/api/class-browsertype.mdx @@ -45,12 +45,12 @@ The major and minor version of the Playwright instance that connects needs to ma **Usage** ```java -BrowserType.connect(wsEndpoint); -BrowserType.connect(wsEndpoint, options); +BrowserType.connect(endpoint); +BrowserType.connect(endpoint, options); ``` **Arguments** -- `wsEndpoint` [String] Added in: v1.10# +- `endpoint` [String] Added in: v1.10# A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`. - `options` `BrowserType.ConnectOptions` *(optional)* @@ -179,6 +179,9 @@ Browser browser = chromium.launch(new BrowserType.LaunchOptions() ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `setArtifactsDir` [Path] *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `setChannel` [String] *(optional)*# Browser distribution channel. @@ -292,6 +295,9 @@ BrowserType.launchPersistentContext(userDataDir, options); ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `setArtifactsDir` [Path] *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `setBaseURL` [String] *(optional)*# When using [Page.navigate()](/api/class-page.mdx#page-goto), [Page.route()](/api/class-page.mdx#page-route), [Page.waitForURL()](/api/class-page.mdx#page-wait-for-url), [Page.waitForRequest()](/api/class-page.mdx#page-wait-for-request), or [Page.waitForResponse()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples: @@ -564,6 +570,7 @@ BrowserType.name(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -585,6 +592,7 @@ BrowserType.name(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-cdpsession.mdx b/java/versioned_docs/version-stable/api/class-cdpsession.mdx index 85925a0830f..47b6395c09b 100644 --- a/java/versioned_docs/version-stable/api/class-cdpsession.mdx +++ b/java/versioned_docs/version-stable/api/class-cdpsession.mdx @@ -68,7 +68,7 @@ CDPSession.off(eventName, handler); - `eventName` [String]# CDP event name. -- `handler` [Consumer]<[JsonObject]># +- `handler` [Consumer]<JsonObject># Event handler. @@ -90,7 +90,7 @@ CDPSession.on(eventName, handler); - `eventName` [String]# CDP event name. -- `handler` [Consumer]<[JsonObject]># +- `handler` [Consumer]<JsonObject># Event handler. @@ -118,6 +118,25 @@ CDPSession.send(method, args); **Returns** - [JsonObject]# +--- + +## Events + +### onClose(handler) {#cdp-session-event-close} + +Added in: v1.59cdpSession.onClose(handler) + +Emitted when the session is closed, either because the target was closed or `session.detach()` was called. + +**Usage** + +```java +CDPSession.onClose(handler) +``` + +**Event data** +- [CDPSession] + [APIRequest]: /api/class-apirequest.mdx "APIRequest" [APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" @@ -129,6 +148,7 @@ CDPSession.send(method, args); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -150,6 +170,7 @@ CDPSession.send(method, args); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-clock.mdx b/java/versioned_docs/version-stable/api/class-clock.mdx index 8524d9b7d75..4b50514706a 100644 --- a/java/versioned_docs/version-stable/api/class-clock.mdx +++ b/java/versioned_docs/version-stable/api/class-clock.mdx @@ -211,6 +211,7 @@ page.clock().setSystemTime("2020-02-02"); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -232,6 +233,7 @@ page.clock().setSystemTime("2020-02-02"); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-consolemessage.mdx b/java/versioned_docs/version-stable/api/class-consolemessage.mdx index b614793046a..de1eb8ed5f4 100644 --- a/java/versioned_docs/version-stable/api/class-consolemessage.mdx +++ b/java/versioned_docs/version-stable/api/class-consolemessage.mdx @@ -103,6 +103,23 @@ ConsoleMessage.text(); --- +### timestamp {#console-message-timestamp} + +Added in: v1.59consoleMessage.timestamp + +The timestamp of the console message in milliseconds since the Unix epoch. + +**Usage** + +```java +ConsoleMessage.timestamp(); +``` + +**Returns** +- [double]# + +--- + ### type {#console-message-type} Added before v1.9consoleMessage.type @@ -146,6 +163,7 @@ ConsoleMessage.worker(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -167,6 +185,7 @@ ConsoleMessage.worker(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-debugger.mdx b/java/versioned_docs/version-stable/api/class-debugger.mdx new file mode 100644 index 00000000000..a1d87b5a9b0 --- /dev/null +++ b/java/versioned_docs/version-stable/api/class-debugger.mdx @@ -0,0 +1,224 @@ +--- +id: class-debugger +title: "Debugger" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +API for controlling the Playwright debugger. The debugger allows pausing script execution and inspecting the page. Obtain the debugger instance via [BrowserContext.debugger()](/api/class-browsercontext.mdx#browser-context-debugger). + + +--- + +## Methods + +### next {#debugger-next} + +Added in: v1.59debugger.next + +Resumes script execution and pauses again before the next action. Throws if the debugger is not paused. + +**Usage** + +```java +Debugger.next(); +``` + +**Returns** +- [void]# + +--- + +### pausedDetails {#debugger-paused-details} + +Added in: v1.59debugger.pausedDetails + +Returns details about the currently paused call. Returns `null` if the debugger is not paused. + +**Usage** + +```java +Debugger.pausedDetails(); +``` + +**Returns** +- [null] | PausedDetails# + - `location` Location + - `file` [String] + + + - `line` [int] *(optional)* + + + - `column` [int] *(optional)* + + + + - `title` [String] + + +--- + +### requestPause {#debugger-request-pause} + +Added in: v1.59debugger.requestPause + +Configures the debugger to pause before the next action is executed. + +Throws if the debugger is already paused. Use [Debugger.next()](/api/class-debugger.mdx#debugger-next) or [Debugger.runTo()](/api/class-debugger.mdx#debugger-run-to) to step while paused. + +Note that [Page.pause()](/api/class-page.mdx#page-pause) is equivalent to a "debugger" statement — it pauses execution at the call site immediately. On the contrary, [Debugger.requestPause()](/api/class-debugger.mdx#debugger-request-pause) is equivalent to "pause on next statement" — it configures the debugger to pause before the next action is executed. + +**Usage** + +```java +Debugger.requestPause(); +``` + +**Returns** +- [void]# + +--- + +### resume {#debugger-resume} + +Added in: v1.59debugger.resume + +Resumes script execution. Throws if the debugger is not paused. + +**Usage** + +```java +Debugger.resume(); +``` + +**Returns** +- [void]# + +--- + +### runTo {#debugger-run-to} + +Added in: v1.59debugger.runTo + +Resumes script execution and pauses when an action originates from the given source location. Throws if the debugger is not paused. + +**Usage** + +```java +Debugger.runTo(location); +``` + +**Arguments** +- `location` Location# + - `setFile` [String] + + + - `setLine` [int] *(optional)* + + + - `setColumn` [int] *(optional)* + + + The source location to pause at. + +**Returns** +- [void]# + +--- + +## Events + +### onPausedStateChanged(handler) {#debugger-event-paused-state-changed} + +Added in: v1.59debugger.onPausedStateChanged(handler) + +Emitted when the debugger pauses or resumes. + +**Usage** + +```java +Debugger.onPausedStateChanged(handler) +``` + + +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Download]: /api/class-download.mdx "Download" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[FormData]: /api/class-formdata.mdx "FormData" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[PlaywrightException]: /api/class-playwrightexception.mdx "PlaywrightException" +[Request]: /api/class-request.mdx "Request" +[RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" +[Selectors]: /api/class-selectors.mdx "Selectors" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketFrame]: /api/class-websocketframe.mdx "WebSocketFrame" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[boolean]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "boolean" +[byte[]]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "byte[]" +[Consumer]: https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html "Consumer" +[Date]: https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date" +[double]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "double" +[InputStream]: https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream" +[int]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "int" +[long]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html "long" +[JsonObject]: https://www.javadoc.io/doc/com.google.code.gson/gson/latest/com.google.gson/com/google/gson/JsonObject.html "JsonObject" +[List]: https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List" +[Map]: https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map" +[null]: https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.7 "null" +[Object]: https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object" +[Path]: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path" +[Pattern]: https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html "Pattern" +[Predicate]: https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html "Predicate" +[void]: https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html "void" +[Runnable]: https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html "Runnable" +[RuntimeException]: https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException" +[String]: https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/java/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/java/about "Microsoft Artifact Registry" +[Dockerfile.noble]: https://github.com/microsoft/playwright-java/blob/main/utils/docker/Dockerfile.noble "Dockerfile.noble" diff --git a/java/versioned_docs/version-stable/api/class-dialog.mdx b/java/versioned_docs/version-stable/api/class-dialog.mdx index a885c843673..3564c2de9b9 100644 --- a/java/versioned_docs/version-stable/api/class-dialog.mdx +++ b/java/versioned_docs/version-stable/api/class-dialog.mdx @@ -157,6 +157,7 @@ Dialog.type(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -178,6 +179,7 @@ Dialog.type(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-download.mdx b/java/versioned_docs/version-stable/api/class-download.mdx index ac368767b3f..a0a3f11de50 100644 --- a/java/versioned_docs/version-stable/api/class-download.mdx +++ b/java/versioned_docs/version-stable/api/class-download.mdx @@ -203,6 +203,7 @@ Download.url(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -224,6 +225,7 @@ Download.url(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-elementhandle.mdx b/java/versioned_docs/version-stable/api/class-elementhandle.mdx index b0419f24801..06d4ad7f05a 100644 --- a/java/versioned_docs/version-stable/api/class-elementhandle.mdx +++ b/java/versioned_docs/version-stable/api/class-elementhandle.mdx @@ -1599,6 +1599,7 @@ This method does not work across navigations, use [Page.waitForSelector()](/api/ [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1620,6 +1621,7 @@ This method does not work across navigations, use [Page.waitForSelector()](/api/ [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-filechooser.mdx b/java/versioned_docs/version-stable/api/class-filechooser.mdx index e0fea5a321e..fa2215e0d2d 100644 --- a/java/versioned_docs/version-stable/api/class-filechooser.mdx +++ b/java/versioned_docs/version-stable/api/class-filechooser.mdx @@ -121,6 +121,7 @@ FileChooser.setFiles(files, options); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -142,6 +143,7 @@ FileChooser.setFiles(files, options); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-formdata.mdx b/java/versioned_docs/version-stable/api/class-formdata.mdx index c438d104382..1c2c669fce5 100644 --- a/java/versioned_docs/version-stable/api/class-formdata.mdx +++ b/java/versioned_docs/version-stable/api/class-formdata.mdx @@ -147,6 +147,7 @@ FormData.set(name, value); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -168,6 +169,7 @@ FormData.set(name, value); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-frame.mdx b/java/versioned_docs/version-stable/api/class-frame.mdx index 21df4c2b509..1417eae4555 100644 --- a/java/versioned_docs/version-stable/api/class-frame.mdx +++ b/java/versioned_docs/version-stable/api/class-frame.mdx @@ -466,7 +466,7 @@ Consider the following DOM structure. ``` -You can locate each element by it's implicit role: +You can locate each element by its implicit role: ```java assertThat(page @@ -562,7 +562,7 @@ Consider the following DOM structure. ``` -You can locate the element by it's test id: +You can locate the element by its test id: ```java page.getByTestId("directions").click(); @@ -1053,7 +1053,7 @@ frame.waitForURL("**/target.html"); **Arguments** - `url` [String] | [Pattern] | [Predicate]<[String]># - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `options` `Frame.WaitForURLOptions` *(optional)* - `setTimeout` [double] *(optional)*# @@ -2548,7 +2548,7 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [BrowserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [BrowserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [Page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [Page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. - `setUrl` [String] | [Pattern] | [Predicate]<[String]> *(optional)*# - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `setWaitUntil` `enum WaitUntilState { LOAD, DOMCONTENTLOADED, NETWORKIDLE, COMMIT }` *(optional)*# When to consider operation succeeded, defaults to `load`. Events can be either: @@ -2673,6 +2673,7 @@ Frame.waitForTimeout(timeout); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -2694,6 +2695,7 @@ Frame.waitForTimeout(timeout); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-framelocator.mdx b/java/versioned_docs/version-stable/api/class-framelocator.mdx index 78eedabc22c..e1c5d06ffcd 100644 --- a/java/versioned_docs/version-stable/api/class-framelocator.mdx +++ b/java/versioned_docs/version-stable/api/class-framelocator.mdx @@ -181,7 +181,7 @@ Consider the following DOM structure. ``` -You can locate each element by it's implicit role: +You can locate each element by its implicit role: ```java assertThat(page @@ -277,7 +277,7 @@ Consider the following DOM structure. ``` -You can locate the element by it's test id: +You can locate the element by its test id: ```java page.getByTestId("directions").click(); @@ -541,6 +541,7 @@ FrameLocator.nth(index); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -562,6 +563,7 @@ FrameLocator.nth(index); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-jshandle.mdx b/java/versioned_docs/version-stable/api/class-jshandle.mdx index 7754fe2685f..c16a481a1d3 100644 --- a/java/versioned_docs/version-stable/api/class-jshandle.mdx +++ b/java/versioned_docs/version-stable/api/class-jshandle.mdx @@ -195,6 +195,7 @@ JSHandle.jsonValue(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -216,6 +217,7 @@ JSHandle.jsonValue(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-keyboard.mdx b/java/versioned_docs/version-stable/api/class-keyboard.mdx index d4e332a3665..381c7d8c388 100644 --- a/java/versioned_docs/version-stable/api/class-keyboard.mdx +++ b/java/versioned_docs/version-stable/api/class-keyboard.mdx @@ -236,6 +236,7 @@ Keyboard.up(key); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -257,6 +258,7 @@ Keyboard.up(key); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/api/class-locator.mdx b/java/versioned_docs/version-stable/api/class-locator.mdx index fd9468f9731..85e9a81665c 100644 --- a/java/versioned_docs/version-stable/api/class-locator.mdx +++ b/java/versioned_docs/version-stable/api/class-locator.mdx @@ -57,7 +57,7 @@ If you need to assert text on the page, prefer [assertThat(locator).hasText()](/ **Usage** ```java -String[] texts = page.getByRole(AriaRole.LINK).allInnerTexts(); +List texts = page.getByRole(AriaRole.LINK).allInnerTexts(); ``` **Returns** @@ -79,7 +79,7 @@ If you need to assert text on the page, prefer [assertThat(locator).hasText()](/ **Usage** ```java -String[] texts = page.getByRole(AriaRole.LINK).allTextContents(); +List texts = page.getByRole(AriaRole.LINK).allTextContents(); ``` **Returns** @@ -125,6 +125,12 @@ page.getByRole(AriaRole.LINK).ariaSnapshot(); **Arguments** - `options` `Locator.AriaSnapshotOptions` *(optional)* + - `setDepth` [int] *(optional)* Added in: v1.59# + + When specified, limits the depth of the snapshot. + - `setMode` `enum AriaSnapshotMode { AI, DEFAULT }` *(optional)* Added in: v1.59# + + When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to `"default"`. See details for more information. - `setTimeout` [double] *(optional)*# 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. @@ -158,6 +164,9 @@ Below is the HTML markup and the respective ARIA snapshot: - link "About" ``` +An AI-optimized snapshot, controlled by [setMode](/api/class-locator.mdx#locator-aria-snapshot-option-mode), is different from a default snapshot: +1. Includes element references `[ref=e2]`. 2. Does not wait for an element matching the locator, and throws when no elements match. 3. Includes snapshots of ` - - + ### 🐂 Debian 11 Bullseye Support @@ -1401,7 +1565,7 @@ Read more in [our documentation](./test-assertions). [Tracing](./api/class-tracing.mdx) now can embed Java sources to recorded traces, using new [`setSources`](./api/class-tracing#tracing-start-option-sources) option. -![tracing-java-sources](https://user-images.githubusercontent.com/746130/150180856-40a7df71-370c-4597-8665-40c77a5e06ad.png) +tracing-java-sources ### New APIs & changes - [`acceptDownloads`](./api/class-browser#browser-new-context-option-accept-downloads) option now defaults to `true`. @@ -1421,7 +1585,7 @@ This version was also tested against the following stable channels: Playwright 1.17 introduces [frame locators](./api/class-framelocator) - a locator to the iframe on the page. Frame locators capture the logic sufficient to retrieve the `iframe` and then locate elements in that iframe. Frame locators are strict by default, will wait for `iframe` to appear and can be used in Web-First assertions. -![Graphics](https://user-images.githubusercontent.com/746130/142082759-2170db38-370d-43ec-8d41-5f9941f57d83.png) +Graphics Frame locators can be created with either [Page.frameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.frameLocator()](/api/class-locator.mdx#locator-frame-locator) method. @@ -1442,13 +1606,13 @@ Playwright Trace Viewer is now **available online** at https://trace.playwright. - New trace metadata tab with browser details - Snapshots now have URL bar -![image](https://user-images.githubusercontent.com/746130/141877831-29e37cd1-e574-4bd9-aab5-b13a463bb4ae.png) +image ### HTML Report Update - HTML report now supports dynamic filtering - Report is now a **single static HTML file** that could be sent by e-mail or as a slack attachment. -![image](https://user-images.githubusercontent.com/746130/141877402-e486643d-72c7-4db3-8844-ed2072c5d676.png) +image ### Ubuntu ARM64 support + more - Playwright now supports **Ubuntu 20.04 ARM64**. You can now run Playwright tests inside Docker on Apple M1 and on Raspberry Pi. @@ -1553,7 +1717,7 @@ locator.click(); Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -1562,7 +1726,7 @@ page.locator("_react=SubmitButton[enabled=true]").click(); page.locator("_vue=submit-button[enabled=true]").click(); ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. @@ -1646,7 +1810,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="sh That will open the following GUI: -![image](https://user-images.githubusercontent.com/746130/121109654-d66c4480-c7c0-11eb-8d4d-eb70d2b03811.png) +image 👉 Read more in [trace viewer documentation](./trace-viewer.mdx). @@ -1787,6 +1951,7 @@ This version of Playwright was also tested against the following stable channels [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1808,6 +1973,7 @@ This version of Playwright was also tested against the following stable channels [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/running-tests.mdx b/java/versioned_docs/version-stable/running-tests.mdx index 51e9aa9e33a..7943a1ed6d5 100644 --- a/java/versioned_docs/version-stable/running-tests.mdx +++ b/java/versioned_docs/version-stable/running-tests.mdx @@ -106,6 +106,7 @@ If you prefer, you can run your tests in headed mode by using the `launch(new Br [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -127,6 +128,7 @@ If you prefer, you can run your tests in headed mode by using the `launch(new Br [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/screenshots.mdx b/java/versioned_docs/version-stable/screenshots.mdx index 90dbb322a90..de8689d6d8f 100644 --- a/java/versioned_docs/version-stable/screenshots.mdx +++ b/java/versioned_docs/version-stable/screenshots.mdx @@ -55,6 +55,7 @@ page.locator(".header").screenshot(new Locator.ScreenshotOptions().setPath(Paths [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -76,6 +77,7 @@ page.locator(".header").screenshot(new Locator.ScreenshotOptions().setPath(Paths [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/selenium-grid.mdx b/java/versioned_docs/version-stable/selenium-grid.mdx index 87a1a1d154e..912069e496a 100644 --- a/java/versioned_docs/version-stable/selenium-grid.mdx +++ b/java/versioned_docs/version-stable/selenium-grid.mdx @@ -134,6 +134,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -155,6 +156,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/test-assertions.mdx b/java/versioned_docs/version-stable/test-assertions.mdx index 88dc40b867c..c0d1a396015 100644 --- a/java/versioned_docs/version-stable/test-assertions.mdx +++ b/java/versioned_docs/version-stable/test-assertions.mdx @@ -50,6 +50,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -71,6 +72,7 @@ import HTMLCard from '@site/src/components/HTMLCard'; [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/test-runners.mdx b/java/versioned_docs/version-stable/test-runners.mdx index 6455c98005d..f2c977d728b 100644 --- a/java/versioned_docs/version-stable/test-runners.mdx +++ b/java/versioned_docs/version-stable/test-runners.mdx @@ -351,6 +351,7 @@ public class TestExample { [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -372,6 +373,7 @@ public class TestExample { [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/threading.mdx b/java/versioned_docs/version-stable/threading.mdx index e97e36a486b..370d0cbde3e 100644 --- a/java/versioned_docs/version-stable/threading.mdx +++ b/java/versioned_docs/version-stable/threading.mdx @@ -91,6 +91,7 @@ page.waitForTimeout(60_000); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -112,6 +113,7 @@ page.waitForTimeout(60_000); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/touch-events.mdx b/java/versioned_docs/version-stable/touch-events.mdx index 1041b23f9af..0fd1ac56b26 100644 --- a/java/versioned_docs/version-stable/touch-events.mdx +++ b/java/versioned_docs/version-stable/touch-events.mdx @@ -161,6 +161,7 @@ public class TouchEvents { [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -182,6 +183,7 @@ public class TouchEvents { [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/trace-viewer-intro.mdx b/java/versioned_docs/version-stable/trace-viewer-intro.mdx index 1110c26c0a2..84eef3b432c 100644 --- a/java/versioned_docs/version-stable/trace-viewer-intro.mdx +++ b/java/versioned_docs/version-stable/trace-viewer-intro.mdx @@ -47,7 +47,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="sh ``` ###### -![playwright trace viewer](https://github.com/microsoft/playwright/assets/13063165/10fe3585-8401-4051-b1c2-b2e92ac4c274) +playwright trace viewer To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). @@ -66,6 +66,7 @@ To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -87,6 +88,7 @@ To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/trace-viewer.mdx b/java/versioned_docs/version-stable/trace-viewer.mdx index bcb0b0fb7eb..3494800f112 100644 --- a/java/versioned_docs/version-stable/trace-viewer.mdx +++ b/java/versioned_docs/version-stable/trace-viewer.mdx @@ -10,7 +10,7 @@ import LiteYouTube from '@site/src/components/LiteYouTube'; ## Introduction -Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. Traces are a great way for debugging your tests when they fail on CI. You can open traces [locally](#opening-the-trace) or in your browser on [trace.playwright.dev](https://trace.playwright.dev). +Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. Traces are a great way for debugging your tests when they fail on CI. You can open traces [locally](#opening-trace-viewer) or in your browser on [trace.playwright.dev](https://trace.playwright.dev). ## Opening Trace Viewer @@ -26,7 +26,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="sh Trace Viewer loads the trace entirely in your browser and does not transmit any data externally. -Drop Playwright Trace to load +Drop Playwright Trace to load ### Viewing remote traces @@ -72,7 +72,7 @@ This will record the trace and place it into the file named `trace.zip`. In the Actions tab you can see what locator was used for every action and how long each one took to run. Hover over each action of your test and visually see the change in the DOM snapshot. Go back and forward in time and click an action to inspect and debug. Use the Before and After tabs to visually see what happened before and after the action. -![actions tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/948b65cd-f0fd-4c7f-8e53-2c632b5a07f1) +actions tab in trace viewer **Selecting each action reveals:** - Action snapshots @@ -85,7 +85,7 @@ When tracing with the [setScreenshots](/api/class-tracing.mdx#tracing-start-opti Double click on an action to see the time range for that action. You can use the slider in the timeline to increase the actions selected and these will be shown in the Actions tab and all console logs and network logs will be filtered to only show the logs for the actions selected. -![timeline view in trace viewer](https://github.com/microsoft/playwright/assets/13063165/b04a7d75-54bb-4ab2-9e30-e76f6f74a2c8) +timeline view in trace viewer ### Snapshots @@ -99,7 +99,7 @@ When tracing with the [setSnapshots](/api/class-tracing.mdx#tracing-start-option Here is what the typical Action snapshot looks like: -![action tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/7168d549-eb0a-4964-9c93-483f03711fa9) +action tab in trace viewer Notice how it highlights both, the DOM Node as well as the exact click position. @@ -107,31 +107,31 @@ Notice how it highlights both, the DOM Node as well as the exact click position. When you click on an action in the sidebar, the line of code for that action is highlighted in the source panel. -![showing source code tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/daa8845d-c250-4923-aa7a-5d040da9adc5) +showing source code tab in trace viewer ### Call The call tab shows you information about the action such as the time it took, what locator was used, if in strict mode and what key was used. -![showing call tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/95498580-f9dd-4932-a123-c37fe7cfc3c2) +showing call tab in trace viewer ### Log See a full log of your test to better understand what Playwright is doing behind the scenes such as scrolling into view, waiting for element to be visible, enabled and stable and performing actions such as click, fill, press etc. -![showing log of tests in trace viewer](https://github.com/microsoft/playwright/assets/13063165/de621461-3bab-4140-b39d-9f02d6672dbf) +showing log of tests in trace viewer ### Errors If your test fails you will see the error messages for each test in the Errors tab. The timeline will also show a red line highlighting where the error occurred. You can also click on the source tab to see on which line of the source code the error is. -![showing errors in trace viewer](https://github.com/microsoft/playwright/assets/13063165/e9ef77b3-05d1-4df2-852c-981023723d34) +showing errors in trace viewer ### Console See console logs from the browser as well as from your test. Different icons are displayed to show you if the console log came from the browser or from the test file. -![showing log of tests in trace viewer](https://github.com/microsoft/playwright/assets/13063165/4107c08d-1eaf-421c-bdd4-9dd2aa641d4a) +showing log of tests in trace viewer Double click on an action from your test in the actions sidebar. This will filter the console to only show the logs that were made during that action. Click the *Show all* button to see all console logs again. @@ -141,7 +141,7 @@ Use the timeline to filter actions, by clicking a start point and dragging to an The Network tab shows you all the network requests that were made during your test. You can sort by different types of requests, status code, method, request, content type, duration and size. Click on a request to see more information about it such as the request headers, response headers, request body and response body. -![network requests tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/0a3d1671-8ccd-4f7a-a844-35f5eb37f236) +network requests tab in trace viewer Double click on an action from your test in the actions sidebar. This will filter the network requests to only show the requests that were made during that action. Click the *Show all* button to see all network requests again. @@ -151,7 +151,7 @@ Use the timeline to filter actions, by clicking a start point and dragging to an Next to the Actions tab you will find the Metadata tab which will show you more information on your test such as the Browser, viewport size, test duration and more. -![meta data in trace viewer](https://github.com/microsoft/playwright/assets/13063165/82ab3d33-1ec9-4b8a-9cf2-30a6e2d59091) +meta data in trace viewer [APIRequest]: /api/class-apirequest.mdx "APIRequest" @@ -164,6 +164,7 @@ Next to the Actions tab you will find the Metadata tab which will show you more [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -185,6 +186,7 @@ Next to the Actions tab you will find the Metadata tab which will show you more [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/videos.mdx b/java/versioned_docs/version-stable/videos.mdx index 53b66491503..c1ef143a57e 100644 --- a/java/versioned_docs/version-stable/videos.mdx +++ b/java/versioned_docs/version-stable/videos.mdx @@ -49,6 +49,7 @@ Note that the video is only available after the page or browser context is close [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -70,6 +71,7 @@ Note that the video is only available after the page or browser context is close [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/webview2.mdx b/java/versioned_docs/version-stable/webview2.mdx index 394d4f055ff..30cdec7533a 100644 --- a/java/versioned_docs/version-stable/webview2.mdx +++ b/java/versioned_docs/version-stable/webview2.mdx @@ -187,6 +187,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -208,6 +209,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_docs/version-stable/writing-tests.mdx b/java/versioned_docs/version-stable/writing-tests.mdx index 95018cbf098..6f1cd4308c5 100644 --- a/java/versioned_docs/version-stable/writing-tests.mdx +++ b/java/versioned_docs/version-stable/writing-tests.mdx @@ -106,6 +106,7 @@ Page page = context.newPage(); [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -127,6 +128,7 @@ Page page = context.newPage(); [RequestOptions]: /api/class-requestoptions.mdx "RequestOptions" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/java/versioned_sidebars/version-stable-sidebars.json b/java/versioned_sidebars/version-stable-sidebars.json index 635b9a951ac..5b3dc3ef763 100644 --- a/java/versioned_sidebars/version-stable-sidebars.json +++ b/java/versioned_sidebars/version-stable-sidebars.json @@ -255,6 +255,10 @@ "type": "doc", "id": "api/class-consolemessage" }, + { + "type": "doc", + "id": "api/class-debugger" + }, { "type": "doc", "id": "api/class-dialog" @@ -323,6 +327,10 @@ "type": "doc", "id": "api/class-route" }, + { + "type": "doc", + "id": "api/class-screencast" + }, { "type": "doc", "id": "api/class-selectors" diff --git a/nodejs/versioned_docs/images/release-notes-1.59-dashboard.png b/nodejs/versioned_docs/images/release-notes-1.59-dashboard.png new file mode 100644 index 00000000000..b951a63c4ef Binary files /dev/null and b/nodejs/versioned_docs/images/release-notes-1.59-dashboard.png differ diff --git a/nodejs/versioned_docs/images/release-notes-1.59-screencast-demo.gif b/nodejs/versioned_docs/images/release-notes-1.59-screencast-demo.gif new file mode 100644 index 00000000000..90b2e029f5b Binary files /dev/null and b/nodejs/versioned_docs/images/release-notes-1.59-screencast-demo.gif differ diff --git a/nodejs/versioned_docs/version-stable/accessibility-testing.mdx b/nodejs/versioned_docs/version-stable/accessibility-testing.mdx index 9b8f0b6fb05..b3dbee51046 100644 --- a/nodejs/versioned_docs/version-stable/accessibility-testing.mdx +++ b/nodejs/versioned_docs/version-stable/accessibility-testing.mdx @@ -350,7 +350,9 @@ test('example using custom fixture', async ({ page, makeAxeBuilder }) => { [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -372,6 +374,7 @@ test('example using custom fixture', async ({ page, makeAxeBuilder }) => { [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/actionability.mdx b/nodejs/versioned_docs/version-stable/actionability.mdx index e72c40edaac..aa5e7b4ca7d 100644 --- a/nodejs/versioned_docs/version-stable/actionability.mdx +++ b/nodejs/versioned_docs/version-stable/actionability.mdx @@ -140,7 +140,9 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -162,6 +164,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api-testing.mdx b/nodejs/versioned_docs/version-stable/api-testing.mdx index 5072e812205..d49a7170cd2 100644 --- a/nodejs/versioned_docs/version-stable/api-testing.mdx +++ b/nodejs/versioned_docs/version-stable/api-testing.mdx @@ -391,7 +391,9 @@ test('global context request has isolated cookie storage', async ({ [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -413,6 +415,7 @@ test('global context request has isolated cookie storage', async ({ [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-android.mdx b/nodejs/versioned_docs/version-stable/api/class-android.mdx index 5df34f8dd16..9c8043213dc 100644 --- a/nodejs/versioned_docs/version-stable/api/class-android.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-android.mdx @@ -93,12 +93,12 @@ This methods attaches Playwright to an existing Android device. Use [android.lau **Usage** ```js -await android.connect(wsEndpoint); -await android.connect(wsEndpoint, options); +await android.connect(endpoint); +await android.connect(endpoint, options); ``` **Arguments** -- `wsEndpoint` [string]# +- `endpoint` [string]# A browser websocket endpoint to connect to. - `options` [Object] *(optional)* @@ -261,7 +261,9 @@ android.setDefaultTimeout(timeout); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -283,6 +285,7 @@ android.setDefaultTimeout(timeout); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-androiddevice.mdx b/nodejs/versioned_docs/version-stable/api/class-androiddevice.mdx index a6ba2d859bb..00fc63052c0 100644 --- a/nodejs/versioned_docs/version-stable/api/class-androiddevice.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-androiddevice.mdx @@ -322,9 +322,9 @@ await androidDevice.launchBrowser(options); Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - `recordVideo` [Object] *(optional)*# - - `dir` [string] + - `dir` [string] *(optional)* - Path to the directory to put videos into. + Path to the directory to put videos into. If not specified, the videos will be stored in `artifactsDir` (see [browserType.launch()](/api/class-browsertype.mdx#browser-type-launch) options). - `size` [Object] *(optional)* - `width` [number] @@ -334,6 +334,18 @@ await androidDevice.launchBrowser(options); Video frame height. Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size. + - `showActions` [Object] *(optional)* + - `duration` [number] *(optional)* + + How long each annotation is displayed in milliseconds. Defaults to `500`. + - `position` "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" *(optional)* + + Position of the action title overlay. Defaults to `"top-right"`. + - `fontSize` [number] *(optional)* + + Font size of the action title in pixels. Defaults to `24`. + + If specified, enables visual annotations on interacted elements during video recording. Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. - `reducedMotion` [null] | "reduce" | "no-preference" *(optional)*# @@ -957,7 +969,9 @@ androidDevice.on('webview', data => {}); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -979,6 +993,7 @@ androidDevice.on('webview', data => {}); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-androidinput.mdx b/nodejs/versioned_docs/version-stable/api/class-androidinput.mdx index 5b8d3393a6d..681ccf6187e 100644 --- a/nodejs/versioned_docs/version-stable/api/class-androidinput.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-androidinput.mdx @@ -175,7 +175,9 @@ await androidInput.type(text); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -197,6 +199,7 @@ await androidInput.type(text); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-androidsocket.mdx b/nodejs/versioned_docs/version-stable/api/class-androidsocket.mdx index 0e32f9feb6b..56374bd8e6d 100644 --- a/nodejs/versioned_docs/version-stable/api/class-androidsocket.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-androidsocket.mdx @@ -102,7 +102,9 @@ androidSocket.on('data', data => {}); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -124,6 +126,7 @@ androidSocket.on('data', data => {}); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-androidwebview.mdx b/nodejs/versioned_docs/version-stable/api/class-androidwebview.mdx index ac1cc740376..9d6f7d14824 100644 --- a/nodejs/versioned_docs/version-stable/api/class-androidwebview.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-androidwebview.mdx @@ -97,7 +97,9 @@ androidWebView.on('close', data => {}); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -119,6 +121,7 @@ androidWebView.on('close', data => {}); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-apirequest.mdx b/nodejs/versioned_docs/version-stable/api/class-apirequest.mdx index 96b1c5220c0..f874d845e97 100644 --- a/nodejs/versioned_docs/version-stable/api/class-apirequest.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-apirequest.mdx @@ -185,7 +185,9 @@ await apiRequest.newContext(options); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -207,6 +209,7 @@ await apiRequest.newContext(options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-apirequestcontext.mdx b/nodejs/versioned_docs/version-stable/api/class-apirequestcontext.mdx index 2bfdad0740d..6a0b78185f6 100644 --- a/nodejs/versioned_docs/version-stable/api/class-apirequestcontext.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-apirequestcontext.mdx @@ -642,7 +642,9 @@ await apiRequestContext.storageState(options); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -664,6 +666,7 @@ await apiRequestContext.storageState(options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-apiresponse.mdx b/nodejs/versioned_docs/version-stable/api/class-apiresponse.mdx index 0ac972bb669..177ac3b2b50 100644 --- a/nodejs/versioned_docs/version-stable/api/class-apiresponse.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-apiresponse.mdx @@ -208,7 +208,9 @@ apiResponse.url(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -230,6 +232,7 @@ apiResponse.url(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-apiresponseassertions.mdx b/nodejs/versioned_docs/version-stable/api/class-apiresponseassertions.mdx index 1050a54e6b6..bebc63bdbb9 100644 --- a/nodejs/versioned_docs/version-stable/api/class-apiresponseassertions.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-apiresponseassertions.mdx @@ -47,16 +47,14 @@ await expect(response).toBeOK(); Added in: v1.20apiResponseAssertions.not -Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful: - -```js -await expect(response).not.toBeOK(); -``` +Makes the assertion check for the opposite condition. **Usage** +For example, this code tests that the response status is not successful: + ```js -expect(response).not +await expect(response).not.toBeOK(); ``` **Type** @@ -80,7 +78,9 @@ expect(response).not [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -102,6 +102,7 @@ expect(response).not [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-browser.mdx b/nodejs/versioned_docs/version-stable/api/class-browser.mdx index e3208aad8de..9e35ed9804d 100644 --- a/nodejs/versioned_docs/version-stable/api/class-browser.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-browser.mdx @@ -25,6 +25,44 @@ const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'. ## Methods +### bind {#browser-bind} + +Added in: v1.59browser.bind + +Binds the browser to a named pipe or web socket, making it available for other clients to connect to. + +**Usage** + +```js +await browser.bind(title); +await browser.bind(title, options); +``` + +**Arguments** +- `title` [string]# + + Title of the browser server, used for identification. +- `options` [Object] *(optional)* + - `host` [string] *(optional)*# + + Host to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. + - `metadata` [Object]<[string], [Object]> *(optional)*# + + Additional metadata to associate with the browser server. + - `port` [number] *(optional)*# + + Port to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. Use `0` to let the OS pick an available port. + - `workspaceDir` [string] *(optional)*# + + Working directory associated with this browser server. + +**Returns** +- [Promise]<[Object]># + - `endpoint` [string] + + +--- + ### browserType {#browser-browser-type} Added in: v1.23browser.browserType @@ -319,9 +357,9 @@ If directly using this method to create [BrowserContext]s, it is best practice t Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - `recordVideo` [Object] *(optional)*# - - `dir` [string] + - `dir` [string] *(optional)* - Path to the directory to put videos into. + Path to the directory to put videos into. If not specified, the videos will be stored in `artifactsDir` (see [browserType.launch()](/api/class-browsertype.mdx#browser-type-launch) options). - `size` [Object] *(optional)* - `width` [number] @@ -331,6 +369,18 @@ If directly using this method to create [BrowserContext]s, it is best practice t Video frame height. Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size. + - `showActions` [Object] *(optional)* + - `duration` [number] *(optional)* + + How long each annotation is displayed in milliseconds. Defaults to `500`. + - `position` "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" *(optional)* + + Position of the action title overlay. Defaults to `"top-right"`. + - `fontSize` [number] *(optional)* + + Font size of the action title in pixels. Defaults to `24`. + + If specified, enables visual annotations on interacted elements during video recording. Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. - `reducedMotion` [null] | "reduce" | "no-preference" *(optional)*# @@ -613,9 +663,9 @@ await browser.newPage(options); Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - `recordVideo` [Object] *(optional)*# - - `dir` [string] + - `dir` [string] *(optional)* - Path to the directory to put videos into. + Path to the directory to put videos into. If not specified, the videos will be stored in `artifactsDir` (see [browserType.launch()](/api/class-browsertype.mdx#browser-type-launch) options). - `size` [Object] *(optional)* - `width` [number] @@ -625,6 +675,18 @@ await browser.newPage(options); Video frame height. Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size. + - `showActions` [Object] *(optional)* + - `duration` [number] *(optional)* + + How long each annotation is displayed in milliseconds. Defaults to `500`. + - `position` "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" *(optional)* + + Position of the action title overlay. Defaults to `"top-right"`. + - `fontSize` [number] *(optional)* + + Font size of the action title in pixels. Defaults to `24`. + + If specified, enables visual annotations on interacted elements during video recording. Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. - `reducedMotion` [null] | "reduce" | "no-preference" *(optional)*# @@ -825,6 +887,23 @@ await browser.stopTracing(); --- +### unbind {#browser-unbind} + +Added in: v1.59browser.unbind + +Unbinds the browser server previously bound with [browser.bind()](/api/class-browser.mdx#browser-bind). + +**Usage** + +```js +await browser.unbind(); +``` + +**Returns** +- [Promise]<[void]># + +--- + ### version {#browser-version} Added before v1.9browser.version @@ -879,7 +958,9 @@ browser.on('disconnected', data => {}); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -901,6 +982,7 @@ browser.on('disconnected', data => {}); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx b/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx index f168b63a539..3a226f0e955 100644 --- a/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-browsercontext.mdx @@ -123,7 +123,7 @@ The order of evaluation of multiple scripts installed via [browserContext.addIni Optional argument to pass to [script](/api/class-browsercontext.mdx#browser-context-add-init-script-option-script) (only supported when passing a function). **Returns** -- [Promise]<[void]># +- [Promise]<[Disposable]># --- @@ -329,7 +329,7 @@ const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'. Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported. **Returns** -- [Promise]<[void]># +- [Promise]<[Disposable]># --- @@ -380,7 +380,7 @@ const crypto = require('crypto'); Callback function that will be called in the Playwright's context. **Returns** -- [Promise]<[void]># +- [Promise]<[Disposable]># --- @@ -425,6 +425,7 @@ await browserContext.grantPermissions(permissions, options); * `'notifications'` * `'payment-handler'` * `'storage-access'` + * `'screen-wake-lock'` - `options` [Object] *(optional)* - `origin` [string] *(optional)*# @@ -435,6 +436,23 @@ await browserContext.grantPermissions(permissions, options); --- +### isClosed {#browser-context-is-closed} + +Added in: v1.59browserContext.isClosed + +Indicates that the browser context is in the process of closing or has already been closed. + +**Usage** + +```js +browserContext.isClosed(); +``` + +**Returns** +- [boolean]# + +--- + ### newCDPSession {#browser-context-new-cdp-session} Added in: v1.11browserContext.newCDPSession @@ -578,9 +596,9 @@ Enabling routing disables http cache. ::: **Arguments** -- `url` [string] | [RegExp] | [function]\([URL]\):[boolean]# +- `url` [string] | [RegExp] | [URLPattern] | [function]\([URL]\):[boolean]# - A glob pattern, regex pattern, or predicate that receives a [URL] to match during routing. If [baseURL](/api/class-browser.mdx#browser-new-context-option-base-url) is set in the context options and the provided URL is a string that does not start with `*`, it is resolved using the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. + A glob pattern, regex pattern, URL pattern, or predicate that receives a [URL] to match during routing. If [baseURL](/api/class-browser.mdx#browser-new-context-option-base-url) is set in the context options and the provided URL is a string that does not start with `*`, it is resolved using the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. - `handler` [function]\([Route], [Request]\):[Promise]<[Object]> | [Object]# handler function to route the request. @@ -590,7 +608,7 @@ Enabling routing disables http cache. How often a route should be used. By default it will be used every time. **Returns** -- [Promise]<[void]># +- [Promise]<[Disposable]># --- @@ -829,6 +847,71 @@ await browserContext.setOffline(offline); --- +### setStorageState {#browser-context-set-storage-state} + +Added in: v1.59browserContext.setStorageState + +Clears the existing cookies, local storage and IndexedDB entries for all origins and sets the new storage state. + +**Usage** + +```js +// Load storage state from a file and apply it to the context. +await context.setStorageState('state.json'); +``` + +**Arguments** +- `storageState` [string] | [Object]# + - `cookies` [Array]<[Object]> + - `name` [string] + + + - `value` [string] + + + - `domain` [string] + + Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com" + - `path` [string] + + Domain and path are required + - `expires` [number] + + Unix time in seconds. + - `httpOnly` [boolean] + + + - `secure` [boolean] + + + - `sameSite` "Strict" | "Lax" | "None" + + sameSite flag + + Cookies to set for context + - `origins` [Array]<[Object]> + - `origin` [string] + + + - `localStorage` [Array]<[Object]> + - `name` [string] + + + - `value` [string] + + + localStorage to set for context + + + Learn more about [storage state and auth](../auth.mdx). + + Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [browserContext.storageState()](/api/class-browsercontext.mdx#browser-context-storage-state). + +**Returns** +- [Promise]<[void]># + +--- + ### storageState {#browser-context-storage-state} Added before v1.9browserContext.storageState @@ -908,9 +991,9 @@ await browserContext.unroute(url, handler); ``` **Arguments** -- `url` [string] | [RegExp] | [function]\([URL]\):[boolean]# +- `url` [string] | [RegExp] | [URLPattern] | [function]\([URL]\):[boolean]# - A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with [browserContext.route()](/api/class-browsercontext.mdx#browser-context-route). + A glob pattern, regex pattern, URL pattern, or predicate receiving [URL] used to register a routing with [browserContext.route()](/api/class-browsercontext.mdx#browser-context-route). - `handler` [function]\([Route], [Request]\):[Promise]<[Object]> | [Object] *(optional)*# Optional handler function used to register a routing with [browserContext.route()](/api/class-browsercontext.mdx#browser-context-route). @@ -1003,6 +1086,23 @@ browserContext.clock --- +### debugger {#browser-context-debugger} + +Added in: v1.59browserContext.debugger + +Debugger allows to pause and resume the execution. + +**Usage** + +```js +browserContext.debugger +``` + +**Type** +- [Debugger] + +--- + ### request {#browser-context-request} Added in: v1.16browserContext.request @@ -1345,7 +1445,9 @@ await browserContext.setHTTPCredentials(httpCredentials); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -1367,6 +1469,7 @@ await browserContext.setHTTPCredentials(httpCredentials); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-browserserver.mdx b/nodejs/versioned_docs/version-stable/api/class-browserserver.mdx index f636d8ba612..a015b13e4ca 100644 --- a/nodejs/versioned_docs/version-stable/api/class-browserserver.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-browserserver.mdx @@ -116,7 +116,9 @@ browserServer.on('close', data => {}); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -138,6 +140,7 @@ browserServer.on('close', data => {}); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx b/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx index 5258a0f8438..4dca4f39384 100644 --- a/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-browsertype.mdx @@ -40,12 +40,12 @@ The major and minor version of the Playwright instance that connects needs to ma **Usage** ```js -await browserType.connect(wsEndpoint); -await browserType.connect(wsEndpoint, options); +await browserType.connect(endpoint); +await browserType.connect(endpoint, options); ``` **Arguments** -- `wsEndpoint` [string] Added in: v1.10# +- `endpoint` [string] Added in: v1.10# A Playwright browser websocket endpoint to connect to. You obtain this endpoint via `BrowserServer.wsEndpoint`. - `options` [Object] *(optional)* @@ -196,6 +196,9 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'. ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `artifactsDir` [string] *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `channel` [string] *(optional)*# Browser distribution channel. @@ -312,6 +315,9 @@ await browserType.launchPersistentContext(userDataDir, options); ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `artifactsDir` [string] *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `baseURL` [string] *(optional)*# When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.waitForURL()](/api/class-page.mdx#page-wait-for-url), [page.waitForRequest()](/api/class-page.mdx#page-wait-for-request), or [page.waitForResponse()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples: @@ -500,9 +506,9 @@ await browserType.launchPersistentContext(userDataDir, options); Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - `recordVideo` [Object] *(optional)*# - - `dir` [string] + - `dir` [string] *(optional)* - Path to the directory to put videos into. + Path to the directory to put videos into. If not specified, the videos will be stored in `artifactsDir` (see [browserType.launch()](/api/class-browsertype.mdx#browser-type-launch) options). - `size` [Object] *(optional)* - `width` [number] @@ -512,6 +518,18 @@ await browserType.launchPersistentContext(userDataDir, options); Video frame height. Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size. + - `showActions` [Object] *(optional)* + - `duration` [number] *(optional)* + + How long each annotation is displayed in milliseconds. Defaults to `500`. + - `position` "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" *(optional)* + + Position of the action title overlay. Defaults to `"top-right"`. + - `fontSize` [number] *(optional)* + + Font size of the action title in pixels. Defaults to `24`. + + If specified, enables visual annotations on interacted elements during video recording. Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. - `reducedMotion` [null] | "reduce" | "no-preference" *(optional)*# @@ -620,6 +638,9 @@ const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'. ::: Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/). + - `artifactsDir` [string] *(optional)*# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `channel` [string] *(optional)*# Browser distribution channel. @@ -739,7 +760,9 @@ browserType.name(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -761,6 +784,7 @@ browserType.name(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-cdpsession.mdx b/nodejs/versioned_docs/version-stable/api/class-cdpsession.mdx index 16a2f04d116..97eb8610cb1 100644 --- a/nodejs/versioned_docs/version-stable/api/class-cdpsession.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-cdpsession.mdx @@ -70,6 +70,50 @@ await cdpSession.send(method, params); **Returns** - [Promise]<[Object]># +--- + +## Events + +### on('close') {#cdp-session-event-close} + +Added in: v1.59cdpSession.on('close') + +Emitted when the session is closed, either because the target was closed or `session.detach()` was called. + +**Usage** + +```js +cdpSession.on('close', data => {}); +``` + +**Event data** +- [CDPSession] + +--- + +### on('event') {#cdp-session-event-event} + +Added in: v1.59cdpSession.on('event') + +Emitted for every CDP event received from the session. Allows subscribing to all CDP events at once without knowing their names ahead of time. + +**Usage** + +```js +session.on('event', ({ name, params }) => { + console.log(`CDP event: ${name}`, params); +}); +``` + +**Event data** +- [Object] + - `method` [string] + + CDP event name. + - `params` [Object] *(optional)* + + CDP event parameters. + [Android]: /api/class-android.mdx "Android" [AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice" @@ -88,7 +132,9 @@ await cdpSession.send(method, params); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -110,6 +156,7 @@ await cdpSession.send(method, params); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-clock.mdx b/nodejs/versioned_docs/version-stable/api/class-clock.mdx index fc9247a6022..5726baa1640 100644 --- a/nodejs/versioned_docs/version-stable/api/class-clock.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-clock.mdx @@ -216,7 +216,9 @@ await page.clock.setSystemTime('2020-02-02'); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -238,6 +240,7 @@ await page.clock.setSystemTime('2020-02-02'); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx b/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx index ce10419b8cb..b92106e53bd 100644 --- a/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-consolemessage.mdx @@ -111,6 +111,23 @@ consoleMessage.text(); --- +### timestamp {#console-message-timestamp} + +Added in: v1.59consoleMessage.timestamp + +The timestamp of the console message in milliseconds since the Unix epoch. + +**Usage** + +```js +consoleMessage.timestamp(); +``` + +**Returns** +- [number]# + +--- + ### type {#console-message-type} Added before v1.9consoleMessage.type @@ -159,7 +176,9 @@ consoleMessage.worker(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -181,6 +200,7 @@ consoleMessage.worker(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-coverage.mdx b/nodejs/versioned_docs/version-stable/api/class-coverage.mdx index 00112c43a60..051d3786674 100644 --- a/nodejs/versioned_docs/version-stable/api/class-coverage.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-coverage.mdx @@ -200,7 +200,9 @@ await coverage.stopJSCoverage(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -222,6 +224,7 @@ await coverage.stopJSCoverage(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-debugger.mdx b/nodejs/versioned_docs/version-stable/api/class-debugger.mdx new file mode 100644 index 00000000000..750141f0738 --- /dev/null +++ b/nodejs/versioned_docs/version-stable/api/class-debugger.mdx @@ -0,0 +1,253 @@ +--- +id: class-debugger +title: "Debugger" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +API for controlling the Playwright debugger. The debugger allows pausing script execution and inspecting the page. Obtain the debugger instance via [browserContext.debugger](/api/class-browsercontext.mdx#browser-context-debugger). + + +--- + +## Methods + +### next {#debugger-next} + +Added in: v1.59debugger.next + +Resumes script execution and pauses again before the next action. Throws if the debugger is not paused. + +**Usage** + +```js +await debugger.next(); +``` + +**Returns** +- [Promise]<[void]># + +--- + +### pausedDetails {#debugger-paused-details} + +Added in: v1.59debugger.pausedDetails + +Returns details about the currently paused call. Returns `null` if the debugger is not paused. + +**Usage** + +```js +debugger.pausedDetails(); +``` + +**Returns** +- [null] | [Object]# + - `location` [Object] + - `file` [string] + + + - `line` [number] *(optional)* + + + - `column` [number] *(optional)* + + + + - `title` [string] + + +--- + +### requestPause {#debugger-request-pause} + +Added in: v1.59debugger.requestPause + +Configures the debugger to pause before the next action is executed. + +Throws if the debugger is already paused. Use [debugger.next()](/api/class-debugger.mdx#debugger-next) or [debugger.runTo()](/api/class-debugger.mdx#debugger-run-to) to step while paused. + +Note that [page.pause()](/api/class-page.mdx#page-pause) is equivalent to a "debugger" statement — it pauses execution at the call site immediately. On the contrary, [debugger.requestPause()](/api/class-debugger.mdx#debugger-request-pause) is equivalent to "pause on next statement" — it configures the debugger to pause before the next action is executed. + +**Usage** + +```js +await debugger.requestPause(); +``` + +**Returns** +- [Promise]<[void]># + +--- + +### resume {#debugger-resume} + +Added in: v1.59debugger.resume + +Resumes script execution. Throws if the debugger is not paused. + +**Usage** + +```js +await debugger.resume(); +``` + +**Returns** +- [Promise]<[void]># + +--- + +### runTo {#debugger-run-to} + +Added in: v1.59debugger.runTo + +Resumes script execution and pauses when an action originates from the given source location. Throws if the debugger is not paused. + +**Usage** + +```js +await debugger.runTo(location); +``` + +**Arguments** +- `location` [Object]# + - `file` [string] + + + - `line` [number] *(optional)* + + + - `column` [number] *(optional)* + + + The source location to pause at. + +**Returns** +- [Promise]<[void]># + +--- + +## Events + +### on('pausedstatechanged') {#debugger-event-paused-state-changed} + +Added in: v1.59debugger.on('pausedstatechanged') + +Emitted when the debugger pauses or resumes. + +**Usage** + +```js +debugger.on('pausedstatechanged', data => {}); +``` + + +[Android]: /api/class-android.mdx "Android" +[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice" +[AndroidInput]: /api/class-androidinput.mdx "AndroidInput" +[AndroidSocket]: /api/class-androidsocket.mdx "AndroidSocket" +[AndroidWebView]: /api/class-androidwebview.mdx "AndroidWebView" +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserServer]: /api/class-browserserver.mdx "BrowserServer" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" +[Download]: /api/class-download.mdx "Download" +[Electron]: /api/class-electron.mdx "Electron" +[ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Logger]: /api/class-logger.mdx "Logger" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" +[Selectors]: /api/class-selectors.mdx "Selectors" +[SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Fixtures]: /api/class-fixtures.mdx "Fixtures" +[FullConfig]: /api/class-fullconfig.mdx "FullConfig" +[FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" +[Test]: /api/class-test.mdx "Test" +[TestConfig]: /api/class-testconfig.mdx "TestConfig" +[TestInfo]: /api/class-testinfo.mdx "TestInfo" +[TestInfoError]: /api/class-testinfoerror.mdx "TestInfoError" +[TestOptions]: /api/class-testoptions.mdx "TestOptions" +[TestProject]: /api/class-testproject.mdx "TestProject" +[TestStepInfo]: /api/class-teststepinfo.mdx "TestStepInfo" +[WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" +[Reporter]: /api/class-reporter.mdx "Reporter" +[Suite]: /api/class-suite.mdx "Suite" +[TestCase]: /api/class-testcase.mdx "TestCase" +[TestError]: /api/class-testerror.mdx "TestError" +[TestResult]: /api/class-testresult.mdx "TestResult" +[TestStep]: /api/class-teststep.mdx "TestStep" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array" +[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean" +[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer" +[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess" +[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date "Date" +[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error" +[EventEmitter]: https://nodejs.org/api/events.html#events_class_eventemitter "EventEmitter" +[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function" +[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData "FormData" +[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map" +[Metadata]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object<string, any>" +[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null" +[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number" +[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable" +[ReadStream]: https://nodejs.org/api/fs.html#class-fsreadstream "ReadStream" +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp" +[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string" +[void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined "void" +[URL]: https://nodejs.org/api/url.html "URL" +[URLSearchParams]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams "URLSearchParams" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/about "Microsoft Artifact Registry" +[Dockerfile.noble]: https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.noble "Dockerfile.noble" diff --git a/nodejs/versioned_docs/version-stable/api/class-dialog.mdx b/nodejs/versioned_docs/version-stable/api/class-dialog.mdx index 8f5d4a08819..a4bdfcafe40 100644 --- a/nodejs/versioned_docs/version-stable/api/class-dialog.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-dialog.mdx @@ -159,7 +159,9 @@ dialog.type(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -181,6 +183,7 @@ dialog.type(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-disposable.mdx b/nodejs/versioned_docs/version-stable/api/class-disposable.mdx new file mode 100644 index 00000000000..08eda2aa414 --- /dev/null +++ b/nodejs/versioned_docs/version-stable/api/class-disposable.mdx @@ -0,0 +1,139 @@ +--- +id: class-disposable +title: "Disposable" +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import HTMLCard from '@site/src/components/HTMLCard'; + + +[Disposable] is returned from various methods to allow undoing the corresponding action. For example, [page.addInitScript()](/api/class-page.mdx#page-add-init-script) returns a [Disposable] that can be used to remove the init script. + + +--- + +## Methods + +### dispose {#disposable-dispose} + +Added in: v1.59disposable.dispose + +Removes the associated resource. For example, removes the init script installed via [page.addInitScript()](/api/class-page.mdx#page-add-init-script) or [browserContext.addInitScript()](/api/class-browsercontext.mdx#browser-context-add-init-script). + +**Usage** + +```js +await disposable.dispose(); +``` + +**Returns** +- [Promise]<[void]># + + +[Android]: /api/class-android.mdx "Android" +[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice" +[AndroidInput]: /api/class-androidinput.mdx "AndroidInput" +[AndroidSocket]: /api/class-androidsocket.mdx "AndroidSocket" +[AndroidWebView]: /api/class-androidwebview.mdx "AndroidWebView" +[APIRequest]: /api/class-apirequest.mdx "APIRequest" +[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext" +[APIResponse]: /api/class-apiresponse.mdx "APIResponse" +[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions" +[Browser]: /api/class-browser.mdx "Browser" +[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext" +[BrowserServer]: /api/class-browserserver.mdx "BrowserServer" +[BrowserType]: /api/class-browsertype.mdx "BrowserType" +[CDPSession]: /api/class-cdpsession.mdx "CDPSession" +[Clock]: /api/class-clock.mdx "Clock" +[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" +[Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" +[Download]: /api/class-download.mdx "Download" +[Electron]: /api/class-electron.mdx "Electron" +[ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" +[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" +[FileChooser]: /api/class-filechooser.mdx "FileChooser" +[Frame]: /api/class-frame.mdx "Frame" +[FrameLocator]: /api/class-framelocator.mdx "FrameLocator" +[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions" +[JSHandle]: /api/class-jshandle.mdx "JSHandle" +[Keyboard]: /api/class-keyboard.mdx "Keyboard" +[Locator]: /api/class-locator.mdx "Locator" +[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions" +[Logger]: /api/class-logger.mdx "Logger" +[Mouse]: /api/class-mouse.mdx "Mouse" +[Page]: /api/class-page.mdx "Page" +[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions" +[Playwright]: /api/class-playwright.mdx "Playwright" +[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions" +[Request]: /api/class-request.mdx "Request" +[Response]: /api/class-response.mdx "Response" +[Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" +[Selectors]: /api/class-selectors.mdx "Selectors" +[SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" +[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" +[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" +[Tracing]: /api/class-tracing.mdx "Tracing" +[Video]: /api/class-video.mdx "Video" +[WebError]: /api/class-weberror.mdx "WebError" +[WebSocket]: /api/class-websocket.mdx "WebSocket" +[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute" +[Worker]: /api/class-worker.mdx "Worker" +[Fixtures]: /api/class-fixtures.mdx "Fixtures" +[FullConfig]: /api/class-fullconfig.mdx "FullConfig" +[FullProject]: /api/class-fullproject.mdx "FullProject" +[Location]: /api/class-location.mdx "Location" +[Test]: /api/class-test.mdx "Test" +[TestConfig]: /api/class-testconfig.mdx "TestConfig" +[TestInfo]: /api/class-testinfo.mdx "TestInfo" +[TestInfoError]: /api/class-testinfoerror.mdx "TestInfoError" +[TestOptions]: /api/class-testoptions.mdx "TestOptions" +[TestProject]: /api/class-testproject.mdx "TestProject" +[TestStepInfo]: /api/class-teststepinfo.mdx "TestStepInfo" +[WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo" +[Reporter]: /api/class-reporter.mdx "Reporter" +[Suite]: /api/class-suite.mdx "Suite" +[TestCase]: /api/class-testcase.mdx "TestCase" +[TestError]: /api/class-testerror.mdx "TestError" +[TestResult]: /api/class-testresult.mdx "TestResult" +[TestStep]: /api/class-teststep.mdx "TestStep" +[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element" +[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator" +[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin" +[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector" +[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable" +[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail" +[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time" +[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath" + +[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array" +[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean" +[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer" +[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess" +[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date "Date" +[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error" +[EventEmitter]: https://nodejs.org/api/events.html#events_class_eventemitter "EventEmitter" +[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function" +[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData "FormData" +[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map" +[Metadata]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object<string, any>" +[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null" +[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number" +[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object" +[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise" +[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable" +[ReadStream]: https://nodejs.org/api/fs.html#class-fsreadstream "ReadStream" +[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp" +[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string" +[void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined "void" +[URL]: https://nodejs.org/api/url.html "URL" +[URLSearchParams]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams "URLSearchParams" + +[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/about "all available image tags" +[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/about "Microsoft Artifact Registry" +[Dockerfile.noble]: https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.noble "Dockerfile.noble" diff --git a/nodejs/versioned_docs/version-stable/api/class-download.mdx b/nodejs/versioned_docs/version-stable/api/class-download.mdx index 520cc764610..53b3a63f6a2 100644 --- a/nodejs/versioned_docs/version-stable/api/class-download.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-download.mdx @@ -209,7 +209,9 @@ download.url(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -231,6 +233,7 @@ download.url(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-electron.mdx b/nodejs/versioned_docs/version-stable/api/class-electron.mdx index 8d4a4fc937e..6d3432abae8 100644 --- a/nodejs/versioned_docs/version-stable/api/class-electron.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-electron.mdx @@ -81,9 +81,15 @@ await electron.launch(options); - `args` [Array]<[string]> *(optional)*# Additional arguments to pass to the application when launching. You typically pass the main script name here. + - `artifactsDir` [string] *(optional)* Added in: v1.59# + + If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes. - `bypassCSP` [boolean] *(optional)* Added in: v1.12# Toggles bypassing page's Content-Security-Policy. Defaults to `false`. + - `chromiumSandbox` [boolean] *(optional)* Added in: v1.59# + + Enable Chromium sandboxing. Defaults to `false`. - `colorScheme` [null] | "light" | "dark" | "no-preference" *(optional)* Added in: v1.12# Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See [page.emulateMedia()](/api/class-page.mdx#page-emulate-media) for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`. @@ -152,9 +158,9 @@ await electron.launch(options); Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not specified, the HAR is not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for the HAR to be saved. - `recordVideo` [Object] *(optional)* Added in: v1.12# - - `dir` [string] + - `dir` [string] *(optional)* - Path to the directory to put videos into. + Path to the directory to put videos into. If not specified, the videos will be stored in `artifactsDir` (see [browserType.launch()](/api/class-browsertype.mdx#browser-type-launch) options). - `size` [Object] *(optional)* - `width` [number] @@ -164,6 +170,18 @@ await electron.launch(options); Video frame height. Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size. + - `showActions` [Object] *(optional)* + - `duration` [number] *(optional)* + + How long each annotation is displayed in milliseconds. Defaults to `500`. + - `position` "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" *(optional)* + + Position of the action title overlay. Defaults to `"top-right"`. + - `fontSize` [number] *(optional)* + + Font size of the action title in pixels. Defaults to `24`. + + If specified, enables visual annotations on interacted elements during video recording. Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make sure to await [browserContext.close()](/api/class-browsercontext.mdx#browser-context-close) for videos to be saved. - `timeout` [number] *(optional)* Added in: v1.15# @@ -197,7 +215,9 @@ await electron.launch(options); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -219,6 +239,7 @@ await electron.launch(options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-electronapplication.mdx b/nodejs/versioned_docs/version-stable/api/class-electronapplication.mdx index 005b4b9f641..faf5b153645 100644 --- a/nodejs/versioned_docs/version-stable/api/class-electronapplication.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-electronapplication.mdx @@ -328,7 +328,9 @@ electronApplication.on('window', data => {}); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -350,6 +352,7 @@ electronApplication.on('window', data => {}); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-elementhandle.mdx b/nodejs/versioned_docs/version-stable/api/class-elementhandle.mdx index 9c2583e93ba..0c515a8929d 100644 --- a/nodejs/versioned_docs/version-stable/api/class-elementhandle.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-elementhandle.mdx @@ -1609,7 +1609,9 @@ This method does not work across navigations, use [page.waitForSelector()](/api/ [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -1631,6 +1633,7 @@ This method does not work across navigations, use [page.waitForSelector()](/api/ [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-filechooser.mdx b/nodejs/versioned_docs/version-stable/api/class-filechooser.mdx index c343795440a..79af166527e 100644 --- a/nodejs/versioned_docs/version-stable/api/class-filechooser.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-filechooser.mdx @@ -131,7 +131,9 @@ await fileChooser.setFiles(files, options); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -153,6 +155,7 @@ await fileChooser.setFiles(files, options); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-fixtures.mdx b/nodejs/versioned_docs/version-stable/api/class-fixtures.mdx index 7bf93dae008..c16839120ef 100644 --- a/nodejs/versioned_docs/version-stable/api/class-fixtures.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-fixtures.mdx @@ -164,7 +164,9 @@ test('basic test', async ({ request }) => { [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -186,6 +188,7 @@ test('basic test', async ({ request }) => { [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-frame.mdx b/nodejs/versioned_docs/version-stable/api/class-frame.mdx index 6e8c9f484b8..eeb9c6ea4df 100644 --- a/nodejs/versioned_docs/version-stable/api/class-frame.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-frame.mdx @@ -467,7 +467,7 @@ Consider the following DOM structure. ``` -You can locate each element by it's implicit role: +You can locate each element by its implicit role: ```js await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible(); @@ -555,7 +555,7 @@ Consider the following DOM structure. ``` -You can locate the element by it's test id: +You can locate the element by its test id: ```js await page.getByTestId('directions').click(); @@ -1051,9 +1051,9 @@ await frame.waitForURL('**/target.html'); ``` **Arguments** -- `url` [string] | [RegExp] | [function]\([URL]\):[boolean]# +- `url` [string] | [RegExp] | [URLPattern] | [function]\([URL]\):[boolean]# - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, URL pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `options` [Object] *(optional)* - `timeout` [number] *(optional)*# @@ -2545,9 +2545,9 @@ Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/Hist - `timeout` [number] *(optional)*# Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [browserContext.setDefaultNavigationTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-navigation-timeout), [browserContext.setDefaultTimeout()](/api/class-browsercontext.mdx#browser-context-set-default-timeout), [page.setDefaultNavigationTimeout()](/api/class-page.mdx#page-set-default-navigation-timeout) or [page.setDefaultTimeout()](/api/class-page.mdx#page-set-default-timeout) methods. - - `url` [string] | [RegExp] | [function]\([URL]\):[boolean] *(optional)*# + - `url` [string] | [RegExp] | [URLPattern] | [function]\([URL]\):[boolean] *(optional)*# - A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. + A glob pattern, regex pattern, URL pattern, or predicate receiving [URL] to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string. - `waitUntil` "load" | "domcontentloaded" | "networkidle" | "commit" *(optional)*# When to consider operation succeeded, defaults to `load`. Events can be either: @@ -2671,7 +2671,9 @@ await frame.waitForTimeout(timeout); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -2693,6 +2695,7 @@ await frame.waitForTimeout(timeout); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-framelocator.mdx b/nodejs/versioned_docs/version-stable/api/class-framelocator.mdx index 9605686033d..b46f39750de 100644 --- a/nodejs/versioned_docs/version-stable/api/class-framelocator.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-framelocator.mdx @@ -183,7 +183,7 @@ Consider the following DOM structure. ``` -You can locate each element by it's implicit role: +You can locate each element by its implicit role: ```js await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible(); @@ -271,7 +271,7 @@ Consider the following DOM structure. ``` -You can locate the element by it's test id: +You can locate the element by its test id: ```js await page.getByTestId('directions').click(); @@ -553,7 +553,9 @@ frameLocator.nth(index); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -575,6 +577,7 @@ frameLocator.nth(index); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-fullconfig.mdx b/nodejs/versioned_docs/version-stable/api/class-fullconfig.mdx index fa00830f5f9..45003f6938a 100644 --- a/nodejs/versioned_docs/version-stable/api/class-fullconfig.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-fullconfig.mdx @@ -439,7 +439,9 @@ fullConfig.workers [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -461,6 +463,7 @@ fullConfig.workers [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-fullproject.mdx b/nodejs/versioned_docs/version-stable/api/class-fullproject.mdx index 29752586f38..52665c95fcd 100644 --- a/nodejs/versioned_docs/version-stable/api/class-fullproject.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-fullproject.mdx @@ -65,6 +65,23 @@ fullProject.grepInvert --- +### ignoreSnapshots {#full-project-ignore-snapshots} + +Added in: v1.59fullProject.ignoreSnapshots + +See [testProject.ignoreSnapshots](/api/class-testproject.mdx#test-project-ignore-snapshots). + +**Usage** + +```js +fullProject.ignoreSnapshots +``` + +**Type** +- [boolean] + +--- + ### metadata {#full-project-metadata} Added in: v1.10fullProject.metadata @@ -285,7 +302,9 @@ fullProject.use [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -307,6 +326,7 @@ fullProject.use [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-genericassertions.mdx b/nodejs/versioned_docs/version-stable/api/class-genericassertions.mdx index 3a5ddfe0efb..bc477f14399 100644 --- a/nodejs/versioned_docs/version-stable/api/class-genericassertions.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-genericassertions.mdx @@ -768,17 +768,65 @@ expect(() => { Added in: v1.9genericAssertions.not -Makes the assertion check for the opposite condition. For example, the following code passes: +Makes the assertion check for the opposite condition. + +**Usage** + +For example, the following code passes: ```js const value = 1; expect(value).not.toBe(2); ``` +**Type** +- [GenericAssertions] + +--- + +### rejects {#generic-assertions-rejects} + +Added in: v1.9genericAssertions.rejects + +Use `.rejects` to unwrap the reason of a rejected promise so any other matcher can be chained. If the promise is fulfilled the assertion fails. + +For example, this code tests that the promise rejects with reason `'octopus'`: + +```js +test('rejects to octopus', async () => { + await expect(Promise.reject(new Error('octopus'))).rejects.toThrow('octopus'); +}); +``` + +**Usage** + +```js +expect(value).rejects +``` + +**Type** +- [GenericAssertions] + +--- + +### resolves {#generic-assertions-resolves} + +Added in: v1.9genericAssertions.resolves + +Use `resolves` to unwrap the value of a fulfilled promise so any other matcher can be chained. If the promise is rejected the assertion fails. + +For example, this code tests that the promise resolves and that the resulting value is `'lemon'`: + +```js +test('resolves to lemon', async () => { + await expect(Promise.resolve('lemon')).resolves.toBe('lemon'); +}); +``` + **Usage** ```js -expect(value).not +expect(value).resolves ``` **Type** @@ -802,7 +850,9 @@ expect(value).not [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -824,6 +874,7 @@ expect(value).not [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-jshandle.mdx b/nodejs/versioned_docs/version-stable/api/class-jshandle.mdx index 91512d911ac..da7a0976e55 100644 --- a/nodejs/versioned_docs/version-stable/api/class-jshandle.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-jshandle.mdx @@ -202,7 +202,9 @@ await jsHandle.jsonValue(); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -224,6 +226,7 @@ await jsHandle.jsonValue(); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-keyboard.mdx b/nodejs/versioned_docs/version-stable/api/class-keyboard.mdx index c6e877d211b..cc70b2c4d7e 100644 --- a/nodejs/versioned_docs/version-stable/api/class-keyboard.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-keyboard.mdx @@ -243,7 +243,9 @@ await keyboard.up(key); [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -265,6 +267,7 @@ await keyboard.up(key); [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-location.mdx b/nodejs/versioned_docs/version-stable/api/class-location.mdx index 0bb4c721c31..0450285e4aa 100644 --- a/nodejs/versioned_docs/version-stable/api/class-location.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-location.mdx @@ -81,7 +81,9 @@ location.line [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" [Coverage]: /api/class-coverage.mdx "Coverage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" +[Disposable]: /api/class-disposable.mdx "Disposable" [Download]: /api/class-download.mdx "Download" [Electron]: /api/class-electron.mdx "Electron" [ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication" @@ -103,6 +105,7 @@ location.line [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" diff --git a/nodejs/versioned_docs/version-stable/api/class-locator.mdx b/nodejs/versioned_docs/version-stable/api/class-locator.mdx index e8c54761c3a..8b748b7d81c 100644 --- a/nodejs/versioned_docs/version-stable/api/class-locator.mdx +++ b/nodejs/versioned_docs/version-stable/api/class-locator.mdx @@ -125,6 +125,12 @@ await page.getByRole('link').ariaSnapshot(); **Arguments** - `options` [Object] *(optional)* + - `depth` [number] *(optional)* Added in: v1.59# + + When specified, limits the depth of the snapshot. + - `mode` "ai" | "default" *(optional)* Added in: v1.59# + + When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to `"default"`. See details for more information. - `timeout` [number] *(optional)*# Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or 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. @@ -158,6 +164,9 @@ Below is the HTML markup and the respective ARIA snapshot: - link "About" ``` +An AI-optimized snapshot, controlled by [mode](/api/class-locator.mdx#locator-aria-snapshot-option-mode), is different from a default snapshot: +1. Includes element references `[ref=e2]`. 2. Does not wait for an element matching the locator, and throws when no elements match. 3. Includes snapshots of ` - - + ### 🐂 Debian 11 Bullseye Support @@ -1320,7 +1487,7 @@ Note that the new methods [page.route_from_har()](/api/class-page.mdx#page-route - Codegen now supports generating Pytest Tests - ![Graphics](https://user-images.githubusercontent.com/746130/168098384-40784024-6c26-4426-8255-e714862af6fc.png) + Graphics ## Version 1.21 @@ -1567,7 +1734,7 @@ This version was also tested against the following stable channels: Playwright 1.17 introduces [frame locators](./api/class-framelocator) - a locator to the iframe on the page. Frame locators capture the logic sufficient to retrieve the `iframe` and then locate elements in that iframe. Frame locators are strict by default, will wait for `iframe` to appear and can be used in Web-First assertions. -![Graphics](https://user-images.githubusercontent.com/746130/142082759-2170db38-370d-43ec-8d41-5f9941f57d83.png) +Graphics Frame locators can be created with either [page.frame_locator()](/api/class-page.mdx#page-frame-locator) or [locator.frame_locator()](/api/class-locator.mdx#locator-frame-locator) method. @@ -1588,13 +1755,13 @@ Playwright Trace Viewer is now **available online** at https://trace.playwright. - New trace metadata tab with browser details - Snapshots now have URL bar -![image](https://user-images.githubusercontent.com/746130/141877831-29e37cd1-e574-4bd9-aab5-b13a463bb4ae.png) +image ### HTML Report Update - HTML report now supports dynamic filtering - Report is now a **single static HTML file** that could be sent by e-mail or as a slack attachment. -![image](https://user-images.githubusercontent.com/746130/141877402-e486643d-72c7-4db3-8844-ed2072c5d676.png) +image ### Ubuntu ARM64 support + more - Playwright now supports **Ubuntu 20.04 ARM64**. You can now run Playwright tests inside Docker on Apple M1 and on Raspberry Pi. @@ -1707,7 +1874,7 @@ locator.click() Learn more in the [documentation](./api/class-locator). -#### 🧩 Experimental [**React**](./other-locators.mdx#react-locator) and [**Vue**](./other-locators.mdx#vue-locator) selector engines +#### 🧩 Experimental [**React**](./other-locators.mdx) and [**Vue**](./other-locators.mdx) selector engines React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to [attribute selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) and supports all attribute selector operators. @@ -1716,7 +1883,7 @@ page.locator("_react=SubmitButton[enabled=true]").click() page.locator("_vue=submit-button[enabled=true]").click() ``` -Learn more in the [react selectors documentation](./other-locators.mdx#react-locator) and the [vue selectors documentation](./other-locators.mdx#vue-locator). +Learn more in the [react selectors documentation](./other-locators.mdx) and the [vue selectors documentation](./other-locators.mdx). #### ✨ New [**`nth`**](./other-locators.mdx#n-th-element-locator) and [**`visible`**](./other-locators.mdx#css-matching-only-visible-elements) selector engines - [`nth`](./other-locators.mdx#n-th-element-locator) selector engine is equivalent to the `:nth-match` pseudo class, but could be combined with other selector engines. @@ -1797,7 +1964,7 @@ playwright show-trace trace.zip That will open the following GUI: -![image](https://user-images.githubusercontent.com/746130/121109654-d66c4480-c7c0-11eb-8d4d-eb70d2b03811.png) +image 👉 Read more in [trace viewer documentation](./trace-viewer.mdx). @@ -1938,6 +2105,7 @@ This version of Playwright was also tested against the following stable channels [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -1956,6 +2124,7 @@ This version of Playwright was also tested against the following stable channels [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/running-tests.mdx b/python/versioned_docs/version-stable/running-tests.mdx index 10fd48b4052..2c9afe2eb74 100644 --- a/python/versioned_docs/version-stable/running-tests.mdx +++ b/python/versioned_docs/version-stable/running-tests.mdx @@ -194,7 +194,7 @@ This command will open up a Browser window as well as the Playwright Inspector. While debugging you can use the Pick Locator button to select an element on the page and see the locator that Playwright would use to find that element. You can also edit the locator and see it highlighting live on the Browser window. Use the Copy Locator button to copy the locator to your clipboard and then paste it into your test. -![Playwright Inspector](https://github.com/microsoft/playwright/assets/13063165/c94c89c8-f945-460c-a653-7809c6ca50ee) +Playwright Inspector Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright Inspector](./debug.mdx#playwright-inspector) as well as debugging with [Browser Developer tools](./debug.mdx#browser-developer-tools). @@ -214,6 +214,7 @@ Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -232,6 +233,7 @@ Check out our [debugging guide](./debug.mdx) to learn more about the [Playwright [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/screenshots.mdx b/python/versioned_docs/version-stable/screenshots.mdx index 3383100e60d..25acd57b27e 100644 --- a/python/versioned_docs/version-stable/screenshots.mdx +++ b/python/versioned_docs/version-stable/screenshots.mdx @@ -134,6 +134,7 @@ await page.locator(".header").screenshot(path="screenshot.png") [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -152,6 +153,7 @@ await page.locator(".header").screenshot(path="screenshot.png") [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/selenium-grid.mdx b/python/versioned_docs/version-stable/selenium-grid.mdx index 54994f1acba..27665f71b6b 100644 --- a/python/versioned_docs/version-stable/selenium-grid.mdx +++ b/python/versioned_docs/version-stable/selenium-grid.mdx @@ -134,6 +134,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -152,6 +153,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/service-workers.mdx b/python/versioned_docs/version-stable/service-workers.mdx index c3180e09b38..e301ab73b94 100644 --- a/python/versioned_docs/version-stable/service-workers.mdx +++ b/python/versioned_docs/version-stable/service-workers.mdx @@ -200,6 +200,7 @@ Requests for updated Service Worker main script code currently cannot be routed [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -218,6 +219,7 @@ Requests for updated Service Worker main script code currently cannot be routed [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/test-assertions.mdx b/python/versioned_docs/version-stable/test-assertions.mdx index f7c9a2ee2e1..c5dc340ca62 100644 --- a/python/versioned_docs/version-stable/test-assertions.mdx +++ b/python/versioned_docs/version-stable/test-assertions.mdx @@ -94,6 +94,7 @@ def test_foobar(page: Page) -> None: [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -112,6 +113,7 @@ def test_foobar(page: Page) -> None: [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/test-runners.mdx b/python/versioned_docs/version-stable/test-runners.mdx index 3242fa716e3..39d4cf3cdf8 100644 --- a/python/versioned_docs/version-stable/test-runners.mdx +++ b/python/versioned_docs/version-stable/test-runners.mdx @@ -295,6 +295,7 @@ async def test_foo(page: Page): [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -313,6 +314,7 @@ async def test_foo(page: Page): [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/touch-events.mdx b/python/versioned_docs/version-stable/touch-events.mdx index ce3243614e7..922af336d98 100644 --- a/python/versioned_docs/version-stable/touch-events.mdx +++ b/python/versioned_docs/version-stable/touch-events.mdx @@ -317,6 +317,7 @@ asyncio.run(main()) [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -335,6 +336,7 @@ asyncio.run(main()) [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/trace-viewer-intro.mdx b/python/versioned_docs/version-stable/trace-viewer-intro.mdx index 00ddbbf5e24..b8bae9d375a 100644 --- a/python/versioned_docs/version-stable/trace-viewer-intro.mdx +++ b/python/versioned_docs/version-stable/trace-viewer-intro.mdx @@ -88,7 +88,7 @@ playwright show-trace trace.zip ``` ###### -![playwright trace viewer](https://github.com/microsoft/playwright/assets/13063165/10fe3585-8401-4051-b1c2-b2e92ac4c274) +playwright trace viewer To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). @@ -107,6 +107,7 @@ To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -125,6 +126,7 @@ To learn more check out our detailed guide on [Trace Viewer](/trace-viewer.mdx). [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/trace-viewer.mdx b/python/versioned_docs/version-stable/trace-viewer.mdx index 66a527b1d50..60110823ce1 100644 --- a/python/versioned_docs/version-stable/trace-viewer.mdx +++ b/python/versioned_docs/version-stable/trace-viewer.mdx @@ -10,7 +10,7 @@ import LiteYouTube from '@site/src/components/LiteYouTube'; ## Introduction -Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. Traces are a great way for debugging your tests when they fail on CI. You can open traces [locally](#opening-the-trace) or in your browser on [trace.playwright.dev](https://trace.playwright.dev). +Playwright Trace Viewer is a GUI tool that helps you explore recorded Playwright traces after the script has run. Traces are a great way for debugging your tests when they fail on CI. You can open traces [locally](#opening-trace-viewer) or in your browser on [trace.playwright.dev](https://trace.playwright.dev). ## Opening Trace Viewer @@ -26,7 +26,7 @@ playwright show-trace trace.zip Trace Viewer loads the trace entirely in your browser and does not transmit any data externally. -Drop Playwright Trace to load +Drop Playwright Trace to load ### Viewing remote traces @@ -113,7 +113,7 @@ await context.tracing.stop(path = "trace.zip") In the Actions tab you can see what locator was used for every action and how long each one took to run. Hover over each action of your test and visually see the change in the DOM snapshot. Go back and forward in time and click an action to inspect and debug. Use the Before and After tabs to visually see what happened before and after the action. -![actions tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/948b65cd-f0fd-4c7f-8e53-2c632b5a07f1) +actions tab in trace viewer **Selecting each action reveals:** - Action snapshots @@ -126,7 +126,7 @@ When tracing with the [screenshots](/api/class-tracing.mdx#tracing-start-option- Double click on an action to see the time range for that action. You can use the slider in the timeline to increase the actions selected and these will be shown in the Actions tab and all console logs and network logs will be filtered to only show the logs for the actions selected. -![timeline view in trace viewer](https://github.com/microsoft/playwright/assets/13063165/b04a7d75-54bb-4ab2-9e30-e76f6f74a2c8) +timeline view in trace viewer ### Snapshots @@ -140,7 +140,7 @@ When tracing with the [snapshots](/api/class-tracing.mdx#tracing-start-option-sn Here is what the typical Action snapshot looks like: -![action tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/7168d549-eb0a-4964-9c93-483f03711fa9) +action tab in trace viewer Notice how it highlights both, the DOM Node as well as the exact click position. @@ -148,31 +148,31 @@ Notice how it highlights both, the DOM Node as well as the exact click position. When you click on an action in the sidebar, the line of code for that action is highlighted in the source panel. -![showing source code tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/daa8845d-c250-4923-aa7a-5d040da9adc5) +showing source code tab in trace viewer ### Call The call tab shows you information about the action such as the time it took, what locator was used, if in strict mode and what key was used. -![showing call tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/95498580-f9dd-4932-a123-c37fe7cfc3c2) +showing call tab in trace viewer ### Log See a full log of your test to better understand what Playwright is doing behind the scenes such as scrolling into view, waiting for element to be visible, enabled and stable and performing actions such as click, fill, press etc. -![showing log of tests in trace viewer](https://github.com/microsoft/playwright/assets/13063165/de621461-3bab-4140-b39d-9f02d6672dbf) +showing log of tests in trace viewer ### Errors If your test fails you will see the error messages for each test in the Errors tab. The timeline will also show a red line highlighting where the error occurred. You can also click on the source tab to see on which line of the source code the error is. -![showing errors in trace viewer](https://github.com/microsoft/playwright/assets/13063165/e9ef77b3-05d1-4df2-852c-981023723d34) +showing errors in trace viewer ### Console See console logs from the browser as well as from your test. Different icons are displayed to show you if the console log came from the browser or from the test file. -![showing log of tests in trace viewer](https://github.com/microsoft/playwright/assets/13063165/4107c08d-1eaf-421c-bdd4-9dd2aa641d4a) +showing log of tests in trace viewer Double click on an action from your test in the actions sidebar. This will filter the console to only show the logs that were made during that action. Click the *Show all* button to see all console logs again. @@ -182,7 +182,7 @@ Use the timeline to filter actions, by clicking a start point and dragging to an The Network tab shows you all the network requests that were made during your test. You can sort by different types of requests, status code, method, request, content type, duration and size. Click on a request to see more information about it such as the request headers, response headers, request body and response body. -![network requests tab in trace viewer](https://github.com/microsoft/playwright/assets/13063165/0a3d1671-8ccd-4f7a-a844-35f5eb37f236) +network requests tab in trace viewer Double click on an action from your test in the actions sidebar. This will filter the network requests to only show the requests that were made during that action. Click the *Show all* button to see all network requests again. @@ -192,7 +192,7 @@ Use the timeline to filter actions, by clicking a start point and dragging to an Next to the Actions tab you will find the Metadata tab which will show you more information on your test such as the Browser, viewport size, test duration and more. -![meta data in trace viewer](https://github.com/microsoft/playwright/assets/13063165/82ab3d33-1ec9-4b8a-9cf2-30a6e2d59091) +meta data in trace viewer [APIRequest]: /api/class-apirequest.mdx "APIRequest" @@ -205,6 +205,7 @@ Next to the Actions tab you will find the Metadata tab which will show you more [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -223,6 +224,7 @@ Next to the Actions tab you will find the Metadata tab which will show you more [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/videos.mdx b/python/versioned_docs/version-stable/videos.mdx index 5439ba65b71..897133e1203 100644 --- a/python/versioned_docs/version-stable/videos.mdx +++ b/python/versioned_docs/version-stable/videos.mdx @@ -116,6 +116,7 @@ Note that the video is only available after the page or browser context is close [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -134,6 +135,7 @@ Note that the video is only available after the page or browser context is close [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/webview2.mdx b/python/versioned_docs/version-stable/webview2.mdx index 91221f3f282..62260d1395c 100644 --- a/python/versioned_docs/version-stable/webview2.mdx +++ b/python/versioned_docs/version-stable/webview2.mdx @@ -180,6 +180,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -198,6 +199,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug). [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_docs/version-stable/writing-tests.mdx b/python/versioned_docs/version-stable/writing-tests.mdx index 15ed082f14c..3d5311c5f9c 100644 --- a/python/versioned_docs/version-stable/writing-tests.mdx +++ b/python/versioned_docs/version-stable/writing-tests.mdx @@ -178,6 +178,7 @@ def test_main_navigation(page: Page): [CDPSession]: /api/class-cdpsession.mdx "CDPSession" [Clock]: /api/class-clock.mdx "Clock" [ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage" +[Debugger]: /api/class-debugger.mdx "Debugger" [Dialog]: /api/class-dialog.mdx "Dialog" [Download]: /api/class-download.mdx "Download" [ElementHandle]: /api/class-elementhandle.mdx "ElementHandle" @@ -196,6 +197,7 @@ def test_main_navigation(page: Page): [Request]: /api/class-request.mdx "Request" [Response]: /api/class-response.mdx "Response" [Route]: /api/class-route.mdx "Route" +[Screencast]: /api/class-screencast.mdx "Screencast" [Selectors]: /api/class-selectors.mdx "Selectors" [TimeoutError]: /api/class-timeouterror.mdx "TimeoutError" [Touchscreen]: /api/class-touchscreen.mdx "Touchscreen" diff --git a/python/versioned_sidebars/version-stable-sidebars.json b/python/versioned_sidebars/version-stable-sidebars.json index 9e37a6d7966..91d64438698 100644 --- a/python/versioned_sidebars/version-stable-sidebars.json +++ b/python/versioned_sidebars/version-stable-sidebars.json @@ -251,6 +251,10 @@ "type": "doc", "id": "api/class-consolemessage" }, + { + "type": "doc", + "id": "api/class-debugger" + }, { "type": "doc", "id": "api/class-dialog" @@ -311,6 +315,10 @@ "type": "doc", "id": "api/class-route" }, + { + "type": "doc", + "id": "api/class-screencast" + }, { "type": "doc", "id": "api/class-selectors"