Skip to content

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

chore: normalize api markdown (#18942)

Pavel Feldman3fb4b3bbf995
diff --git a/docs/src/api/class-android.md b/docs/src/api/class-android.md
index 16c9e31f44..88f003e331 100644
--- a/docs/src/api/class-android.md
+++ b/docs/src/api/class-android.md
@@ -5,14 +5,12 @@
Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
*Requirements*
-
* Android device or AVD Emulator.
* [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device. Typically running `adb devices` is all you need to do.
* [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
* "Enable command line on non-rooted devices" enabled in `chrome://flags`.
*Known limitations*
-
* Raw USB operation is not yet supported, so you need ADB.
* Device needs to be awake to produce screenshots. Enabling "Stay awake" developer mode will help.
* We didn't run all the tests against the device, so not everything works.
diff --git a/docs/src/api/class-androiddevice.md b/docs/src/api/class-androiddevice.md
index 258946fe92..6ab8f95329 100644
--- a/docs/src/api/class-androiddevice.md
+++ b/docs/src/api/class-androiddevice.md
@@ -173,7 +173,6 @@ Launches a process in the shell on the device and returns a socket to communicat
* since: v1.9
- `command` <[string]> Shell command to execute.
-
## async method: AndroidDevice.pinchClose
* since: v1.9
@@ -344,7 +343,6 @@ Executes a shell command on the device and returns its output.
Shell command to execute.
-
## async method: AndroidDevice.swipe
* since: v1.9
diff --git a/docs/src/api/class-androidinput.md b/docs/src/api/class-androidinput.md
index b68178efaf..3d541b494b 100644
--- a/docs/src/api/class-androidinput.md
+++ b/docs/src/api/class-androidinput.md
@@ -40,7 +40,6 @@ Presses the [`param: key`].
Key to press.
-
## async method: AndroidInput.swipe
* since: v1.9
diff --git a/docs/src/api/class-androidwebview.md b/docs/src/api/class-androidwebview.md
index 1d4b7eacf4..960e50f4cf 100644
--- a/docs/src/api/class-androidwebview.md
+++ b/docs/src/api/class-androidwebview.md
@@ -25,4 +25,4 @@ WebView process PID.
* since: v1.9
- returns: <[string]>
-WebView package identifier.
\ No newline at end of file
+WebView package identifier.
diff --git a/docs/src/api/class-apirequest.md b/docs/src/api/class-apirequest.md
index 8142da9a47..164de27b2e 100644
--- a/docs/src/api/class-apirequest.md
+++ b/docs/src/api/class-apirequest.md
@@ -14,12 +14,16 @@ Creates new instances of [APIRequestContext].
### option: APIRequest.newContext.useragent = %%-context-option-useragent-%%
* since: v1.16
+
### option: APIRequest.newContext.extraHTTPHeaders = %%-context-option-extrahttpheaders-%%
* since: v1.16
+
### option: APIRequest.newContext.httpCredentials = %%-context-option-httpcredentials-%%
* since: v1.16
+
### option: APIRequest.newContext.proxy = %%-browser-option-proxy-%%
* since: v1.16
+
### option: APIRequest.newContext.ignoreHTTPSErrors = %%-context-option-ignorehttpserrors-%%
* since: v1.16
@@ -30,7 +34,6 @@ Creates new instances of [APIRequestContext].
Maximum time in milliseconds to wait for the response. Defaults to
`30000` (30 seconds). Pass `0` to disable timeout.
-
### option: APIRequest.newContext.baseURL
* since: v1.16
- `baseURL` <[string]>
diff --git a/docs/src/api/class-apirequestcontext.md b/docs/src/api/class-apirequestcontext.md
index 9ceafa3978..932b5e198c 100644
--- a/docs/src/api/class-apirequestcontext.md
+++ b/docs/src/api/class-apirequestcontext.md
@@ -137,30 +137,43 @@ context cookies from the response. The method will automatically follow redirect
### param: APIRequestContext.delete.url = %%-fetch-param-url-%%
* since: v1.16
+
### param: APIRequestContext.delete.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.delete.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.delete.params = %%-csharp-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.delete.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.delete.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.17
+
### option: APIRequestContext.delete.form = %%-js-python-fetch-option-form-%%
* since: v1.17
+
### option: APIRequestContext.delete.form = %%-csharp-fetch-option-form-%%
* since: v1.17
+
### option: APIRequestContext.delete.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.17
+
### option: APIRequestContext.delete.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.17
+
### option: APIRequestContext.delete.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.delete.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.delete.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.delete.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
@@ -285,8 +298,10 @@ Target URL or Request to get all parameters from.
### param: APIRequestContext.fetch.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.fetch.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.fetch.params = %%-csharp-fetch-option-params-%%
* since: v1.16
@@ -300,22 +315,31 @@ If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/
### option: APIRequestContext.fetch.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.fetch.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.16
+
### option: APIRequestContext.fetch.form = %%-js-python-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.fetch.form = %%-csharp-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.fetch.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.fetch.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.fetch.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.fetch.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.fetch.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.fetch.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
@@ -363,30 +387,43 @@ await request.GetAsync("https://example.com/api/getText", new() { Params = param
### param: APIRequestContext.get.url = %%-fetch-param-url-%%
* since: v1.16
+
### param: APIRequestContext.get.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.get.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.get.params = %%-csharp-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.get.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.get.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.26
+
### option: APIRequestContext.get.form = %%-js-python-fetch-option-form-%%
* since: v1.26
+
### option: APIRequestContext.get.form = %%-csharp-fetch-option-form-%%
* since: v1.26
+
### option: APIRequestContext.get.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.26
+
### option: APIRequestContext.get.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.26
+
### option: APIRequestContext.get.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.get.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.get.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.get.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
@@ -400,30 +437,43 @@ context cookies from the response. The method will automatically follow redirect
### param: APIRequestContext.head.url = %%-fetch-param-url-%%
* since: v1.16
+
### param: APIRequestContext.head.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.head.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.head.params = %%-csharp-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.head.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.head.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.26
+
### option: APIRequestContext.head.form = %%-js-python-fetch-option-form-%%
* since: v1.26
+
### option: APIRequestContext.head.form = %%-csharp-fetch-option-form-%%
* since: v1.26
+
### option: APIRequestContext.head.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.26
+
### option: APIRequestContext.head.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.26
+
### option: APIRequestContext.head.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.head.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.head.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.head.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
@@ -437,30 +487,43 @@ context cookies from the response. The method will automatically follow redirect
### param: APIRequestContext.patch.url = %%-fetch-param-url-%%
* since: v1.16
+
### param: APIRequestContext.patch.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.patch.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.patch.params = %%-csharp-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.patch.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.patch.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.16
+
### option: APIRequestContext.patch.form = %%-js-python-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.patch.form = %%-csharp-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.patch.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.patch.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.patch.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.patch.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.patch.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.patch.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
@@ -602,30 +665,43 @@ await request.PostAsync("https://example.com/api/uploadScript", new() { Multipar
### param: APIRequestContext.post.url = %%-fetch-param-url-%%
* since: v1.16
+
### param: APIRequestContext.post.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.post.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.post.params = %%-csharp-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.post.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.post.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.16
+
### option: APIRequestContext.post.form = %%-js-python-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.post.form = %%-csharp-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.post.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.post.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.post.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.post.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.post.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.post.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
@@ -639,30 +715,43 @@ context cookies from the response. The method will automatically follow redirect
### param: APIRequestContext.put.url = %%-fetch-param-url-%%
* since: v1.16
+
### param: APIRequestContext.put.params = %%-java-csharp-fetch-params-%%
* since: v1.18
+
### option: APIRequestContext.put.params = %%-js-python-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.put.params = %%-csharp-fetch-option-params-%%
* since: v1.16
+
### option: APIRequestContext.put.headers = %%-js-python-csharp-fetch-option-headers-%%
* since: v1.16
+
### option: APIRequestContext.put.data = %%-js-python-csharp-fetch-option-data-%%
* since: v1.16
+
### option: APIRequestContext.put.form = %%-js-python-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.put.form = %%-csharp-fetch-option-form-%%
* since: v1.16
+
### option: APIRequestContext.put.multipart = %%-js-python-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.put.multipart = %%-csharp-fetch-option-multipart-%%
* since: v1.16
+
### option: APIRequestContext.put.timeout = %%-js-python-csharp-fetch-option-timeout-%%
* since: v1.16
+
### option: APIRequestContext.put.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%%
* since: v1.16
+
### option: APIRequestContext.put.ignoreHTTPSErrors = %%-js-python-csharp-fetch-option-ignorehttpserrors-%%
* since: v1.16
+
### option: APIRequestContext.put.maxRedirects = %%-js-python-csharp-fetch-option-maxredirects-%%
* since: v1.26
diff --git a/docs/src/api/class-apiresponseassertions.md b/docs/src/api/class-apiresponseassertions.md
index 27e699073f..c045ae679f 100644
--- a/docs/src/api/class-apiresponseassertions.md
+++ b/docs/src/api/class-apiresponseassertions.md
@@ -46,7 +46,6 @@ def test_navigates_to_login_page(page: Page) -> None:
expect(response).to_be_ok()
```
-
## property: APIResponseAssertions.not
* since: v1.20
* langs: java, js, csharp
diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md
index 7621c017cd..e4d1fbee89 100644
--- a/docs/src/api/class-browsercontext.md
+++ b/docs/src/api/class-browsercontext.md
@@ -73,7 +73,6 @@ Only works with Chromium browser's persistent context.
Emitted when new background page is created in the context.
-
```js
const backgroundPage = await context.waitForEvent('backgroundpage');
```
@@ -1083,7 +1082,6 @@ Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerec
### option: BrowserContext.routeFromHAR.notFound
* since: v1.23
- `notFound` ?<[HarNotFound]<"abort"|"fallback">>
-
* If set to 'abort' any request not found in the HAR file will be aborted.
* If set to 'fallback' falls through to the next route handler in the handler chain.
@@ -1380,7 +1378,9 @@ Will throw an error if the browser context is closed before the `event` is fired
### param: BrowserContext.waitForEvent2.event = %%-wait-for-event-event-%%
* since: v1.8
+
### option: BrowserContext.waitForEvent2.predicate = %%-wait-for-event-predicate-%%
* since: v1.8
+
### option: BrowserContext.waitForEvent2.timeout = %%-wait-for-event-timeout-%%
* since: v1.8
diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md
index 425efe80c7..a9b229b7db 100644
--- a/docs/src/api/class-browsertype.md
+++ b/docs/src/api/class-browsertype.md
@@ -264,20 +264,25 @@ describes some differences for Linux users.
### option: BrowserType.launch.-inline- = %%-shared-browser-options-list-v1.8-%%
* since: v1.8
+
### option: BrowserType.launch.firefoxUserPrefs = %%-js-python-browser-option-firefoxuserprefs-%%
* since: v1.8
+
### option: BrowserType.launch.firefoxUserPrefs2 = %%-csharp-java-browser-option-firefoxuserprefs-%%
* since: v1.8
+
### option: BrowserType.launch.logger = %%-browser-option-logger-%%
* since: v1.8
+
### option: BrowserType.launch.slowMo = %%-browser-option-slowmo-%%
* since: v1.8
+
### option: BrowserType.launch.ignoreDefaultArgs = %%-csharp-java-browser-option-ignoredefaultargs-%%
* since: v1.8
+
### option: BrowserType.launch.ignoreAllDefaultArgs = %%-csharp-java-browser-option-ignorealldefaultargs-%%
* since: v1.9
-
## async method: BrowserType.launchPersistentContext
* since: v1.8
- returns: <[BrowserContext]>
@@ -299,12 +304,16 @@ use a temporary directory instead.
### option: BrowserType.launchPersistentContext.-inline- = %%-shared-browser-options-list-v1.8-%%
* since: v1.8
+
### option: BrowserType.launchPersistentContext.slowMo = %%-browser-option-slowmo-%%
* since: v1.8
+
### option: BrowserType.launchPersistentContext.ignoreDefaultArgs = %%-csharp-java-browser-option-ignoredefaultargs-%%
* since: v1.8
+
### option: BrowserType.launchPersistentContext.ignoreAllDefaultArgs = %%-csharp-java-browser-option-ignorealldefaultargs-%%
* since: v1.9
+
### option: BrowserType.launchPersistentContext.-inline- = %%-shared-context-params-list-v1.8-%%
* since: v1.8
@@ -333,10 +342,13 @@ const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.
### option: BrowserType.launchServer.-inline- = %%-shared-browser-options-list-v1.8-%%
* since: v1.8
+
### option: BrowserType.launchServer.firefoxUserPrefs = %%-js-python-browser-option-firefoxuserprefs-%%
* since: v1.8
+
### option: BrowserType.launchServer.firefoxUserPrefs2 = %%-csharp-java-browser-option-firefoxuserprefs-%%
* since: v1.8
+
### option: BrowserType.launchServer.logger = %%-browser-option-logger-%%
* since: v1.8
diff --git a/docs/src/api/class-electron.md b/docs/src/api/class-electron.md
index 57baacb92e..8188504733 100644
--- a/docs/src/api/class-electron.md
+++ b/docs/src/api/class-electron.md
@@ -91,33 +91,48 @@ Maximum time in milliseconds to wait for the application to start. Defaults to `
### option: Electron.launch.acceptdownloads = %%-context-option-acceptdownloads-%%
* since: v1.12
+
### option: Electron.launch.bypassCSP = %%-context-option-bypasscsp-%%
* since: v1.12
+
### option: Electron.launch.colorScheme = %%-context-option-colorscheme-%%
* since: v1.12
+
### option: Electron.launch.extraHTTPHeaders = %%-context-option-extrahttpheaders-%%
* since: v1.12
+
### option: Electron.launch.geolocation = %%-context-option-geolocation-%%
* since: v1.12
+
### option: Electron.launch.httpcredentials = %%-context-option-httpcredentials-%%
* since: v1.12
+
### option: Electron.launch.ignoreHTTPSErrors = %%-context-option-ignorehttpserrors-%%
* since: v1.12
+
### option: Electron.launch.locale = %%-context-option-locale-%%
* since: v1.12
+
### option: Electron.launch.offline = %%-context-option-offline-%%
* since: v1.12
+
### option: Electron.launch.recordhar = %%-context-option-recordhar-%%
* since: v1.12
+
### option: Electron.launch.recordharpath = %%-context-option-recordhar-path-%%
* since: v1.12
+
### option: Electron.launch.recordHarOmitContent = %%-context-option-recordhar-omit-content-%%
* since: v1.12
+
### option: Electron.launch.recordvideo = %%-context-option-recordvideo-%%
* since: v1.12
+
### option: Electron.launch.recordvideodir = %%-context-option-recordvideo-dir-%%
* since: v1.12
+
### option: Electron.launch.recordvideosize = %%-context-option-recordvideo-size-%%
* since: v1.12
+
### option: Electron.launch.timezoneId = %%-context-option-timezoneid-%%
* since: v1.12
diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md
index 484ea9f4e1..295acb425d 100644
--- a/docs/src/api/class-elementhandle.md
+++ b/docs/src/api/class-elementhandle.md
@@ -504,8 +504,10 @@ Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: ElementHandle.fill.force = %%-input-force-%%
* since: v1.13
+
### option: ElementHandle.fill.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: ElementHandle.fill.timeout = %%-input-timeout-%%
* since: v1.8
@@ -785,10 +787,13 @@ await handle.SelectOptionAsync(new[] {
### param: ElementHandle.selectOption.values = %%-select-options-values-%%
* since: v1.8
+
### option: ElementHandle.selectOption.force = %%-input-force-%%
* since: v1.13
+
### option: ElementHandle.selectOption.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: ElementHandle.selectOption.timeout = %%-input-timeout-%%
* since: v1.8
@@ -802,6 +807,7 @@ If the element is inside the `<label>` element that has an associated [control](
### option: ElementHandle.selectText.force = %%-input-force-%%
* since: v1.13
+
### option: ElementHandle.selectText.timeout = %%-input-timeout-%%
* since: v1.8
@@ -823,14 +829,19 @@ When all steps combined have not finished during the specified [`option: timeout
### param: ElementHandle.setChecked.checked = %%-input-checked-%%
* since: v1.15
+
### option: ElementHandle.setChecked.force = %%-input-force-%%
* since: v1.15
+
### option: ElementHandle.setChecked.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.15
+
### option: ElementHandle.setChecked.position = %%-input-position-%%
* since: v1.15
+
### option: ElementHandle.setChecked.timeout = %%-input-timeout-%%
* since: v1.15
+
### option: ElementHandle.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -843,7 +854,6 @@ are resolved relative to the current working directory. For empty array, clears
This method expects [ElementHandle] to point to an
[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
-
### param: ElementHandle.setInputFiles.files = %%-input-files-%%
* since: v1.8
diff --git a/docs/src/api/class-error.md b/docs/src/api/class-error.md
index a24487e659..02027e22a4 100644
--- a/docs/src/api/class-error.md
+++ b/docs/src/api/class-error.md
@@ -6,7 +6,6 @@
Error is raised whenever certain operations are terminated abnormally, e.g.
browser closes while [`method: Page.evaluate`] is running. All Playwright exceptions
inherit from this class.
-
- [error.message](./class-error.md#errormessage)
- [error.name](./class-error.md#errorname)
- [error.stack](./class-error.md#errorstack)
diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md
index 504f3aa4ac..db137da96c 100644
--- a/docs/src/api/class-frame.md
+++ b/docs/src/api/class-frame.md
@@ -209,14 +209,19 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.check.force = %%-input-force-%%
* since: v1.8
+
### option: Frame.check.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.check.position = %%-input-position-%%
* since: v1.11
+
### option: Frame.check.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.check.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Frame.check.trial = %%-input-trial-%%
* since: v1.11
@@ -224,7 +229,6 @@ When all steps combined have not finished during the specified [`option: timeout
* since: v1.8
- returns: <[Array]<[Frame]>>
-
## async method: Frame.click
* since: v1.8
@@ -245,22 +249,31 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.click.button = %%-input-button-%%
* since: v1.8
+
### option: Frame.click.clickCount = %%-input-click-count-%%
* since: v1.8
+
### option: Frame.click.delay = %%-input-down-up-delay-%%
* since: v1.8
+
### option: Frame.click.force = %%-input-force-%%
* since: v1.8
+
### option: Frame.click.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Frame.click.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.click.position = %%-input-position-%%
* since: v1.8
+
### option: Frame.click.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.click.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Frame.click.trial = %%-input-trial-%%
* since: v1.11
@@ -297,20 +310,28 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.dblclick.button = %%-input-button-%%
* since: v1.8
+
### option: Frame.dblclick.force = %%-input-force-%%
* since: v1.8
+
### option: Frame.dblclick.delay = %%-input-down-up-delay-%%
* since: v1.8
+
### option: Frame.dblclick.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Frame.dblclick.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.dblclick.position = %%-input-position-%%
* since: v1.8
+
### option: Frame.dblclick.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.dblclick.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Frame.dblclick.trial = %%-input-trial-%%
* since: v1.11
@@ -406,6 +427,7 @@ Optional event-specific initialization properties.
### option: Frame.dispatchEvent.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.dispatchEvent.timeout = %%-input-timeout-%%
* since: v1.8
@@ -420,12 +442,16 @@ Optional event-specific initialization properties.
### option: Frame.dragAndDrop.force = %%-input-force-%%
* since: v1.13
+
### option: Frame.dragAndDrop.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.13
+
### option: Frame.dragAndDrop.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.dragAndDrop.timeout = %%-input-timeout-%%
* since: v1.13
+
### option: Frame.dragAndDrop.trial = %%-input-trial-%%
* since: v1.13
@@ -490,8 +516,10 @@ var html = await frame.EvalOnSelectorAsync(".main-container", "(e, suffix) => e.
### param: Frame.evalOnSelector.selector = %%-query-selector-%%
* since: v1.9
+
### param: Frame.evalOnSelector.expression = %%-evaluate-expression-%%
* since: v1.9
+
### param: Frame.evalOnSelector.arg
* since: v1.9
- `arg` ?<[EvaluationArgument]>
@@ -545,6 +573,7 @@ var divsCount = await frame.EvalOnSelectorAllAsync<bool>("div", "(divs, min) =>
### param: Frame.evalOnSelectorAll.selector = %%-query-selector-%%
* since: v1.9
+
### param: Frame.evalOnSelectorAll.expression = %%-evaluate-expression-%%
* since: v1.9
@@ -788,10 +817,13 @@ Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: Frame.fill.force = %%-input-force-%%
* since: v1.13
+
### option: Frame.fill.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.fill.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.fill.timeout = %%-input-timeout-%%
* since: v1.8
@@ -806,6 +838,7 @@ This method fetches an element with [`param: selector`] and focuses it. If there
### option: Frame.focus.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.focus.timeout = %%-input-timeout-%%
* since: v1.8
@@ -850,7 +883,6 @@ var contentFrame = await frameElement.ContentFrameAsync();
Console.WriteLine(frame == contentFrame); // -> True
```
-
## method: Frame.frameLocator
* since: v1.17
- returns: <[FrameLocator]>
@@ -887,7 +919,6 @@ await locator.ClickAsync();
### param: Frame.frameLocator.selector = %%-find-selector-%%
* since: v1.17
-
## async method: Frame.getAttribute
* since: v1.8
- returns: <[null]|[string]>
@@ -905,10 +936,10 @@ Attribute name to get the value for.
### option: Frame.getAttribute.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.getAttribute.timeout = %%-input-timeout-%%
* since: v1.8
-
## method: Frame.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -916,8 +947,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-alt-text-%%
### param: Frame.getByAltText.text = %%-locator-get-by-text-text-%%
-### option: Frame.getByAltText.exact = %%-locator-get-by-text-exact-%%
+### option: Frame.getByAltText.exact = %%-locator-get-by-text-exact-%%
## method: Frame.getByLabel
* since: v1.27
@@ -926,8 +957,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-label-text-%%
### param: Frame.getByLabel.text = %%-locator-get-by-text-text-%%
-### option: Frame.getByLabel.exact = %%-locator-get-by-text-exact-%%
+### option: Frame.getByLabel.exact = %%-locator-get-by-text-exact-%%
## method: Frame.getByPlaceholder
* since: v1.27
@@ -936,8 +967,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-placeholder-text-%%
### param: Frame.getByPlaceholder.text = %%-locator-get-by-text-text-%%
-### option: Frame.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
+### option: Frame.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
## method: Frame.getByRole
* since: v1.27
@@ -945,12 +976,12 @@ Attribute name to get the value for.
%%-template-locator-get-by-role-%%
-
### param: Frame.getByRole.role = %%-locator-get-by-role-role-%%
+
### option: Frame.getByRole.-inline- = %%-locator-get-by-role-option-list-v1.27-%%
* since: v1.27
-### option: Frame.getByRole.exact = %%-locator-get-by-role-option-exact-%%
+### option: Frame.getByRole.exact = %%-locator-get-by-role-option-exact-%%
## method: Frame.getByTestId
* since: v1.27
@@ -961,7 +992,6 @@ Attribute name to get the value for.
### param: Frame.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27
-
## method: Frame.getByText
* since: v1.27
- returns: <[Locator]>
@@ -969,8 +999,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-text-%%
### param: Frame.getByText.text = %%-locator-get-by-text-text-%%
-### option: Frame.getByText.exact = %%-locator-get-by-text-exact-%%
+### option: Frame.getByText.exact = %%-locator-get-by-text-exact-%%
## method: Frame.getByTitle
* since: v1.27
@@ -979,8 +1009,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-title-%%
### param: Frame.getByTitle.text = %%-locator-get-by-text-text-%%
-### option: Frame.getByTitle.exact = %%-locator-get-by-text-exact-%%
+### option: Frame.getByTitle.exact = %%-locator-get-by-text-exact-%%
## async method: Frame.goto
* since: v1.8
@@ -1051,16 +1081,22 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.hover.position = %%-input-position-%%
* since: v1.8
+
### option: Frame.hover.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Frame.hover.force = %%-input-force-%%
* since: v1.8
+
### option: Frame.hover.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.hover.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Frame.hover.trial = %%-input-trial-%%
* since: v1.11
+
### option: Frame.hover.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.28
@@ -1075,6 +1111,7 @@ Returns `element.innerHTML`.
### option: Frame.innerHTML.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.innerHTML.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1089,6 +1126,7 @@ Returns `element.innerText`.
### option: Frame.innerText.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.innerText.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1105,6 +1143,7 @@ Throws for non-input elements. However, if the element is inside the `<label>` e
### option: Frame.inputValue.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.inputValue.timeout = %%-input-timeout-%%
* since: v1.13
@@ -1119,6 +1158,7 @@ Returns whether the element is checked. Throws if the element is not a checkbox
### option: Frame.isChecked.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.isChecked.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1139,6 +1179,7 @@ Returns whether the element is disabled, the opposite of [enabled](../actionabil
### option: Frame.isDisabled.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.isDisabled.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1153,6 +1194,7 @@ Returns whether the element is [editable](../actionability.md#editable).
### option: Frame.isEditable.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.isEditable.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1167,6 +1209,7 @@ Returns whether the element is [enabled](../actionability.md#enabled).
### option: Frame.isEnabled.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.isEnabled.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1181,6 +1224,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
### option: Frame.isHidden.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.isHidden.timeout
* since: v1.8
- `timeout` <[float]>
@@ -1198,6 +1242,7 @@ Returns whether the element is [visible](../actionability.md#visible). [`option:
### option: Frame.isVisible.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.isVisible.timeout
* since: v1.8
- `timeout` <[float]>
@@ -1214,6 +1259,7 @@ Returns whether the element is [visible](../actionability.md#visible). [`option:
### param: Frame.locator.selector = %%-find-selector-%%
* since: v1.14
+
### option: Frame.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.14
@@ -1279,8 +1325,10 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
### option: Frame.press.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.press.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.press.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1388,18 +1436,22 @@ await frame.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" })
### param: Frame.selectOption.selector = %%-query-selector-%%
* since: v1.8
+
### param: Frame.selectOption.values = %%-select-options-values-%%
* since: v1.8
+
### option: Frame.selectOption.force = %%-input-force-%%
* since: v1.13
+
### option: Frame.selectOption.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.selectOption.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.selectOption.timeout = %%-input-timeout-%%
* since: v1.8
-
## async method: Frame.setChecked
* since: v1.15
@@ -1420,22 +1472,28 @@ When all steps combined have not finished during the specified [`option: timeout
### param: Frame.setChecked.selector = %%-input-selector-%%
* since: v1.15
+
### param: Frame.setChecked.checked = %%-input-checked-%%
* since: v1.15
+
### option: Frame.setChecked.force = %%-input-force-%%
* since: v1.15
+
### option: Frame.setChecked.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.15
+
### option: Frame.setChecked.position = %%-input-position-%%
* since: v1.15
+
### option: Frame.setChecked.strict = %%-input-strict-%%
* since: v1.15
+
### option: Frame.setChecked.timeout = %%-input-timeout-%%
* since: v1.15
+
### option: Frame.setChecked.trial = %%-input-trial-%%
* since: v1.15
-
## async method: Frame.setContent
* since: v1.8
@@ -1462,12 +1520,16 @@ This method expects [`param: selector`] to point to an
### param: Frame.setInputFiles.selector = %%-input-selector-%%
* since: v1.8
+
### param: Frame.setInputFiles.files = %%-input-files-%%
* since: v1.8
+
### option: Frame.setInputFiles.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.setInputFiles.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.setInputFiles.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1495,16 +1557,22 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.tap.force = %%-input-force-%%
* since: v1.8
+
### option: Frame.tap.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Frame.tap.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.tap.position = %%-input-position-%%
* since: v1.8
+
### option: Frame.tap.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.tap.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Frame.tap.trial = %%-input-trial-%%
* since: v1.11
@@ -1519,6 +1587,7 @@ Returns `element.textContent`.
### option: Frame.textContent.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.textContent.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1580,8 +1649,10 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Frame.type.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.type.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.type.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1608,14 +1679,19 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.uncheck.force = %%-input-force-%%
* since: v1.8
+
### option: Frame.uncheck.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Frame.uncheck.position = %%-input-position-%%
* since: v1.11
+
### option: Frame.uncheck.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.uncheck.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Frame.uncheck.trial = %%-input-trial-%%
* since: v1.11
@@ -1978,10 +2054,13 @@ class FrameExamples
### param: Frame.waitForSelector.selector = %%-query-selector-%%
* since: v1.8
+
### option: Frame.waitForSelector.state = %%-wait-for-selector-state-%%
* since: v1.8
+
### option: Frame.waitForSelector.strict = %%-input-strict-%%
* since: v1.14
+
### option: Frame.waitForSelector.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2031,7 +2110,9 @@ await frame.WaitForURLAsync("**/target.html");
### param: Frame.waitForURL.url = %%-wait-for-navigation-url-%%
* since: v1.11
+
### option: Frame.waitForURL.timeout = %%-navigation-timeout-%%
* since: v1.11
+
### option: Frame.waitForURL.waitUntil = %%-navigation-wait-until-%%
* since: v1.11
diff --git a/docs/src/api/class-framelocator.md b/docs/src/api/class-framelocator.md
index 6b643b36f7..3b5ab6679b 100644
--- a/docs/src/api/class-framelocator.md
+++ b/docs/src/api/class-framelocator.md
@@ -102,7 +102,6 @@ var frameLocator = locator.FrameLocator(":scope");
Returns locator to the first matching frame.
-
## method: FrameLocator.frameLocator
* since: v1.17
- returns: <[FrameLocator]>
@@ -113,7 +112,6 @@ in that iframe.
### param: FrameLocator.frameLocator.selector = %%-find-selector-%%
* since: v1.17
-
## method: FrameLocator.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -121,8 +119,8 @@ in that iframe.
%%-template-locator-get-by-alt-text-%%
### param: FrameLocator.getByAltText.text = %%-locator-get-by-text-text-%%
-### option: FrameLocator.getByAltText.exact = %%-locator-get-by-text-exact-%%
+### option: FrameLocator.getByAltText.exact = %%-locator-get-by-text-exact-%%
## method: FrameLocator.getByLabel
* since: v1.27
@@ -131,8 +129,8 @@ in that iframe.
%%-template-locator-get-by-label-text-%%
### param: FrameLocator.getByLabel.text = %%-locator-get-by-text-text-%%
-### option: FrameLocator.getByLabel.exact = %%-locator-get-by-text-exact-%%
+### option: FrameLocator.getByLabel.exact = %%-locator-get-by-text-exact-%%
## method: FrameLocator.getByPlaceholder
* since: v1.27
@@ -141,8 +139,8 @@ in that iframe.
%%-template-locator-get-by-placeholder-text-%%
### param: FrameLocator.getByPlaceholder.text = %%-locator-get-by-text-text-%%
-### option: FrameLocator.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
+### option: FrameLocator.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
## method: FrameLocator.getByRole
* since: v1.27
@@ -151,10 +149,11 @@ in that iframe.
%%-template-locator-get-by-role-%%
### param: FrameLocator.getByRole.role = %%-locator-get-by-role-role-%%
+
### option: FrameLocator.getByRole.-inline- = %%-locator-get-by-role-option-list-v1.27-%%
* since: v1.27
-### option: FrameLocator.getByRole.exact = %%-locator-get-by-role-option-exact-%%
+### option: FrameLocator.getByRole.exact = %%-locator-get-by-role-option-exact-%%
## method: FrameLocator.getByTestId
* since: v1.27
@@ -165,7 +164,6 @@ in that iframe.
### param: FrameLocator.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27
-
## method: FrameLocator.getByText
* since: v1.27
- returns: <[Locator]>
@@ -173,8 +171,8 @@ in that iframe.
%%-template-locator-get-by-text-%%
### param: FrameLocator.getByText.text = %%-locator-get-by-text-text-%%
-### option: FrameLocator.getByText.exact = %%-locator-get-by-text-exact-%%
+### option: FrameLocator.getByText.exact = %%-locator-get-by-text-exact-%%
## method: FrameLocator.getByTitle
* since: v1.27
@@ -183,8 +181,8 @@ in that iframe.
%%-template-locator-get-by-title-%%
### param: FrameLocator.getByTitle.text = %%-locator-get-by-text-text-%%
-### option: FrameLocator.getByTitle.exact = %%-locator-get-by-text-exact-%%
+### option: FrameLocator.getByTitle.exact = %%-locator-get-by-text-exact-%%
## method: FrameLocator.last
* since: v1.17
@@ -192,7 +190,6 @@ in that iframe.
Returns locator to the last matching frame.
-
## method: FrameLocator.locator
* since: v1.17
- returns: <[Locator]>
@@ -201,10 +198,10 @@ Returns locator to the last matching frame.
### param: FrameLocator.locator.selector = %%-find-selector-%%
* since: v1.17
+
### option: FrameLocator.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.17
-
## method: FrameLocator.nth
* since: v1.17
- returns: <[FrameLocator]>
diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md
index 1a7b0ca416..4dad1998a0 100644
--- a/docs/src/api/class-locator.md
+++ b/docs/src/api/class-locator.md
@@ -94,12 +94,16 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.check.position = %%-input-position-%%
* since: v1.14
+
### option: Locator.check.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.check.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.check.timeout = %%-input-timeout-%%
* since: v1.14
+
### option: Locator.check.trial = %%-input-trial-%%
* since: v1.14
@@ -112,8 +116,10 @@ If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` e
### option: Locator.clear.force = %%-input-force-%%
* since: v1.28
+
### option: Locator.clear.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.28
+
### option: Locator.clear.timeout = %%-input-timeout-%%
* since: v1.28
@@ -133,20 +139,28 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.click.button = %%-input-button-%%
* since: v1.14
+
### option: Locator.click.clickCount = %%-input-click-count-%%
* since: v1.14
+
### option: Locator.click.delay = %%-input-down-up-delay-%%
* since: v1.14
+
### option: Locator.click.position = %%-input-position-%%
* since: v1.14
+
### option: Locator.click.modifiers = %%-input-modifiers-%%
* since: v1.14
+
### option: Locator.click.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.click.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.click.timeout = %%-input-timeout-%%
* since: v1.14
+
### option: Locator.click.trial = %%-input-trial-%%
* since: v1.14
@@ -179,18 +193,25 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.dblclick.button = %%-input-button-%%
* since: v1.14
+
### option: Locator.dblclick.delay = %%-input-down-up-delay-%%
* since: v1.14
+
### option: Locator.dblclick.position = %%-input-position-%%
* since: v1.14
+
### option: Locator.dblclick.modifiers = %%-input-modifiers-%%
* since: v1.14
+
### option: Locator.dblclick.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.dblclick.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.dblclick.timeout = %%-input-timeout-%%
* since: v1.14
+
### option: Locator.dblclick.trial = %%-input-trial-%%
* since: v1.14
@@ -362,14 +383,19 @@ Locator of the element to drag to.
### option: Locator.dragTo.force = %%-input-force-%%
* since: v1.18
+
### option: Locator.dragTo.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.18
+
### option: Locator.dragTo.timeout = %%-input-timeout-%%
* since: v1.18
+
### option: Locator.dragTo.trial = %%-input-trial-%%
* since: v1.18
+
### option: Locator.dragTo.sourcePosition = %%-input-source-position-%%
* since: v1.18
+
### option: Locator.dragTo.targetPosition = %%-input-target-position-%%
* since: v1.18
@@ -484,7 +510,6 @@ var divsCount = await elements.EvaluateAll<bool>("(divs, min) => divs.length >=
Optional argument to pass to [`param: expression`].
-
## async method: Locator.evaluateHandle
* since: v1.14
- returns: <[JSHandle]>
@@ -529,8 +554,10 @@ Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: Locator.fill.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.fill.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.fill.timeout = %%-input-timeout-%%
* since: v1.14
@@ -549,6 +576,7 @@ await rowLocator
.filter({ has: page.getByRole('button', { name: 'column 2 button' }) })
.screenshot();
```
+
```java
Locator rowLocator = page.locator("tr");
// ...
@@ -559,6 +587,7 @@ rowLocator
))
.screenshot();
```
+
```python async
row_locator = page.locator("tr")
# ...
@@ -567,6 +596,7 @@ await row_locator
.filter(has=page.get_by_role("button", name="column 2 button"))
.screenshot()
```
+
```python sync
row_locator = page.locator("tr")
# ...
@@ -575,6 +605,7 @@ row_locator
.filter(has=page.get_by_role("button", name="column 2 button"))
.screenshot()
```
+
```csharp
var rowLocator = page.Locator("tr");
// ...
@@ -603,7 +634,6 @@ Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
### option: Locator.focus.timeout = %%-input-timeout-%%
* since: v1.14
-
## method: Locator.frameLocator
* since: v1.17
- returns: <[FrameLocator]>
@@ -639,7 +669,6 @@ await locator.ClickAsync();
### param: Locator.frameLocator.selector = %%-find-selector-%%
* since: v1.17
-
## async method: Locator.getAttribute
* since: v1.14
- returns: <[null]|[string]>
@@ -655,7 +684,6 @@ Attribute name to get the value for.
### option: Locator.getAttribute.timeout = %%-input-timeout-%%
* since: v1.14
-
## method: Locator.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -663,8 +691,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-alt-text-%%
### param: Locator.getByAltText.text = %%-locator-get-by-text-text-%%
-### option: Locator.getByAltText.exact = %%-locator-get-by-text-exact-%%
+### option: Locator.getByAltText.exact = %%-locator-get-by-text-exact-%%
## method: Locator.getByLabel
* since: v1.27
@@ -673,8 +701,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-label-text-%%
### param: Locator.getByLabel.text = %%-locator-get-by-text-text-%%
-### option: Locator.getByLabel.exact = %%-locator-get-by-text-exact-%%
+### option: Locator.getByLabel.exact = %%-locator-get-by-text-exact-%%
## method: Locator.getByPlaceholder
* since: v1.27
@@ -683,8 +711,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-placeholder-text-%%
### param: Locator.getByPlaceholder.text = %%-locator-get-by-text-text-%%
-### option: Locator.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
+### option: Locator.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
## method: Locator.getByRole
* since: v1.27
@@ -693,10 +721,11 @@ Attribute name to get the value for.
%%-template-locator-get-by-role-%%
### param: Locator.getByRole.role = %%-locator-get-by-role-role-%%
+
### option: Locator.getByRole.-inline- = %%-locator-get-by-role-option-list-v1.27-%%
* since: v1.27
-### option: Locator.getByRole.exact = %%-locator-get-by-role-option-exact-%%
+### option: Locator.getByRole.exact = %%-locator-get-by-role-option-exact-%%
## method: Locator.getByTestId
* since: v1.27
@@ -707,7 +736,6 @@ Attribute name to get the value for.
### param: Locator.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27
-
## method: Locator.getByText
* since: v1.27
- returns: <[Locator]>
@@ -715,8 +743,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-text-%%
### param: Locator.getByText.text = %%-locator-get-by-text-text-%%
-### option: Locator.getByText.exact = %%-locator-get-by-text-exact-%%
+### option: Locator.getByText.exact = %%-locator-get-by-text-exact-%%
## method: Locator.getByTitle
* since: v1.27
@@ -725,8 +753,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-title-%%
### param: Locator.getByTitle.text = %%-locator-get-by-text-text-%%
-### option: Locator.getByTitle.exact = %%-locator-get-by-text-exact-%%
+### option: Locator.getByTitle.exact = %%-locator-get-by-text-exact-%%
## async method: Locator.highlight
* since: v1.20
@@ -749,14 +777,19 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.hover.position = %%-input-position-%%
* since: v1.14
+
### option: Locator.hover.modifiers = %%-input-modifiers-%%
* since: v1.14
+
### option: Locator.hover.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.hover.timeout = %%-input-timeout-%%
* since: v1.14
+
### option: Locator.hover.trial = %%-input-trial-%%
* since: v1.14
+
### option: Locator.hover.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.28
@@ -863,6 +896,7 @@ Returns locator to the last matching element.
### param: Locator.locator.selector = %%-find-selector-%%
* since: v1.14
+
### option: Locator.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.14
@@ -1013,10 +1047,13 @@ await element.SelectOptionAsync(new[] {
### param: Locator.selectOption.values = %%-select-options-values-%%
* since: v1.14
+
### option: Locator.selectOption.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.selectOption.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.selectOption.timeout = %%-input-timeout-%%
* since: v1.14
@@ -1030,6 +1067,7 @@ If the element is inside the `<label>` element that has an associated [control](
### option: Locator.selectText.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.selectText.timeout = %%-input-timeout-%%
* since: v1.14
@@ -1051,14 +1089,19 @@ When all steps combined have not finished during the specified [`option: timeout
### param: Locator.setChecked.checked = %%-input-checked-%%
* since: v1.15
+
### option: Locator.setChecked.force = %%-input-force-%%
* since: v1.15
+
### option: Locator.setChecked.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.15
+
### option: Locator.setChecked.position = %%-input-position-%%
* since: v1.15
+
### option: Locator.setChecked.timeout = %%-input-timeout-%%
* since: v1.15
+
### option: Locator.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -1073,8 +1116,10 @@ This method expects [Locator] to point to an
### param: Locator.setInputFiles.files = %%-input-files-%%
* since: v1.14
+
### option: Locator.setInputFiles.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.setInputFiles.timeout = %%-input-timeout-%%
* since: v1.14
@@ -1098,14 +1143,19 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.tap.position = %%-input-position-%%
* since: v1.14
+
### option: Locator.tap.modifiers = %%-input-modifiers-%%
* since: v1.14
+
### option: Locator.tap.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.tap.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.tap.timeout = %%-input-timeout-%%
* since: v1.14
+
### option: Locator.tap.trial = %%-input-trial-%%
* since: v1.14
@@ -1196,6 +1246,7 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Locator.type.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.type.timeout = %%-input-timeout-%%
* since: v1.14
@@ -1218,12 +1269,16 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.uncheck.position = %%-input-position-%%
* since: v1.14
+
### option: Locator.uncheck.force = %%-input-force-%%
* since: v1.14
+
### option: Locator.uncheck.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.14
+
### option: Locator.uncheck.timeout = %%-input-timeout-%%
* since: v1.14
+
### option: Locator.uncheck.trial = %%-input-trial-%%
* since: v1.14
@@ -1262,5 +1317,6 @@ orderSent.WaitForAsync();
### option: Locator.waitFor.state = %%-wait-for-selector-state-%%
* since: v1.16
+
### option: Locator.waitFor.timeout = %%-input-timeout-%%
* since: v1.16
diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md
index ee1835273e..1cc15e6c2e 100644
--- a/docs/src/api/class-locatorassertions.md
+++ b/docs/src/api/class-locatorassertions.md
@@ -94,6 +94,7 @@ The opposite of [`method: LocatorAssertions.toBeChecked`].
### option: LocatorAssertions.NotToBeChecked.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeChecked.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -105,6 +106,7 @@ The opposite of [`method: LocatorAssertions.toBeDisabled`].
### option: LocatorAssertions.NotToBeDisabled.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeDisabled.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -117,8 +119,10 @@ The opposite of [`method: LocatorAssertions.toBeEditable`].
### option: LocatorAssertions.NotToBeEditable.editable
* since: v1.26
- `editable` <[boolean]>
+
### option: LocatorAssertions.NotToBeEditable.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeEditable.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -130,6 +134,7 @@ The opposite of [`method: LocatorAssertions.toBeEmpty`].
### option: LocatorAssertions.NotToBeEmpty.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeEmpty.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -142,8 +147,10 @@ The opposite of [`method: LocatorAssertions.toBeEnabled`].
### option: LocatorAssertions.NotToBeEnabled.enabled
* since: v1.26
- `enabled` <[boolean]>
+
### option: LocatorAssertions.NotToBeEnabled.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeEnabled.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -155,6 +162,7 @@ The opposite of [`method: LocatorAssertions.toBeFocused`].
### option: LocatorAssertions.NotToBeFocused.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeFocused.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -166,6 +174,7 @@ The opposite of [`method: LocatorAssertions.toBeHidden`].
### option: LocatorAssertions.NotToBeHidden.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeHidden.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -178,12 +187,13 @@ The opposite of [`method: LocatorAssertions.toBeVisible`].
### option: LocatorAssertions.NotToBeVisible.visible
* since: v1.26
- `visible` <[boolean]>
+
### option: LocatorAssertions.NotToBeVisible.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToBeVisible.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.NotToContainText
* since: v1.20
* langs: python
@@ -210,6 +220,7 @@ Whether to use `element.innerText` instead of `element.textContent` when retriev
### option: LocatorAssertions.NotToContainText.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToContainText.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -233,6 +244,7 @@ Expected attribute value.
### option: LocatorAssertions.NotToHaveAttribute.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveAttribute.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -250,6 +262,7 @@ Expected class or RegExp or a list of those.
### option: LocatorAssertions.NotToHaveClass.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveClass.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -267,6 +280,7 @@ Expected count.
### option: LocatorAssertions.NotToHaveCount.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveCount.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -290,6 +304,7 @@ CSS property value.
### option: LocatorAssertions.NotToHaveCSS.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveCSS.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -307,6 +322,7 @@ Element id.
### option: LocatorAssertions.NotToHaveId.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveId.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -330,6 +346,7 @@ Property value.
### option: LocatorAssertions.NotToHaveJSProperty.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveJSProperty.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -359,6 +376,7 @@ Whether to use `element.innerText` instead of `element.textContent` when retriev
### option: LocatorAssertions.NotToHaveText.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveText.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -376,6 +394,7 @@ Expected value.
### option: LocatorAssertions.NotToHaveValue.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.NotToHaveValue.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -393,6 +412,7 @@ Expected options currently selected.
### option: LocatorAssertions.NotToHaveValues.timeout = %%-js-assertions-timeout-%%
* since: v1.23
+
### option: LocatorAssertions.NotToHaveValues.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.23
@@ -437,10 +457,10 @@ await Expect(locator).ToBeCheckedAsync();
### option: LocatorAssertions.toBeChecked.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeChecked.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeDisabled
* since: v1.20
* langs:
@@ -482,10 +502,10 @@ await Expect(locator).ToBeDisabledAsync();
### option: LocatorAssertions.toBeDisabled.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeDisabled.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeEditable
* since: v1.20
* langs:
@@ -524,12 +544,13 @@ await Expect(locator).ToBeEditableAsync();
### option: LocatorAssertions.toBeEditable.editable
* since: v1.26
- `editable` <[boolean]>
+
### option: LocatorAssertions.toBeEditable.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeEditable.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeEmpty
* since: v1.20
* langs:
@@ -567,10 +588,10 @@ await Expect(locator).ToBeEmptyAsync();
### option: LocatorAssertions.toBeEmpty.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeEmpty.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeEnabled
* since: v1.20
* langs:
@@ -609,12 +630,13 @@ await Expect(locator).toBeEnabledAsync();
### option: LocatorAssertions.toBeEnabled.enabled
* since: v1.26
- `enabled` <[boolean]>
+
### option: LocatorAssertions.toBeEnabled.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeEnabled.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeFocused
* since: v1.20
* langs:
@@ -652,10 +674,10 @@ await Expect(locator).ToBeFocusedAsync();
### option: LocatorAssertions.toBeFocused.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeFocused.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeHidden
* since: v1.20
* langs:
@@ -693,10 +715,10 @@ await Expect(locator).ToBeHiddenAsync();
### option: LocatorAssertions.toBeHidden.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeHidden.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toBeVisible
* since: v1.20
* langs:
@@ -735,8 +757,10 @@ await Expect(locator).ToBeVisibleAsync();
### option: LocatorAssertions.toBeVisible.visible
* since: v1.26
- `visible` <[boolean]>
+
### option: LocatorAssertions.toBeVisible.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toBeVisible.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -788,6 +812,7 @@ If you pass an array as an expected value, the expectations are:
1. Each text value from the expected array is matched by some element from the list.
For example, consider the following list:
+
```html
<ul>
<li>Item Text 1</li>
@@ -900,10 +925,10 @@ Whether to use `element.innerText` instead of `element.textContent` when retriev
### option: LocatorAssertions.toContainText.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toContainText.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toHaveAttribute
* since: v1.20
* langs:
@@ -953,6 +978,7 @@ Expected attribute value.
### option: LocatorAssertions.toHaveAttribute.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveAttribute.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -1047,10 +1073,10 @@ Expected class or RegExp or a list of those.
### option: LocatorAssertions.toHaveClass.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveClass.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toHaveCount
* since: v1.20
* langs:
@@ -1094,6 +1120,7 @@ Expected count.
### option: LocatorAssertions.toHaveCount.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveCount.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -1146,6 +1173,7 @@ CSS property value.
### option: LocatorAssertions.toHaveCSS.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveCSS.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -1192,10 +1220,10 @@ Element id.
### option: LocatorAssertions.toHaveId.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveId.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toHaveJSProperty
* since: v1.20
* langs:
@@ -1246,10 +1274,10 @@ Property value.
### option: LocatorAssertions.toHaveJSProperty.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveJSProperty.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: LocatorAssertions.toHaveScreenshot#1
* since: v1.23
* langs: js
@@ -1270,21 +1298,28 @@ Snapshot name.
### option: LocatorAssertions.toHaveScreenshot#1.timeout = %%-js-assertions-timeout-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.animations = %%-screenshot-option-animations-default-disabled-%%
* since: v1.23
### option: LocatorAssertions.toHaveScreenshot#1.caret = %%-screenshot-option-caret-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.mask = %%-screenshot-option-mask-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.omitBackground = %%-screenshot-option-omit-background-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.scale = %%-screenshot-option-scale-default-css-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.maxDiffPixels = %%-assertions-max-diff-pixels-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.maxDiffPixelRatio = %%-assertions-max-diff-pixel-ratio-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#1.threshold = %%-assertions-threshold-%%
* since: v1.23
@@ -1302,25 +1337,31 @@ await expect(locator).toHaveScreenshot();
### option: LocatorAssertions.toHaveScreenshot#2.timeout = %%-js-assertions-timeout-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.animations = %%-screenshot-option-animations-default-disabled-%%
* since: v1.23
### option: LocatorAssertions.toHaveScreenshot#2.caret = %%-screenshot-option-caret-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.mask = %%-screenshot-option-mask-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.omitBackground = %%-screenshot-option-omit-background-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.scale = %%-screenshot-option-scale-default-css-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.maxDiffPixels = %%-assertions-max-diff-pixels-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.maxDiffPixelRatio = %%-assertions-max-diff-pixel-ratio-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveScreenshot#2.threshold = %%-assertions-threshold-%%
* since: v1.23
-
## async method: LocatorAssertions.toHaveText
* since: v1.20
* langs:
@@ -1363,13 +1404,13 @@ await Expect(locator).ToHaveTextAsync(new Regex("Welcome, Test User"));
await Expect(locator).ToHaveTextAsync(new Regex("Welcome, .*"));
```
-
If you pass an array as an expected value, the expectations are:
1. Locator resolves to a list of elements.
1. The number of elements equals the number of expected values in the array.
1. Elements from the list have text matching expected array values, one by one, in order.
For example, consider the following list:
+
```html
<ul>
<li>Text 1</li>
@@ -1482,6 +1523,7 @@ Whether to use `element.innerText` instead of `element.textContent` when retriev
### option: LocatorAssertions.toHaveText.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveText.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -1530,6 +1572,7 @@ Expected value.
### option: LocatorAssertions.toHaveValue.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: LocatorAssertions.toHaveValue.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -1601,5 +1644,6 @@ Expected options currently selected.
### option: LocatorAssertions.toHaveValues.timeout = %%-js-assertions-timeout-%%
* since: v1.23
+
### option: LocatorAssertions.toHaveValues.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.23
diff --git a/docs/src/api/class-mouse.md b/docs/src/api/class-mouse.md
index ff471abd49..2234eac3f9 100644
--- a/docs/src/api/class-mouse.md
+++ b/docs/src/api/class-mouse.md
@@ -58,6 +58,7 @@ await Page.Mouse.MoveAsync(100, 0);
await Page.Mouse.MoveAsync(0, 0);
await Page.Mouse.UpAsync();
```
+
## async method: Mouse.click
* since: v1.8
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md
index 2eaebaf5c9..165efdbf62 100644
--- a/docs/src/api/class-page.md
+++ b/docs/src/api/class-page.md
@@ -726,14 +726,19 @@ Shortcut for main frame's [`method: Frame.check`].
### option: Page.check.force = %%-input-force-%%
* since: v1.8
+
### option: Page.check.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.check.position = %%-input-position-%%
* since: v1.11
+
### option: Page.check.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.check.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Page.check.trial = %%-input-trial-%%
* since: v1.11
@@ -759,22 +764,31 @@ Shortcut for main frame's [`method: Frame.click`].
### option: Page.click.button = %%-input-button-%%
* since: v1.8
+
### option: Page.click.clickCount = %%-input-click-count-%%
* since: v1.8
+
### option: Page.click.delay = %%-input-down-up-delay-%%
* since: v1.8
+
### option: Page.click.force = %%-input-force-%%
* since: v1.8
+
### option: Page.click.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Page.click.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.click.position = %%-input-position-%%
* since: v1.8
+
### option: Page.click.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.click.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Page.click.trial = %%-input-trial-%%
* since: v1.11
@@ -850,20 +864,28 @@ Shortcut for main frame's [`method: Frame.dblclick`].
### option: Page.dblclick.button = %%-input-button-%%
* since: v1.8
+
### option: Page.dblclick.force = %%-input-force-%%
* since: v1.8
+
### option: Page.dblclick.delay = %%-input-down-up-delay-%%
* since: v1.8
+
### option: Page.dblclick.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Page.dblclick.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.dblclick.position = %%-input-position-%%
* since: v1.8
+
### option: Page.dblclick.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.dblclick.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Page.dblclick.trial = %%-input-trial-%%
* since: v1.11
@@ -958,6 +980,7 @@ Optional event-specific initialization properties.
### option: Page.dispatchEvent.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.dispatchEvent.timeout = %%-input-timeout-%%
* since: v1.8
@@ -1018,17 +1041,22 @@ await Page.DragAndDropAsync("#source", "#target", new()
### param: Page.dragAndDrop.source = %%-input-source-%%
* since: v1.13
+
### param: Page.dragAndDrop.target = %%-input-target-%%
* since: v1.13
### option: Page.dragAndDrop.force = %%-input-force-%%
* since: v1.13
+
### option: Page.dragAndDrop.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.13
+
### option: Page.dragAndDrop.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.dragAndDrop.timeout = %%-input-timeout-%%
* since: v1.13
+
### option: Page.dragAndDrop.trial = %%-input-trial-%%
* since: v1.13
@@ -1302,8 +1330,10 @@ Shortcut for main frame's [`method: Frame.evalOnSelector`].
### param: Page.evalOnSelector.selector = %%-query-selector-%%
* since: v1.9
+
### param: Page.evalOnSelector.expression = %%-evaluate-expression-%%
* since: v1.9
+
### param: Page.evalOnSelector.arg
* since: v1.9
- `arg` ?<[EvaluationArgument]>
@@ -1354,8 +1384,10 @@ var divsCount = await page.EvalOnSelectorAllAsync<bool>("div", "(divs, min) => d
### param: Page.evalOnSelectorAll.selector = %%-query-selector-%%
* since: v1.9
+
### param: Page.evalOnSelectorAll.expression = %%-evaluate-expression-%%
* since: v1.9
+
### param: Page.evalOnSelectorAll.arg
* since: v1.9
- `arg` ?<[EvaluationArgument]>
@@ -2026,10 +2058,13 @@ Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: Page.fill.force = %%-input-force-%%
* since: v1.13
+
### option: Page.fill.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.fill.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.fill.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2046,6 +2081,7 @@ Shortcut for main frame's [`method: Frame.focus`].
### option: Page.focus.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.focus.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2118,7 +2154,6 @@ Returns frame with matching URL.
A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object.
-
## method: Page.frameLocator
* since: v1.17
- returns: <[FrameLocator]>
@@ -2155,7 +2190,6 @@ await locator.ClickAsync();
### param: Page.frameLocator.selector = %%-find-selector-%%
* since: v1.17
-
## method: Page.frames
* since: v1.8
- returns: <[Array]<[Frame]>>
@@ -2179,10 +2213,10 @@ Attribute name to get the value for.
### option: Page.getAttribute.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.getAttribute.timeout = %%-input-timeout-%%
* since: v1.8
-
## method: Page.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -2190,8 +2224,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-alt-text-%%
### param: Page.getByAltText.text = %%-locator-get-by-text-text-%%
-### option: Page.getByAltText.exact = %%-locator-get-by-text-exact-%%
+### option: Page.getByAltText.exact = %%-locator-get-by-text-exact-%%
## method: Page.getByLabel
* since: v1.27
@@ -2200,8 +2234,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-label-text-%%
### param: Page.getByLabel.text = %%-locator-get-by-text-text-%%
-### option: Page.getByLabel.exact = %%-locator-get-by-text-exact-%%
+### option: Page.getByLabel.exact = %%-locator-get-by-text-exact-%%
## method: Page.getByPlaceholder
* since: v1.27
@@ -2210,8 +2244,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-placeholder-text-%%
### param: Page.getByPlaceholder.text = %%-locator-get-by-text-text-%%
-### option: Page.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
+### option: Page.getByPlaceholder.exact = %%-locator-get-by-text-exact-%%
## method: Page.getByRole
* since: v1.27
@@ -2220,10 +2254,11 @@ Attribute name to get the value for.
%%-template-locator-get-by-role-%%
### param: Page.getByRole.role = %%-locator-get-by-role-role-%%
+
### option: Page.getByRole.-inline- = %%-locator-get-by-role-option-list-v1.27-%%
* since: v1.27
-### option: Page.getByRole.exact = %%-locator-get-by-role-option-exact-%%
+### option: Page.getByRole.exact = %%-locator-get-by-role-option-exact-%%
## method: Page.getByTestId
* since: v1.27
@@ -2234,7 +2269,6 @@ Attribute name to get the value for.
### param: Page.getByTestId.testId = %%-locator-get-by-test-id-test-id-%%
* since: v1.27
-
## method: Page.getByText
* since: v1.27
- returns: <[Locator]>
@@ -2242,8 +2276,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-text-%%
### param: Page.getByText.text = %%-locator-get-by-text-text-%%
-### option: Page.getByText.exact = %%-locator-get-by-text-exact-%%
+### option: Page.getByText.exact = %%-locator-get-by-text-exact-%%
## method: Page.getByTitle
* since: v1.27
@@ -2252,8 +2286,8 @@ Attribute name to get the value for.
%%-template-locator-get-by-title-%%
### param: Page.getByTitle.text = %%-locator-get-by-text-text-%%
-### option: Page.getByTitle.exact = %%-locator-get-by-text-exact-%%
+### option: Page.getByTitle.exact = %%-locator-get-by-text-exact-%%
## async method: Page.goBack
* since: v1.8
@@ -2360,16 +2394,22 @@ Shortcut for main frame's [`method: Frame.hover`].
### option: Page.hover.force = %%-input-force-%%
* since: v1.8
+
### option: Page.hover.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Page.hover.position = %%-input-position-%%
* since: v1.8
+
### option: Page.hover.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.hover.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Page.hover.trial = %%-input-trial-%%
* since: v1.11
+
### option: Page.hover.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.28
@@ -2384,6 +2424,7 @@ Returns `element.innerHTML`.
### option: Page.innerHTML.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.innerHTML.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2398,6 +2439,7 @@ Returns `element.innerText`.
### option: Page.innerText.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.innerText.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2414,6 +2456,7 @@ Throws for non-input elements. However, if the element is inside the `<label>` e
### option: Page.inputValue.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.inputValue.timeout = %%-input-timeout-%%
* since: v1.13
@@ -2426,9 +2469,9 @@ Returns whether the element is checked. Throws if the element is not a checkbox
### param: Page.isChecked.selector = %%-input-selector-%%
* since: v1.8
-
### option: Page.isChecked.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.isChecked.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2449,6 +2492,7 @@ Returns whether the element is disabled, the opposite of [enabled](../actionabil
### option: Page.isDisabled.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.isDisabled.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2463,6 +2507,7 @@ Returns whether the element is [editable](../actionability.md#editable).
### option: Page.isEditable.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.isEditable.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2477,6 +2522,7 @@ Returns whether the element is [enabled](../actionability.md#enabled).
### option: Page.isEnabled.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.isEnabled.timeout = %%-input-timeout-%%
* since: v1.8
@@ -2491,6 +2537,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
### option: Page.isHidden.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.isHidden.timeout
* since: v1.8
- `timeout` <[float]>
@@ -2508,6 +2555,7 @@ Returns whether the element is [visible](../actionability.md#visible). [`option:
### option: Page.isVisible.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.isVisible.timeout
* since: v1.8
- `timeout` <[float]>
@@ -2526,6 +2574,7 @@ Returns whether the element is [visible](../actionability.md#visible). [`option:
### param: Page.locator.selector = %%-find-selector-%%
* since: v1.14
+
### option: Page.locator.-inline- = %%-locator-options-list-v1.14-%%
* since: v1.14
@@ -2857,8 +2906,10 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
### option: Page.press.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.press.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.press.timeout = %%-input-timeout-%%
* since: v1.8
@@ -3077,6 +3128,7 @@ Enabling routing disables http cache.
A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
When a [`option: baseURL`] via the context options was provided and the passed URL is a path,
it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
+
### param: Page.route.handler
* since: v1.8
* langs: js, python
@@ -3113,7 +3165,6 @@ Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerec
### option: Page.routeFromHAR.notFound
* since: v1.23
- `notFound` ?<[HarNotFound]<"abort"|"fallback">>
-
* If set to 'abort' any request not found in the HAR file will be aborted.
* If set to 'fallback' missing requests will be sent to the network.
@@ -3210,14 +3261,19 @@ Shortcut for main frame's [`method: Frame.selectOption`].
### param: Page.selectOption.selector = %%-input-selector-%%
* since: v1.8
+
### param: Page.selectOption.values = %%-select-options-values-%%
* since: v1.8
+
### option: Page.selectOption.force = %%-input-force-%%
* since: v1.13
+
### option: Page.selectOption.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.selectOption.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.selectOption.timeout = %%-input-timeout-%%
* since: v1.8
@@ -3243,18 +3299,25 @@ Shortcut for main frame's [`method: Frame.setChecked`].
### param: Page.setChecked.selector = %%-input-selector-%%
* since: v1.15
+
### param: Page.setChecked.checked = %%-input-checked-%%
* since: v1.15
+
### option: Page.setChecked.force = %%-input-force-%%
* since: v1.15
+
### option: Page.setChecked.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.15
+
### option: Page.setChecked.position = %%-input-position-%%
* since: v1.15
+
### option: Page.setChecked.strict = %%-input-strict-%%
* since: v1.15
+
### option: Page.setChecked.timeout = %%-input-timeout-%%
* since: v1.15
+
### option: Page.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -3343,8 +3406,10 @@ This method expects [`param: selector`] to point to an
### option: Page.setInputFiles.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.setInputFiles.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.setInputFiles.timeout = %%-input-timeout-%%
* since: v1.8
@@ -3433,16 +3498,22 @@ Shortcut for main frame's [`method: Frame.tap`].
### option: Page.tap.force = %%-input-force-%%
* since: v1.8
+
### option: Page.tap.modifiers = %%-input-modifiers-%%
* since: v1.8
+
### option: Page.tap.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.tap.position = %%-input-position-%%
* since: v1.8
+
### option: Page.tap.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.tap.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Page.tap.trial = %%-input-trial-%%
* since: v1.11
@@ -3457,6 +3528,7 @@ Returns `element.textContent`.
### option: Page.textContent.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.textContent.timeout = %%-input-timeout-%%
* since: v1.8
@@ -3524,8 +3596,10 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Page.type.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.type.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.type.timeout = %%-input-timeout-%%
* since: v1.8
@@ -3554,14 +3628,19 @@ Shortcut for main frame's [`method: Frame.uncheck`].
### option: Page.uncheck.force = %%-input-force-%%
* since: v1.8
+
### option: Page.uncheck.noWaitAfter = %%-input-no-wait-after-%%
* since: v1.8
+
### option: Page.uncheck.position = %%-input-position-%%
* since: v1.11
+
### option: Page.uncheck.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.uncheck.timeout = %%-input-timeout-%%
* since: v1.8
+
### option: Page.uncheck.trial = %%-input-trial-%%
* since: v1.11
@@ -4140,7 +4219,6 @@ Request URL string, regex or predicate receiving [Request] object.
Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be
changed by using the [`method: Page.setDefaultTimeout`] method.
-
## async method: Page.waitForRequestFinished
* since: v1.12
* langs: java, python, csharp
@@ -4161,7 +4239,6 @@ Receives the [Request] object and resolves to truthy value when the waiting shou
### option: Page.waitForRequestFinished.timeout = %%-wait-for-event-timeout-%%
* since: v1.12
-
## async method: Page.waitForResponse
* since: v1.8
* langs:
@@ -4392,8 +4469,10 @@ class FrameExamples
### option: Page.waitForSelector.state = %%-wait-for-selector-state-%%
* since: v1.8
+
### option: Page.waitForSelector.strict = %%-input-strict-%%
* since: v1.14
+
### option: Page.waitForSelector.timeout = %%-input-timeout-%%
* since: v1.8
@@ -4472,8 +4551,10 @@ Shortcut for main frame's [`method: Frame.waitForURL`].
### param: Page.waitForURL.url = %%-wait-for-navigation-url-%%
* since: v1.11
+
### option: Page.waitForURL.timeout = %%-navigation-timeout-%%
* since: v1.11
+
### option: Page.waitForURL.waitUntil = %%-navigation-wait-until-%%
* since: v1.11
@@ -4544,7 +4625,9 @@ Will throw an error if the page is closed before the `event` is fired.
### param: Page.waitForEvent2.event = %%-wait-for-event-event-%%
* since: v1.8
+
### option: Page.waitForEvent2.predicate = %%-wait-for-event-predicate-%%
* since: v1.8
+
### option: Page.waitForEvent2.timeout = %%-wait-for-event-timeout-%%
* since: v1.8
diff --git a/docs/src/api/class-pageassertions.md b/docs/src/api/class-pageassertions.md
index 796b8489c9..6ee2306d6f 100644
--- a/docs/src/api/class-pageassertions.md
+++ b/docs/src/api/class-pageassertions.md
@@ -94,7 +94,6 @@ await Expect(page).Not.ToHaveURL("error");
The opposite of [`method: PageAssertions.toHaveTitle`].
-
### param: PageAssertions.NotToHaveTitle.titleOrRegExp
* since: v1.18
- `titleOrRegExp` <[string]|[RegExp]>
@@ -103,6 +102,7 @@ Expected title or RegExp.
### option: PageAssertions.NotToHaveTitle.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: PageAssertions.NotToHaveTitle.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -121,10 +121,10 @@ Expected URL string or RegExp.
### option: PageAssertions.NotToHaveURL.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: PageAssertions.NotToHaveURL.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
-
## async method: PageAssertions.toHaveScreenshot#1
* since: v1.23
* langs: js
@@ -144,28 +144,37 @@ Snapshot name.
### option: PageAssertions.toHaveScreenshot#1.timeout = %%-js-assertions-timeout-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.animations = %%-screenshot-option-animations-default-disabled-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.caret = %%-screenshot-option-caret-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.clip = %%-screenshot-option-clip-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.fullPage = %%-screenshot-option-full-page-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.mask = %%-screenshot-option-mask-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.omitBackground = %%-screenshot-option-omit-background-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.scale = %%-screenshot-option-scale-default-css-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.maxDiffPixels = %%-assertions-max-diff-pixels-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.maxDiffPixelRatio = %%-assertions-max-diff-pixel-ratio-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#1.threshold = %%-assertions-threshold-%%
* since: v1.23
-
## async method: PageAssertions.toHaveScreenshot#2
* since: v1.23
* langs: js
@@ -179,28 +188,37 @@ await expect(page).toHaveScreenshot();
### option: PageAssertions.toHaveScreenshot#2.timeout = %%-js-assertions-timeout-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.animations = %%-screenshot-option-animations-default-disabled-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.caret = %%-screenshot-option-caret-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.clip = %%-screenshot-option-clip-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.fullPage = %%-screenshot-option-full-page-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.mask = %%-screenshot-option-mask-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.omitBackground = %%-screenshot-option-omit-background-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.scale = %%-screenshot-option-scale-default-css-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.maxDiffPixels = %%-assertions-max-diff-pixels-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.maxDiffPixelRatio = %%-assertions-max-diff-pixel-ratio-%%
* since: v1.23
+
### option: PageAssertions.toHaveScreenshot#2.threshold = %%-assertions-threshold-%%
* since: v1.23
-
## async method: PageAssertions.toHaveTitle
* since: v1.20
* langs:
@@ -244,6 +262,7 @@ Expected title or RegExp.
### option: PageAssertions.toHaveTitle.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: PageAssertions.toHaveTitle.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
@@ -290,5 +309,6 @@ Expected URL string or RegExp.
### option: PageAssertions.toHaveURL.timeout = %%-js-assertions-timeout-%%
* since: v1.18
+
### option: PageAssertions.toHaveURL.timeout = %%-csharp-java-python-assertions-timeout-%%
* since: v1.18
diff --git a/docs/src/api/class-request.md b/docs/src/api/class-request.md
index 3b0dd6be7e..1929beb4af 100644
--- a/docs/src/api/class-request.md
+++ b/docs/src/api/class-request.md
@@ -89,7 +89,6 @@ Returns the value of the header matching the name. The name is case insensitive.
Name of the header.
-
## method: Request.isNavigationRequest
* since: v1.8
- returns: <[boolean]>
diff --git a/docs/src/api/class-requestoptions.md b/docs/src/api/class-requestoptions.md
index 65130ee494..75cc0714b8 100644
--- a/docs/src/api/class-requestoptions.md
+++ b/docs/src/api/class-requestoptions.md
@@ -33,6 +33,7 @@ APIResponse response = context.request().post("https://example.com/upload_member
```
Alternatively, you can build the file payload manually:
+
```java
FilePayload filePayload = new FilePayload("members.csv", "text/csv",
"Alice, 33\nJohn, 35\n".getBytes(StandardCharsets.UTF_8));
diff --git a/docs/src/api/class-screenshotassertions.md b/docs/src/api/class-screenshotassertions.md
index f059016608..bafc3b862f 100644
--- a/docs/src/api/class-screenshotassertions.md
+++ b/docs/src/api/class-screenshotassertions.md
@@ -48,8 +48,6 @@ Snapshot name.
### option: ScreenshotAssertions.toMatchSnapshot#1.threshold = %%-assertions-threshold-%%
* since: v1.22
-
-
## method: ScreenshotAssertions.toMatchSnapshot#2
* since: v1.22
@@ -87,4 +85,3 @@ Snapshot name. If not passed, the test name and ordinals are used when called mu
### option: ScreenshotAssertions.toMatchSnapshot#2.threshold = %%-assertions-threshold-%%
* since: v1.22
-
diff --git a/docs/src/api/class-tracing.md b/docs/src/api/class-tracing.md
index d2e6ad78d3..269636c852 100644
--- a/docs/src/api/class-tracing.md
+++ b/docs/src/api/class-tracing.md
@@ -263,7 +263,6 @@ await context.Tracing.StopChunkAsync(new()
Trace name to be shown in the Trace Viewer.
-
## async method: Tracing.stop
* since: v1.12
@@ -275,8 +274,6 @@ Stop tracing.
Export trace into the file with the given path.
-
-
## async method: Tracing.stopChunk
* since: v1.15
diff --git a/docs/src/api/class-websocket.md b/docs/src/api/class-websocket.md
index 79f4cb88a3..95157bddd3 100644
--- a/docs/src/api/class-websocket.md
+++ b/docs/src/api/class-websocket.md
@@ -127,7 +127,9 @@ Will throw an error if the socket is closed before the `event` is fired.
### param: WebSocket.waitForEvent2.event = %%-wait-for-event-event-%%
* since: v1.8
+
### option: WebSocket.waitForEvent2.predicate = %%-wait-for-event-predicate-%%
* since: v1.8
+
### option: WebSocket.waitForEvent2.timeout = %%-wait-for-event-timeout-%%
* since: v1.8
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 10b82f3163..82432bdb95 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -77,16 +77,16 @@ export interface Page {
* Returns the value of the `pageFunction` invocation.
*
* If the function passed to the
- * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) returns a [Promise], then
- * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) would wait for the
- * promise to resolve and return its value.
+ * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) returns a [Promise],
+ * then [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) would wait for
+ * the promise to resolve and return its value.
*
* If the function passed to the
* [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) returns a
* non-[Serializable] value, then
- * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) resolves to `undefined`.
- * Playwright also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`,
- * `Infinity`, `-Infinity`.
+ * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) resolves to
+ * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
+ * `-0`, `NaN`, `Infinity`, `-Infinity`.
*
* Passing argument to `pageFunction`:
*
@@ -124,16 +124,16 @@ export interface Page {
* Returns the value of the `pageFunction` invocation.
*
* If the function passed to the
- * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) returns a [Promise], then
- * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) would wait for the
- * promise to resolve and return its value.
+ * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) returns a [Promise],
+ * then [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) would wait for
+ * the promise to resolve and return its value.
*
* If the function passed to the
* [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) returns a
* non-[Serializable] value, then
- * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) resolves to `undefined`.
- * Playwright also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`,
- * `Infinity`, `-Infinity`.
+ * [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) resolves to
+ * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
+ * `-0`, `NaN`, `Infinity`, `-Infinity`.
*
* Passing argument to `pageFunction`:
*
@@ -178,10 +178,10 @@ export interface Page {
* [JSHandle].
*
* If the function passed to the
- * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) returns a
- * [Promise], then
- * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) would wait
- * for the promise to resolve and return its value.
+ * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) returns
+ * a [Promise], then
+ * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) would
+ * wait for the promise to resolve and return its value.
*
* ```js
* const aWindowHandle = await page.evaluateHandle(() => Promise.resolve(window));
@@ -218,10 +218,10 @@ export interface Page {
* [JSHandle].
*
* If the function passed to the
- * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) returns a
- * [Promise], then
- * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) would wait
- * for the promise to resolve and return its value.
+ * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) returns
+ * a [Promise], then
+ * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) would
+ * wait for the promise to resolve and return its value.
*
* ```js
* const aWindowHandle = await page.evaluateHandle(() => Promise.resolve(window));
@@ -252,11 +252,11 @@ export interface Page {
/**
* Adds a script which would be evaluated in one of the following scenarios:
* - Whenever the page is navigated.
- * - Whenever the child frame is attached or navigated. In this case, the script is evaluated in the context of the newly
- * attached frame.
+ * - Whenever the child frame is attached or navigated. In this case, the script is evaluated in the context of the
+ * newly attached frame.
*
- * The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend
- * the JavaScript environment, e.g. to seed `Math.random`.
+ * The script is evaluated after the document was created but before any of its scripts were run. This is useful to
+ * amend the JavaScript environment, e.g. to seed `Math.random`.
*
* An example of overriding `Math.random` before the page loads:
*
@@ -272,7 +272,8 @@ export interface Page {
*
* > NOTE: The order of evaluation of multiple scripts installed via
* [browserContext.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-browsercontext#browser-context-add-init-script)
- * and [page.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-page#page-add-init-script) is not defined.
+ * and [page.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-page#page-add-init-script) is not
+ * defined.
* @param script Script to be evaluated in the page.
* @param arg Optional argument to pass to `script` (only supported when passing a function).
*/
@@ -308,20 +309,22 @@ export interface Page {
/**
* > NOTE: The use of [ElementHandle] is discouraged, use [Locator] objects and web-first assertions instead.
*
- * The method finds all elements matching the specified selector within the page. If no elements match the selector, the
- * return value resolves to `[]`.
+ * The method finds all elements matching the specified selector within the page. If no elements match the selector,
+ * the return value resolves to `[]`.
*
- * Shortcut for main frame's [frame.$$(selector)](https://playwright.dev/docs/api/class-frame#frame-query-selector-all).
+ * Shortcut for main frame's
+ * [frame.$$(selector)](https://playwright.dev/docs/api/class-frame#frame-query-selector-all).
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
*/
$$<K extends keyof HTMLElementTagNameMap>(selector: K): Promise<ElementHandleForTag<K>[]>;
/**
* > NOTE: The use of [ElementHandle] is discouraged, use [Locator] objects and web-first assertions instead.
*
- * The method finds all elements matching the specified selector within the page. If no elements match the selector, the
- * return value resolves to `[]`.
+ * The method finds all elements matching the specified selector within the page. If no elements match the selector,
+ * the return value resolves to `[]`.
*
- * Shortcut for main frame's [frame.$$(selector)](https://playwright.dev/docs/api/class-frame#frame-query-selector-all).
+ * Shortcut for main frame's
+ * [frame.$$(selector)](https://playwright.dev/docs/api/class-frame#frame-query-selector-all).
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
*/
$$(selector: string): Promise<ElementHandle<SVGElement | HTMLElement>[]>;
@@ -329,8 +332,8 @@ export interface Page {
/**
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the page and passes it as a first argument to
* `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
@@ -360,8 +363,8 @@ export interface Page {
/**
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the page and passes it as a first argument to
* `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
@@ -391,8 +394,8 @@ export interface Page {
/**
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the page and passes it as a first argument to
* `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
@@ -422,8 +425,8 @@ export interface Page {
/**
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the page and passes it as a first argument to
* `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
@@ -453,15 +456,15 @@ export interface Page {
/**
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the page and passes an array of matched elements as
- * a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
+ * The method finds all elements matching the specified selector within the page and passes an array of matched
+ * elements as a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all) would
- * wait for the promise to resolve and return its value.
+ * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all)
+ * would wait for the promise to resolve and return its value.
*
* Examples:
*
@@ -476,15 +479,15 @@ export interface Page {
$$eval<K extends keyof HTMLElementTagNameMap, R, Arg>(selector: K, pageFunction: PageFunctionOn<HTMLElementTagNameMap[K][], Arg, R>, arg: Arg): Promise<R>;
/**
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the page and passes an array of matched elements as
- * a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
+ * The method finds all elements matching the specified selector within the page and passes an array of matched
+ * elements as a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all) would
- * wait for the promise to resolve and return its value.
+ * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all)
+ * would wait for the promise to resolve and return its value.
*
* Examples:
*
@@ -499,15 +502,15 @@ export interface Page {
$$eval<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(selector: string, pageFunction: PageFunctionOn<E[], Arg, R>, arg: Arg): Promise<R>;
/**
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the page and passes an array of matched elements as
- * a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
+ * The method finds all elements matching the specified selector within the page and passes an array of matched
+ * elements as a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all) would
- * wait for the promise to resolve and return its value.
+ * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all)
+ * would wait for the promise to resolve and return its value.
*
* Examples:
*
@@ -522,15 +525,15 @@ export interface Page {
$$eval<K extends keyof HTMLElementTagNameMap, R>(selector: K, pageFunction: PageFunctionOn<HTMLElementTagNameMap[K][], void, R>, arg?: any): Promise<R>;
/**
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the page and passes an array of matched elements as
- * a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
+ * The method finds all elements matching the specified selector within the page and passes an array of matched
+ * elements as a first argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all) would
- * wait for the promise to resolve and return its value.
+ * [page.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-eval-on-selector-all)
+ * would wait for the promise to resolve and return its value.
*
* Examples:
*
@@ -621,12 +624,12 @@ export interface Page {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions makes the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions makes the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -653,12 +656,12 @@ export interface Page {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions makes the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions makes the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -685,12 +688,12 @@ export interface Page {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions makes the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions makes the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -717,12 +720,12 @@ export interface Page {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions makes the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions makes the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -747,20 +750,20 @@ export interface Page {
waitForSelector(selector: string, options: PageWaitForSelectorOptions): Promise<null|ElementHandle<SVGElement | HTMLElement>>;
/**
- * The method adds a function called `name` on the `window` object of every frame in this page. When called, the function
- * executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the `callback` returns
- * a [Promise], it will be awaited.
+ * The method adds a function called `name` on the `window` object of every frame in this page. When called, the
+ * function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the
+ * `callback` returns a [Promise], it will be awaited.
*
- * The first argument of the `callback` function contains information about the caller: `{ browserContext: BrowserContext,
- * page: Page, frame: Frame }`.
+ * The first argument of the `callback` function contains information about the caller: `{ browserContext:
+ * BrowserContext, page: Page, frame: Frame }`.
*
* See
* [browserContext.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-expose-binding)
* for the context-wide version.
*
* > NOTE: Functions installed via
- * [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding) survive
- * navigations.
+ * [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding)
+ * survive navigations.
*
* An example of exposing page URL to all frames in a page:
*
@@ -806,20 +809,20 @@ export interface Page {
*/
exposeBinding(name: string, playwrightBinding: (source: BindingSource, arg: JSHandle) => any, options: { handle: true }): Promise<void>;
/**
- * The method adds a function called `name` on the `window` object of every frame in this page. When called, the function
- * executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the `callback` returns
- * a [Promise], it will be awaited.
+ * The method adds a function called `name` on the `window` object of every frame in this page. When called, the
+ * function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the
+ * `callback` returns a [Promise], it will be awaited.
*
- * The first argument of the `callback` function contains information about the caller: `{ browserContext: BrowserContext,
- * page: Page, frame: Frame }`.
+ * The first argument of the `callback` function contains information about the caller: `{ browserContext:
+ * BrowserContext, page: Page, frame: Frame }`.
*
* See
* [browserContext.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-expose-binding)
* for the context-wide version.
*
* > NOTE: Functions installed via
- * [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding) survive
- * navigations.
+ * [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding)
+ * survive navigations.
*
* An example of exposing page URL to all frames in a page:
*
@@ -891,8 +894,8 @@ export interface Page {
on(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
/**
- * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page crashes,
- * ongoing and subsequent operations will throw.
+ * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page
+ * crashes, ongoing and subsequent operations will throw.
*
* The most common way to deal with crashes is to catch an exception:
*
@@ -913,9 +916,9 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**
* either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or
- * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page will
- * [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and
- * actions like click will never finish.
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page
+ * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the
+ * dialog, and actions like click will never finish.
*
* ```js
* page.on('dialog', dialog => {
@@ -923,28 +926,28 @@ export interface Page {
* });
* ```
*
- * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are present,
- * all dialogs are automatically dismissed.
+ * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are
+ * present, all dialogs are automatically dismissed.
*/
on(event: 'dialog', listener: (dialog: Dialog) => void): this;
/**
- * Emitted when the JavaScript [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)
- * event is dispatched.
+ * Emitted when the JavaScript
+ * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
*/
on(event: 'domcontentloaded', listener: (page: Page) => void): this;
/**
- * Emitted when attachment download started. User can access basic file operations on downloaded content via the passed
- * [Download] instance.
+ * Emitted when attachment download started. User can access basic file operations on downloaded content via the
+ * passed [Download] instance.
*/
on(event: 'download', listener: (download: Download) => void): this;
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can
* respond to it via setting the input files using
- * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files) that
- * can be uploaded after that.
+ * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files)
+ * that can be uploaded after that.
*
* ```js
* page.on('filechooser', async (fileChooser) => {
@@ -993,12 +996,12 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but only
- * for popups relevant to this page.
+ * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but
+ * only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -1013,14 +1016,14 @@ export interface Page {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
on(event: 'popup', listener: (page: Page) => void): this;
/**
- * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
+ * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,
+ * see [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).
*/
on(event: 'request', listener: (request: Request) => void): this;
@@ -1034,11 +1037,12 @@ export interface Page {
* });
* ```
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event
- * and not with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
- * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network error
- * net::ERR_FAILED.
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event and not
+ * with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
+ * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
+ * error net::ERR_FAILED.
*/
on(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -1049,8 +1053,8 @@ export interface Page {
on(event: 'requestfinished', listener: (request: Request) => void): this;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`.
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`.
*/
on(event: 'response', listener: (response: Response) => void): this;
@@ -1060,8 +1064,8 @@ export interface Page {
on(event: 'websocket', listener: (webSocket: WebSocket) => void): this;
/**
- * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
- * page.
+ * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned
+ * by the page.
*/
on(event: 'worker', listener: (worker: Worker) => void): this;
@@ -1187,8 +1191,8 @@ export interface Page {
addListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
/**
- * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page crashes,
- * ongoing and subsequent operations will throw.
+ * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page
+ * crashes, ongoing and subsequent operations will throw.
*
* The most common way to deal with crashes is to catch an exception:
*
@@ -1209,9 +1213,9 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**
* either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or
- * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page will
- * [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and
- * actions like click will never finish.
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page
+ * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the
+ * dialog, and actions like click will never finish.
*
* ```js
* page.on('dialog', dialog => {
@@ -1219,28 +1223,28 @@ export interface Page {
* });
* ```
*
- * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are present,
- * all dialogs are automatically dismissed.
+ * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are
+ * present, all dialogs are automatically dismissed.
*/
addListener(event: 'dialog', listener: (dialog: Dialog) => void): this;
/**
- * Emitted when the JavaScript [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)
- * event is dispatched.
+ * Emitted when the JavaScript
+ * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
*/
addListener(event: 'domcontentloaded', listener: (page: Page) => void): this;
/**
- * Emitted when attachment download started. User can access basic file operations on downloaded content via the passed
- * [Download] instance.
+ * Emitted when attachment download started. User can access basic file operations on downloaded content via the
+ * passed [Download] instance.
*/
addListener(event: 'download', listener: (download: Download) => void): this;
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can
* respond to it via setting the input files using
- * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files) that
- * can be uploaded after that.
+ * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files)
+ * that can be uploaded after that.
*
* ```js
* page.on('filechooser', async (fileChooser) => {
@@ -1289,12 +1293,12 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but only
- * for popups relevant to this page.
+ * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but
+ * only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -1309,14 +1313,14 @@ export interface Page {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
addListener(event: 'popup', listener: (page: Page) => void): this;
/**
- * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
+ * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,
+ * see [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).
*/
addListener(event: 'request', listener: (request: Request) => void): this;
@@ -1330,11 +1334,12 @@ export interface Page {
* });
* ```
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event
- * and not with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
- * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network error
- * net::ERR_FAILED.
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event and not
+ * with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
+ * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
+ * error net::ERR_FAILED.
*/
addListener(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -1345,8 +1350,8 @@ export interface Page {
addListener(event: 'requestfinished', listener: (request: Request) => void): this;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`.
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`.
*/
addListener(event: 'response', listener: (response: Response) => void): this;
@@ -1356,8 +1361,8 @@ export interface Page {
addListener(event: 'websocket', listener: (webSocket: WebSocket) => void): this;
/**
- * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
- * page.
+ * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned
+ * by the page.
*/
addListener(event: 'worker', listener: (worker: Worker) => void): this;
@@ -1578,8 +1583,8 @@ export interface Page {
prependListener(event: 'console', listener: (consoleMessage: ConsoleMessage) => void): this;
/**
- * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page crashes,
- * ongoing and subsequent operations will throw.
+ * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page
+ * crashes, ongoing and subsequent operations will throw.
*
* The most common way to deal with crashes is to catch an exception:
*
@@ -1600,9 +1605,9 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**
* either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or
- * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page will
- * [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and
- * actions like click will never finish.
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page
+ * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the
+ * dialog, and actions like click will never finish.
*
* ```js
* page.on('dialog', dialog => {
@@ -1610,28 +1615,28 @@ export interface Page {
* });
* ```
*
- * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are present,
- * all dialogs are automatically dismissed.
+ * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are
+ * present, all dialogs are automatically dismissed.
*/
prependListener(event: 'dialog', listener: (dialog: Dialog) => void): this;
/**
- * Emitted when the JavaScript [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)
- * event is dispatched.
+ * Emitted when the JavaScript
+ * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
*/
prependListener(event: 'domcontentloaded', listener: (page: Page) => void): this;
/**
- * Emitted when attachment download started. User can access basic file operations on downloaded content via the passed
- * [Download] instance.
+ * Emitted when attachment download started. User can access basic file operations on downloaded content via the
+ * passed [Download] instance.
*/
prependListener(event: 'download', listener: (download: Download) => void): this;
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can
* respond to it via setting the input files using
- * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files) that
- * can be uploaded after that.
+ * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files)
+ * that can be uploaded after that.
*
* ```js
* page.on('filechooser', async (fileChooser) => {
@@ -1680,12 +1685,12 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but only
- * for popups relevant to this page.
+ * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but
+ * only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -1700,14 +1705,14 @@ export interface Page {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
prependListener(event: 'popup', listener: (page: Page) => void): this;
/**
- * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
+ * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,
+ * see [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).
*/
prependListener(event: 'request', listener: (request: Request) => void): this;
@@ -1721,11 +1726,12 @@ export interface Page {
* });
* ```
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event
- * and not with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
- * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network error
- * net::ERR_FAILED.
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event and not
+ * with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
+ * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
+ * error net::ERR_FAILED.
*/
prependListener(event: 'requestfailed', listener: (request: Request) => void): this;
@@ -1736,8 +1742,8 @@ export interface Page {
prependListener(event: 'requestfinished', listener: (request: Request) => void): this;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`.
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`.
*/
prependListener(event: 'response', listener: (response: Response) => void): this;
@@ -1747,14 +1753,14 @@ export interface Page {
prependListener(event: 'websocket', listener: (webSocket: WebSocket) => void): this;
/**
- * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
- * page.
+ * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned
+ * by the page.
*/
prependListener(event: 'worker', listener: (worker: Worker) => void): this;
/**
- * **DEPRECATED** This property is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
- * need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
+ * **DEPRECATED** This property is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if
+ * you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
* integration with Axe.
* @deprecated
*/
@@ -1775,8 +1781,8 @@ export interface Page {
content?: string;
/**
- * Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the
- * current working directory.
+ * Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative
+ * to the current working directory.
*/
path?: string;
@@ -1826,19 +1832,21 @@ export interface Page {
/**
* This method checks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already
- * checked, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is
+ * already checked, this method returns immediately.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
- * Shortcut for main frame's [frame.check(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-check).
+ * Shortcut for main frame's
+ * [frame.check(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-check).
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -1849,15 +1857,15 @@ export interface Page {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -1872,16 +1880,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -1889,17 +1897,18 @@ export interface Page {
/**
* This method clicks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element, or
- * the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
- * Shortcut for main frame's [frame.click(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-click).
+ * Shortcut for main frame's
+ * [frame.click(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-click).
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -1925,21 +1934,21 @@ export interface Page {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -1954,16 +1963,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -1974,8 +1983,8 @@ export interface Page {
*
* By default, `page.close()` **does not** run `beforeunload` handlers.
*
- * > NOTE: if `runBeforeUnload` is passed as true, a `beforeunload` dialog might be summoned and should be handled manually
- * via [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) event.
+ * > NOTE: if `runBeforeUnload` is passed as true, a `beforeunload` dialog might be summoned and should be handled
+ * manually via [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) event.
* @param options
*/
close(options?: {
@@ -2006,16 +2015,16 @@ export interface Page {
/**
* This method double clicks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
* 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the
* element, or the specified `position`.
- * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the
- * first click of the `dblclick()` triggers a navigation event, this method will throw.
+ * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if
+ * the first click of the `dblclick()` triggers a navigation event, this method will throw.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `page.dblclick()` dispatches two `click` events and a single `dblclick` event.
*
@@ -2041,21 +2050,21 @@ export interface Page {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -2070,16 +2079,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -2093,8 +2102,8 @@ export interface Page {
* await page.dispatchEvent('button#submit', 'click');
* ```
*
- * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
- * and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
+ * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`
+ * properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
*
* Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:
* - [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)
@@ -2126,8 +2135,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2158,9 +2167,9 @@ export interface Page {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -2191,16 +2200,16 @@ export interface Page {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -2242,33 +2251,33 @@ export interface Page {
*/
emulateMedia(options?: {
/**
- * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing
- * `null` disables color scheme emulation.
+ * Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`.
+ * Passing `null` disables color scheme emulation.
*/
colorScheme?: null|"light"|"dark"|"no-preference";
/**
- * Emulates `'forced-colors'` media feature, supported values are `'active'` and `'none'`. Passing `null` disables forced
- * colors emulation.
+ * Emulates `'forced-colors'` media feature, supported values are `'active'` and `'none'`. Passing `null` disables
+ * forced colors emulation.
*/
forcedColors?: null|"active"|"none";
/**
- * Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`. Passing `null`
- * disables CSS media emulation.
+ * Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`. Passing
+ * `null` disables CSS media emulation.
*/
media?: null|"screen"|"print";
/**
- * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing `null`
- * disables reduced motion emulation.
+ * Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing
+ * `null` disables reduced motion emulation.
*/
reducedMotion?: null|"reduce"|"no-preference";
}): Promise<void>;
/**
- * The method adds a function called `name` on the `window` object of every frame in the page. When called, the function
- * executes `callback` and returns a [Promise] which resolves to the return value of `callback`.
+ * The method adds a function called `name` on the `window` object of every frame in the page. When called, the
+ * function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.
*
* If the `callback` returns a [Promise], it will be awaited.
*
@@ -2309,12 +2318,12 @@ export interface Page {
exposeFunction(name: string, callback: Function): Promise<void>;
/**
- * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the
- * element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input
- * field.
+ * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks,
+ * focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string
+ * to clear the input field.
*
- * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.
- * However, if the element is inside the `<label>` element that has an associated
+ * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an
+ * error. However, if the element is inside the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
* instead.
*
@@ -2334,9 +2343,9 @@ export interface Page {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -2347,8 +2356,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2356,10 +2365,11 @@ export interface Page {
}): Promise<void>;
/**
- * This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method
- * waits until a matching element appears in the DOM.
+ * This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the
+ * method waits until a matching element appears in the DOM.
*
- * Shortcut for main frame's [frame.focus(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-focus).
+ * Shortcut for main frame's
+ * [frame.focus(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-focus).
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -2371,8 +2381,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2405,9 +2415,9 @@ export interface Page {
}): null|Frame;
/**
- * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
- * that iframe. Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe
- * id="my-frame">`:
+ * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
+ * in that iframe. Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like
+ * `<iframe id="my-frame">`:
*
* ```js
* const locator = page.frameLocator('#my-iframe').getByText('Submit');
@@ -2437,8 +2447,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2457,8 +2467,8 @@ export interface Page {
*/
getByAltText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -2477,8 +2487,8 @@ export interface Page {
*/
getByLabel(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -2496,8 +2506,8 @@ export interface Page {
*/
getByPlaceholder(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -2509,9 +2519,10 @@ export interface Page {
* accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
*
* Note that many html elements have an implicitly
- * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
- * can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
- * recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
+ * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector.
+ * You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines
+ * **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to
+ * default values.
* @param role Required aria role.
* @param options
*/
@@ -2532,8 +2543,8 @@ export interface Page {
disabled?: boolean;
/**
- * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
@@ -2553,8 +2564,8 @@ export interface Page {
includeHidden?: boolean;
/**
- * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for
- * `<h1>-<h6>` elements.
+ * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values
+ * for `<h1>-<h6>` elements.
*
* Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).
*/
@@ -2626,26 +2637,27 @@ export interface Page {
* page.getByText(/^hello$/i)
* ```
*
- * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to match
- * by another criteria, like an accessible role, and then filter by the text content.
+ * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to
+ * match by another criteria, like an accessible role, and then filter by the text content.
*
- * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into
- * one, turns line breaks into spaces and ignores leading and trailing whitespace.
- * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For
- * example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
+ * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces
+ * into one, turns line breaks into spaces and ignores leading and trailing whitespace.
+ * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content.
+ * For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
* @param text Text to locate the element for.
* @param options
*/
getByText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
/**
- * Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
+ * Allows locating elements by their title. For example, this method will find the button by its title "Place the
+ * order":
*
* ```html
* <button title='Place the order'>Order Now</button>
@@ -2656,23 +2668,23 @@ export interface Page {
*/
getByTitle(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
/**
- * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
- * last redirect. If can not go back, returns `null`.
+ * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of
+ * the last redirect. If can not go back, returns `null`.
*
* Navigate to the previous page in history.
* @param options
*/
goBack(options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -2684,23 +2696,25 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
/**
- * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
- * last redirect. If can not go forward, returns `null`.
+ * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of
+ * the last redirect. If can not go forward, returns `null`.
*
* Navigate to the next page in history.
* @param options
*/
goForward(options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -2712,8 +2726,10 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
@@ -2729,12 +2745,12 @@ export interface Page {
* - the remote server does not respond or is unreachable.
* - the main resource failed to load.
*
- * The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not
- * Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling
+ * The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404
+ * "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling
* [response.status()](https://playwright.dev/docs/api/class-response#response-status).
*
- * > NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation to
- * `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.
+ * > NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation
+ * to `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.
* > NOTE: Headless mode doesn't support navigation to a PDF document. See the
* [upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295).
*
@@ -2751,8 +2767,8 @@ export interface Page {
referer?: string;
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -2764,8 +2780,10 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
@@ -2773,17 +2791,18 @@ export interface Page {
/**
* This method hovers over an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the element,
- * or the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
- * Shortcut for main frame's [frame.hover(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-hover).
+ * Shortcut for main frame's
+ * [frame.hover(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-hover).
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -2794,21 +2813,21 @@ export interface Page {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -2823,16 +2842,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -2850,8 +2869,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2871,8 +2890,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2883,7 +2902,8 @@ export interface Page {
* Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
*
* Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the
+ * control.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -2895,8 +2915,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2916,8 +2936,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2942,8 +2962,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2963,8 +2983,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2984,8 +3004,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -2993,8 +3013,8 @@ export interface Page {
}): Promise<boolean>;
/**
- * Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not
- * match any elements is considered hidden.
+ * Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/docs/actionability#visible). `selector` that
+ * does not match any elements is considered hidden.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -3007,16 +3027,16 @@ export interface Page {
/**
* **DEPRECATED** This option is ignored.
- * [page.isHidden(selector[, options])](https://playwright.dev/docs/api/class-page#page-is-hidden) does not wait for the
- * element to become hidden and returns immediately.
+ * [page.isHidden(selector[, options])](https://playwright.dev/docs/api/class-page#page-is-hidden) does not wait for
+ * the element to become hidden and returns immediately.
* @deprecated
*/
timeout?: number;
}): Promise<boolean>;
/**
- * Returns whether the element is [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not match any elements is
- * considered not visible.
+ * Returns whether the element is [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not match any elements
+ * is considered not visible.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -3029,8 +3049,8 @@ export interface Page {
/**
* **DEPRECATED** This option is ignored.
- * [page.isVisible(selector[, options])](https://playwright.dev/docs/api/class-page#page-is-visible) does not wait for the
- * element to become visible and returns immediately.
+ * [page.isVisible(selector[, options])](https://playwright.dev/docs/api/class-page#page-is-visible) does not wait for
+ * the element to become visible and returns immediately.
* @deprecated
*/
timeout?: number;
@@ -3039,9 +3059,9 @@ export interface Page {
keyboard: Keyboard;
/**
- * The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved to
- * the element immediately before performing an action, so a series of actions on the same locator can in fact be performed
- * on different DOM elements. That would happen if the DOM structure between those actions has changed.
+ * The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved
+ * to the element immediately before performing an action, so a series of actions on the same locator can in fact be
+ * performed on different DOM elements. That would happen if the DOM structure between those actions has changed.
*
* [Learn more about locators](https://playwright.dev/docs/locators).
* @param selector A selector to use when resolving DOM element. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
@@ -3049,16 +3069,16 @@ export interface Page {
*/
locator(selector: string, options?: {
/**
- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
- * For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
+ * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer
+ * one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
*
* Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
*/
has?: Locator;
/**
- * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
- * [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
+ * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
+ * passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
* `<article><div>Playwright</div></article>`.
*/
hasText?: string|RegExp;
@@ -3077,11 +3097,11 @@ export interface Page {
opener(): Promise<null|Page>;
/**
- * Pauses script execution. Playwright will stop executing the script and wait for the user to either press 'Resume' button
- * in the page overlay or to call `playwright.resume()` in the DevTools console.
+ * Pauses script execution. Playwright will stop executing the script and wait for the user to either press 'Resume'
+ * button in the page overlay or to call `playwright.resume()` in the DevTools console.
*
- * User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from
- * the place it was paused.
+ * User can inspect selectors or perform manual steps while paused. Resume will continue running the original script
+ * from the place it was paused.
*
* > NOTE: This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch).
@@ -3098,8 +3118,8 @@ export interface Page {
* `page.pdf()`:
*
* > NOTE: By default, `page.pdf()` generates a pdf with modified colors for printing. Use the
- * [`-webkit-print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to
- * force rendering of exact colors.
+ * [`-webkit-print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust)
+ * property to force rendering of exact colors.
*
* ```js
* // Generates a PDF with 'screen' media type.
@@ -3107,7 +3127,8 @@ export interface Page {
* await page.pdf({path: 'page.pdf'});
* ```
*
- * The `width`, `height`, and `margin` options accept values labeled with units. Unlabeled values are treated as pixels.
+ * The `width`, `height`, and `margin` options accept values labeled with units. Unlabeled values are treated as
+ * pixels.
*
* A few examples:
* - `page.pdf({width: 100})` - prints with width set to 100 pixels
@@ -3133,8 +3154,8 @@ export interface Page {
* - `A5`: 5.83in x 8.27in
* - `A6`: 4.13in x 5.83in
*
- * > NOTE: `headerTemplate` and `footerTemplate` markup have the following limitations: > 1. Script tags inside templates
- * are not evaluated. > 2. Page styles are not visible inside templates.
+ * > NOTE: `headerTemplate` and `footerTemplate` markup have the following limitations: > 1. Script tags inside
+ * templates are not evaluated. > 2. Page styles are not visible inside templates.
* @param options
*/
pdf(options?: {
@@ -3154,8 +3175,8 @@ export interface Page {
format?: string;
/**
- * HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values
- * into them:
+ * HTML template for the print header. Should be valid HTML markup with following classes used to inject printing
+ * values into them:
* - `'date'` formatted print date
* - `'title'` document title
* - `'url'` document location
@@ -3233,15 +3254,18 @@ export interface Page {
}): Promise<Buffer>;
/**
- * Focuses the element, and then uses [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down)
- * and [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
+ * Focuses the element, and then uses
+ * [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down) and
+ * [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
*
- * `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
- * value or a single character to generate the text for. A superset of the `key` values can be found
+ * `key` can specify the intended
+ * [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
+ * to generate the text for. A superset of the `key` values can be found
* [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:
*
* `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
- * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.
+ * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,
+ * etc.
*
* Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.
*
@@ -3276,9 +3300,9 @@ export interface Page {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -3289,8 +3313,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -3298,14 +3322,15 @@ export interface Page {
}): Promise<void>;
/**
- * This method reloads the current page, in the same way as if the user had triggered a browser refresh. Returns the main
- * resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.
+ * This method reloads the current page, in the same way as if the user had triggered a browser refresh. Returns the
+ * main resource response. In case of multiple redirects, the navigation will resolve with the response of the last
+ * redirect.
* @param options
*/
reload(options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -3317,30 +3342,34 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
/**
* API testing helper associated with this page. This method returns the same instance as
- * [browserContext.request](https://playwright.dev/docs/api/class-browsercontext#browser-context-request) on the page's
- * context. See [browserContext.request](https://playwright.dev/docs/api/class-browsercontext#browser-context-request) for
- * more details.
+ * [browserContext.request](https://playwright.dev/docs/api/class-browsercontext#browser-context-request) on the
+ * page's context. See
+ * [browserContext.request](https://playwright.dev/docs/api/class-browsercontext#browser-context-request) for more
+ * details.
*/
request: APIRequestContext;
/**
* Routing provides the capability to modify network requests that are made by a page.
*
- * Once routing is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.
+ * Once routing is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or
+ * aborted.
*
* > NOTE: The handler will only be called for the first url if the response is a redirect.
- * > NOTE: [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) will not intercept
- * requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We
- * recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to
- * `'block'`.
+ * > NOTE: [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) will not
+ * intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090)
+ * issue. We recommend disabling Service Workers when using request interception by setting
+ * `Browser.newContext.serviceWorkers` to `'block'`.
*
* An example of a naive handler that aborts all image requests:
*
@@ -3360,8 +3389,8 @@ export interface Page {
* await browser.close();
* ```
*
- * It is possible to examine the request to decide the route action. For example, mocking all requests that contain some
- * post data, and leaving all other requests as is:
+ * It is possible to examine the request to decide the route action. For example, mocking all requests that contain
+ * some post data, and leaving all other requests as is:
*
* ```js
* await page.route('/api/**', route => {
@@ -3397,8 +3426,8 @@ export interface Page {
* [Replaying from HAR](https://playwright.dev/docs/network#replaying-from-har).
*
* Playwright will not serve requests intercepted by Service Worker from the HAR file. See
- * [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using
- * request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
+ * [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
+ * using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
* @param har Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a relative path, then it is resolved relative to the current working directory.
* @param options
*/
@@ -3419,8 +3448,8 @@ export interface Page {
update?: boolean;
/**
- * A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern
- * will be served from the HAR file. If not specified, all requests are served from the HAR file.
+ * A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the
+ * pattern will be served from the HAR file. If not specified, all requests are served from the HAR file.
*/
url?: string|RegExp;
}): Promise<void>;
@@ -3432,12 +3461,13 @@ export interface Page {
screenshot(options?: PageScreenshotOptions): Promise<Buffer>;
/**
- * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until
- * all specified options are present in the `<select>` element and selects these options.
+ * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks, waits
+ * until all specified options are present in the `<select>` element and selects these options.
*
- * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the
- * `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead.
+ * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside
+ * the `<label>` element that has an associated
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used
+ * instead.
*
* Returns the array of option values that have been successfully selected.
*
@@ -3458,8 +3488,8 @@ export interface Page {
* Shortcut for main frame's
* [frame.selectOption(selector, values[, options])](https://playwright.dev/docs/api/class-frame#frame-select-option).
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
- * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
- * is considered matching if all specified properties match.
+ * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to
+ * `{value:'string'}`. Option is considered matching if all specified properties match.
* @param options
*/
selectOption(selector: string, values: null|string|ElementHandle|Array<string>|{
@@ -3499,9 +3529,9 @@ export interface Page {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -3512,8 +3542,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -3525,15 +3555,16 @@ export interface Page {
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
* 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.
* 1. If the element already has the right checked state, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked or unchecked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* Shortcut for main frame's
* [frame.setChecked(selector, checked[, options])](https://playwright.dev/docs/api/class-frame#frame-set-checked).
@@ -3548,15 +3579,15 @@ export interface Page {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -3571,16 +3602,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -3591,8 +3622,8 @@ export interface Page {
*/
setContent(html: string, options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -3604,8 +3635,10 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<void>;
@@ -3645,19 +3678,19 @@ export interface Page {
/**
* The extra HTTP headers will be sent with every request the page initiates.
*
- * > NOTE: [page.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-page#page-set-extra-http-headers) does
- * not guarantee the order of headers in the outgoing requests.
+ * > NOTE: [page.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-page#page-set-extra-http-headers)
+ * does not guarantee the order of headers in the outgoing requests.
* @param headers An object containing additional HTTP headers to be sent with every request. All header values must be strings.
*/
setExtraHTTPHeaders(headers: { [key: string]: string; }): Promise<void>;
/**
- * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
- * are resolved relative to the current working directory. For empty array, clears the selected files.
+ * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then
+ * they are resolved relative to the current working directory. For empty array, clears the selected files.
*
* This method expects `selector` to point to an
- * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
- * `<label>` element that has an associated
+ * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside
+ * the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param files
@@ -3695,9 +3728,9 @@ export interface Page {
buffer: Buffer;
}>, options?: {
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -3708,8 +3741,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -3721,12 +3754,13 @@ export interface Page {
* [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) allows to set
* viewport size (and more) for all pages in the context at once.
*
- * [page.setViewportSize(viewportSize)](https://playwright.dev/docs/api/class-page#page-set-viewport-size) will resize the
- * page. A lot of websites don't expect phones to change size, so you should set the viewport size before navigating to the
- * page. [page.setViewportSize(viewportSize)](https://playwright.dev/docs/api/class-page#page-set-viewport-size) will also
+ * [page.setViewportSize(viewportSize)](https://playwright.dev/docs/api/class-page#page-set-viewport-size) will resize
+ * the page. A lot of websites don't expect phones to change size, so you should set the viewport size before
+ * navigating to the page.
+ * [page.setViewportSize(viewportSize)](https://playwright.dev/docs/api/class-page#page-set-viewport-size) will also
* reset `screen` size, use
- * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) with `screen` and
- * `viewport` parameters if you need better control of these properties.
+ * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) with `screen`
+ * and `viewport` parameters if you need better control of these properties.
*
* ```js
* const page = await browser.newPage();
@@ -3754,15 +3788,15 @@ export interface Page {
/**
* This method taps an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
* 1. Use [page.touchscreen](https://playwright.dev/docs/api/class-page#page-touchscreen) to tap the center of the
* element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) requires that the
* `hasTouch` option of the browser context be set to true.
@@ -3778,21 +3812,21 @@ export interface Page {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -3807,16 +3841,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -3834,8 +3868,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -3851,8 +3885,8 @@ export interface Page {
touchscreen: Touchscreen;
/**
- * Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to send
- * fine-grained keyboard events. To fill values in form fields, use
+ * Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to
+ * send fine-grained keyboard events. To fill values in form fields, use
* [page.fill(selector, value[, options])](https://playwright.dev/docs/api/class-page#page-fill).
*
* To press a special key, like `Control` or `ArrowDown`, use
@@ -3876,9 +3910,9 @@ export interface Page {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -3889,8 +3923,8 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -3900,17 +3934,18 @@ export interface Page {
/**
* This method unchecks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already
- * unchecked, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is
+ * already unchecked, this method returns immediately.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now unchecked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* Shortcut for main frame's
* [frame.uncheck(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-uncheck).
@@ -3924,15 +3959,15 @@ export interface Page {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -3947,16 +3982,16 @@ export interface Page {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -4019,8 +4054,8 @@ export interface Page {
waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;
/**
- * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page crashes,
- * ongoing and subsequent operations will throw.
+ * Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page
+ * crashes, ongoing and subsequent operations will throw.
*
* The most common way to deal with crashes is to catch an exception:
*
@@ -4041,9 +4076,9 @@ export interface Page {
/**
* Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**
* either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or
- * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page will
- * [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and
- * actions like click will never finish.
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page
+ * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the
+ * dialog, and actions like click will never finish.
*
* ```js
* page.on('dialog', dialog => {
@@ -4051,28 +4086,28 @@ export interface Page {
* });
* ```
*
- * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are present,
- * all dialogs are automatically dismissed.
+ * > NOTE: When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listeners are
+ * present, all dialogs are automatically dismissed.
*/
waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;
/**
- * Emitted when the JavaScript [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)
- * event is dispatched.
+ * Emitted when the JavaScript
+ * [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.
*/
waitForEvent(event: 'domcontentloaded', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;
/**
- * Emitted when attachment download started. User can access basic file operations on downloaded content via the passed
- * [Download] instance.
+ * Emitted when attachment download started. User can access basic file operations on downloaded content via the
+ * passed [Download] instance.
*/
waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;
/**
* Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can
* respond to it via setting the input files using
- * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files) that
- * can be uploaded after that.
+ * [fileChooser.setFiles(files[, options])](https://playwright.dev/docs/api/class-filechooser#file-chooser-set-files)
+ * that can be uploaded after that.
*
* ```js
* page.on('filechooser', async (fileChooser) => {
@@ -4121,12 +4156,12 @@ export interface Page {
/**
* Emitted when the page opens a new tab or window. This event is emitted in addition to the
- * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but only
- * for popups relevant to this page.
+ * [browserContext.on('page')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page), but
+ * only for popups relevant to this page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -4141,14 +4176,14 @@ export interface Page {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
waitForEvent(event: 'popup', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;
/**
- * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see
- * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
+ * Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,
+ * see [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).
*/
waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;
@@ -4162,11 +4197,12 @@ export interface Page {
* });
* ```
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event
- * and not with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
- * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network error
- * net::ERR_FAILED.
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) event and not
+ * with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
+ * will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
+ * error net::ERR_FAILED.
*/
waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;
@@ -4177,8 +4213,8 @@ export interface Page {
waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`.
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`.
*/
waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;
@@ -4188,8 +4224,8 @@ export interface Page {
waitForEvent(event: 'websocket', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;
/**
- * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
- * page.
+ * Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned
+ * by the page.
*/
waitForEvent(event: 'worker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;
@@ -4197,8 +4233,9 @@ export interface Page {
/**
* Returns when the required load state has been reached.
*
- * This resolves when the page reaches a required load state, `load` by default. The navigation must have been committed
- * when this method is called. If current document has already reached the required state, resolves immediately.
+ * This resolves when the page reaches a required load state, `load` by default. The navigation must have been
+ * committed when this method is called. If current document has already reached the required state, resolves
+ * immediately.
*
* ```js
* await page.getByRole('button').click(); // Click triggers navigation.
@@ -4226,8 +4263,8 @@ export interface Page {
*/
waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -4241,9 +4278,9 @@ export interface Page {
* navigation will resolve with the response of the last redirect. In case of navigation to a different anchor or
* navigation due to History API usage, the navigation will resolve with `null`.
*
- * This resolves when the page navigates to a new URL or reloads. It is useful for when you run code which will indirectly
- * cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.
- * Consider this example:
+ * This resolves when the page navigates to a new URL or reloads. It is useful for when you run code which will
+ * indirectly cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from
+ * a `setTimeout`. Consider this example:
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -4256,8 +4293,8 @@ export interface Page {
* ]);
* ```
*
- * > NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
- * considered a navigation.
+ * > NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL
+ * is considered a navigation.
*
* Shortcut for main frame's
* [frame.waitForNavigation([options])](https://playwright.dev/docs/api/class-frame#frame-wait-for-navigation).
@@ -4265,8 +4302,8 @@ export interface Page {
*/
waitForNavigation(options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -4275,9 +4312,9 @@ export interface Page {
timeout?: number;
/**
- * 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.
*/
url?: string|RegExp|((url: URL) => boolean);
@@ -4285,15 +4322,17 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
/**
- * Waits for the matching request and returns it. See [waiting for event](https://playwright.dev/docs/events#waiting-for-event) for more details
- * about events.
+ * Waits for the matching request and returns it. See [waiting for event](https://playwright.dev/docs/events#waiting-for-event) for more
+ * details about events.
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -4319,15 +4358,16 @@ export interface Page {
*/
waitForRequest(urlOrPredicate: string|RegExp|((request: Request) => boolean|Promise<boolean>), options?: {
/**
- * Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be
- * changed by using the
+ * Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can
+ * be changed by using the
* [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) method.
*/
timeout?: number;
}): Promise<Request>;
/**
- * Returns the matched response. See [waiting for event](https://playwright.dev/docs/events#waiting-for-event) for more details about events.
+ * Returns the matched response. See [waiting for event](https://playwright.dev/docs/events#waiting-for-event) for more details about
+ * events.
*
* ```js
* // Note that Promise.all prevents a race condition
@@ -4354,8 +4394,8 @@ export interface Page {
*/
waitForResponse(urlOrPredicate: string|RegExp|((response: Response) => boolean|Promise<boolean>), options?: {
/**
- * Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be
- * changed by using the
+ * Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can
+ * be changed by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -4365,8 +4405,8 @@ export interface Page {
/**
* Waits for the given `timeout` in milliseconds.
*
- * Note that `page.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going to be
- * flaky. Use signals such as network events, selectors becoming visible and others instead.
+ * Note that `page.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going
+ * to be flaky. Use signals such as network events, selectors becoming visible and others instead.
*
* ```js
* // wait for 1 second
@@ -4389,14 +4429,14 @@ export interface Page {
*
* Shortcut for main frame's
* [frame.waitForURL(url[, options])](https://playwright.dev/docs/api/class-frame#frame-wait-for-url).
- * @param url 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.
+ * @param url 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.
* @param options
*/
waitForURL(url: string|RegExp|((url: URL) => boolean), options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -4408,15 +4448,17 @@ export interface Page {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<void>;
/**
- * This method returns all of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
- * associated with the page.
+ * This method returns all of the dedicated
+ * [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page.
*
* > NOTE: This does not contain ServiceWorkers
*/
@@ -4428,12 +4470,12 @@ export interface Page {
* [frame.childFrames()](https://playwright.dev/docs/api/class-frame#frame-child-frames) methods.
*
* [Frame] object's lifecycle is controlled by three events, dispatched on the page object:
- * - [page.on('frameattached')](https://playwright.dev/docs/api/class-page#page-event-frame-attached) - fired when the
- * frame gets attached to the page. A Frame can be attached to the page only once.
- * - [page.on('framenavigated')](https://playwright.dev/docs/api/class-page#page-event-frame-navigated) - fired when the
- * frame commits navigation to a different URL.
- * - [page.on('framedetached')](https://playwright.dev/docs/api/class-page#page-event-frame-detached) - fired when the
- * frame gets detached from the page. A Frame can be detached from the page only once.
+ * - [page.on('frameattached')](https://playwright.dev/docs/api/class-page#page-event-frame-attached) - fired when
+ * the frame gets attached to the page. A Frame can be attached to the page only once.
+ * - [page.on('framenavigated')](https://playwright.dev/docs/api/class-page#page-event-frame-navigated) - fired when
+ * the frame commits navigation to a different URL.
+ * - [page.on('framedetached')](https://playwright.dev/docs/api/class-page#page-event-frame-detached) - fired when
+ * the frame gets detached from the page. A Frame can be detached from the page only once.
*
* An example of dumping frame tree:
*
@@ -4462,16 +4504,16 @@ export interface Frame {
* Returns the return value of `pageFunction`.
*
* If the function passed to the
- * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns a [Promise],
- * then [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) would wait for
- * the promise to resolve and return its value.
+ * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns a
+ * [Promise], then [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate)
+ * would wait for the promise to resolve and return its value.
*
* If the function passed to the
* [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns a
* non-[Serializable] value, then
- * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns `undefined`.
- * Playwright also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`,
- * `Infinity`, `-Infinity`.
+ * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns
+ * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
+ * `-0`, `NaN`, `Infinity`, `-Infinity`.
*
* ```js
* const result = await frame.evaluate(([x, y]) => {
@@ -4503,16 +4545,16 @@ export interface Frame {
* Returns the return value of `pageFunction`.
*
* If the function passed to the
- * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns a [Promise],
- * then [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) would wait for
- * the promise to resolve and return its value.
+ * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns a
+ * [Promise], then [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate)
+ * would wait for the promise to resolve and return its value.
*
* If the function passed to the
* [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns a
* non-[Serializable] value, then
- * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns `undefined`.
- * Playwright also supports transferring some additional values that are not serializable by `JSON`: `-0`, `NaN`,
- * `Infinity`, `-Infinity`.
+ * [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) returns
+ * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
+ * `-0`, `NaN`, `Infinity`, `-Infinity`.
*
* ```js
* const result = await frame.evaluate(([x, y]) => {
@@ -4546,15 +4588,15 @@ export interface Frame {
*
* The only difference between
* [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) and
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) is that
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) returns
- * [JSHandle].
+ * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) is
+ * that [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle)
+ * returns [JSHandle].
*
* If the function, passed to the
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle), returns
- * a [Promise], then
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) would
- * wait for the promise to resolve and return its value.
+ * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle),
+ * returns a [Promise], then
+ * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle)
+ * would wait for the promise to resolve and return its value.
*
* ```js
* const aWindowHandle = await frame.evaluateHandle(() => Promise.resolve(window));
@@ -4586,15 +4628,15 @@ export interface Frame {
*
* The only difference between
* [frame.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate) and
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) is that
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) returns
- * [JSHandle].
+ * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) is
+ * that [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle)
+ * returns [JSHandle].
*
* If the function, passed to the
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle), returns
- * a [Promise], then
- * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle) would
- * wait for the promise to resolve and return its value.
+ * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle),
+ * returns a [Promise], then
+ * [frame.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-evaluate-handle)
+ * would wait for the promise to resolve and return its value.
*
* ```js
* const aWindowHandle = await frame.evaluateHandle(() => Promise.resolve(window));
@@ -4671,12 +4713,12 @@ export interface Frame {
*
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the frame and passes it as a first argument to
- * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector, the
- * method throws an error.
+ * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector,
+ * the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [frame.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector)
@@ -4701,12 +4743,12 @@ export interface Frame {
*
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the frame and passes it as a first argument to
- * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector, the
- * method throws an error.
+ * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector,
+ * the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [frame.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector)
@@ -4731,12 +4773,12 @@ export interface Frame {
*
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the frame and passes it as a first argument to
- * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector, the
- * method throws an error.
+ * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector,
+ * the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [frame.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector)
@@ -4761,12 +4803,12 @@ export interface Frame {
*
* > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
* tests. Use
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate), other
- * [Locator] helper methods or web-first assertions instead.
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate),
+ * other [Locator] helper methods or web-first assertions instead.
*
* The method finds an element matching the specified selector within the frame and passes it as a first argument to
- * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector, the
- * method throws an error.
+ * `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the selector,
+ * the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [frame.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector)
@@ -4791,11 +4833,11 @@ export interface Frame {
* Returns the return value of `pageFunction`.
*
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the frame and passes an array of matched elements
- * as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector within the frame and passes an array of matched
+ * elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
*
* If `pageFunction` returns a [Promise], then
* [frame.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector-all)
@@ -4816,11 +4858,11 @@ export interface Frame {
* Returns the return value of `pageFunction`.
*
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the frame and passes an array of matched elements
- * as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector within the frame and passes an array of matched
+ * elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
*
* If `pageFunction` returns a [Promise], then
* [frame.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector-all)
@@ -4841,11 +4883,11 @@ export interface Frame {
* Returns the return value of `pageFunction`.
*
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the frame and passes an array of matched elements
- * as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector within the frame and passes an array of matched
+ * elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
*
* If `pageFunction` returns a [Promise], then
* [frame.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector-all)
@@ -4866,11 +4908,11 @@ export interface Frame {
* Returns the return value of `pageFunction`.
*
* > NOTE: In most cases,
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all), other
- * [Locator] helper methods and web-first assertions do a better job.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all),
+ * other [Locator] helper methods and web-first assertions do a better job.
*
- * The method finds all elements matching the specified selector within the frame and passes an array of matched elements
- * as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector within the frame and passes an array of matched
+ * elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
*
* If `pageFunction` returns a [Promise], then
* [frame.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-frame#frame-eval-on-selector-all)
@@ -4957,12 +4999,12 @@ export interface Frame {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions make the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions make the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -4989,12 +5031,12 @@ export interface Frame {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions make the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions make the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -5021,12 +5063,12 @@ export interface Frame {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions make the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions make the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -5053,12 +5095,12 @@ export interface Frame {
* Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects and
- * web-first assertions make the code wait-for-selector-free.
+ * > NOTE: Playwright automatically waits for element to be ready before performing an action. Using [Locator] objects
+ * and web-first assertions make the code wait-for-selector-free.
*
- * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
- * the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
- * selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
+ * Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If
+ * at the moment of calling the method `selector` already satisfies the condition, the method will return immediately.
+ * If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
*
* This method works across navigations:
*
@@ -5094,8 +5136,8 @@ export interface Frame {
content?: string;
/**
- * Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the
- * current working directory.
+ * Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative
+ * to the current working directory.
*/
path?: string;
@@ -5139,17 +5181,18 @@ export interface Frame {
/**
* This method checks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already
- * checked, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is
+ * already checked, this method returns immediately.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -5160,15 +5203,15 @@ export interface Frame {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -5183,16 +5226,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -5202,15 +5245,15 @@ export interface Frame {
/**
* This method clicks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element, or
- * the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -5236,21 +5279,21 @@ export interface Frame {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -5265,16 +5308,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -5287,16 +5330,16 @@ export interface Frame {
/**
* This method double clicks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
* 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the
* element, or the specified `position`.
- * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the
- * first click of the `dblclick()` triggers a navigation event, this method will throw.
+ * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if
+ * the first click of the `dblclick()` triggers a navigation event, this method will throw.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `frame.dblclick()` dispatches two `click` events and a single `dblclick` event.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
@@ -5319,21 +5362,21 @@ export interface Frame {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -5348,16 +5391,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -5371,8 +5414,8 @@ export interface Frame {
* await frame.dispatchEvent('button#submit', 'click');
* ```
*
- * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
- * and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
+ * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`
+ * properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
*
* Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:
* - [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)
@@ -5404,8 +5447,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -5424,9 +5467,9 @@ export interface Frame {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -5457,27 +5500,27 @@ export interface Frame {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
/**
- * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the
- * element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input
- * field.
+ * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks,
+ * focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string
+ * to clear the input field.
*
- * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.
- * However, if the element is inside the `<label>` element that has an associated
+ * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an
+ * error. However, if the element is inside the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
* instead.
*
@@ -5494,9 +5537,9 @@ export interface Frame {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -5507,8 +5550,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -5516,8 +5559,8 @@ export interface Frame {
}): Promise<void>;
/**
- * This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the method
- * waits until a matching element appears in the DOM.
+ * This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the
+ * method waits until a matching element appears in the DOM.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -5529,8 +5572,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -5541,8 +5584,8 @@ export interface Frame {
* Returns the `frame` or `iframe` element handle which corresponds to this frame.
*
* This is an inverse of
- * [elementHandle.contentFrame()](https://playwright.dev/docs/api/class-elementhandle#element-handle-content-frame). Note
- * that returned handle actually belongs to the parent frame.
+ * [elementHandle.contentFrame()](https://playwright.dev/docs/api/class-elementhandle#element-handle-content-frame).
+ * Note that returned handle actually belongs to the parent frame.
*
* This method throws an error if the frame has been detached before `frameElement()` returns.
*
@@ -5556,9 +5599,9 @@ export interface Frame {
frameElement(): Promise<ElementHandle>;
/**
- * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
- * that iframe. Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe
- * id="my-frame">`:
+ * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
+ * in that iframe. Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like
+ * `<iframe id="my-frame">`:
*
* ```js
* const locator = frame.frameLocator('#my-iframe').getByText('Submit');
@@ -5583,8 +5626,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -5603,8 +5646,8 @@ export interface Frame {
*/
getByAltText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -5623,8 +5666,8 @@ export interface Frame {
*/
getByLabel(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -5642,8 +5685,8 @@ export interface Frame {
*/
getByPlaceholder(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -5655,9 +5698,10 @@ export interface Frame {
* accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
*
* Note that many html elements have an implicitly
- * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
- * can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
- * recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
+ * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector.
+ * You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines
+ * **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to
+ * default values.
* @param role Required aria role.
* @param options
*/
@@ -5678,8 +5722,8 @@ export interface Frame {
disabled?: boolean;
/**
- * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
@@ -5699,8 +5743,8 @@ export interface Frame {
includeHidden?: boolean;
/**
- * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for
- * `<h1>-<h6>` elements.
+ * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values
+ * for `<h1>-<h6>` elements.
*
* Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).
*/
@@ -5772,26 +5816,27 @@ export interface Frame {
* page.getByText(/^hello$/i)
* ```
*
- * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to match
- * by another criteria, like an accessible role, and then filter by the text content.
+ * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to
+ * match by another criteria, like an accessible role, and then filter by the text content.
*
- * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into
- * one, turns line breaks into spaces and ignores leading and trailing whitespace.
- * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For
- * example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
+ * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces
+ * into one, turns line breaks into spaces and ignores leading and trailing whitespace.
+ * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content.
+ * For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
* @param text Text to locate the element for.
* @param options
*/
getByText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
/**
- * Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
+ * Allows locating elements by their title. For example, this method will find the button by its title "Place the
+ * order":
*
* ```html
* <button title='Place the order'>Order Now</button>
@@ -5802,15 +5847,15 @@ export interface Frame {
*/
getByTitle(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
/**
- * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the
- * last redirect.
+ * Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of
+ * the last redirect.
*
* The method will throw an error if:
* - there's an SSL error (e.g. in case of self-signed certificates).
@@ -5819,12 +5864,12 @@ export interface Frame {
* - the remote server does not respond or is unreachable.
* - the main resource failed to load.
*
- * The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not
- * Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling
+ * The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404
+ * "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling
* [response.status()](https://playwright.dev/docs/api/class-response#response-status).
*
- * > NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation to
- * `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.
+ * > NOTE: The method either throws an error or returns a main resource response. The only exceptions are navigation
+ * to `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.
* > NOTE: Headless mode doesn't support navigation to a PDF document. See the
* [upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295).
* @param url URL to navigate frame to. The url should include scheme, e.g. `https://`.
@@ -5838,8 +5883,8 @@ export interface Frame {
referer?: string;
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -5851,8 +5896,10 @@ export interface Frame {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
@@ -5860,15 +5907,15 @@ export interface Frame {
/**
* This method hovers over an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the element,
- * or the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -5879,21 +5926,21 @@ export interface Frame {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -5908,16 +5955,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -5935,8 +5982,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -5956,8 +6003,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -5968,7 +6015,8 @@ export interface Frame {
* Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
*
* Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the
+ * control.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -5980,8 +6028,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6001,8 +6049,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6027,8 +6075,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6048,8 +6096,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6069,8 +6117,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6078,8 +6126,8 @@ export interface Frame {
}): Promise<boolean>;
/**
- * Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not
- * match any elements is considered hidden.
+ * Returns whether the element is hidden, the opposite of [visible](https://playwright.dev/docs/actionability#visible). `selector` that
+ * does not match any elements is considered hidden.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -6092,16 +6140,16 @@ export interface Frame {
/**
* **DEPRECATED** This option is ignored.
- * [frame.isHidden(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-is-hidden) does not wait for the
- * element to become hidden and returns immediately.
+ * [frame.isHidden(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-is-hidden) does not wait
+ * for the element to become hidden and returns immediately.
* @deprecated
*/
timeout?: number;
}): Promise<boolean>;
/**
- * Returns whether the element is [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not match any elements is
- * considered not visible.
+ * Returns whether the element is [visible](https://playwright.dev/docs/actionability#visible). `selector` that does not match any elements
+ * is considered not visible.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -6114,17 +6162,17 @@ export interface Frame {
/**
* **DEPRECATED** This option is ignored.
- * [frame.isVisible(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-is-visible) does not wait for
- * the element to become visible and returns immediately.
+ * [frame.isVisible(selector[, options])](https://playwright.dev/docs/api/class-frame#frame-is-visible) does not wait
+ * for the element to become visible and returns immediately.
* @deprecated
*/
timeout?: number;
}): Promise<boolean>;
/**
- * The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved to
- * the element immediately before performing an action, so a series of actions on the same locator can in fact be performed
- * on different DOM elements. That would happen if the DOM structure between those actions has changed.
+ * The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved
+ * to the element immediately before performing an action, so a series of actions on the same locator can in fact be
+ * performed on different DOM elements. That would happen if the DOM structure between those actions has changed.
*
* [Learn more about locators](https://playwright.dev/docs/locators).
*
@@ -6134,16 +6182,16 @@ export interface Frame {
*/
locator(selector: string, options?: {
/**
- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
- * For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
+ * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer
+ * one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
*
* Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
*/
has?: Locator;
/**
- * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
- * [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
+ * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
+ * passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
* `<article><div>Playwright</div></article>`.
*/
hasText?: string|RegExp;
@@ -6154,7 +6202,8 @@ export interface Frame {
*
* If the name is empty, returns the id attribute instead.
*
- * > NOTE: This value is calculated once when the frame is created, and will not update if the attribute is changed later.
+ * > NOTE: This value is calculated once when the frame is created, and will not update if the attribute is changed
+ * later.
*/
name(): string;
@@ -6169,12 +6218,14 @@ export interface Frame {
parentFrame(): null|Frame;
/**
- * `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
- * value or a single character to generate the text for. A superset of the `key` values can be found
+ * `key` can specify the intended
+ * [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
+ * to generate the text for. A superset of the `key` values can be found
* [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:
*
* `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
- * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.
+ * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,
+ * etc.
*
* Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.
*
@@ -6196,9 +6247,9 @@ export interface Frame {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -6209,8 +6260,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6218,12 +6269,13 @@ export interface Frame {
}): Promise<void>;
/**
- * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until
- * all specified options are present in the `<select>` element and selects these options.
+ * This method waits for an element matching `selector`, waits for [actionability](https://playwright.dev/docs/actionability) checks, waits
+ * until all specified options are present in the `<select>` element and selects these options.
*
- * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the
- * `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead.
+ * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside
+ * the `<label>` element that has an associated
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used
+ * instead.
*
* Returns the array of option values that have been successfully selected.
*
@@ -6241,8 +6293,8 @@ export interface Frame {
* ```
*
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
- * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
- * is considered matching if all specified properties match.
+ * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to
+ * `{value:'string'}`. Option is considered matching if all specified properties match.
* @param options
*/
selectOption(selector: string, values: null|string|ElementHandle|Array<string>|{
@@ -6282,9 +6334,9 @@ export interface Frame {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -6295,8 +6347,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6308,15 +6360,16 @@ export interface Frame {
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
* 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.
* 1. If the element already has the right checked state, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked or unchecked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param checked Whether to check or uncheck the checkbox.
* @param options
@@ -6328,15 +6381,15 @@ export interface Frame {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -6351,16 +6404,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -6371,8 +6424,8 @@ export interface Frame {
*/
setContent(html: string, options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -6384,19 +6437,21 @@ export interface Frame {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<void>;
/**
- * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
- * are resolved relative to the current working directory. For empty array, clears the selected files.
+ * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then
+ * they are resolved relative to the current working directory. For empty array, clears the selected files.
*
* This method expects `selector` to point to an
- * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
- * `<label>` element that has an associated
+ * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside
+ * the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param files
@@ -6434,9 +6489,9 @@ export interface Frame {
buffer: Buffer;
}>, options?: {
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -6447,8 +6502,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6458,15 +6513,15 @@ export interface Frame {
/**
* This method taps an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
* 1. Use [page.touchscreen](https://playwright.dev/docs/api/class-page#page-touchscreen) to tap the center of the
* element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `frame.tap()` requires that the `hasTouch` option of the browser context be set to true.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
@@ -6479,21 +6534,21 @@ export interface Frame {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -6508,16 +6563,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -6535,8 +6590,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6549,8 +6604,8 @@ export interface Frame {
title(): Promise<string>;
/**
- * Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used to
- * send fine-grained keyboard events. To fill values in form fields, use
+ * Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used
+ * to send fine-grained keyboard events. To fill values in form fields, use
* [frame.fill(selector, value[, options])](https://playwright.dev/docs/api/class-frame#frame-fill).
*
* To press a special key, like `Control` or `ArrowDown`, use
@@ -6572,9 +6627,9 @@ export interface Frame {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -6585,8 +6640,8 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -6596,17 +6651,18 @@ export interface Frame {
/**
* This method checks an element matching `selector` by performing the following steps:
* 1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.
- * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already
- * unchecked, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is
+ * already unchecked, this method returns immediately.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now unchecked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -6617,15 +6673,15 @@ export interface Frame {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -6640,16 +6696,16 @@ export interface Frame {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -6662,8 +6718,9 @@ export interface Frame {
/**
* Waits for the required load state to be reached.
*
- * This returns when the frame reaches a required load state, `load` by default. The navigation must have been committed
- * when this method is called. If current document has already reached the required state, resolves immediately.
+ * This returns when the frame reaches a required load state, `load` by default. The navigation must have been
+ * committed when this method is called. If current document has already reached the required state, resolves
+ * immediately.
*
* ```js
* await frame.click('button'); // Click triggers navigation.
@@ -6678,8 +6735,8 @@ export interface Frame {
*/
waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -6689,12 +6746,12 @@ export interface Frame {
}): Promise<void>;
/**
- * Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the navigation
- * will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to
- * History API usage, the navigation will resolve with `null`.
+ * Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the
+ * navigation will resolve with the response of the last redirect. In case of navigation to a different anchor or
+ * navigation due to History API usage, the navigation will resolve with `null`.
*
- * This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly cause
- * the frame to navigate. Consider this example:
+ * This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly
+ * cause the frame to navigate. Consider this example:
*
* ```js
* const [response] = await Promise.all([
@@ -6703,14 +6760,14 @@ export interface Frame {
* ]);
* ```
*
- * > NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is
- * considered a navigation.
+ * > NOTE: Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL
+ * is considered a navigation.
* @param options
*/
waitForNavigation(options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -6719,9 +6776,9 @@ export interface Frame {
timeout?: number;
/**
- * 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.
*/
url?: string|RegExp|((url: URL) => boolean);
@@ -6729,8 +6786,10 @@ export interface Frame {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<null|Response>;
@@ -6738,8 +6797,8 @@ export interface Frame {
/**
* Waits for the given `timeout` in milliseconds.
*
- * Note that `frame.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going to
- * be flaky. Use signals such as network events, selectors becoming visible and others instead.
+ * Note that `frame.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going
+ * to be flaky. Use signals such as network events, selectors becoming visible and others instead.
* @param timeout A timeout to wait for
*/
waitForTimeout(timeout: number): Promise<void>;
@@ -6752,14 +6811,14 @@ export interface Frame {
* await frame.waitForURL('**\/target.html');
* ```
*
- * @param url 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.
+ * @param url 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.
* @param options
*/
waitForURL(url: string|RegExp|((url: URL) => boolean), options?: {
/**
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be
- * changed by using the
+ * 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(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout),
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout),
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
@@ -6771,8 +6830,10 @@ export interface Frame {
* When to consider operation succeeded, defaults to `load`. Events can be either:
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
* - `'load'` - consider operation to be finished when the `load` event is fired.
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
- * - `'commit'` - consider operation to be finished when network response is received and the document started loading.
+ * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500`
+ * ms.
+ * - `'commit'` - consider operation to be finished when network response is received and the document started
+ * loading.
*/
waitUntil?: "load"|"domcontentloaded"|"networkidle"|"commit";
}): Promise<void>;}
@@ -6786,8 +6847,8 @@ export interface Frame {
* context.
*
* Playwright allows creating "incognito" browser contexts with
- * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) method. "Incognito"
- * browser contexts don't write any browsing data to disk.
+ * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) method.
+ * "Incognito" browser contexts don't write any browsing data to disk.
*
* ```js
* // Create a new incognito browser context
@@ -6803,14 +6864,14 @@ export interface Frame {
export interface BrowserContext {
/**
* The method adds a function called `name` on the `window` object of every frame in every page in the context. When
- * called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If
- * the `callback` returns a [Promise], it will be awaited.
+ * called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.
+ * If the `callback` returns a [Promise], it will be awaited.
*
- * The first argument of the `callback` function contains information about the caller: `{ browserContext: BrowserContext,
- * page: Page, frame: Frame }`.
+ * The first argument of the `callback` function contains information about the caller: `{ browserContext:
+ * BrowserContext, page: Page, frame: Frame }`.
*
- * See [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding) for
- * page-only version.
+ * See [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding)
+ * for page-only version.
*
* An example of exposing page URL to all frames in all pages in the context:
*
@@ -6857,14 +6918,14 @@ export interface BrowserContext {
exposeBinding(name: string, playwrightBinding: (source: BindingSource, arg: JSHandle) => any, options: { handle: true }): Promise<void>;
/**
* The method adds a function called `name` on the `window` object of every frame in every page in the context. When
- * called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If
- * the `callback` returns a [Promise], it will be awaited.
+ * called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.
+ * If the `callback` returns a [Promise], it will be awaited.
*
- * The first argument of the `callback` function contains information about the caller: `{ browserContext: BrowserContext,
- * page: Page, frame: Frame }`.
+ * The first argument of the `callback` function contains information about the caller: `{ browserContext:
+ * BrowserContext, page: Page, frame: Frame }`.
*
- * See [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding) for
- * page-only version.
+ * See [page.exposeBinding(name, callback[, options])](https://playwright.dev/docs/api/class-page#page-expose-binding)
+ * for page-only version.
*
* An example of exposing page URL to all frames in all pages in the context:
*
@@ -6916,8 +6977,8 @@ export interface BrowserContext {
* - Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is
* evaluated in the context of the newly attached frame.
*
- * The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend
- * the JavaScript environment, e.g. to seed `Math.random`.
+ * The script is evaluated after the document was created but before any of its scripts were run. This is useful to
+ * amend the JavaScript environment, e.g. to seed `Math.random`.
*
* An example of overriding `Math.random` before the page loads:
*
@@ -6935,7 +6996,8 @@ export interface BrowserContext {
*
* > NOTE: The order of evaluation of multiple scripts installed via
* [browserContext.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-browsercontext#browser-context-add-init-script)
- * and [page.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-page#page-add-init-script) is not defined.
+ * and [page.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-page#page-add-init-script) is not
+ * defined.
* @param script Script to be evaluated in all pages in the browser context.
* @param arg Optional argument to pass to `script` (only supported when passing a function).
*/
@@ -6961,13 +7023,14 @@ export interface BrowserContext {
on(event: 'close', listener: (browserContext: BrowserContext) => void): this;
/**
- * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will
- * also fire for popup pages. See also [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to
- * receive events about popups relevant to a specific page.
+ * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event
+ * will also fire for popup pages. See also
+ * [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to receive events about popups
+ * relevant to a specific page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* const [newPage] = await Promise.all([
@@ -6978,14 +7041,14 @@ export interface BrowserContext {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
on(event: 'page', listener: (page: Page) => void): this;
/**
- * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To only
- * listen for requests from a particular page, use
+ * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To
+ * only listen for requests from a particular page, use
* [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request).
*
* In order to intercept and mutate requests, see
@@ -6995,11 +7058,11 @@ export interface BrowserContext {
on(event: 'request', listener: (request: Request) => void): this;
/**
- * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use
- * [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
+ * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,
+ * use [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
* [browserContext.on('requestfinished')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-finished)
* event and not with
* [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed).
@@ -7008,14 +7071,15 @@ export interface BrowserContext {
/**
* Emitted when a request finishes successfully after downloading the response body. For a successful response, the
- * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a particular
- * page, use [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
+ * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a
+ * particular page, use
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
*/
on(event: 'requestfinished', listener: (request: Request) => void): this;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
* [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response).
*/
on(event: 'response', listener: (response: Response) => void): this;
@@ -7088,13 +7152,14 @@ export interface BrowserContext {
addListener(event: 'close', listener: (browserContext: BrowserContext) => void): this;
/**
- * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will
- * also fire for popup pages. See also [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to
- * receive events about popups relevant to a specific page.
+ * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event
+ * will also fire for popup pages. See also
+ * [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to receive events about popups
+ * relevant to a specific page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* const [newPage] = await Promise.all([
@@ -7105,14 +7170,14 @@ export interface BrowserContext {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
addListener(event: 'page', listener: (page: Page) => void): this;
/**
- * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To only
- * listen for requests from a particular page, use
+ * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To
+ * only listen for requests from a particular page, use
* [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request).
*
* In order to intercept and mutate requests, see
@@ -7122,11 +7187,11 @@ export interface BrowserContext {
addListener(event: 'request', listener: (request: Request) => void): this;
/**
- * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use
- * [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
+ * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,
+ * use [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
* [browserContext.on('requestfinished')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-finished)
* event and not with
* [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed).
@@ -7135,14 +7200,15 @@ export interface BrowserContext {
/**
* Emitted when a request finishes successfully after downloading the response body. For a successful response, the
- * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a particular
- * page, use [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
+ * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a
+ * particular page, use
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
*/
addListener(event: 'requestfinished', listener: (request: Request) => void): this;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
* [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response).
*/
addListener(event: 'response', listener: (response: Response) => void): this;
@@ -7255,13 +7321,14 @@ export interface BrowserContext {
prependListener(event: 'close', listener: (browserContext: BrowserContext) => void): this;
/**
- * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will
- * also fire for popup pages. See also [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to
- * receive events about popups relevant to a specific page.
+ * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event
+ * will also fire for popup pages. See also
+ * [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to receive events about popups
+ * relevant to a specific page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* const [newPage] = await Promise.all([
@@ -7272,14 +7339,14 @@ export interface BrowserContext {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
prependListener(event: 'page', listener: (page: Page) => void): this;
/**
- * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To only
- * listen for requests from a particular page, use
+ * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To
+ * only listen for requests from a particular page, use
* [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request).
*
* In order to intercept and mutate requests, see
@@ -7289,11 +7356,11 @@ export interface BrowserContext {
prependListener(event: 'request', listener: (request: Request) => void): this;
/**
- * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use
- * [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
+ * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,
+ * use [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
* [browserContext.on('requestfinished')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-finished)
* event and not with
* [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed).
@@ -7302,14 +7369,15 @@ export interface BrowserContext {
/**
* Emitted when a request finishes successfully after downloading the response body. For a successful response, the
- * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a particular
- * page, use [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
+ * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a
+ * particular page, use
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
*/
prependListener(event: 'requestfinished', listener: (request: Request) => void): this;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
* [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response).
*/
prependListener(event: 'response', listener: (response: Response) => void): this;
@@ -7322,8 +7390,8 @@ export interface BrowserContext {
prependListener(event: 'serviceworker', listener: (worker: Worker) => void): this;
/**
- * Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be
- * obtained via
+ * Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies
+ * can be obtained via
* [browserContext.cookies([urls])](https://playwright.dev/docs/api/class-browsercontext#browser-context-cookies).
*
* ```js
@@ -7411,8 +7479,8 @@ export interface BrowserContext {
close(): Promise<void>;
/**
- * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs
- * are returned.
+ * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those
+ * URLs are returned.
* @param urls Optional list of URLs.
*/
cookies(urls?: string|Array<string>): Promise<Array<Cookie>>;
@@ -7423,8 +7491,8 @@ export interface BrowserContext {
*
* If the `callback` returns a [Promise], it will be awaited.
*
- * See [page.exposeFunction(name, callback)](https://playwright.dev/docs/api/class-page#page-expose-function) for page-only
- * version.
+ * See [page.exposeFunction(name, callback)](https://playwright.dev/docs/api/class-page#page-expose-function) for
+ * page-only version.
*
* An example of adding a `sha256` function to all pages in the context:
*
@@ -7506,14 +7574,14 @@ export interface BrowserContext {
request: APIRequestContext;
/**
- * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route
- * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.
+ * Routing provides the capability to modify network requests that are made by any page in the browser context. Once
+ * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.
*
* > NOTE:
* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route)
* will not intercept requests intercepted by Service Worker. See
- * [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using
- * request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
+ * [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
+ * using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
*
* An example of a naive handler that aborts all image requests:
*
@@ -7535,8 +7603,8 @@ export interface BrowserContext {
* await browser.close();
* ```
*
- * It is possible to examine the request to decide the route action. For example, mocking all requests that contain some
- * post data, and leaving all other requests as is:
+ * It is possible to examine the request to decide the route action. For example, mocking all requests that contain
+ * some post data, and leaving all other requests as is:
*
* ```js
* await context.route('/api/**', route => {
@@ -7547,8 +7615,9 @@ export interface BrowserContext {
* });
* ```
*
- * Page routes (set up with [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route))
- * take precedence over browser context routes when request matches both handlers.
+ * Page routes (set up with
+ * [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route)) take precedence over
+ * browser context routes when request matches both handlers.
*
* To remove a route with its handler you can use
* [browserContext.unroute(url[, handler])](https://playwright.dev/docs/api/class-browsercontext#browser-context-unroute).
@@ -7571,8 +7640,8 @@ export interface BrowserContext {
* [Replaying from HAR](https://playwright.dev/docs/network#replaying-from-har).
*
* Playwright will not serve requests intercepted by Service Worker from the HAR file. See
- * [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using
- * request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
+ * [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when
+ * using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.
* @param har Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a relative path, then it is resolved relative to the current working directory.
* @param options
*/
@@ -7593,8 +7662,8 @@ export interface BrowserContext {
update?: boolean;
/**
- * A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern
- * will be served from the HAR file. If not specified, all requests are served from the HAR file.
+ * A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the
+ * pattern will be served from the HAR file. If not specified, all requests are served from the HAR file.
*/
url?: string|RegExp;
}): Promise<void>;
@@ -7617,8 +7686,8 @@ export interface BrowserContext {
*
* > NOTE:
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
- * and [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) take priority
- * over
+ * and [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) take
+ * priority over
* [browserContext.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout).
* @param timeout Maximum navigation time in milliseconds
*/
@@ -7638,10 +7707,11 @@ export interface BrowserContext {
setDefaultTimeout(timeout: number): void;
/**
- * The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged
- * with page-specific extra HTTP headers set with
- * [page.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-page#page-set-extra-http-headers). If page
- * overrides a particular header, page-specific header value will be used instead of the browser context header value.
+ * The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are
+ * merged with page-specific extra HTTP headers set with
+ * [page.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-page#page-set-extra-http-headers). If
+ * page overrides a particular header, page-specific header value will be used instead of the browser context header
+ * value.
*
* > NOTE:
* [browserContext.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-extra-http-headers)
@@ -7680,7 +7750,8 @@ export interface BrowserContext {
}): Promise<void>;
/**
- * **DEPRECATED** Browsers may cache credentials after successful authentication. Create a new browser context instead.
+ * **DEPRECATED** Browsers may cache credentials after successful authentication. Create a new browser context
+ * instead.
* @deprecated
* @param httpCredentials
*/
@@ -7770,13 +7841,14 @@ export interface BrowserContext {
waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (browserContext: BrowserContext) => boolean | Promise<boolean>, timeout?: number } | ((browserContext: BrowserContext) => boolean | Promise<boolean>)): Promise<BrowserContext>;
/**
- * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will
- * also fire for popup pages. See also [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to
- * receive events about popups relevant to a specific page.
+ * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event
+ * will also fire for popup pages. See also
+ * [page.on('popup')](https://playwright.dev/docs/api/class-page#page-event-popup) to receive events about popups
+ * relevant to a specific page.
*
* The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
- * popup with `window.open('http://example.com')`, this event will fire when the network request to "http://example.com" is
- * done and its response has started loading in the popup.
+ * popup with `window.open('http://example.com')`, this event will fire when the network request to
+ * "http://example.com" is done and its response has started loading in the popup.
*
* ```js
* const [newPage] = await Promise.all([
@@ -7787,14 +7859,14 @@ export interface BrowserContext {
* ```
*
* > NOTE: Use
- * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to wait
- * until the page gets to a particular state (you should not need it in most cases).
+ * [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
+ * wait until the page gets to a particular state (you should not need it in most cases).
*/
waitForEvent(event: 'page', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;
/**
- * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To only
- * listen for requests from a particular page, use
+ * Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To
+ * only listen for requests from a particular page, use
* [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request).
*
* In order to intercept and mutate requests, see
@@ -7804,11 +7876,11 @@ export interface BrowserContext {
waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;
/**
- * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use
- * [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
+ * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,
+ * use [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed).
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with
* [browserContext.on('requestfinished')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-finished)
* event and not with
* [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed).
@@ -7817,14 +7889,15 @@ export interface BrowserContext {
/**
* Emitted when a request finishes successfully after downloading the response body. For a successful response, the
- * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a particular
- * page, use [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
+ * sequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a
+ * particular page, use
+ * [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).
*/
waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;
/**
- * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events
- * is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
+ * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of
+ * events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use
* [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response).
*/
waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;
@@ -7838,9 +7911,9 @@ export interface BrowserContext {
}
/**
- * The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). `worker`
- * event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker object when the
- * worker is gone.
+ * The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
+ * `worker` event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker
+ * object when the worker is gone.
*
* ```js
* page.on('worker', worker => {
@@ -7860,15 +7933,16 @@ export interface Worker {
*
* If the function passed to the
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a
- * [Promise], then [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate)
- * would wait for the promise to resolve and return its value.
+ * [Promise], then
+ * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) would wait for
+ * the promise to resolve and return its value.
*
* If the function passed to the
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a
* non-[Serializable] value, then
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns
- * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`: `-0`,
- * `NaN`, `Infinity`, `-Infinity`.
+ * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
+ * `-0`, `NaN`, `Infinity`, `-Infinity`.
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -7878,15 +7952,16 @@ export interface Worker {
*
* If the function passed to the
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a
- * [Promise], then [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate)
- * would wait for the promise to resolve and return its value.
+ * [Promise], then
+ * [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) would wait for
+ * the promise to resolve and return its value.
*
* If the function passed to the
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns a
* non-[Serializable] value, then
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) returns
- * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`: `-0`,
- * `NaN`, `Infinity`, `-Infinity`.
+ * `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
+ * `-0`, `NaN`, `Infinity`, `-Infinity`.
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -7897,15 +7972,16 @@ export interface Worker {
*
* The only difference between
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) and
- * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) is
- * that [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
+ * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
+ * is that
+ * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
* returns [JSHandle].
*
* If the function passed to the
* [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
* returns a [Promise], then
- * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) would
- * wait for the promise to resolve and return its value.
+ * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
+ * would wait for the promise to resolve and return its value.
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -7915,21 +7991,23 @@ export interface Worker {
*
* The only difference between
* [worker.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate) and
- * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) is
- * that [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
+ * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
+ * is that
+ * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
* returns [JSHandle].
*
* If the function passed to the
* [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
* returns a [Promise], then
- * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle) would
- * wait for the promise to resolve and return its value.
+ * [worker.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-worker#worker-evaluate-handle)
+ * would wait for the promise to resolve and return its value.
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
evaluateHandle<R>(pageFunction: PageFunction<void, R>, arg?: any): Promise<SmartHandle<R>>;
/**
- * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is terminated.
+ * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is
+ * terminated.
*/
on(event: 'close', listener: (worker: Worker) => void): this;
@@ -7939,7 +8017,8 @@ export interface Worker {
once(event: 'close', listener: (worker: Worker) => void): this;
/**
- * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is terminated.
+ * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is
+ * terminated.
*/
addListener(event: 'close', listener: (worker: Worker) => void): this;
@@ -7954,7 +8033,8 @@ export interface Worker {
off(event: 'close', listener: (worker: Worker) => void): this;
/**
- * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is terminated.
+ * Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is
+ * terminated.
*/
prependListener(event: 'close', listener: (worker: Worker) => void): this;
@@ -7970,13 +8050,14 @@ export interface Worker {
* ```
*
* JSHandle prevents the referenced JavaScript object being garbage collected unless the handle is exposed with
- * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). JSHandles are auto-disposed when
- * their origin frame gets navigated or the parent context gets destroyed.
+ * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). JSHandles are auto-disposed
+ * when their origin frame gets navigated or the parent context gets destroyed.
*
* JSHandle instances can be used as an argument in
* [page.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-eval-on-selector),
* [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) and
- * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) methods.
+ * [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle)
+ * methods.
*/
export interface JSHandle<T = any> {
/**
@@ -8023,14 +8104,14 @@ export interface JSHandle<T = any> {
*
* This method passes this handle as the first argument to `pageFunction`.
*
- * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns
- * [JSHandle].
+ * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle`
+ * returns [JSHandle].
*
- * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would wait
- * for the promise to resolve and return its value.
+ * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would
+ * wait for the promise to resolve and return its value.
*
- * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for more
- * details.
+ * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for
+ * more details.
* @param pageFunction Function to be evaluated in the page context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -8040,14 +8121,14 @@ export interface JSHandle<T = any> {
*
* This method passes this handle as the first argument to `pageFunction`.
*
- * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns
- * [JSHandle].
+ * The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle`
+ * returns [JSHandle].
*
- * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would wait
- * for the promise to resolve and return its value.
+ * If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would
+ * wait for the promise to resolve and return its value.
*
- * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for more
- * details.
+ * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for
+ * more details.
* @param pageFunction Function to be evaluated in the page context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -8103,19 +8184,19 @@ export interface JSHandle<T = any> {
* ```
*
* ElementHandle prevents DOM element from garbage collection unless the handle is disposed with
- * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). ElementHandles are auto-disposed
- * when their origin frame gets navigated.
+ * [jsHandle.dispose()](https://playwright.dev/docs/api/class-jshandle#js-handle-dispose). ElementHandles are
+ * auto-disposed when their origin frame gets navigated.
*
* ElementHandle instances can be used as an argument in
* [page.$eval(selector, pageFunction[, arg, options])](https://playwright.dev/docs/api/class-page#page-eval-on-selector)
* and [page.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate) methods.
*
- * The difference between the [Locator] and ElementHandle is that the ElementHandle points to a particular element, while
- * [Locator] captures the logic of how to retrieve an element.
+ * The difference between the [Locator] and ElementHandle is that the ElementHandle points to a particular element,
+ * while [Locator] captures the logic of how to retrieve an element.
*
* In the example below, handle points to a particular DOM element on page. If that element changes text or is used by
- * React to render an entirely different component, handle is still pointing to that very DOM element. This can lead to
- * unexpected behaviors.
+ * React to render an entirely different component, handle is still pointing to that very DOM element. This can lead
+ * to unexpected behaviors.
*
* ```js
* const handle = await page.$('text=Submit');
@@ -8124,8 +8205,8 @@ export interface JSHandle<T = any> {
* await handle.click();
* ```
*
- * With the locator, every time the `element` is used, up-to-date DOM element is located in the page using the selector. So
- * in the snippet below, underlying DOM element is going to be located twice.
+ * With the locator, every time the `element` is used, up-to-date DOM element is located in the page using the
+ * selector. So in the snippet below, underlying DOM element is going to be located twice.
*
* ```js
* const locator = page.getByText('Submit');
@@ -8165,9 +8246,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first
- * argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the
- * selector, the method throws an error.
+ * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a
+ * first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements
+ * match the selector, the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector)
@@ -8189,9 +8270,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first
- * argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the
- * selector, the method throws an error.
+ * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a
+ * first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements
+ * match the selector, the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector)
@@ -8213,9 +8294,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first
- * argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the
- * selector, the method throws an error.
+ * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a
+ * first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements
+ * match the selector, the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector)
@@ -8237,9 +8318,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first
- * argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements match the
- * selector, the method throws an error.
+ * The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a
+ * first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details. If no elements
+ * match the selector, the method throws an error.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector)
@@ -8262,8 +8343,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of
- * matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array
+ * of matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more
+ * details.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-all)
@@ -8291,8 +8373,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of
- * matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array
+ * of matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more
+ * details.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-all)
@@ -8320,8 +8403,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of
- * matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array
+ * of matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more
+ * details.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-all)
@@ -8349,8 +8433,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* Returns the return value of `pageFunction`.
*
- * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of
- * matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more details.
+ * The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array
+ * of matched elements as a first argument to `pageFunction`. See [Working with selectors](https://playwright.dev/docs/selectors) for more
+ * details.
*
* If `pageFunction` returns a [Promise], then
* [elementHandle.$$eval(selector, pageFunction[, arg])](https://playwright.dev/docs/api/class-elementhandle#element-handle-eval-on-selector-all)
@@ -8380,10 +8465,10 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or
- * become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method
- * will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will
- * throw.
+ * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom,
+ * or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the
+ * method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the
+ * function will throw.
*
* ```js
* await page.setContent(`<div><span></span></div>`);
@@ -8393,7 +8478,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* ```
*
* > NOTE: This method does not work across navigations, use
- * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector) instead.
+ * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector)
+ * instead.
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -8402,10 +8488,10 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or
- * become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method
- * will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will
- * throw.
+ * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom,
+ * or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the
+ * method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the
+ * function will throw.
*
* ```js
* await page.setContent(`<div><span></span></div>`);
@@ -8415,7 +8501,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* ```
*
* > NOTE: This method does not work across navigations, use
- * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector) instead.
+ * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector)
+ * instead.
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -8424,10 +8511,10 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or
- * become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method
- * will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will
- * throw.
+ * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom,
+ * or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the
+ * method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the
+ * function will throw.
*
* ```js
* await page.setContent(`<div><span></span></div>`);
@@ -8437,7 +8524,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* ```
*
* > NOTE: This method does not work across navigations, use
- * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector) instead.
+ * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector)
+ * instead.
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -8446,10 +8534,10 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or
* `detached`.
*
- * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom, or
- * become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method
- * will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will
- * throw.
+ * Wait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom,
+ * or become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the
+ * method will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the
+ * function will throw.
*
* ```js
* await page.setContent(`<div><span></span></div>`);
@@ -8459,7 +8547,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* ```
*
* > NOTE: This method does not work across navigations, use
- * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector) instead.
+ * [page.waitForSelector(selector[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-selector)
+ * instead.
* @param selector A selector to query for. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
* @param options
*/
@@ -8469,14 +8558,14 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* calculated relative to the main frame viewport - which is usually the same as the browser window.
*
* Scrolling affects the returned bounding box, similarly to
- * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That
- * means `x` and/or `y` may be negative.
+ * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
+ * That means `x` and/or `y` may be negative.
*
* Elements from child frames return the bounding box relative to the main frame, unlike the
* [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
*
- * Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following
- * snippet should click the center of the element.
+ * Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the
+ * following snippet should click the center of the element.
*
* ```js
* const box = await elementHandle.boundingBox();
@@ -8508,18 +8597,19 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* This method checks the element by performing the following steps:
- * 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already checked,
- * this method returns immediately.
+ * 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already
+ * checked, this method returns immediately.
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked. If not, this method throws.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
check(options?: {
@@ -8529,15 +8619,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -8546,16 +8636,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -8564,14 +8654,14 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* This method clicks the element by performing the following steps:
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element, or
- * the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
click(options?: {
@@ -8596,21 +8686,21 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -8619,16 +8709,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -8644,13 +8734,13 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* 1. Scroll the element into view if needed.
* 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the
* element, or the specified `position`.
- * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the
- * first click of the `dblclick()` triggers a navigation event, this method will throw.
+ * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if
+ * the first click of the `dblclick()` triggers a navigation event, this method will throw.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event.
* @param options
@@ -8672,21 +8762,21 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -8695,16 +8785,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -8718,8 +8808,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* await elementHandle.dispatchEvent('click');
* ```
*
- * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
- * and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
+ * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`
+ * properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
*
* Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:
* - [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)
@@ -8744,11 +8834,11 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
dispatchEvent(type: string, eventInit?: EvaluationArgument): Promise<void>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, fills it and triggers an `input`
- * event after filling. Note that you can pass an empty string to clear the input field.
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, fills it and triggers an
+ * `input` event after filling. Note that you can pass an empty string to clear the input field.
*
- * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.
- * However, if the element is inside the `<label>` element that has an associated
+ * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an
+ * error. However, if the element is inside the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
* instead.
*
@@ -8764,15 +8854,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -8794,14 +8884,14 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* This method hovers over the element by performing the following steps:
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the element,
- * or the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
hover(options?: {
@@ -8811,21 +8901,21 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -8834,16 +8924,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -8862,13 +8952,14 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
*
* Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the
+ * control.
* @param options
*/
inputValue(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -8911,15 +9002,18 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
ownerFrame(): Promise<null|Frame>;
/**
- * Focuses the element, and then uses [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down)
- * and [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
+ * Focuses the element, and then uses
+ * [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down) and
+ * [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
*
- * `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
- * value or a single character to generate the text for. A superset of the `key` values can be found
+ * `key` can specify the intended
+ * [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
+ * to generate the text for. A superset of the `key` values can be found
* [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:
*
* `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
- * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.
+ * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,
+ * etc.
*
* Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.
*
@@ -8940,15 +9034,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -8957,19 +9051,19 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
/**
* This method captures a screenshot of the page, clipped to the size and position of this particular element. If the
- * element is covered by other elements, it will not be actually visible on the screenshot. If the element is a scrollable
- * container, only the currently scrolled content will be visible on the screenshot.
+ * element is covered by other elements, it will not be actually visible on the screenshot. If the element is a
+ * scrollable container, only the currently scrolled content will be visible on the screenshot.
*
- * This method waits for the [actionability](https://playwright.dev/docs/actionability) checks, then scrolls element into view before taking a
- * screenshot. If the element is detached from DOM, the method throws an error.
+ * This method waits for the [actionability](https://playwright.dev/docs/actionability) checks, then scrolls element into view before taking
+ * a screenshot. If the element is detached from DOM, the method throws an error.
*
* Returns the buffer with the captured screenshot.
* @param options
*/
screenshot(options?: {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -8978,14 +9072,14 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -8996,9 +9090,9 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
omitBackground?: boolean;
/**
- * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative
- * path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to
- * the disk.
+ * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a
+ * relative path, then it is resolved relative to the current working directory. If no path is provided, the image
+ * won't be saved to the disk.
*/
path?: string;
@@ -9008,17 +9102,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
quality?: number;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"device"`.
*/
scale?: "css"|"device";
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9031,8 +9125,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
}): Promise<Buffer>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then tries to scroll element into view, unless it is
- * completely visible as defined by
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then tries to scroll element into view, unless
+ * it is completely visible as defined by
* [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`.
*
* Throws when `elementHandle` does not point to an element
@@ -9041,8 +9135,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scrollIntoViewIfNeeded(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9050,12 +9144,13 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
}): Promise<void>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until all specified options are present in the
- * `<select>` element and selects these options.
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until all specified options are present in
+ * the `<select>` element and selects these options.
*
- * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the
- * `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead.
+ * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside
+ * the `<label>` element that has an associated
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used
+ * instead.
*
* Returns the array of option values that have been successfully selected.
*
@@ -9072,8 +9167,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* handle.selectOption(['red', 'green', 'blue']);
* ```
*
- * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
- * is considered matching if all specified properties match.
+ * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to
+ * `{value:'string'}`. Option is considered matching if all specified properties match.
* @param options
*/
selectOption(values: null|string|ElementHandle|Array<string>|{
@@ -9113,15 +9208,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9129,12 +9224,12 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
}): Promise<Array<string>>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then focuses the element and selects all its text
- * content.
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then focuses the element and selects all its
+ * text content.
*
* If the element is inside the `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the
- * control instead.
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in
+ * the control instead.
* @param options
*/
selectText(options?: {
@@ -9144,8 +9239,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9156,15 +9251,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* This method checks or unchecks an element by performing the following steps:
* 1. Ensure that element is a checkbox or a radio input. If not, this method throws.
* 1. If the element already has the right checked state, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked or unchecked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param checked Whether to check or uncheck the checkbox.
* @param options
*/
@@ -9175,15 +9271,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -9192,27 +9288,27 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
/**
- * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
- * are resolved relative to the current working directory. For empty array, clears the selected files.
+ * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then
+ * they are resolved relative to the current working directory. For empty array, clears the selected files.
*
* This method expects [ElementHandle] to point to an
- * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
- * `<label>` element that has an associated
+ * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside
+ * the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
* @param files
* @param options
@@ -9249,15 +9345,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
buffer: Buffer;
}>, options?: {
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9274,8 +9370,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `elementHandle.tap()` requires that the `hasTouch` option of the browser context be set to true.
* @param options
@@ -9287,21 +9383,21 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -9310,16 +9406,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -9330,7 +9426,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
textContent(): Promise<null|string>;
/**
- * Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
+ * Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the
+ * text.
*
* To press a special key, like `Control` or `ArrowDown`, use
* [elementHandle.press(key[, options])](https://playwright.dev/docs/api/class-elementhandle#element-handle-press).
@@ -9358,15 +9455,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9379,14 +9476,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* unchecked, this method returns immediately.
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now unchecked. If not, this method throws.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
uncheck(options?: {
@@ -9396,15 +9494,15 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -9413,16 +9511,16 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -9434,7 +9532,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* pass. This method throws when the element is detached while waiting, unless waiting for the `"hidden"` state.
* - `"visible"` Wait until the element is [visible](https://playwright.dev/docs/actionability#visible).
* - `"hidden"` Wait until the element is [not visible](https://playwright.dev/docs/actionability#visible) or
- * [not attached](https://playwright.dev/docs/actionability#attached). Note that waiting for hidden does not throw when the element detaches.
+ * [not attached](https://playwright.dev/docs/actionability#attached). Note that waiting for hidden does not throw when the element
+ * detaches.
* - `"stable"` Wait until the element is both [visible](https://playwright.dev/docs/actionability#visible) and
* [stable](https://playwright.dev/docs/actionability#stable).
* - `"enabled"` Wait until the element is [enabled](https://playwright.dev/docs/actionability#enabled).
@@ -9447,8 +9546,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
waitForElementState(state: "visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable", options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9456,8 +9555,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
}): Promise<void>;}
/**
- * Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way
- * to find element(s) on the page at any moment. Locator can be created with the
+ * Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a
+ * way to find element(s) on the page at any moment. Locator can be created with the
* [page.locator(selector[, options])](https://playwright.dev/docs/api/class-page#page-locator) method.
*
* [Learn more about locators](https://playwright.dev/docs/locators).
@@ -9508,12 +9607,12 @@ export interface Locator {
timeout?: number;
}): Promise<R>;
/**
- * The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
- * to `pageFunction`. Returns the result of `pageFunction` invocation.
+ * The method finds all elements matching the specified locator and passes an array of matched elements as a first
+ * argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all) would
- * wait for the promise to resolve and return its value.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all)
+ * would wait for the promise to resolve and return its value.
*
* Examples:
*
@@ -9527,12 +9626,12 @@ export interface Locator {
*/
evaluateAll<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E[], Arg, R>, arg: Arg): Promise<R>;
/**
- * The method finds all elements matching the specified locator and passes an array of matched elements as a first argument
- * to `pageFunction`. Returns the result of `pageFunction` invocation.
+ * The method finds all elements matching the specified locator and passes an array of matched elements as a first
+ * argument to `pageFunction`. Returns the result of `pageFunction` invocation.
*
* If `pageFunction` returns a [Promise], then
- * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all) would
- * wait for the promise to resolve and return its value.
+ * [locator.evaluateAll(pageFunction[, arg])](https://playwright.dev/docs/api/class-locator#locator-evaluate-all)
+ * would wait for the promise to resolve and return its value.
*
* Examples:
*
@@ -9546,8 +9645,8 @@ export interface Locator {
*/
evaluateAll<R, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E[], void, R>): Promise<R>;
/**
- * Resolves given locator to the first matching DOM element. If no elements matching the query are visible, waits for them
- * up to a given timeout. If multiple elements match the selector, throws.
+ * Resolves given locator to the first matching DOM element. If no elements matching the query are visible, waits for
+ * them up to a given timeout. If multiple elements match the selector, throws.
* @param options
*/
elementHandle(options?: {
@@ -9569,8 +9668,8 @@ export interface Locator {
*/
blur(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9582,14 +9681,14 @@ export interface Locator {
* calculated relative to the main frame viewport - which is usually the same as the browser window.
*
* Scrolling affects the returned bounding box, similarly to
- * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That
- * means `x` and/or `y` may be negative.
+ * [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
+ * That means `x` and/or `y` may be negative.
*
* Elements from child frames return the bounding box relative to the main frame, unlike the
* [Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
*
- * Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following
- * snippet should click the center of the element.
+ * Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the
+ * following snippet should click the center of the element.
*
* ```js
* const box = await element.boundingBox();
@@ -9600,8 +9699,8 @@ export interface Locator {
*/
boundingBox(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9630,18 +9729,19 @@ export interface Locator {
/**
* This method checks the element by performing the following steps:
- * 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already checked,
- * this method returns immediately.
+ * 1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already
+ * checked, this method returns immediately.
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked. If not, this method throws.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
check(options?: {
@@ -9651,15 +9751,15 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -9668,16 +9768,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -9686,8 +9786,8 @@ export interface Locator {
* This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, clears it and triggers an
* `input` event after clearing.
*
- * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.
- * However, if the element is inside the `<label>` element that has an associated
+ * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an
+ * error. However, if the element is inside the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be cleared
* instead.
* @param options
@@ -9699,15 +9799,15 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9718,14 +9818,14 @@ export interface Locator {
* This method clicks the element by performing the following steps:
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element, or
- * the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
click(options?: {
@@ -9750,21 +9850,21 @@ export interface Locator {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -9773,16 +9873,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -9798,13 +9898,13 @@ export interface Locator {
* 1. Scroll the element into view if needed.
* 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to double click in the center of the
* element, or the specified `position`.
- * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if the
- * first click of the `dblclick()` triggers a navigation event, this method will throw.
+ * 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if
+ * the first click of the `dblclick()` triggers a navigation event, this method will throw.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `element.dblclick()` dispatches two `click` events and a single `dblclick` event.
* @param options
@@ -9826,21 +9926,21 @@ export interface Locator {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -9849,16 +9949,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -9872,8 +9972,8 @@ export interface Locator {
* await element.dispatchEvent('click');
* ```
*
- * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit` properties
- * and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
+ * Under the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`
+ * properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.
*
* Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:
* - [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)
@@ -9898,8 +9998,8 @@ export interface Locator {
*/
dispatchEvent(type: string, eventInit?: EvaluationArgument, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -9907,8 +10007,8 @@ export interface Locator {
}): Promise<void>;
/**
- * This method drags the locator to another target locator or target position. It will first move to the source element,
- * perform a `mousedown`, then move to the target element or position and perform a `mouseup`.
+ * This method drags the locator to another target locator or target position. It will first move to the source
+ * element, perform a `mousedown`, then move to the target element or position and perform a `mouseup`.
*
* ```js
* const source = page.locator('#source');
@@ -9932,9 +10032,9 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
@@ -9959,16 +10059,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -9984,7 +10084,8 @@ export interface Locator {
* This method passes this handle as the first argument to `pageFunction`.
*
* The only difference between
- * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate) and
+ * [locator.evaluate(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate)
+ * and
* [locator.evaluateHandle(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate-handle)
* is that
* [locator.evaluateHandle(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate-handle)
@@ -9996,16 +10097,16 @@ export interface Locator {
* [locator.evaluateHandle(pageFunction[, arg, options])](https://playwright.dev/docs/api/class-locator#locator-evaluate-handle)
* would wait for the promise to resolve and return its value.
*
- * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for more
- * details.
+ * See [page.evaluateHandle(pageFunction[, arg])](https://playwright.dev/docs/api/class-page#page-evaluate-handle) for
+ * more details.
* @param pageFunction Function to be evaluated in the page context.
* @param arg Optional argument to pass to `pageFunction`.
* @param options
*/
evaluateHandle(pageFunction: Function|string, arg?: EvaluationArgument, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10013,11 +10114,11 @@ export interface Locator {
}): Promise<JSHandle>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, fills it and triggers an `input`
- * event after filling. Note that you can pass an empty string to clear the input field.
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, focuses the element, fills it and triggers an
+ * `input` event after filling. Note that you can pass an empty string to clear the input field.
*
- * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error.
- * However, if the element is inside the `<label>` element that has an associated
+ * If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an
+ * error. However, if the element is inside the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
* instead.
*
@@ -10033,15 +10134,15 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10049,8 +10150,8 @@ export interface Locator {
}): Promise<void>;
/**
- * This method narrows existing locator according to the options, for example filters by text. It can be chained to filter
- * multiple times.
+ * This method narrows existing locator according to the options, for example filters by text. It can be chained to
+ * filter multiple times.
*
* ```js
* const rowLocator = page.locator('tr');
@@ -10065,16 +10166,16 @@ export interface Locator {
*/
filter(options?: {
/**
- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
- * For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
+ * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer
+ * one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
*
* Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
*/
has?: Locator;
/**
- * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
- * [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
+ * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
+ * passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
* `<article><div>Playwright</div></article>`.
*/
hasText?: string|RegExp;
@@ -10091,8 +10192,8 @@ export interface Locator {
*/
focus(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10100,8 +10201,8 @@ export interface Locator {
}): Promise<void>;
/**
- * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
- * that iframe:
+ * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
+ * in that iframe:
*
* ```js
* const locator = page.frameLocator('iframe').getByText('Submit');
@@ -10119,8 +10220,8 @@ export interface Locator {
*/
getAttribute(name: string, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10139,8 +10240,8 @@ export interface Locator {
*/
getByAltText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -10159,8 +10260,8 @@ export interface Locator {
*/
getByLabel(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -10178,8 +10279,8 @@ export interface Locator {
*/
getByPlaceholder(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -10191,9 +10292,10 @@ export interface Locator {
* accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
*
* Note that many html elements have an implicitly
- * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
- * can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
- * recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
+ * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector.
+ * You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines
+ * **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to
+ * default values.
* @param role Required aria role.
* @param options
*/
@@ -10214,8 +10316,8 @@ export interface Locator {
disabled?: boolean;
/**
- * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
@@ -10235,8 +10337,8 @@ export interface Locator {
includeHidden?: boolean;
/**
- * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for
- * `<h1>-<h6>` elements.
+ * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values
+ * for `<h1>-<h6>` elements.
*
* Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).
*/
@@ -10308,26 +10410,27 @@ export interface Locator {
* page.getByText(/^hello$/i)
* ```
*
- * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to match
- * by another criteria, like an accessible role, and then filter by the text content.
+ * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to
+ * match by another criteria, like an accessible role, and then filter by the text content.
*
- * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into
- * one, turns line breaks into spaces and ignores leading and trailing whitespace.
- * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For
- * example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
+ * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces
+ * into one, turns line breaks into spaces and ignores leading and trailing whitespace.
+ * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content.
+ * For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
* @param text Text to locate the element for.
* @param options
*/
getByText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
/**
- * Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
+ * Allows locating elements by their title. For example, this method will find the button by its title "Place the
+ * order":
*
* ```html
* <button title='Place the order'>Order Now</button>
@@ -10338,8 +10441,8 @@ export interface Locator {
*/
getByTitle(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -10354,14 +10457,14 @@ export interface Locator {
* This method hovers over the element by performing the following steps:
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the element,
- * or the specified `position`.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to hover over the center of the
+ * element, or the specified `position`.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
hover(options?: {
@@ -10371,21 +10474,21 @@ export interface Locator {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -10394,16 +10497,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -10414,8 +10517,8 @@ export interface Locator {
*/
innerHTML(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10428,8 +10531,8 @@ export interface Locator {
*/
innerText(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10440,13 +10543,14 @@ export interface Locator {
* Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
*
* Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control.
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the
+ * control.
* @param options
*/
inputValue(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10459,8 +10563,8 @@ export interface Locator {
*/
isChecked(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10473,8 +10577,8 @@ export interface Locator {
*/
isDisabled(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10487,8 +10591,8 @@ export interface Locator {
*/
isEditable(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10501,8 +10605,8 @@ export interface Locator {
*/
isEnabled(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10516,8 +10620,8 @@ export interface Locator {
isHidden(options?: {
/**
* **DEPRECATED** This option is ignored.
- * [locator.isHidden([options])](https://playwright.dev/docs/api/class-locator#locator-is-hidden) does not wait for the
- * element to become hidden and returns immediately.
+ * [locator.isHidden([options])](https://playwright.dev/docs/api/class-locator#locator-is-hidden) does not wait for
+ * the element to become hidden and returns immediately.
* @deprecated
*/
timeout?: number;
@@ -10530,8 +10634,8 @@ export interface Locator {
isVisible(options?: {
/**
* **DEPRECATED** This option is ignored.
- * [locator.isVisible([options])](https://playwright.dev/docs/api/class-locator#locator-is-visible) does not wait for the
- * element to become visible and returns immediately.
+ * [locator.isVisible([options])](https://playwright.dev/docs/api/class-locator#locator-is-visible) does not wait for
+ * the element to become visible and returns immediately.
* @deprecated
*/
timeout?: number;
@@ -10543,8 +10647,9 @@ export interface Locator {
last(): Locator;
/**
- * The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options,
- * similar to [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) method.
+ * The method finds an element matching the specified selector in the locator's subtree. It also accepts filter
+ * options, similar to [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter)
+ * method.
*
* [Learn more about locators](https://playwright.dev/docs/locators).
* @param selector A selector to use when resolving DOM element. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
@@ -10552,16 +10657,16 @@ export interface Locator {
*/
locator(selector: string, options?: {
/**
- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
- * For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
+ * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer
+ * one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
*
* Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
*/
has?: Locator;
/**
- * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
- * [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
+ * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
+ * passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
* `<article><div>Playwright</div></article>`.
*/
hasText?: string|RegExp;
@@ -10579,15 +10684,18 @@ export interface Locator {
page(): Page;
/**
- * Focuses the element, and then uses [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down)
- * and [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
+ * Focuses the element, and then uses
+ * [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down) and
+ * [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
*
- * `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
- * value or a single character to generate the text for. A superset of the `key` values can be found
+ * `key` can specify the intended
+ * [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
+ * to generate the text for. A superset of the `key` values can be found
* [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:
*
* `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
- * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.
+ * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,
+ * etc.
*
* Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.
*
@@ -10608,15 +10716,15 @@ export interface Locator {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10624,12 +10732,12 @@ export interface Locator {
}): Promise<void>;
/**
- * This method captures a screenshot of the page, clipped to the size and position of a particular element matching the
- * locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the element
- * is a scrollable container, only the currently scrolled content will be visible on the screenshot.
+ * This method captures a screenshot of the page, clipped to the size and position of a particular element matching
+ * the locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the
+ * element is a scrollable container, only the currently scrolled content will be visible on the screenshot.
*
- * This method waits for the [actionability](https://playwright.dev/docs/actionability) checks, then scrolls element into view before taking a
- * screenshot. If the element is detached from DOM, the method throws an error.
+ * This method waits for the [actionability](https://playwright.dev/docs/actionability) checks, then scrolls element into view before taking
+ * a screenshot. If the element is detached from DOM, the method throws an error.
*
* Returns the buffer with the captured screenshot.
* @param options
@@ -10637,15 +10745,15 @@ export interface Locator {
screenshot(options?: LocatorScreenshotOptions): Promise<Buffer>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then tries to scroll element into view, unless it is
- * completely visible as defined by
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then tries to scroll element into view, unless
+ * it is completely visible as defined by
* [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`.
* @param options
*/
scrollIntoViewIfNeeded(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10653,12 +10761,13 @@ export interface Locator {
}): Promise<void>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until all specified options are present in the
- * `<select>` element and selects these options.
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, waits until all specified options are present in
+ * the `<select>` element and selects these options.
*
- * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the
- * `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead.
+ * If the target element is not a `<select>` element, this method throws an error. However, if the element is inside
+ * the `<label>` element that has an associated
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used
+ * instead.
*
* Returns the array of option values that have been successfully selected.
*
@@ -10675,8 +10784,8 @@ export interface Locator {
* element.selectOption(['red', 'green', 'blue']);
* ```
*
- * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
- * is considered matching if all specified properties match.
+ * @param values Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to
+ * `{value:'string'}`. Option is considered matching if all specified properties match.
* @param options
*/
selectOption(values: null|string|ElementHandle|Array<string>|{
@@ -10716,15 +10825,15 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10732,12 +10841,12 @@ export interface Locator {
}): Promise<Array<string>>;
/**
- * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then focuses the element and selects all its text
- * content.
+ * This method waits for [actionability](https://playwright.dev/docs/actionability) checks, then focuses the element and selects all its
+ * text content.
*
* If the element is inside the `<label>` element that has an associated
- * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the
- * control instead.
+ * [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in
+ * the control instead.
* @param options
*/
selectText(options?: {
@@ -10747,8 +10856,8 @@ export interface Locator {
force?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10759,15 +10868,16 @@ export interface Locator {
* This method checks or unchecks an element by performing the following steps:
* 1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.
* 1. If the element already has the right checked state, this method returns immediately.
- * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If the
- * element is detached during the checks, the whole action is retried.
+ * 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the matched element, unless `force` option is set. If
+ * the element is detached during the checks, the whole action is retried.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now checked or unchecked. If not, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param checked Whether to check or uncheck the checkbox.
* @param options
*/
@@ -10778,15 +10888,15 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -10795,27 +10905,27 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
/**
- * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
- * are resolved relative to the current working directory. For empty array, clears the selected files.
+ * Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then
+ * they are resolved relative to the current working directory. For empty array, clears the selected files.
*
* This method expects [Locator] to point to an
- * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the
- * `<label>` element that has an associated
+ * [input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside
+ * the `<label>` element that has an associated
* [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.
* @param files
* @param options
@@ -10852,15 +10962,15 @@ export interface Locator {
buffer: Buffer;
}>, options?: {
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10877,8 +10987,8 @@ export interface Locator {
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
*
* > NOTE: `element.tap()` requires that the `hasTouch` option of the browser context be set to true.
* @param options
@@ -10890,21 +11000,21 @@ export interface Locator {
force?: boolean;
/**
- * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
- * modifiers back. If not specified, currently pressed modifiers are used.
+ * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores
+ * current modifiers back. If not specified, currently pressed modifiers are used.
*/
modifiers?: Array<"Alt"|"Control"|"Meta"|"Shift">;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -10913,16 +11023,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -10933,8 +11043,8 @@ export interface Locator {
*/
textContent(options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10942,7 +11052,8 @@ export interface Locator {
}): Promise<null|string>;
/**
- * Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
+ * Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the
+ * text.
*
* To press a special key, like `Control` or `ArrowDown`, use
* [locator.press(key[, options])](https://playwright.dev/docs/api/class-locator#locator-press).
@@ -10970,15 +11081,15 @@ export interface Locator {
delay?: number;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -10991,14 +11102,15 @@ export interface Locator {
* unchecked, this method returns immediately.
* 1. Wait for [actionability](https://playwright.dev/docs/actionability) checks on the element, unless `force` option is set.
* 1. Scroll the element into view if needed.
- * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the element.
+ * 1. Use [page.mouse](https://playwright.dev/docs/api/class-page#page-mouse) to click in the center of the
+ * element.
* 1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.
* 1. Ensure that the element is now unchecked. If not, this method throws.
*
* If the element is detached from the DOM at any moment during the action, this method throws.
*
- * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError]. Passing
- * zero timeout disables this.
+ * When all steps combined have not finished during the specified `timeout`, this method throws a [TimeoutError].
+ * Passing zero timeout disables this.
* @param options
*/
uncheck(options?: {
@@ -11008,15 +11120,15 @@ export interface Locator {
force?: boolean;
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
- * element.
+ * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of
+ * the element.
*/
position?: {
x: number;
@@ -11025,16 +11137,16 @@ export interface Locator {
};
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
timeout?: number;
/**
- * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults to
- * `false`. Useful to wait until the element is ready for the action without performing it.
+ * When set, this method only performs the [actionability](https://playwright.dev/docs/actionability) checks and skips the action. Defaults
+ * to `false`. Useful to wait until the element is ready for the action without performing it.
*/
trial?: boolean;
}): Promise<void>;
@@ -11042,8 +11154,8 @@ export interface Locator {
/**
* Returns when element specified by locator satisfies the `state` option.
*
- * If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to `timeout`
- * milliseconds until the condition is met.
+ * If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to
+ * `timeout` milliseconds until the condition is met.
*
* ```js
* const orderSent = page.locator('#order-sent');
@@ -11057,16 +11169,16 @@ export interface Locator {
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
* - `'detached'` - wait for element to not be present in DOM.
- * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
- * any content or with `display:none` has an empty bounding box and is not considered visible.
- * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
- * This is opposite to the `'visible'` option.
+ * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element
+ * without any content or with `display:none` has an empty bounding box and is not considered visible.
+ * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or
+ * `visibility:hidden`. This is opposite to the `'visible'` option.
*/
state?: "attached"|"detached"|"visible"|"hidden";
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -11074,8 +11186,8 @@ export interface Locator {
}): Promise<void>;}
/**
- * BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a
- * typical example of using Playwright to drive automation:
+ * BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is
+ * a typical example of using Playwright to drive automation:
*
* ```js
* const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.
@@ -11169,18 +11281,18 @@ export interface BrowserType<Unused = {}> {
* });
* ```
*
- * > **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works
- * best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use
- * `executablePath` option with extreme caution.
+ * > **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it
+ * works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other
+ * version. Use `executablePath` option with extreme caution.
* >
* > If Google Chrome (rather than Chromium) is preferred, a
* [Chrome Canary](https://www.google.com/chrome/browser/canary.html) or
* [Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested.
* >
- * > Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs for
- * video playback. See
- * [this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for other
- * differences between Chromium and Chrome.
+ * > Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs
+ * for video playback. See
+ * [this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for
+ * other differences between Chromium and Chrome.
* [This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md)
* describes some differences for Linux users.
* @param options
@@ -11193,9 +11305,9 @@ export interface BrowserType<Unused = {}> {
* Launches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing this
* context will automatically close the browser.
* @param userDataDir Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and
- * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's user
- * data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`. Pass an empty string to use
- * a temporary directory instead.
+ * [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's
+ * user data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`. Pass an empty
+ * string to use a temporary directory instead.
* @param options
*/
launchPersistentContext(userDataDir: string, options?: {
@@ -11214,12 +11326,15 @@ export interface BrowserType<Unused = {}> {
* When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto),
* [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route),
* [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url),
- * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), or
- * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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. Examples:
+ * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request),
+ * or
+ * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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.
+ * Examples:
* - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
- * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`
+ * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
+ * `http://localhost:3000/foo/bar.html`
* - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
* `http://localhost:3000/bar.html`
*/
@@ -11231,8 +11346,8 @@ export interface BrowserType<Unused = {}> {
bypassCSP?: boolean;
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
+ * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
+ * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
* [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
*/
channel?: string;
@@ -11244,8 +11359,8 @@ export interface BrowserType<Unused = {}> {
/**
* Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'light'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
*/
colorScheme?: null|"light"|"dark"|"no-preference";
@@ -11255,15 +11370,15 @@ export interface BrowserType<Unused = {}> {
deviceScaleFactor?: number;
/**
- * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless`
- * option will be set `false`.
+ * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
+ * `headless` option will be set `false`.
*/
devtools?: boolean;
/**
- * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is
- * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in
- * is closed.
+ * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
+ * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were
+ * created in is closed.
*/
downloadsPath?: string;
@@ -11274,8 +11389,8 @@ export interface BrowserType<Unused = {}> {
/**
* Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is
- * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox
- * or WebKit, use at your own risk.
+ * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,
+ * Firefox or WebKit, use at your own risk.
*/
executablePath?: string;
@@ -11286,8 +11401,8 @@ export interface BrowserType<Unused = {}> {
/**
* Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'none'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'none'`.
*/
forcedColors?: null|"active"|"none";
@@ -11357,8 +11472,8 @@ export interface BrowserType<Unused = {}> {
ignoreHTTPSErrors?: boolean;
/**
- * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported
- * in Firefox.
+ * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not
+ * supported in Firefox.
*/
isMobile?: boolean;
@@ -11368,8 +11483,8 @@ export interface BrowserType<Unused = {}> {
javaScriptEnabled?: boolean;
/**
- * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
- * request header value as well as number and date formatting rules.
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules.
*/
locale?: string;
@@ -11417,23 +11532,23 @@ export interface BrowserType<Unused = {}> {
};
/**
- * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to be
- * saved.
+ * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to
+ * be saved.
*/
recordHar?: {
/**
- * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use `content`
- * policy instead.
+ * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use
+ * `content` policy instead.
*/
omitContent?: boolean;
/**
- * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach`
- * is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content
- * is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for
- * all other file extensions.
+ * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
+ * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is
+ * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output
+ * files and to `embed` for all other file extensions.
*/
content?: "omit"|"embed"|"attach";
@@ -11444,8 +11559,8 @@ export interface BrowserType<Unused = {}> {
path: string;
/**
- * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies,
- * security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
+ * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
+ * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
*/
mode?: "full"|"minimal";
@@ -11458,9 +11573,10 @@ export interface BrowserType<Unused = {}> {
};
/**
- * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make
- * sure to await [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for
- * videos to be saved.
+ * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
+ * Make sure to await
+ * [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for videos to
+ * be saved.
*/
recordVideo?: {
/**
@@ -11469,9 +11585,9 @@ export interface BrowserType<Unused = {}> {
dir: string;
/**
- * 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.
+ * 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.
*/
size?: {
/**
@@ -11488,14 +11604,14 @@ export interface BrowserType<Unused = {}> {
/**
* Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'no-preference'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
*/
reducedMotion?: null|"reduce"|"no-preference";
/**
- * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`
- * is set.
+ * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the
+ * `viewport` is set.
*/
screen?: {
/**
@@ -11511,26 +11627,28 @@ export interface BrowserType<Unused = {}> {
/**
* Whether to allow sites to register Service workers. Defaults to `'allow'`.
- * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.
+ * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be
+ * registered.
* - `'block'`: Playwright will block all registration of Service Workers.
*/
serviceWorkers?: "allow"|"block";
/**
- * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
+ * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
+ * on.
*/
slowMo?: number;
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
- * that imply single target DOM element will throw when more than one element matches the selector. See [Locator] to learn
- * more about the strict mode.
+ * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. See
+ * [Locator] to learn more about the strict mode.
*/
strictSelectors?: boolean;
/**
- * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to
- * disable timeout.
+ * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`
+ * to disable timeout.
*/
timeout?: number;
@@ -11594,8 +11712,8 @@ export interface BrowserType<Unused = {}> {
* [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect),
* which requires the major/minor client/server version to match (1.2.3 → is compatible with 1.2.x).
*
- * Launches browser server that client can connect to. An example of launching a browser executable and connecting to it
- * later:
+ * Launches browser server that client can connect to. An example of launching a browser executable and connecting to
+ * it later:
*
* ```js
* const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.
@@ -11620,8 +11738,8 @@ export interface BrowserType<Unused = {}> {
args?: Array<string>;
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
+ * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
+ * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
* [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
*/
channel?: string;
@@ -11632,15 +11750,15 @@ export interface BrowserType<Unused = {}> {
chromiumSandbox?: boolean;
/**
- * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless`
- * option will be set `false`.
+ * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
+ * `headless` option will be set `false`.
*/
devtools?: boolean;
/**
- * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is
- * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in
- * is closed.
+ * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
+ * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were
+ * created in is closed.
*/
downloadsPath?: string;
@@ -11651,8 +11769,8 @@ export interface BrowserType<Unused = {}> {
/**
* Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is
- * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox
- * or WebKit, use at your own risk.
+ * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,
+ * Firefox or WebKit, use at your own risk.
*/
executablePath?: string;
@@ -11728,8 +11846,8 @@ export interface BrowserType<Unused = {}> {
};
/**
- * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to
- * disable timeout.
+ * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`
+ * to disable timeout.
*/
timeout?: number;
@@ -11741,8 +11859,8 @@ export interface BrowserType<Unused = {}> {
/**
* Path at which to serve the Browser Server. For security, this defaults to an unguessable string.
*
- * > NOTE: Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take control
- * of the OS user. For this reason, you should use an unguessable token when using this option.
+ * > NOTE: Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take
+ * control of the OS user. For this reason, you should use an unguessable token when using this option.
*/
wsPath?: string;
}): Promise<BrowserServer>;
@@ -11792,8 +11910,8 @@ export interface CDPSession {
params?: Protocol.CommandParameters[T]
): Promise<Protocol.CommandReturnValues[T]>;
/**
- * Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to
- * send messages.
+ * Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be
+ * used to send messages.
*/
detach(): Promise<void>;}
@@ -11811,9 +11929,8 @@ export namespace errors {
/**
* - extends: [Error]
*
- * TimeoutError is emitted whenever certain operations are terminated due to timeout, e.g.
- * [locator.waitFor([options])](https://playwright.dev/docs/api/class-locator#locator-wait-for) or
- * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch).
+ * TimeoutError is emitted whenever certain operations are terminated due to timeout, e.g. [`method: Locator.waitFor`]
+ * or [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch).
*
* ```js
* const playwright = require('playwright');
@@ -11840,32 +11957,32 @@ class TimeoutError extends Error {}
}
/**
- * **DEPRECATED** This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
- * need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
+ * **DEPRECATED** This class is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if
+ * you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
* integration with Axe.
*
- * The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by
- * assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
+ * The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is
+ * used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or
* [switches](https://en.wikipedia.org/wiki/Switch_access).
*
- * Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might
- * have wildly different output.
+ * Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that
+ * might have wildly different output.
*
- * Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated into
- * different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
+ * Rendering engines of Chromium, Firefox and WebKit have a concept of "accessibility tree", which is then translated
+ * into different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.
*
* Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific
- * AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing
- * only the "interesting" nodes of the tree.
+ * AX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering,
+ * exposing only the "interesting" nodes of the tree.
*/
export interface Accessibility {
/**
- * **DEPRECATED** This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you
- * need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
+ * **DEPRECATED** This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if
+ * you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for
* integration with Axe.
*
- * Captures the current state of the accessibility tree. The returned object represents the root accessible node of the
- * page.
+ * Captures the current state of the accessibility tree. The returned object represents the root accessible node of
+ * the page.
*
* > NOTE: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers.
* Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
@@ -11938,8 +12055,8 @@ type ElectronType = typeof import('electron');
/**
* Electron application representation. You can use
- * [electron.launch([options])](https://playwright.dev/docs/api/class-electron#electron-launch) to obtain the application
- * instance. This instance you can control main electron process as well as work with Electron windows:
+ * [electron.launch([options])](https://playwright.dev/docs/api/class-electron#electron-launch) to obtain the
+ * application instance. This instance you can control main electron process as well as work with Electron windows:
*
* ```js
* const { _electron: electron } = require('playwright');
@@ -11986,8 +12103,8 @@ export interface ElectronApplication {
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
* returns a non-[Serializable] value, then
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
- * returns `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
- * `-0`, `NaN`, `Infinity`, `-Infinity`.
+ * returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
+ * `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -12005,8 +12122,8 @@ export interface ElectronApplication {
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
* returns a non-[Serializable] value, then
* [electronApplication.evaluate(pageFunction[, arg])](https://playwright.dev/docs/api/class-electronapplication#electron-application-evaluate)
- * returns `undefined`. Playwright also supports transferring some additional values that are not serializable by `JSON`:
- * `-0`, `NaN`, `Infinity`, `-Infinity`.
+ * returns `undefined`. Playwright also supports transferring some additional values that are not serializable by
+ * `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.
* @param pageFunction Function to be evaluated in the worker context.
* @param arg Optional argument to pass to `pageFunction`.
*/
@@ -12058,8 +12175,8 @@ export interface ElectronApplication {
on(event: 'close', listener: () => void): this;
/**
- * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be used
- * for Playwright automation.
+ * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be
+ * used for Playwright automation.
*/
on(event: 'window', listener: (page: Page) => void): this;
@@ -12079,8 +12196,8 @@ export interface ElectronApplication {
addListener(event: 'close', listener: () => void): this;
/**
- * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be used
- * for Playwright automation.
+ * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be
+ * used for Playwright automation.
*/
addListener(event: 'window', listener: (page: Page) => void): this;
@@ -12110,8 +12227,8 @@ export interface ElectronApplication {
prependListener(event: 'close', listener: () => void): this;
/**
- * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be used
- * for Playwright automation.
+ * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be
+ * used for Playwright automation.
*/
prependListener(event: 'window', listener: (page: Page) => void): this;
@@ -12156,8 +12273,8 @@ export interface ElectronApplication {
waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number } | (() => boolean | Promise<boolean>)): Promise<void>;
/**
- * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be used
- * for Playwright automation.
+ * This event is issued for every window that is created **and loaded** in Electron. It contains a [Page] that can be
+ * used for Playwright automation.
*/
waitForEvent(event: 'window', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;
@@ -12263,13 +12380,15 @@ export {};
/**
- * Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView.
+ * Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android
+ * WebView.
*
* *Requirements*
* - Android device or AVD Emulator.
* - [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device.
* Typically running `adb devices` is all you need to do.
- * - [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device
+ * - [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the
+ * device
* - "Enable command line on non-rooted devices" enabled in `chrome://flags`.
*
* *Known limitations*
@@ -12332,8 +12451,8 @@ export {};
* })();
* ```
*
- * Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser download
- * via setting the following environment variable when installing Playwright:
+ * Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser
+ * download via setting the following environment variable when installing Playwright:
*
* ```bash
* PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright
@@ -12343,8 +12462,8 @@ export {};
export interface Android {
/**
* This methods attaches Playwright to an existing Android device. Use
- * [android.launchServer([options])](https://playwright.dev/docs/api/class-android#android-launch-server) to launch a new
- * Android server instance.
+ * [android.launchServer([options])](https://playwright.dev/docs/api/class-android#android-launch-server) to launch a
+ * new Android server instance.
* @param wsEndpoint A browser websocket endpoint to connect to.
* @param options
*/
@@ -12355,14 +12474,14 @@ export interface Android {
headers?: { [key: string]: string; };
/**
- * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
- * Defaults to `0`.
+ * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
+ * on. Defaults to `0`.
*/
slowMo?: number;
/**
- * Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to
- * disable timeout.
+ * Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass
+ * `0` to disable timeout.
*/
timeout?: number;
}): Promise<AndroidDevice>;
@@ -12460,8 +12579,8 @@ export interface Android {
/**
* Path at which to serve the Android Server. For security, this defaults to an unguessable string.
*
- * > NOTE: Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take control
- * of the OS user. For this reason, you should use an unguessable token when using this option.
+ * > NOTE: Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take
+ * control of the OS user. For this reason, you should use an unguessable token when using this option.
*/
wsPath?: string;
}): Promise<BrowserServer>;
@@ -12560,8 +12679,8 @@ export interface AndroidDevice {
speed?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -12576,8 +12695,8 @@ export interface AndroidDevice {
*/
fill(selector: AndroidSelector, text: string, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -12597,8 +12716,8 @@ export interface AndroidDevice {
speed?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -12639,12 +12758,15 @@ export interface AndroidDevice {
* When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto),
* [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route),
* [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url),
- * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), or
- * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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. Examples:
+ * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request),
+ * or
+ * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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.
+ * Examples:
* - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
- * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`
+ * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
+ * `http://localhost:3000/foo/bar.html`
* - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
* `http://localhost:3000/bar.html`
*/
@@ -12657,8 +12779,8 @@ export interface AndroidDevice {
/**
* Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'light'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
*/
colorScheme?: null|"light"|"dark"|"no-preference";
@@ -12679,8 +12801,8 @@ export interface AndroidDevice {
/**
* Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'none'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'none'`.
*/
forcedColors?: null|"active"|"none";
@@ -12721,8 +12843,8 @@ export interface AndroidDevice {
ignoreHTTPSErrors?: boolean;
/**
- * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported
- * in Firefox.
+ * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not
+ * supported in Firefox.
*/
isMobile?: boolean;
@@ -12732,8 +12854,8 @@ export interface AndroidDevice {
javaScriptEnabled?: boolean;
/**
- * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
- * request header value as well as number and date formatting rules.
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules.
*/
locale?: string;
@@ -12755,23 +12877,23 @@ export interface AndroidDevice {
permissions?: Array<string>;
/**
- * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to be
- * saved.
+ * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to
+ * be saved.
*/
recordHar?: {
/**
- * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use `content`
- * policy instead.
+ * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use
+ * `content` policy instead.
*/
omitContent?: boolean;
/**
- * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach`
- * is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content
- * is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for
- * all other file extensions.
+ * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
+ * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is
+ * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output
+ * files and to `embed` for all other file extensions.
*/
content?: "omit"|"embed"|"attach";
@@ -12782,8 +12904,8 @@ export interface AndroidDevice {
path: string;
/**
- * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies,
- * security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
+ * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
+ * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
*/
mode?: "full"|"minimal";
@@ -12796,9 +12918,10 @@ export interface AndroidDevice {
};
/**
- * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make
- * sure to await [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for
- * videos to be saved.
+ * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
+ * Make sure to await
+ * [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for videos to
+ * be saved.
*/
recordVideo?: {
/**
@@ -12807,9 +12930,9 @@ export interface AndroidDevice {
dir: string;
/**
- * 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.
+ * 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.
*/
size?: {
/**
@@ -12826,14 +12949,14 @@ export interface AndroidDevice {
/**
* Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'no-preference'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
*/
reducedMotion?: null|"reduce"|"no-preference";
/**
- * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`
- * is set.
+ * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the
+ * `viewport` is set.
*/
screen?: {
/**
@@ -12849,15 +12972,16 @@ export interface AndroidDevice {
/**
* Whether to allow sites to register Service workers. Defaults to `'allow'`.
- * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.
+ * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be
+ * registered.
* - `'block'`: Playwright will block all registration of Service Workers.
*/
serviceWorkers?: "allow"|"block";
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
- * that imply single target DOM element will throw when more than one element matches the selector. See [Locator] to learn
- * more about the strict mode.
+ * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. See
+ * [Locator] to learn more about the strict mode.
*/
strictSelectors?: boolean;
@@ -12918,8 +13042,8 @@ export interface AndroidDevice {
*/
longTap(selector: AndroidSelector, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -12950,8 +13074,8 @@ export interface AndroidDevice {
speed?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -12971,8 +13095,8 @@ export interface AndroidDevice {
speed?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -12987,8 +13111,8 @@ export interface AndroidDevice {
*/
press(selector: AndroidSelector, key: AndroidKey, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -13014,8 +13138,8 @@ export interface AndroidDevice {
*/
screenshot(options?: {
/**
- * The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current working
- * directory. If no path is provided, the image won't be saved to the disk.
+ * The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current
+ * working directory. If no path is provided, the image won't be saved to the disk.
*/
path?: string;
}): Promise<Buffer>;
@@ -13034,8 +13158,8 @@ export interface AndroidDevice {
speed?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -13073,8 +13197,8 @@ export interface AndroidDevice {
speed?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -13093,8 +13217,8 @@ export interface AndroidDevice {
duration?: number;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -13115,8 +13239,8 @@ export interface AndroidDevice {
state?: "gone";
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -13135,8 +13259,8 @@ export interface AndroidDevice {
/**
- * This method waits until [AndroidWebView] matching the `selector` is opened and returns it. If there is already an open
- * [AndroidWebView] matching the `selector`, returns immediately.
+ * This method waits until [AndroidWebView] matching the `selector` is opened and returns it. If there is already an
+ * open [AndroidWebView] matching the `selector`, returns immediately.
* @param selector
* @param options
*/
@@ -13152,8 +13276,8 @@ export interface AndroidDevice {
socketName?: string;
}, options?: {
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [androidDevice.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-androiddevice#android-device-set-default-timeout)
* method.
*/
@@ -13224,7 +13348,8 @@ export interface AndroidInput {
/**
* [AndroidSocket] is a way to communicate with a process launched on the [AndroidDevice]. Use
- * [androidDevice.open(command)](https://playwright.dev/docs/api/class-androiddevice#android-device-open) to open a socket.
+ * [androidDevice.open(command)](https://playwright.dev/docs/api/class-androiddevice#android-device-open) to open a
+ * socket.
*/
export interface AndroidSocket {
/**
@@ -13351,8 +13476,8 @@ export interface AndroidWebView {
}
/**
- * Exposes API that can be used for the Web API testing. This class is used for creating [APIRequestContext] instance which
- * in turn can be used for sending web requests. An instance of this class can be obtained via
+ * Exposes API that can be used for the Web API testing. This class is used for creating [APIRequestContext] instance
+ * which in turn can be used for sending web requests. An instance of this class can be obtained via
* [playwright.request](https://playwright.dev/docs/api/class-playwright#playwright-request). For more information see
* [APIRequestContext].
*/
@@ -13365,8 +13490,9 @@ export interface APIRequest {
/**
* Methods like
* [apiRequestContext.get(url[, options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get)
- * take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)
- * constructor for building the corresponding URL. Examples:
+ * take the base URL into consideration by using the
+ * [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL.
+ * Examples:
* - baseURL: `http://localhost:3000` and sending request to `/bar.html` results in `http://localhost:3000/bar.html`
* - baseURL: `http://localhost:3000/foo/` and sending request to `./bar.html` results in
* `http://localhost:3000/foo/bar.html`
@@ -13421,8 +13547,8 @@ export interface APIRequest {
};
/**
- * Populates context with given storage state. This option can be used to initialize context with logged-in information
- * obtained via
+ * Populates context with given storage state. This option can be used to initialize context with logged-in
+ * information obtained via
* [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state)
* or
* [apiRequestContext.storageState([options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-storage-state).
@@ -13466,7 +13592,8 @@ export interface APIRequest {
};
/**
- * Maximum time in milliseconds to wait for the response. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
+ * Maximum time in milliseconds to wait for the response. Defaults to `30000` (30 seconds). Pass `0` to disable
+ * timeout.
*/
timeout?: number;
@@ -13478,11 +13605,11 @@ export interface APIRequest {
}
/**
- * This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare
- * environment or the service to your e2e test.
+ * This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services,
+ * prepare environment or the service to your e2e test.
*
- * Each Playwright browser context has associated with it [APIRequestContext] instance which shares cookie storage with the
- * browser context and can be accessed via
+ * Each Playwright browser context has associated with it [APIRequestContext] instance which shares cookie storage
+ * with the browser context and can be accessed via
* [browserContext.request](https://playwright.dev/docs/api/class-browsercontext#browser-context-request) or
* [page.request](https://playwright.dev/docs/api/class-page#page-request). It is also possible to create a new
* APIRequestContext instance manually by calling
@@ -13492,40 +13619,42 @@ export interface APIRequest {
*
* [APIRequestContext] returned by
* [browserContext.request](https://playwright.dev/docs/api/class-browsercontext#browser-context-request) and
- * [page.request](https://playwright.dev/docs/api/class-page#page-request) shares cookie storage with the corresponding
- * [BrowserContext]. Each API request will have `Cookie` header populated with the values from the browser context. If the
- * API response contains `Set-Cookie` header it will automatically update [BrowserContext] cookies and requests made from
- * the page will pick them up. This means that if you log in using this API, your e2e test will be logged in and vice
- * versa.
+ * [page.request](https://playwright.dev/docs/api/class-page#page-request) shares cookie storage with the
+ * corresponding [BrowserContext]. Each API request will have `Cookie` header populated with the values from the
+ * browser context. If the API response contains `Set-Cookie` header it will automatically update [BrowserContext]
+ * cookies and requests made from the page will pick them up. This means that if you log in using this API, your e2e
+ * test will be logged in and vice versa.
*
* If you want API requests to not interfere with the browser cookies you should create a new [APIRequestContext] by
- * calling [apiRequest.newContext([options])](https://playwright.dev/docs/api/class-apirequest#api-request-new-context).
- * Such `APIRequestContext` object will have its own isolated cookie storage.
+ * calling
+ * [apiRequest.newContext([options])](https://playwright.dev/docs/api/class-apirequest#api-request-new-context). Such
+ * `APIRequestContext` object will have its own isolated cookie storage.
*/
export interface APIRequestContext {
/**
* Sends HTTP(S) [DELETE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) request and returns its
- * response. The method will populate request cookies from the context and update context cookies from the response. The
- * method will automatically follow redirects.
+ * response. The method will populate request cookies from the context and update context cookies from the response.
+ * The method will automatically follow redirects.
* @param url Target URL.
* @param options
*/
delete(url: string, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -13547,10 +13676,11 @@ export interface APIRequestContext {
maxRedirects?: number;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -13585,14 +13715,15 @@ export interface APIRequestContext {
* [apiRequestContext.get(url[, options])](https://playwright.dev/docs/api/class-apirequestcontext#api-request-context-get)
* and similar methods are stored in the memory, so that you can later call
* [apiResponse.body()](https://playwright.dev/docs/api/class-apiresponse#api-response-body). This method discards all
- * stored responses, and makes [apiResponse.body()](https://playwright.dev/docs/api/class-apiresponse#api-response-body)
- * throw "Response disposed" error.
+ * stored responses, and makes
+ * [apiResponse.body()](https://playwright.dev/docs/api/class-apiresponse#api-response-body) throw "Response disposed"
+ * error.
*/
dispose(): Promise<void>;
/**
- * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update
- * context cookies from the response. The method will automatically follow redirects.
+ * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and
+ * update context cookies from the response. The method will automatically follow redirects.
*
* JSON objects can be passed directly to the request:
*
@@ -13637,20 +13768,21 @@ export interface APIRequestContext {
*/
fetch(urlOrRequest: string|Request, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -13678,10 +13810,11 @@ export interface APIRequestContext {
method?: string;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -13712,9 +13845,9 @@ export interface APIRequestContext {
}): Promise<APIResponse>;
/**
- * Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its response. The
- * method will populate request cookies from the context and update context cookies from the response. The method will
- * automatically follow redirects.
+ * Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its
+ * response. The method will populate request cookies from the context and update context cookies from the response.
+ * The method will automatically follow redirects.
*
* Request parameters can be configured with `params` option, they will be serialized into the URL search parameters:
*
@@ -13732,20 +13865,21 @@ export interface APIRequestContext {
*/
get(url: string, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -13767,10 +13901,11 @@ export interface APIRequestContext {
maxRedirects?: number;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -13801,28 +13936,29 @@ export interface APIRequestContext {
}): Promise<APIResponse>;
/**
- * Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its response.
- * The method will populate request cookies from the context and update context cookies from the response. The method will
- * automatically follow redirects.
+ * Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its
+ * response. The method will populate request cookies from the context and update context cookies from the response.
+ * The method will automatically follow redirects.
* @param url Target URL.
* @param options
*/
head(url: string, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -13844,10 +13980,11 @@ export interface APIRequestContext {
maxRedirects?: number;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -13878,28 +14015,29 @@ export interface APIRequestContext {
}): Promise<APIResponse>;
/**
- * Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its response.
- * The method will populate request cookies from the context and update context cookies from the response. The method will
- * automatically follow redirects.
+ * Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its
+ * response. The method will populate request cookies from the context and update context cookies from the response.
+ * The method will automatically follow redirects.
* @param url Target URL.
* @param options
*/
patch(url: string, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -13921,10 +14059,11 @@ export interface APIRequestContext {
maxRedirects?: number;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -13955,9 +14094,9 @@ export interface APIRequestContext {
}): Promise<APIResponse>;
/**
- * Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its response.
- * The method will populate request cookies from the context and update context cookies from the response. The method will
- * automatically follow redirects.
+ * Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its
+ * response. The method will populate request cookies from the context and update context cookies from the response.
+ * The method will automatically follow redirects.
*
* JSON objects can be passed directly to the request:
*
@@ -13971,7 +14110,8 @@ export interface APIRequestContext {
* ```
*
* To send form data to the server use `form` option. Its value will be encoded into the request body with
- * `application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send files):
+ * `application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send
+ * files):
*
* ```js
* await request.post('https://example.com/api/findBook', {
@@ -14011,20 +14151,21 @@ export interface APIRequestContext {
*/
post(url: string, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -14046,10 +14187,11 @@ export interface APIRequestContext {
maxRedirects?: number;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -14080,28 +14222,29 @@ export interface APIRequestContext {
}): Promise<APIResponse>;
/**
- * Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its response. The
- * method will populate request cookies from the context and update context cookies from the response. The method will
- * automatically follow redirects.
+ * Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its
+ * response. The method will populate request cookies from the context and update context cookies from the response.
+ * The method will automatically follow redirects.
* @param url Target URL.
* @param options
*/
put(url: string, options?: {
/**
- * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
- * `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will
- * be set to `application/octet-stream` if not explicitly set.
+ * Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string
+ * and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`
+ * header will be set to `application/octet-stream` if not explicitly set.
*/
data?: string|Buffer|Serializable;
/**
- * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
+ * Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status
+ * codes.
*/
failOnStatusCode?: boolean;
/**
- * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as
- * this request body. If this parameter is specified `content-type` header will be set to
+ * Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent
+ * as this request body. If this parameter is specified `content-type` header will be set to
* `application/x-www-form-urlencoded` unless explicitly provided.
*/
form?: { [key: string]: string|number|boolean; };
@@ -14123,10 +14266,11 @@ export interface APIRequestContext {
maxRedirects?: number;
/**
- * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this request
- * body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless explicitly
- * provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)
- * or as file-like object containing file name, mime-type and its content.
+ * Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this
+ * request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless
+ * explicitly provided. File values can be passed either as
+ * [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file
+ * name, mime-type and its content.
*/
multipart?: { [key: string]: string|number|boolean|ReadStream|{
/**
@@ -14157,8 +14301,8 @@ export interface APIRequestContext {
}): Promise<APIResponse>;
/**
- * Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to
- * the constructor.
+ * Returns storage state for this request context, contains current cookies and local storage snapshot if it was
+ * passed to the constructor.
* @param options
*/
storageState(options?: {
@@ -14223,8 +14367,8 @@ export interface APIResponse {
headers(): { [key: string]: string; };
/**
- * An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with
- * multiple entries, such as `Set-Cookie`, appear in the array multiple times.
+ * An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers
+ * with multiple entries, such as `Set-Cookie`, appear in the array multiple times.
*/
headersArray(): Array<{
/**
@@ -14275,8 +14419,8 @@ export interface APIResponse {
* - extends: [EventEmitter]
*
* A Browser is created via
- * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). An example of
- * using a [Browser] to create a [Page]:
+ * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). An example
+ * of using a [Browser] to create a [Page]:
*
* ```js
* const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.
@@ -14292,7 +14436,8 @@ export interface APIResponse {
*/
export interface Browser extends EventEmitter {
/**
- * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:
+ * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the
+ * following:
* - Browser application is closed or crashed.
* - The [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close) method was called.
*/
@@ -14304,7 +14449,8 @@ export interface Browser extends EventEmitter {
once(event: 'disconnected', listener: (browser: Browser) => void): this;
/**
- * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:
+ * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the
+ * following:
* - Browser application is closed or crashed.
* - The [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close) method was called.
*/
@@ -14321,7 +14467,8 @@ export interface Browser extends EventEmitter {
off(event: 'disconnected', listener: (browser: Browser) => void): this;
/**
- * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:
+ * Emitted when Browser gets disconnected from the browser application. This might happen because of one of the
+ * following:
* - Browser application is closed or crashed.
* - The [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close) method was called.
*/
@@ -14337,14 +14484,14 @@ export interface Browser extends EventEmitter {
* [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch), closes the
* browser and all of its pages (if any were opened).
*
- * In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the
- * browser server.
+ * In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from
+ * the browser server.
*
* > NOTE: This is similar to force quitting the browser. Therefore, you should call
* [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) on any
* [BrowserContext]'s you explicitly created earlier with
- * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) **before** calling
- * [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close).
+ * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) **before**
+ * calling [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close).
*
* The [Browser] object itself is considered to be disposed and cannot be used anymore.
*/
@@ -14379,11 +14526,12 @@ export interface Browser extends EventEmitter {
/**
* Creates a new browser context. It won't share cookies/cache with other browser contexts.
*
- * > NOTE: If directly using this method to create [BrowserContext]s, it is best practice to explicitly close the returned
- * context via [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) when
- * your code is done with the [BrowserContext], and before calling
- * [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close). This will ensure the `context` is closed
- * gracefully and any artifacts—like HARs and videos—are fully flushed and saved.
+ * > NOTE: If directly using this method to create [BrowserContext]s, it is best practice to explicitly close the
+ * returned context via
+ * [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) when your code
+ * is done with the [BrowserContext], and before calling
+ * [browser.close()](https://playwright.dev/docs/api/class-browser#browser-close). This will ensure the `context` is
+ * closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved.
*
* ```js
* (async () => {
@@ -14407,11 +14555,11 @@ export interface Browser extends EventEmitter {
/**
* Creates a new page in a new browser context. Closing this page will close the context as well.
*
- * This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and
- * testing frameworks should explicitly create
+ * This is a convenience API that should only be used for the single-page scenarios and short snippets. Production
+ * code and testing frameworks should explicitly create
* [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context) followed by the
- * [browserContext.newPage()](https://playwright.dev/docs/api/class-browsercontext#browser-context-new-page) to control
- * their exact life times.
+ * [browserContext.newPage()](https://playwright.dev/docs/api/class-browsercontext#browser-context-new-page) to
+ * control their exact life times.
* @param options
*/
newPage(options?: {
@@ -14424,12 +14572,15 @@ export interface Browser extends EventEmitter {
* When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto),
* [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route),
* [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url),
- * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), or
- * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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. Examples:
+ * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request),
+ * or
+ * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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.
+ * Examples:
* - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
- * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`
+ * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
+ * `http://localhost:3000/foo/bar.html`
* - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
* `http://localhost:3000/bar.html`
*/
@@ -14442,8 +14593,8 @@ export interface Browser extends EventEmitter {
/**
* Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'light'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
*/
colorScheme?: null|"light"|"dark"|"no-preference";
@@ -14459,8 +14610,8 @@ export interface Browser extends EventEmitter {
/**
* Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'none'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'none'`.
*/
forcedColors?: null|"active"|"none";
@@ -14501,8 +14652,8 @@ export interface Browser extends EventEmitter {
ignoreHTTPSErrors?: boolean;
/**
- * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported
- * in Firefox.
+ * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not
+ * supported in Firefox.
*/
isMobile?: boolean;
@@ -14512,8 +14663,8 @@ export interface Browser extends EventEmitter {
javaScriptEnabled?: boolean;
/**
- * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
- * request header value as well as number and date formatting rules.
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules.
*/
locale?: string;
@@ -14537,9 +14688,9 @@ export interface Browser extends EventEmitter {
/**
* Network proxy settings to use with this context.
*
- * > NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all
- * contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: {
- * server: 'http://per-context' } })`.
+ * > NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If
+ * all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({
+ * proxy: { server: 'http://per-context' } })`.
*/
proxy?: {
/**
@@ -14565,23 +14716,23 @@ export interface Browser extends EventEmitter {
};
/**
- * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to be
- * saved.
+ * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to
+ * be saved.
*/
recordHar?: {
/**
- * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use `content`
- * policy instead.
+ * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use
+ * `content` policy instead.
*/
omitContent?: boolean;
/**
- * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach`
- * is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content
- * is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for
- * all other file extensions.
+ * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
+ * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is
+ * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output
+ * files and to `embed` for all other file extensions.
*/
content?: "omit"|"embed"|"attach";
@@ -14592,8 +14743,8 @@ export interface Browser extends EventEmitter {
path: string;
/**
- * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies,
- * security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
+ * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
+ * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
*/
mode?: "full"|"minimal";
@@ -14606,9 +14757,10 @@ export interface Browser extends EventEmitter {
};
/**
- * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make
- * sure to await [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for
- * videos to be saved.
+ * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
+ * Make sure to await
+ * [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for videos to
+ * be saved.
*/
recordVideo?: {
/**
@@ -14617,9 +14769,9 @@ export interface Browser extends EventEmitter {
dir: string;
/**
- * 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.
+ * 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.
*/
size?: {
/**
@@ -14636,14 +14788,14 @@ export interface Browser extends EventEmitter {
/**
* Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'no-preference'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
*/
reducedMotion?: null|"reduce"|"no-preference";
/**
- * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`
- * is set.
+ * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the
+ * `viewport` is set.
*/
screen?: {
/**
@@ -14659,14 +14811,15 @@ export interface Browser extends EventEmitter {
/**
* Whether to allow sites to register Service workers. Defaults to `'allow'`.
- * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.
+ * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be
+ * registered.
* - `'block'`: Playwright will block all registration of Service Workers.
*/
serviceWorkers?: "allow"|"block";
/**
- * Populates context with given storage state. This option can be used to initialize context with logged-in information
- * obtained via
+ * Populates context with given storage state. This option can be used to initialize context with logged-in
+ * information obtained via
* [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state).
* Either a path to the file with saved storage, or an object with the following fields:
*/
@@ -14719,9 +14872,9 @@ export interface Browser extends EventEmitter {
};
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
- * that imply single target DOM element will throw when more than one element matches the selector. See [Locator] to learn
- * more about the strict mode.
+ * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. See
+ * [Locator] to learn more about the strict mode.
*/
strictSelectors?: boolean;
@@ -14776,12 +14929,14 @@ export interface Browser extends EventEmitter {
}): Promise<Page>;
/**
- * > NOTE: This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
- * which is a low-level chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be
- * found [here](https://playwright.dev/docs/api/class-tracing).
+ * > NOTE: This API controls
+ * [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level
+ * chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be found
+ * [here](https://playwright.dev/docs/api/class-tracing).
*
- * You can use [browser.startTracing([page, options])](https://playwright.dev/docs/api/class-browser#browser-start-tracing)
- * and [browser.stopTracing()](https://playwright.dev/docs/api/class-browser#browser-stop-tracing) to create a trace file
+ * You can use
+ * [browser.startTracing([page, options])](https://playwright.dev/docs/api/class-browser#browser-start-tracing) and
+ * [browser.stopTracing()](https://playwright.dev/docs/api/class-browser#browser-stop-tracing) to create a trace file
* that can be opened in Chrome DevTools performance panel.
*
* ```js
@@ -14811,9 +14966,10 @@ export interface Browser extends EventEmitter {
}): Promise<void>;
/**
- * > NOTE: This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
- * which is a low-level chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be
- * found [here](https://playwright.dev/docs/api/class-tracing).
+ * > NOTE: This API controls
+ * [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level
+ * chromium-specific debugging tool. API to control [Playwright Tracing](https://playwright.dev/docs/trace-viewer) could be found
+ * [here](https://playwright.dev/docs/api/class-tracing).
*
* Returns the buffer with trace data.
*/
@@ -14875,16 +15031,16 @@ export interface BrowserServer {
* Browser websocket url.
*
* Browser websocket endpoint which can be used as an argument to
- * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect) to
- * establish connection to the browser.
+ * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect)
+ * to establish connection to the browser.
*/
wsEndpoint(): string;
}
/**
* [ConsoleMessage] objects are dispatched by page via the
- * [page.on('console')](https://playwright.dev/docs/api/class-page#page-event-console) event. For each console messages
- * logged in the page there will be corresponding event in the Playwright context.
+ * [page.on('console')](https://playwright.dev/docs/api/class-page#page-event-console) event. For each console
+ * messages logged in the page there will be corresponding event in the Playwright context.
*
* ```js
* // Listen for all console logs
@@ -14942,8 +15098,8 @@ export interface ConsoleMessage {
/**
* One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,
- * `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,
- * `'count'`, `'timeEnd'`.
+ * `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`,
+ * `'profileEnd'`, `'count'`, `'timeEnd'`.
*/
type(): string;
}
@@ -14991,9 +15147,9 @@ export interface Coverage {
/**
* Returns coverage is started
*
- * > NOTE: Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on
- * the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts will have
- * `__playwright_evaluation_script__` as their URL.
+ * > NOTE: Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically
+ * created on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts
+ * will have `__playwright_evaluation_script__` as their URL.
* @param options
*/
startJSCoverage(options?: {
@@ -15043,7 +15199,8 @@ export interface Coverage {
/**
* Returns the array of coverage reports for all scripts
*
- * > NOTE: JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are reported.
+ * > NOTE: JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are
+ * reported.
*/
stopJSCoverage(): Promise<Array<{
/**
@@ -15102,11 +15259,12 @@ export interface Coverage {
* ```
*
* > NOTE: Dialogs are dismissed automatically, unless there is a
- * [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listener. When listener is present, it
- * **must** either [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or
- * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page will
- * [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and
- * actions like click will never finish.
+ * [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) listener. When listener is
+ * present, it **must** either
+ * [dialog.accept([promptText])](https://playwright.dev/docs/api/class-dialog#dialog-accept) or
+ * [dialog.dismiss()](https://playwright.dev/docs/api/class-dialog#dialog-dismiss) the dialog - otherwise the page
+ * will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the
+ * dialog, and actions like click will never finish.
*/
export interface Dialog {
/**
@@ -15186,8 +15344,8 @@ export interface Download {
page(): Page;
/**
- * Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if
- * necessary. The method throws when connected remotely.
+ * Returns path to the downloaded file in case of successful download. The method will wait for the download to finish
+ * if necessary. The method throws when connected remotely.
*
* Note that the download's file name is a random GUID, use
* [download.suggestedFilename()](https://playwright.dev/docs/api/class-download#download-suggested-filename) to get
@@ -15196,17 +15354,17 @@ export interface Download {
path(): Promise<null|string>;
/**
- * Copy the download to a user-specified path. It is safe to call this method while the download is still in progress. Will
- * wait for the download to finish if necessary.
+ * Copy the download to a user-specified path. It is safe to call this method while the download is still in progress.
+ * Will wait for the download to finish if necessary.
* @param path Path where the download should be copied.
*/
saveAs(path: string): Promise<void>;
/**
* Returns suggested filename for this download. It is typically computed by the browser from the
- * [`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response header
- * or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources). Different
- * browsers can use different logic for computing it.
+ * [`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response
+ * header or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources).
+ * Different browsers can use different logic for computing it.
*/
suggestedFilename(): string;
@@ -15255,8 +15413,8 @@ export interface Download {
* })();
* ```
*
- * Note that since you don't need Playwright to install web browsers when testing Electron, you can omit browser download
- * via setting the following environment variable when installing Playwright:
+ * Note that since you don't need Playwright to install web browsers when testing Electron, you can omit browser
+ * download via setting the following environment variable when installing Playwright:
*
* ```bash
* PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright
@@ -15290,8 +15448,8 @@ export interface Electron {
/**
* Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'light'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
*/
colorScheme?: null|"light"|"dark"|"no-preference";
@@ -15348,8 +15506,8 @@ export interface Electron {
ignoreHTTPSErrors?: boolean;
/**
- * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
- * request header value as well as number and date formatting rules.
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules.
*/
locale?: string;
@@ -15359,23 +15517,23 @@ export interface Electron {
offline?: boolean;
/**
- * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to be
- * saved.
+ * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to
+ * be saved.
*/
recordHar?: {
/**
- * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use `content`
- * policy instead.
+ * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use
+ * `content` policy instead.
*/
omitContent?: boolean;
/**
- * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach`
- * is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content
- * is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for
- * all other file extensions.
+ * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
+ * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is
+ * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output
+ * files and to `embed` for all other file extensions.
*/
content?: "omit"|"embed"|"attach";
@@ -15386,8 +15544,8 @@ export interface Electron {
path: string;
/**
- * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies,
- * security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
+ * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
+ * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
*/
mode?: "full"|"minimal";
@@ -15400,9 +15558,10 @@ export interface Electron {
};
/**
- * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make
- * sure to await [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for
- * videos to be saved.
+ * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
+ * Make sure to await
+ * [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for videos to
+ * be saved.
*/
recordVideo?: {
/**
@@ -15411,9 +15570,9 @@ export interface Electron {
dir: string;
/**
- * 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.
+ * 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.
*/
size?: {
/**
@@ -15429,8 +15588,8 @@ export interface Electron {
};
/**
- * Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to disable
- * timeout.
+ * Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to
+ * disable timeout.
*/
timeout?: number;
@@ -15477,8 +15636,8 @@ export interface FileChooser {
page(): Page;
/**
- * Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then
- * they are resolved relative to the current working directory. For empty array, clears the selected files.
+ * Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths,
+ * then they are resolved relative to the current working directory. For empty array, clears the selected files.
* @param files
* @param options
*/
@@ -15514,15 +15673,15 @@ export interface FileChooser {
buffer: Buffer;
}>, options?: {
/**
- * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
- * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
- * inaccessible pages. Defaults to `false`.
+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
+ * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
+ * navigating to inaccessible pages. Defaults to `false`.
*/
noWaitAfter?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -15531,8 +15690,8 @@ export interface FileChooser {
}
/**
- * FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe`
- * and locate elements in that iframe. FrameLocator can be created with either
+ * FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the
+ * `iframe` and locate elements in that iframe. FrameLocator can be created with either
* [page.frameLocator(selector)](https://playwright.dev/docs/api/class-page#page-frame-locator) or
* [locator.frameLocator(selector)](https://playwright.dev/docs/api/class-locator#locator-frame-locator) method.
*
@@ -15543,8 +15702,8 @@ export interface FileChooser {
*
* **Strictness**
*
- * Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches
- * a given selector.
+ * Frame locators are strict. This means that all operations on frame locators will throw if more than one element
+ * matches a given selector.
*
* ```js
* // Throws if there are several frames in DOM:
@@ -15571,8 +15730,8 @@ export interface FrameLocator {
first(): FrameLocator;
/**
- * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
- * that iframe.
+ * When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
+ * in that iframe.
* @param selector A selector to use when resolving DOM element. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
*/
frameLocator(selector: string): FrameLocator;
@@ -15589,8 +15748,8 @@ export interface FrameLocator {
*/
getByAltText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -15609,8 +15768,8 @@ export interface FrameLocator {
*/
getByLabel(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -15628,8 +15787,8 @@ export interface FrameLocator {
*/
getByPlaceholder(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -15641,9 +15800,10 @@ export interface FrameLocator {
* accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines.
*
* Note that many html elements have an implicitly
- * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector. You
- * can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not
- * recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
+ * [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings) that is recognized by the role selector.
+ * You can find all the [supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines
+ * **do not recommend** duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to
+ * default values.
* @param role Required aria role.
* @param options
*/
@@ -15664,8 +15824,8 @@ export interface FrameLocator {
disabled?: boolean;
/**
- * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
@@ -15685,8 +15845,8 @@ export interface FrameLocator {
includeHidden?: boolean;
/**
- * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for
- * `<h1>-<h6>` elements.
+ * A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values
+ * for `<h1>-<h6>` elements.
*
* Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).
*/
@@ -15758,26 +15918,27 @@ export interface FrameLocator {
* page.getByText(/^hello$/i)
* ```
*
- * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to match
- * by another criteria, like an accessible role, and then filter by the text content.
+ * See also [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) that allows to
+ * match by another criteria, like an accessible role, and then filter by the text content.
*
- * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into
- * one, turns line breaks into spaces and ignores leading and trailing whitespace.
- * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For
- * example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
+ * > NOTE: Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces
+ * into one, turns line breaks into spaces and ignores leading and trailing whitespace.
+ * > NOTE: Input elements of the type `button` and `submit` are matched by their `value` instead of the text content.
+ * For example, locating by text `"Log in"` matches `<input type=button value="Log in">`.
* @param text Text to locate the element for.
* @param options
*/
getByText(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
/**
- * Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
+ * Allows locating elements by their title. For example, this method will find the button by its title "Place the
+ * order":
*
* ```html
* <button title='Place the order'>Order Now</button>
@@ -15788,8 +15949,8 @@ export interface FrameLocator {
*/
getByTitle(text: string|RegExp, options?: {
/**
- * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular
- * expression. Note that exact match still trims whitespace.
+ * Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
+ * regular expression. Note that exact match still trims whitespace.
*/
exact?: boolean;
}): Locator;
@@ -15800,8 +15961,9 @@ export interface FrameLocator {
last(): FrameLocator;
/**
- * The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options,
- * similar to [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter) method.
+ * The method finds an element matching the specified selector in the locator's subtree. It also accepts filter
+ * options, similar to [locator.filter([options])](https://playwright.dev/docs/api/class-locator#locator-filter)
+ * method.
*
* [Learn more about locators](https://playwright.dev/docs/locators).
* @param selector A selector to use when resolving DOM element. See [working with selectors](https://playwright.dev/docs/selectors) for more details.
@@ -15809,16 +15971,16 @@ export interface FrameLocator {
*/
locator(selector: string, options?: {
/**
- * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
- * For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
+ * Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer
+ * one. For example, `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
*
* Note that outer and inner locators must belong to the same frame. Inner locator must not contain [FrameLocator]s.
*/
has?: Locator;
/**
- * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
- * [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
+ * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
+ * passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
* `<article><div>Playwright</div></article>`.
*/
hasText?: string|RegExp;
@@ -15838,8 +16000,8 @@ export interface FrameLocator {
*
* For finer control, you can use [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down),
* [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up), and
- * [keyboard.insertText(text)](https://playwright.dev/docs/api/class-keyboard#keyboard-insert-text) to manually fire events
- * as if they were generated from a real keyboard.
+ * [keyboard.insertText(text)](https://playwright.dev/docs/api/class-keyboard#keyboard-insert-text) to manually fire
+ * events as if they were generated from a real keyboard.
*
* An example of holding down `Shift` in order to select and delete some text:
*
@@ -15878,12 +16040,14 @@ export interface Keyboard {
/**
* Dispatches a `keydown` event.
*
- * `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
- * value or a single character to generate the text for. A superset of the `key` values can be found
+ * `key` can specify the intended
+ * [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
+ * to generate the text for. A superset of the `key` values can be found
* [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:
*
* `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
- * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.
+ * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,
+ * etc.
*
* Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.
*
@@ -15892,13 +16056,14 @@ export interface Keyboard {
* If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective
* texts.
*
- * If `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that modifier
- * active. To release the modifier key, use [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
+ * If `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that
+ * modifier active. To release the modifier key, use
+ * [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
*
* After the key is pressed once, subsequent calls to
* [keyboard.down(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-down) will have
- * [repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key, use
- * [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
+ * [repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key,
+ * use [keyboard.up(key)](https://playwright.dev/docs/api/class-keyboard#keyboard-up).
*
* > NOTE: Modifier keys DO influence `keyboard.down`. Holding down `Shift` will type the text in upper case.
* @param key Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
@@ -15912,18 +16077,21 @@ export interface Keyboard {
* page.keyboard.insertText('嗨');
* ```
*
- * > NOTE: Modifier keys DO NOT effect `keyboard.insertText`. Holding down `Shift` will not type the text in upper case.
+ * > NOTE: Modifier keys DO NOT effect `keyboard.insertText`. Holding down `Shift` will not type the text in upper
+ * case.
* @param text Sets input to the specified text value.
*/
insertText(text: string): Promise<void>;
/**
- * `key` can specify the intended [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key)
- * value or a single character to generate the text for. A superset of the `key` values can be found
+ * `key` can specify the intended
+ * [keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character
+ * to generate the text for. A superset of the `key` values can be found
* [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:
*
* `F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,
- * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc.
+ * `Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,
+ * etc.
*
* Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`.
*
@@ -16144,8 +16312,8 @@ export interface Mouse {
/**
* Dispatches a `wheel` event.
*
- * > NOTE: Wheel events may cause scrolling if they are not handled, and this method does not wait for the scrolling to
- * finish before returning.
+ * > NOTE: Wheel events may cause scrolling if they are not handled, and this method does not wait for the scrolling
+ * to finish before returning.
* @param deltaX Pixels to scroll horizontally.
* @param deltaY Pixels to scroll vertically.
*/
@@ -16181,19 +16349,20 @@ export const webkit: BrowserType;
* Whenever the page sends a request for a network resource the following sequence of events are emitted by [Page]:
* - [page.on('request')](https://playwright.dev/docs/api/class-page#page-event-request) emitted when the request is
* issued by the page.
- * - [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response) emitted when/if the response
- * status and headers are received for the request.
- * - [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) emitted when
- * the response body is downloaded and the request is complete.
+ * - [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response) emitted when/if the
+ * response status and headers are received for the request.
+ * - [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished) emitted
+ * when the response body is downloaded and the request is complete.
*
- * If request fails at some point, then instead of `'requestfinished'` event (and possibly instead of 'response' event),
- * the [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed) event is emitted.
+ * If request fails at some point, then instead of `'requestfinished'` event (and possibly instead of 'response'
+ * event), the [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed) event
+ * is emitted.
*
- * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will
- * complete with `'requestfinished'` event.
+ * > NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request
+ * will complete with `'requestfinished'` event.
*
- * If request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a new
- * request is issued to a redirected url.
+ * If request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a
+ * new request is issued to a redirected url.
*/
export interface Request {
/**
@@ -16228,8 +16397,8 @@ export interface Request {
/**
* An object with the request HTTP headers. The header names are lower-cased. Note that this method does not return
* security-related headers, including cookie-related ones. You can use
- * [request.allHeaders()](https://playwright.dev/docs/api/class-request#request-all-headers) for complete list of headers
- * that include `cookie` information.
+ * [request.allHeaders()](https://playwright.dev/docs/api/class-request#request-all-headers) for complete list of
+ * headers that include `cookie` information.
*/
headers(): { [key: string]: string; };
@@ -16287,8 +16456,8 @@ export interface Request {
/**
* Request that was redirected by the server to this one, if any.
*
- * When the server responds with a redirect, Playwright creates a new [Request] object. The two requests are connected by
- * `redirectedFrom()` and `redirectedTo()` methods. When multiple server redirects has happened, it is possible to
+ * When the server responds with a redirect, Playwright creates a new [Request] object. The two requests are connected
+ * by `redirectedFrom()` and `redirectedTo()` methods. When multiple server redirects has happened, it is possible to
* construct the whole redirect chain by repeatedly calling `redirectedFrom()`.
*
* For example, if the website `http://example.com` redirects to `https://example.com`:
@@ -16323,8 +16492,8 @@ export interface Request {
/**
* Contains the request's resource type as it was perceived by the rendering engine. ResourceType will be one of the
- * following: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`, `eventsource`,
- * `websocket`, `manifest`, `other`.
+ * following: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`,
+ * `eventsource`, `websocket`, `manifest`, `other`.
*/
resourceType(): string;
@@ -16350,7 +16519,8 @@ export interface Request {
requestBodySize: number;
/**
- * Total number of bytes from the start of the HTTP request message until (and including) the double CRLF before the body.
+ * Total number of bytes from the start of the HTTP request message until (and including) the double CRLF before the
+ * body.
*/
requestHeadersSize: number;
@@ -16360,14 +16530,15 @@ export interface Request {
responseBodySize: number;
/**
- * Total number of bytes from the start of the HTTP response message until (and including) the double CRLF before the body.
+ * Total number of bytes from the start of the HTTP response message until (and including) the double CRLF before the
+ * body.
*/
responseHeadersSize: number;
}>;
/**
- * Returns resource timing information for given request. Most of the timing values become available upon the response,
- * `responseEnd` becomes available when request finishes. Find more information at
+ * Returns resource timing information for given request. Most of the timing values become available upon the
+ * response, `responseEnd` becomes available when request finishes. Find more information at
* [Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).
*
* ```js
@@ -16386,50 +16557,51 @@ export interface Request {
startTime: number;
/**
- * Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds
- * relative to `startTime`, -1 if not available.
+ * Time immediately before the browser starts the domain name lookup for the resource. The value is given in
+ * milliseconds relative to `startTime`, -1 if not available.
*/
domainLookupStart: number;
/**
- * Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds
- * relative to `startTime`, -1 if not available.
+ * Time immediately after the browser starts the domain name lookup for the resource. The value is given in
+ * milliseconds relative to `startTime`, -1 if not available.
*/
domainLookupEnd: number;
/**
- * Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The
- * value is given in milliseconds relative to `startTime`, -1 if not available.
+ * Time immediately before the user agent starts establishing the connection to the server to retrieve the resource.
+ * The value is given in milliseconds relative to `startTime`, -1 if not available.
*/
connectStart: number;
/**
- * Time immediately before the browser starts the handshake process to secure the current connection. The value is given in
- * milliseconds relative to `startTime`, -1 if not available.
+ * Time immediately before the browser starts the handshake process to secure the current connection. The value is
+ * given in milliseconds relative to `startTime`, -1 if not available.
*/
secureConnectionStart: number;
/**
- * Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The
- * value is given in milliseconds relative to `startTime`, -1 if not available.
+ * Time immediately before the user agent starts establishing the connection to the server to retrieve the resource.
+ * The value is given in milliseconds relative to `startTime`, -1 if not available.
*/
connectEnd: number;
/**
- * Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value
- * is given in milliseconds relative to `startTime`, -1 if not available.
+ * Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The
+ * value is given in milliseconds relative to `startTime`, -1 if not available.
*/
requestStart: number;
/**
- * Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value
- * is given in milliseconds relative to `startTime`, -1 if not available.
+ * Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The
+ * value is given in milliseconds relative to `startTime`, -1 if not available.
*/
responseStart: number;
/**
- * Time immediately after the browser receives the last byte of the resource or immediately before the transport connection
- * is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not available.
+ * Time immediately after the browser receives the last byte of the resource or immediately before the transport
+ * connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not
+ * available.
*/
responseEnd: number;
};
@@ -16496,9 +16668,9 @@ export interface Response {
}>>;
/**
- * Returns the value of the header matching the name. The name is case insensitive. If multiple headers have the same name
- * (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\n` separator is used. If
- * no headers are found, `null` is returned.
+ * Returns the value of the header matching the name. The name is case insensitive. If multiple headers have the same
+ * name (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\n` separator is
+ * used. If no headers are found, `null` is returned.
* @param name Name of the header.
*/
headerValue(name: string): Promise<null|string>;
@@ -16531,8 +16703,8 @@ export interface Response {
*/
securityDetails(): Promise<null|{
/**
- * Common Name component of the Issuer field. from the certificate. This should only be used for informational purposes.
- * Optional.
+ * Common Name component of the Issuer field. from the certificate. This should only be used for informational
+ * purposes. Optional.
*/
issuer?: string;
@@ -16542,8 +16714,8 @@ export interface Response {
protocol?: string;
/**
- * Common Name component of the Subject field from the certificate. This should only be used for informational purposes.
- * Optional.
+ * Common Name component of the Subject field from the certificate. This should only be used for informational
+ * purposes. Optional.
*/
subjectName?: string;
@@ -16604,11 +16776,11 @@ export interface Route {
* Aborts the route's request.
* @param errorCode Optional error code. Defaults to `failed`, could be one of the following: - `'aborted'` - An operation was aborted (due to user action)
* - `'accessdenied'` - Permission to access a resource, other than the network, was denied
- * - `'addressunreachable'` - The IP address is unreachable. This usually means that there is no route to the specified
- * host or network.
+ * - `'addressunreachable'` - The IP address is unreachable. This usually means that there is no route to the
+ * specified host or network.
* - `'blockedbyclient'` - The client chose to block the request.
- * - `'blockedbyresponse'` - The request failed because the response was delivered along with requirements which are not
- * met ('X-Frame-Options' and 'Content-Security-Policy' ancestor checks, for instance).
+ * - `'blockedbyresponse'` - The request failed because the response was delivered along with requirements which are
+ * not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor checks, for instance).
* - `'connectionaborted'` - A connection timed out as a result of not receiving an ACK for data sent.
* - `'connectionclosed'` - A connection was closed (corresponding to a TCP FIN).
* - `'connectionfailed'` - A connection attempt failed.
@@ -16661,9 +16833,9 @@ export interface Route {
}): Promise<void>;
/**
- * When several routes match the given pattern, they run in the order opposite to their registration. That way the last
- * registered route can always override all the previous ones. In the example below, request will be handled by the
- * bottom-most handler first, then it'll fall back to the previous one and in the end will be aborted by the first
+ * When several routes match the given pattern, they run in the order opposite to their registration. That way the
+ * last registered route can always override all the previous ones. In the example below, request will be handled by
+ * the bottom-most handler first, then it'll fall back to the previous one and in the end will be aborted by the first
* registered route.
*
* ```js
@@ -16681,8 +16853,8 @@ export interface Route {
* });
* ```
*
- * Registering multiple routes is useful when you want separate handlers to handle different kinds of requests, for example
- * API calls vs page resources or GET requests vs POST requests as in the example below.
+ * Registering multiple routes is useful when you want separate handlers to handle different kinds of requests, for
+ * example API calls vs page resources or GET requests vs POST requests as in the example below.
*
* ```js
* // Handle GET requests.
@@ -16706,8 +16878,8 @@ export interface Route {
* });
* ```
*
- * One can also modify request while falling back to the subsequent handler, that way intermediate route handler can modify
- * url, method, headers and postData of the request.
+ * One can also modify request while falling back to the subsequent handler, that way intermediate route handler can
+ * modify url, method, headers and postData of the request.
*
* ```js
* await page.route('**\/*', (route, request) => {
@@ -16740,8 +16912,8 @@ export interface Route {
postData?: string|Buffer;
/**
- * If set changes the request URL. New URL must have same protocol as original one. Changing the URL won't affect the route
- * matching, all the routes are matched using the original request URL.
+ * If set changes the request URL. New URL must have same protocol as original one. Changing the URL won't affect the
+ * route matching, all the routes are matched using the original request URL.
*/
url?: string;
}): Promise<void>;
@@ -16786,14 +16958,14 @@ export interface Route {
headers?: { [key: string]: string; };
/**
- * File path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it
- * is resolved relative to the current working directory.
+ * File path to respond with. The content type will be inferred from file extension. If `path` is a relative path,
+ * then it is resolved relative to the current working directory.
*/
path?: string;
/**
- * [APIResponse] to fulfill route's request with. Individual fields of the response (such as headers) can be overridden
- * using fulfill options.
+ * [APIResponse] to fulfill route's request with. Individual fields of the response (such as headers) can be
+ * overridden using fulfill options.
*/
response?: APIResponse;
@@ -16869,25 +17041,25 @@ export interface Selectors {
content?: string;
}, options?: {
/**
- * Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but
- * not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content script is not
- * guaranteed when this engine is used together with other registered engines.
+ * Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same
+ * DOM, but not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content
+ * script is not guaranteed when this engine is used together with other registered engines.
*/
contentScript?: boolean;
}): Promise<void>;
/**
* Defines custom attribute name to be used in
- * [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used by
- * default.
+ * [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used
+ * by default.
* @param attributeName Test id attribute name.
*/
setTestIdAttribute(attributeName: string): void;
}
/**
- * The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the
- * touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
+ * The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on
+ * the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
*/
export interface Touchscreen {
/**
@@ -16899,8 +17071,8 @@ export interface Touchscreen {
}
/**
- * API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](https://playwright.dev/docs/trace-viewer)
- * after Playwright script runs.
+ * API for collecting and saving Playwright traces. Playwright traces can be opened in
+ * [Trace Viewer](https://playwright.dev/docs/trace-viewer) after Playwright script runs.
*
* Start recording a trace before performing actions. At the end, stop tracing and save it to a file.
*
@@ -16929,8 +17101,9 @@ export interface Tracing {
*/
start(options?: {
/**
- * If specified, the trace is going to be saved into the file with the given name inside the `tracesDir` folder specified
- * in [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch).
+ * If specified, the trace is going to be saved into the file with the given name inside the `tracesDir` folder
+ * specified in
+ * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch).
*/
name?: string;
@@ -16959,8 +17132,9 @@ export interface Tracing {
/**
* Start a new trace chunk. If you'd like to record multiple traces on the same [BrowserContext], use
- * [tracing.start([options])](https://playwright.dev/docs/api/class-tracing#tracing-start) once, and then create multiple
- * trace chunks with [tracing.startChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-start-chunk) and
+ * [tracing.start([options])](https://playwright.dev/docs/api/class-tracing#tracing-start) once, and then create
+ * multiple trace chunks with
+ * [tracing.startChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-start-chunk) and
* [tracing.stopChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-stop-chunk).
*
* ```js
@@ -17008,8 +17182,8 @@ export interface Tracing {
stopChunk(options?: {
/**
* Export trace collected since the last
- * [tracing.startChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-start-chunk) call into the file
- * with the given path.
+ * [tracing.startChunk([options])](https://playwright.dev/docs/api/class-tracing#tracing-start-chunk) call into the
+ * file with the given path.
*/
path?: string;
}): Promise<void>;
@@ -17030,14 +17204,14 @@ export interface Video {
delete(): Promise<void>;
/**
- * Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem
- * upon closing the browser context. This method throws when connected remotely.
+ * Returns the file system path this video will be recorded to. The video is guaranteed to be written to the
+ * filesystem upon closing the browser context. This method throws when connected remotely.
*/
path(): Promise<string>;
/**
- * Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or after
- * the page has closed. This method waits until the page is closed and the video is fully saved.
+ * Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or
+ * after the page has closed. This method waits until the page is closed and the video is fully saved.
* @param path Path where the video should be saved.
*/
saveAs(path: string): Promise<void>;
@@ -17299,12 +17473,15 @@ export interface BrowserContextOptions {
* When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto),
* [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route),
* [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url),
- * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), or
- * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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. Examples:
+ * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request),
+ * or
+ * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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.
+ * Examples:
* - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
- * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`
+ * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
+ * `http://localhost:3000/foo/bar.html`
* - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
* `http://localhost:3000/bar.html`
*/
@@ -17317,8 +17494,8 @@ export interface BrowserContextOptions {
/**
* Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'light'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
*/
colorScheme?: null|"light"|"dark"|"no-preference";
@@ -17334,8 +17511,8 @@ export interface BrowserContextOptions {
/**
* Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'none'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'none'`.
*/
forcedColors?: null|"active"|"none";
@@ -17357,8 +17534,8 @@ export interface BrowserContextOptions {
ignoreHTTPSErrors?: boolean;
/**
- * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported
- * in Firefox.
+ * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not
+ * supported in Firefox.
*/
isMobile?: boolean;
@@ -17368,8 +17545,8 @@ export interface BrowserContextOptions {
javaScriptEnabled?: boolean;
/**
- * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
- * request header value as well as number and date formatting rules.
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules.
*/
locale?: string;
@@ -17393,9 +17570,9 @@ export interface BrowserContextOptions {
/**
* Network proxy settings to use with this context.
*
- * > NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all
- * contexts override the proxy, global proxy will be never used and can be any string, for example `launch({ proxy: {
- * server: 'http://per-context' } })`.
+ * > NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If
+ * all contexts override the proxy, global proxy will be never used and can be any string, for example `launch({
+ * proxy: { server: 'http://per-context' } })`.
*/
proxy?: {
/**
@@ -17421,23 +17598,23 @@ export interface BrowserContextOptions {
};
/**
- * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to be
- * saved.
+ * 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()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for the HAR to
+ * be saved.
*/
recordHar?: {
/**
- * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use `content`
- * policy instead.
+ * Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use
+ * `content` policy instead.
*/
omitContent?: boolean;
/**
- * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach`
- * is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content
- * is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for
- * all other file extensions.
+ * Optional setting to control resource content management. If `omit` is specified, content is not persisted. If
+ * `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is
+ * specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output
+ * files and to `embed` for all other file extensions.
*/
content?: "omit"|"embed"|"attach";
@@ -17448,8 +17625,8 @@ export interface BrowserContextOptions {
path: string;
/**
- * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies,
- * security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
+ * When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,
+ * cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.
*/
mode?: "full"|"minimal";
@@ -17462,9 +17639,10 @@ export interface BrowserContextOptions {
};
/**
- * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make
- * sure to await [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for
- * videos to be saved.
+ * Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.
+ * Make sure to await
+ * [browserContext.close()](https://playwright.dev/docs/api/class-browsercontext#browser-context-close) for videos to
+ * be saved.
*/
recordVideo?: {
/**
@@ -17473,9 +17651,9 @@ export interface BrowserContextOptions {
dir: string;
/**
- * 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.
+ * 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.
*/
size?: {
/**
@@ -17492,14 +17670,14 @@ export interface BrowserContextOptions {
/**
* Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'no-preference'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
*/
reducedMotion?: null|"reduce"|"no-preference";
/**
- * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport`
- * is set.
+ * Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the
+ * `viewport` is set.
*/
screen?: {
/**
@@ -17515,14 +17693,15 @@ export interface BrowserContextOptions {
/**
* Whether to allow sites to register Service workers. Defaults to `'allow'`.
- * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.
+ * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be
+ * registered.
* - `'block'`: Playwright will block all registration of Service Workers.
*/
serviceWorkers?: "allow"|"block";
/**
- * Populates context with given storage state. This option can be used to initialize context with logged-in information
- * obtained via
+ * Populates context with given storage state. This option can be used to initialize context with logged-in
+ * information obtained via
* [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state).
* Either a path to the file with saved storage, or an object with the following fields:
*/
@@ -17575,9 +17754,9 @@ export interface BrowserContextOptions {
};
/**
- * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
- * that imply single target DOM element will throw when more than one element matches the selector. See [Locator] to learn
- * more about the strict mode.
+ * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on
+ * selectors that imply single target DOM element will throw when more than one element matches the selector. See
+ * [Locator] to learn more about the strict mode.
*/
strictSelectors?: boolean;
@@ -17676,8 +17855,8 @@ export interface LaunchOptions {
args?: Array<string>;
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
+ * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
+ * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
* [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
*/
channel?: string;
@@ -17688,15 +17867,15 @@ export interface LaunchOptions {
chromiumSandbox?: boolean;
/**
- * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless`
- * option will be set `false`.
+ * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the
+ * `headless` option will be set `false`.
*/
devtools?: boolean;
/**
- * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is
- * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in
- * is closed.
+ * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and
+ * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were
+ * created in is closed.
*/
downloadsPath?: string;
@@ -17707,8 +17886,8 @@ export interface LaunchOptions {
/**
* Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is
- * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox
- * or WebKit, use at your own risk.
+ * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,
+ * Firefox or WebKit, use at your own risk.
*/
executablePath?: string;
@@ -17779,13 +17958,14 @@ export interface LaunchOptions {
};
/**
- * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
+ * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
+ * on.
*/
slowMo?: number;
/**
- * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to
- * disable timeout.
+ * Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`
+ * to disable timeout.
*/
timeout?: number;
@@ -17812,14 +17992,14 @@ export interface ConnectOverCDPOptions {
logger?: Logger;
/**
- * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
- * Defaults to 0.
+ * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
+ * on. Defaults to 0.
*/
slowMo?: number;
/**
- * Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to
- * disable timeout.
+ * Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass
+ * `0` to disable timeout.
*/
timeout?: number;
}
@@ -17836,8 +18016,8 @@ export interface ConnectOptions {
logger?: Logger;
/**
- * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
- * Defaults to 0.
+ * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going
+ * on. Defaults to 0.
*/
slowMo?: number;
@@ -17849,8 +18029,8 @@ export interface ConnectOptions {
export interface LocatorScreenshotOptions {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -17859,14 +18039,14 @@ export interface LocatorScreenshotOptions {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -17877,9 +18057,9 @@ export interface LocatorScreenshotOptions {
omitBackground?: boolean;
/**
- * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative
- * path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to
- * the disk.
+ * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a
+ * relative path, then it is resolved relative to the current working directory. If no path is provided, the image
+ * won't be saved to the disk.
*/
path?: string;
@@ -17889,17 +18069,17 @@ export interface LocatorScreenshotOptions {
quality?: number;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"device"`.
*/
scale?: "css"|"device";
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -17916,10 +18096,10 @@ interface ElementHandleWaitForSelectorOptions {
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
* - `'detached'` - wait for element to not be present in DOM.
- * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
- * any content or with `display:none` has an empty bounding box and is not considered visible.
- * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
- * This is opposite to the `'visible'` option.
+ * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element
+ * without any content or with `display:none` has an empty bounding box and is not considered visible.
+ * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or
+ * `visibility:hidden`. This is opposite to the `'visible'` option.
*/
state?: "attached"|"detached"|"visible"|"hidden";
@@ -17930,8 +18110,8 @@ interface ElementHandleWaitForSelectorOptions {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -17964,10 +18144,10 @@ interface PageWaitForSelectorOptions {
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
* - `'detached'` - wait for element to not be present in DOM.
- * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
- * any content or with `display:none` has an empty bounding box and is not considered visible.
- * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
- * This is opposite to the `'visible'` option.
+ * - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element
+ * without any content or with `display:none` has an empty bounding box and is not considered visible.
+ * - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or
+ * `visibility:hidden`. This is opposite to the `'visible'` option.
*/
state?: "attached"|"detached"|"visible"|"hidden";
@@ -17978,8 +18158,8 @@ interface PageWaitForSelectorOptions {
strict?: boolean;
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
@@ -17988,14 +18168,15 @@ interface PageWaitForSelectorOptions {
interface PageWaitForFunctionOptions {
/**
- * If `polling` is `'raf'`, then `pageFunction` is constantly executed in `requestAnimationFrame` callback. If `polling` is
- * a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to `raf`.
+ * If `polling` is `'raf'`, then `pageFunction` is constantly executed in `requestAnimationFrame` callback. If
+ * `polling` is a number, then it is treated as an interval in milliseconds at which the function would be executed.
+ * Defaults to `raf`.
*/
polling?: number|"raf";
/**
- * maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
- * value can be changed by using the
+ * maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The
+ * default value can be changed by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout).
*/
timeout?: number;
@@ -18003,8 +18184,8 @@ interface PageWaitForFunctionOptions {
export interface PageScreenshotOptions {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -18013,8 +18194,8 @@ export interface PageScreenshotOptions {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
@@ -18050,8 +18231,8 @@ export interface PageScreenshotOptions {
fullPage?: boolean;
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -18062,9 +18243,9 @@ export interface PageScreenshotOptions {
omitBackground?: boolean;
/**
- * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative
- * path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to
- * the disk.
+ * The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a
+ * relative path, then it is resolved relative to the current working directory. If no path is provided, the image
+ * won't be saved to the disk.
*/
path?: string;
@@ -18074,17 +18255,17 @@ export interface PageScreenshotOptions {
quality?: number;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"device"`.
*/
scale?: "css"|"device";
/**
- * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
- * using the
+ * Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed
+ * by using the
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout) methods.
*/
diff --git a/packages/playwright-test/types/test.d.ts b/packages/playwright-test/types/test.d.ts
index e61b28b00f..a23101d428 100644
--- a/packages/playwright-test/types/test.d.ts
+++ b/packages/playwright-test/types/test.d.ts
@@ -32,15 +32,16 @@ export type ReporterDescription =
type UseOptions<TestArgs, WorkerArgs> = { [K in keyof WorkerArgs]?: WorkerArgs[K] } & { [K in keyof TestArgs]?: TestArgs[K] };
/**
- * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in multiple
- * configurations. For example, consider running tests against multiple browsers.
+ * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in
+ * multiple configurations. For example, consider running tests against multiple browsers.
*
* `TestProject` encapsulates configuration specific to a single project. Projects are configured in
* [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects) specified in the
- * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of [TestProject] are available in the top-level
- * [TestConfig], in which case they are shared between all projects.
+ * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of [TestProject] are available in the
+ * top-level [TestConfig], in which case they are shared between all projects.
*
- * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile versions.
+ * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile
+ * versions.
*
* ```js
* // playwright.config.ts
@@ -93,8 +94,8 @@ type UseOptions<TestArgs, WorkerArgs> = { [K in keyof WorkerArgs]?: WorkerArgs[K
export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
/**
* Options for all tests in this project, for example
- * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more about
- * [configuration](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
+ * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more
+ * about [configuration](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
*
* ```js
* // playwright.config.ts
@@ -113,22 +114,23 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
* export default config;
* ```
*
- * Use [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) to change this option for all
- * projects.
+ * Use [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) to change this option for
+ * all projects.
*/
use?: UseOptions<TestArgs, WorkerArgs>;
}
/**
- * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in multiple
- * configurations. For example, consider running tests against multiple browsers.
+ * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in
+ * multiple configurations. For example, consider running tests against multiple browsers.
*
* `TestProject` encapsulates configuration specific to a single project. Projects are configured in
* [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects) specified in the
- * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of [TestProject] are available in the top-level
- * [TestConfig], in which case they are shared between all projects.
+ * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of [TestProject] are available in the
+ * top-level [TestConfig], in which case they are shared between all projects.
*
- * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile versions.
+ * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile
+ * versions.
*
* ```js
* // playwright.config.ts
@@ -180,16 +182,17 @@ export interface Project<TestArgs = {}, WorkerArgs = {}> extends TestProject {
*/
export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
/**
- * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run
- * tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
+ * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
+ * run tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g`
+ * option.
*
* `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
*/
grep: RegExp | RegExp[];
/**
* Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of
- * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally and in
- * the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
+ * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally
+ * and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
*
* `grepInvert` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
*/
@@ -211,8 +214,8 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
* [testInfo.snapshotPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path).
*
* This path will serve as the base directory for each test file snapshot directory. Setting `snapshotDir` to
- * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir) would
- * resolve to `snapshots/a.spec.js-snapshots`.
+ * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir)
+ * would resolve to `snapshots/a.spec.js-snapshots`.
*/
snapshotDir: string;
/**
@@ -225,8 +228,8 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
* [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path).
*
* Here is an example that uses
- * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to create a
- * temporary file.
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to
+ * create a temporary file.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -245,25 +248,26 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
/**
* The number of times to repeat each test, useful for debugging flaky tests.
*
- * Use [testConfig.repeatEach](https://playwright.dev/docs/api/class-testconfig#test-config-repeat-each) to change this
- * option for all projects.
+ * Use [testConfig.repeatEach](https://playwright.dev/docs/api/class-testconfig#test-config-repeat-each) to change
+ * this option for all projects.
*/
repeatEach: number;
/**
- * The maximum number of retry attempts given to failed tests. Learn more about [test retries](https://playwright.dev/docs/test-retries#retries).
+ * The maximum number of retry attempts given to failed tests. Learn more about
+ * [test retries](https://playwright.dev/docs/test-retries#retries).
*
- * Use [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) to change
- * the number of retries for a specific file or a group of tests.
+ * Use [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) to
+ * change the number of retries for a specific file or a group of tests.
*
- * Use [testConfig.retries](https://playwright.dev/docs/api/class-testconfig#test-config-retries) to change this option for
- * all projects.
+ * Use [testConfig.retries](https://playwright.dev/docs/api/class-testconfig#test-config-retries) to change this
+ * option for all projects.
*/
retries: number;
/**
* Directory that will be recursively scanned for test files. Defaults to the directory of the configuration file.
*
- * Each project can use a different directory. Here is an example that runs smoke tests in three browsers and all other
- * tests in stable Chrome browser.
+ * Each project can use a different directory. Here is an example that runs smoke tests in three browsers and all
+ * other tests in stable Chrome browser.
*
* ```js
* // playwright.config.ts
@@ -305,23 +309,23 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
* export default config;
* ```
*
- * Use [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) to change this option
- * for all projects.
+ * Use [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) to change this
+ * option for all projects.
*/
testDir: string;
/**
- * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute file
- * path. Strings are treated as glob patterns.
+ * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute
+ * file path. Strings are treated as glob patterns.
*
* For example, `'**\/test-assets/**'` will ignore any files in the `test-assets` directory.
*
- * Use [testConfig.testIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-test-ignore) to change this
- * option for all projects.
+ * Use [testConfig.testIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-test-ignore) to change
+ * this option for all projects.
*/
testIgnore: string | RegExp | (string | RegExp)[];
/**
- * Only the files matching one of these patterns are executed as test files. Matching is performed against the absolute
- * file path. Strings are treated as glob patterns.
+ * Only the files matching one of these patterns are executed as test files. Matching is performed against the
+ * absolute file path. Strings are treated as glob patterns.
*
* By default, Playwright Test looks for files matching `.*(test|spec)\.(js|ts|mjs)`.
*
@@ -333,18 +337,18 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
* Timeout for each test in milliseconds. Defaults to 30 seconds.
*
* This is a base timeout for all tests. Each test can configure its own timeout with
- * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout). Each file or a group of tests
- * can configure the timeout with
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout). Each file or a group of
+ * tests can configure the timeout with
* [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure).
*
- * Use [testConfig.timeout](https://playwright.dev/docs/api/class-testconfig#test-config-timeout) to change this option for
- * all projects.
+ * Use [testConfig.timeout](https://playwright.dev/docs/api/class-testconfig#test-config-timeout) to change this
+ * option for all projects.
*/
timeout: number;
/**
* Options for all tests in this project, for example
- * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more about
- * [configuration](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
+ * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more
+ * about [configuration](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
*
* ```js
* // playwright.config.ts
@@ -363,8 +367,8 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
* export default config;
* ```
*
- * Use [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) to change this option for all
- * projects.
+ * Use [testConfig.use](https://playwright.dev/docs/api/class-testconfig#test-config-use) to change this option for
+ * all projects.
*/
use: UseOptions<PlaywrightTestOptions & TestArgs, PlaywrightWorkerOptions & WorkerArgs>;
}
@@ -372,12 +376,13 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
type LiteralUnion<T extends U, U = string> = T | (U & { zz_IGNORE_ME?: never });
/**
- * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout` or
- * `testDir`. These options are described in the [TestConfig] object in the [configuration file](https://playwright.dev/docs/test-configuration).
+ * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout`
+ * or `testDir`. These options are described in the [TestConfig] object in the
+ * [configuration file](https://playwright.dev/docs/test-configuration).
*
* Playwright Test supports running multiple test projects at the same time. Project-specific options should be put to
- * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level [TestConfig]
- * can also define base options shared between all projects.
+ * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level
+ * [TestConfig] can also define base options shared between all projects.
*
* ```js
* // playwright.config.ts
@@ -419,21 +424,21 @@ interface TestConfig {
/**
* Launch a development web server (or multiple) during the tests.
*
- * If the port is specified, Playwright Test will wait for it to be available on `127.0.0.1` or `::1`, before running the
- * tests. If the url is specified, Playwright Test will wait for the URL to return a 2xx, 3xx, 400, 401, 402, or 403 status
- * code before running the tests.
+ * If the port is specified, Playwright Test will wait for it to be available on `127.0.0.1` or `::1`, before running
+ * the tests. If the url is specified, Playwright Test will wait for the URL to return a 2xx, 3xx, 400, 401, 402, or
+ * 403 status code before running the tests.
*
- * For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an
- * existing server on the CI. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable.
+ * For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not
+ * use an existing server on the CI. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable.
*
* The `port` (but not the `url`) gets passed over to Playwright as a
- * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). For example port `8080`
- * produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must explicitly configure
- * the `baseURL` (even if it only has one entry).
+ * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). For example port
+ * `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
+ * explicitly configure the `baseURL` (even if it only has one entry).
*
* > NOTE: It is also recommended to specify
- * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so that
- * tests could use relative urls.
+ * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
+ * that tests could use relative urls.
*
* ```js
* // playwright.config.ts
@@ -525,8 +530,8 @@ interface TestConfig {
*/
toHaveScreenshot?: {
/**
- * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
+ * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
*/
threshold?: number;
@@ -536,25 +541,26 @@ interface TestConfig {
maxDiffPixels?: number;
/**
- * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default.
+ * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
*/
maxDiffPixelRatio?: number;
/**
- * See `animations` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults
- * to `"disabled"`.
+ * See `animations` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot).
+ * Defaults to `"disabled"`.
*/
animations?: "allow"|"disabled";
/**
- * See `caret` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to
- * `"hide"`.
+ * See `caret` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults
+ * to `"hide"`.
*/
caret?: "hide"|"initial";
/**
- * See `scale` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to
- * `"css"`.
+ * See `scale` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults
+ * to `"css"`.
*/
scale?: "css"|"device";
};
@@ -566,8 +572,8 @@ interface TestConfig {
*/
toMatchSnapshot?: {
/**
- * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
+ * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
*/
threshold?: number;
@@ -577,7 +583,8 @@ interface TestConfig {
maxDiffPixels?: number;
/**
- * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default.
+ * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
*/
maxDiffPixelRatio?: number;
};
@@ -602,17 +609,17 @@ interface TestConfig {
forbidOnly?: boolean;
/**
- * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the same
- * time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same worker
- * process.
+ * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the
+ * same time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same
+ * worker process.
*
* You can configure entire test run to concurrently execute all tests in all files using this option.
*/
fullyParallel?: boolean;
/**
- * Path to the global setup file. This file will be required and run before all the tests. It must export a single function
- * that takes a [`TestConfig`] argument.
+ * Path to the global setup file. This file will be required and run before all the tests. It must export a single
+ * function that takes a [`TestConfig`] argument.
*
* Learn more about [global setup and teardown](https://playwright.dev/docs/test-advanced#global-setup-and-teardown).
*
@@ -631,7 +638,8 @@ interface TestConfig {
/**
* Path to the global teardown file. This file will be required and run after all the tests. It must export a single
- * function. See also [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup).
+ * function. See also
+ * [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup).
*
* Learn more about [global setup and teardown](https://playwright.dev/docs/test-advanced#global-setup-and-teardown).
*
@@ -649,8 +657,8 @@ interface TestConfig {
globalTeardown?: string;
/**
- * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on CI
- * to prevent broken setup from running too long and wasting resources. Learn more about
+ * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on
+ * CI to prevent broken setup from running too long and wasting resources. Learn more about
* [various timeouts](https://playwright.dev/docs/test-timeouts).
*
* ```js
@@ -667,8 +675,8 @@ interface TestConfig {
globalTimeout?: number;
/**
- * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run
- * tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
+ * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
+ * run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
*
* `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
*/
@@ -690,8 +698,8 @@ interface TestConfig {
ignoreSnapshots?: boolean;
/**
- * The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and exit
- * with an error. Setting to zero (default) disables this behavior.
+ * The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and
+ * exit with an error. Setting to zero (default) disables this behavior.
*
* Also available in the [command line](https://playwright.dev/docs/test-cli) with the `--max-failures` and `-x` options.
*
@@ -733,14 +741,14 @@ interface TestConfig {
* ```
*
* This directory is cleaned at the start. When running a test, a unique subdirectory inside the
- * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir) is created, guaranteeing
- * that test running in parallel do not conflict. This directory can be accessed by
+ * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir) is created,
+ * guaranteeing that test running in parallel do not conflict. This directory can be accessed by
* [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir) and
* [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path).
*
* Here is an example that uses
- * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to create a
- * temporary file.
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to
+ * create a temporary file.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -756,8 +764,8 @@ interface TestConfig {
outputDir?: string;
/**
- * > NOTE: Use of [testConfig.snapshotDir](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-dir) is
- * discouraged. Please use
+ * > NOTE: Use of [testConfig.snapshotDir](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-dir)
+ * is discouraged. Please use
* [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
* to configure snapshot paths.
*
@@ -769,8 +777,8 @@ interface TestConfig {
* [testInfo.snapshotPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path).
*
* This path will serve as the base directory for each test file snapshot directory. Setting `snapshotDir` to
- * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir) would
- * resolve to `snapshots/a.spec.js-snapshots`.
+ * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir)
+ * would resolve to `snapshots/a.spec.js-snapshots`.
*/
snapshotDir?: string;
@@ -817,8 +825,10 @@ interface TestConfig {
* ```
*
* The list of supported tokens:
- * - `{testDir}` - Project's [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir).
- * - Value: `/home/playwright/tests` (absolute path is since `testDir` is resolved relative to directory with config)
+ * - `{testDir}` - Project's
+ * [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir).
+ * - Value: `/home/playwright/tests` (absolute path is since `testDir` is resolved relative to directory with
+ * config)
* - `{snapshotDir}` - Project's
* [testConfig.snapshotDir](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-dir).
* - Value: `/home/playwright/tests` (since `snapshotDir` is not provided in config, it defaults to `testDir`)
@@ -871,7 +881,8 @@ interface TestConfig {
/**
* Whether to preserve test output in the
- * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir). Defaults to `'always'`.
+ * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir). Defaults to
+ * `'always'`.
* - `'always'` - preserve output for all tests;
* - `'never'` - do not preserve output for any tests;
* - `'failures-only'` - only preserve output for failed tests.
@@ -896,8 +907,8 @@ interface TestConfig {
/**
* Whether to report slow test files. Pass `null` to disable this feature.
*
- * Test files that took more than `threshold` milliseconds are considered slow, and the slowest ones are reported, no more
- * than `max` number of them. Passing zero as `max` reports all test files that exceed the threshold.
+ * Test files that took more than `threshold` milliseconds are considered slow, and the slowest ones are reported, no
+ * more than `max` number of them. Passing zero as `max` reports all test files that exceed the threshold.
*/
reportSlowTests?: null|{
/**
@@ -912,8 +923,8 @@ interface TestConfig {
};
/**
- * The maximum number of retry attempts given to failed tests. By default failing tests are not retried. Learn more about
- * [test retries](https://playwright.dev/docs/test-retries#retries).
+ * The maximum number of retry attempts given to failed tests. By default failing tests are not retried. Learn more
+ * about [test retries](https://playwright.dev/docs/test-retries#retries).
*
* ```js
* // playwright.config.ts
@@ -962,8 +973,8 @@ interface TestConfig {
testDir?: string;
/**
- * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute file
- * path. Strings are treated as glob patterns.
+ * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute
+ * file path. Strings are treated as glob patterns.
*
* For example, `'**\/test-assets/**'` will ignore any files in the `test-assets` directory.
*
@@ -981,8 +992,8 @@ interface TestConfig {
testIgnore?: string|RegExp|Array<string|RegExp>;
/**
- * Only the files matching one of these patterns are executed as test files. Matching is performed against the absolute
- * file path. Strings are treated as glob patterns.
+ * Only the files matching one of these patterns are executed as test files. Matching is performed against the
+ * absolute file path. Strings are treated as glob patterns.
*
* By default, Playwright Test looks for files matching `.*(test|spec)\.(js|ts|mjs)`.
*
@@ -1035,11 +1046,11 @@ interface TestConfig {
* The maximum number of concurrent worker processes to use for parallelizing tests. Can also be set as percentage of
* logical CPU cores, e.g. `'50%'.`
*
- * Playwright Test uses worker processes to run tests. There is always at least one worker process, but more can be used to
- * speed up test execution.
+ * Playwright Test uses worker processes to run tests. There is always at least one worker process, but more can be
+ * used to speed up test execution.
*
- * Defaults to half of the number of logical CPU cores. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
- * with Playwright Test.
+ * Defaults to half of the number of logical CPU cores. Learn more about
+ * [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
*
* ```js
* // playwright.config.ts
@@ -1055,12 +1066,13 @@ interface TestConfig {
workers?: number|string;}
/**
- * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout` or
- * `testDir`. These options are described in the [TestConfig] object in the [configuration file](https://playwright.dev/docs/test-configuration).
+ * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout`
+ * or `testDir`. These options are described in the [TestConfig] object in the
+ * [configuration file](https://playwright.dev/docs/test-configuration).
*
* Playwright Test supports running multiple test projects at the same time. Project-specific options should be put to
- * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level [TestConfig]
- * can also define base options shared between all projects.
+ * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level
+ * [TestConfig] can also define base options shared between all projects.
*
* ```js
* // playwright.config.ts
@@ -1083,8 +1095,8 @@ export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig {
projects?: Project<TestArgs, WorkerArgs>[];
/**
* Global options for all tests, for example
- * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more about
- * [configuration](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
+ * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more
+ * about [configuration](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
*
* ```js
* // playwright.config.ts
@@ -1105,12 +1117,13 @@ export interface Config<TestArgs = {}, WorkerArgs = {}> extends TestConfig {
export type Metadata = { [key: string]: any };
/**
- * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout` or
- * `testDir`. These options are described in the [TestConfig] object in the [configuration file](https://playwright.dev/docs/test-configuration).
+ * Playwright Test provides many options to configure how your tests are collected and executed, for example `timeout`
+ * or `testDir`. These options are described in the [TestConfig] object in the
+ * [configuration file](https://playwright.dev/docs/test-configuration).
*
* Playwright Test supports running multiple test projects at the same time. Project-specific options should be put to
- * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level [TestConfig]
- * can also define base options shared between all projects.
+ * [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects), but top-level
+ * [TestConfig] can also define base options shared between all projects.
*
* ```js
* // playwright.config.ts
@@ -1145,16 +1158,16 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/
forbidOnly: boolean;
/**
- * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the same
- * time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same worker
- * process.
+ * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the
+ * same time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same
+ * worker process.
*
* You can configure entire test run to concurrently execute all tests in all files using this option.
*/
fullyParallel: boolean;
/**
- * Path to the global setup file. This file will be required and run before all the tests. It must export a single function
- * that takes a [`TestConfig`] argument.
+ * Path to the global setup file. This file will be required and run before all the tests. It must export a single
+ * function that takes a [`TestConfig`] argument.
*
* Learn more about [global setup and teardown](https://playwright.dev/docs/test-advanced#global-setup-and-teardown).
*
@@ -1172,7 +1185,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
globalSetup: string | null;
/**
* Path to the global teardown file. This file will be required and run after all the tests. It must export a single
- * function. See also [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup).
+ * function. See also
+ * [testConfig.globalSetup](https://playwright.dev/docs/api/class-testconfig#test-config-global-setup).
*
* Learn more about [global setup and teardown](https://playwright.dev/docs/test-advanced#global-setup-and-teardown).
*
@@ -1189,8 +1203,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/
globalTeardown: string | null;
/**
- * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on CI
- * to prevent broken setup from running too long and wasting resources. Learn more about
+ * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on
+ * CI to prevent broken setup from running too long and wasting resources. Learn more about
* [various timeouts](https://playwright.dev/docs/test-timeouts).
*
* ```js
@@ -1206,8 +1220,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/
globalTimeout: number;
/**
- * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run
- * tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
+ * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
+ * run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
*
* `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
*/
@@ -1221,8 +1235,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/
grepInvert: RegExp | RegExp[] | null;
/**
- * The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and exit
- * with an error. Setting to zero (default) disables this behavior.
+ * The maximum number of test failures for the whole test suite run. After reaching this number, testing will stop and
+ * exit with an error. Setting to zero (default) disables this behavior.
*
* Also available in the [command line](https://playwright.dev/docs/test-cli) with the `--max-failures` and `-x` options.
*
@@ -1245,7 +1259,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
version: string;
/**
* Whether to preserve test output in the
- * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir). Defaults to `'always'`.
+ * [testConfig.outputDir](https://playwright.dev/docs/api/class-testconfig#test-config-output-dir). Defaults to
+ * `'always'`.
* - `'always'` - preserve output for all tests;
* - `'never'` - do not preserve output for any tests;
* - `'failures-only'` - only preserve output for failed tests.
@@ -1280,8 +1295,8 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* Whether to report slow test files. Pass `null` to disable this feature.
*
- * Test files that took more than `threshold` milliseconds are considered slow, and the slowest ones are reported, no more
- * than `max` number of them. Passing zero as `max` reports all test files that exceed the threshold.
+ * Test files that took more than `threshold` milliseconds are considered slow, and the slowest ones are reported, no
+ * more than `max` number of them. Passing zero as `max` reports all test files that exceed the threshold.
*/
reportSlowTests: { max: number, threshold: number } | null;
rootDir: string;
@@ -1310,11 +1325,11 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
* The maximum number of concurrent worker processes to use for parallelizing tests. Can also be set as percentage of
* logical CPU cores, e.g. `'50%'.`
*
- * Playwright Test uses worker processes to run tests. There is always at least one worker process, but more can be used to
- * speed up test execution.
+ * Playwright Test uses worker processes to run tests. There is always at least one worker process, but more can be
+ * used to speed up test execution.
*
- * Defaults to half of the number of logical CPU cores. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
- * with Playwright Test.
+ * Defaults to half of the number of logical CPU cores. Learn more about
+ * [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
*
* ```js
* // playwright.config.ts
@@ -1331,21 +1346,21 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
/**
* Launch a development web server (or multiple) during the tests.
*
- * If the port is specified, Playwright Test will wait for it to be available on `127.0.0.1` or `::1`, before running the
- * tests. If the url is specified, Playwright Test will wait for the URL to return a 2xx, 3xx, 400, 401, 402, or 403 status
- * code before running the tests.
+ * If the port is specified, Playwright Test will wait for it to be available on `127.0.0.1` or `::1`, before running
+ * the tests. If the url is specified, Playwright Test will wait for the URL to return a 2xx, 3xx, 400, 401, 402, or
+ * 403 status code before running the tests.
*
- * For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an
- * existing server on the CI. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable.
+ * For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not
+ * use an existing server on the CI. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable.
*
* The `port` (but not the `url`) gets passed over to Playwright as a
- * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). For example port `8080`
- * produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must explicitly configure
- * the `baseURL` (even if it only has one entry).
+ * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url). For example port
+ * `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
+ * explicitly configure the `baseURL` (even if it only has one entry).
*
* > NOTE: It is also recommended to specify
- * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so that
- * tests could use relative urls.
+ * [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
+ * that tests could use relative urls.
*
* ```js
* // playwright.config.ts
@@ -1435,12 +1450,12 @@ export interface WorkerInfo {
*/
project: FullProject;
/**
- * The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have a
- * different `parallelIndex`. When a worker is restarted, for example after a failure, the new worker process has the same
- * `parallelIndex`.
+ * The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have
+ * a different `parallelIndex`. When a worker is restarted, for example after a failure, the new worker process has
+ * the same `parallelIndex`.
*
- * Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
- * with Playwright Test.
+ * Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about
+ * [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
*/
parallelIndex: number;
@@ -1448,8 +1463,8 @@ export interface WorkerInfo {
* The unique index of the worker process that is running the test. When a worker is restarted, for example after a
* failure, the new worker process gets a new unique `workerIndex`.
*
- * Also available as `process.env.TEST_WORKER_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel) with
- * Playwright Test.
+ * Also available as `process.env.TEST_WORKER_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
+ * with Playwright Test.
*/
workerIndex: number;}
@@ -1457,8 +1472,8 @@ export interface WorkerInfo {
* `TestInfo` contains information about currently running test. It is available to any test function,
* [test.beforeEach(hookFunction)](https://playwright.dev/docs/api/class-test#test-before-each) and
* [test.afterEach(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-each) hooks and test-scoped
- * fixtures. `TestInfo` provides utilities to control test execution: attach files, update test timeout, determine which
- * test is currently running and whether it was retried, etc.
+ * fixtures. `TestInfo` provides utilities to control test execution: attach files, update test timeout, determine
+ * which test is currently running and whether it was retried, etc.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -1481,8 +1496,8 @@ export interface TestInfo {
project: FullProject;
/**
* The list of annotations applicable to the current test. Includes annotations from the test, annotations from all
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) groups the test belongs to
- * and file-level annotations for the test file.
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) groups the test
+ * belongs to and file-level annotations for the test file.
*
* Learn more about [test annotations](https://playwright.dev/docs/test-annotations).
*/
@@ -1502,8 +1517,8 @@ export interface TestInfo {
* The list of files or buffers attached to the current test. Some reporters show test attachments.
*
* To add an attachment, use
- * [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach) instead of directly
- * pushing onto this array.
+ * [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach) instead of
+ * directly pushing onto this array.
*/
attachments: Array<{
/**
@@ -1512,7 +1527,8 @@ export interface TestInfo {
name: string;
/**
- * Content type of this attachment to properly present in the report, for example `'application/json'` or `'image/png'`.
+ * Content type of this attachment to properly present in the report, for example `'application/json'` or
+ * `'image/png'`.
*/
contentType: string;
@@ -1528,8 +1544,8 @@ export interface TestInfo {
}>;
/**
- * Attach a value or a file from disk to the current test. Some reporters show test attachments. Either `path` or `body`
- * must be specified, but not both.
+ * Attach a value or a file from disk to the current test. Some reporters show test attachments. Either `path` or
+ * `body` must be specified, but not both.
*
* For example, you can attach a screenshot to the test:
*
@@ -1556,8 +1572,8 @@ export interface TestInfo {
* ```
*
* > NOTE: [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach)
- * automatically takes care of copying attached files to a location that is accessible to reporters. You can safely remove
- * the attachment after awaiting the attach call.
+ * automatically takes care of copying attached files to a location that is accessible to reporters. You can safely
+ * remove the attachment after awaiting the attach call.
* @param name Attachment name. The name will also be sanitized and used as the prefix of file name when saving to disk.
* @param options
*/
@@ -1568,9 +1584,9 @@ export interface TestInfo {
body?: string|Buffer;
/**
- * Content type of this attachment to properly present in the report, for example `'application/json'` or `'image/png'`. If
- * omitted, content type is inferred based on the `path`, or defaults to `text/plain` for [string] attachments and
- * `application/octet-stream` for [Buffer] attachments.
+ * Content type of this attachment to properly present in the report, for example `'application/json'` or
+ * `'image/png'`. If omitted, content type is inferred based on the `path`, or defaults to `text/plain` for [string]
+ * attachments and `application/octet-stream` for [Buffer] attachments.
*/
contentType?: string;
@@ -1586,8 +1602,9 @@ export interface TestInfo {
column: number;
/**
- * The number of milliseconds the test took to finish. Always zero before the test finishes, either successfully or not.
- * Can be used in [test.afterEach(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-each) hook.
+ * The number of milliseconds the test took to finish. Always zero before the test finishes, either successfully or
+ * not. Can be used in [test.afterEach(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-each)
+ * hook.
*/
duration: number;
@@ -1605,7 +1622,8 @@ export interface TestInfo {
/**
* Expected status for the currently running test. This is usually `'passed'`, except for a few cases:
* - `'skipped'` for skipped tests, e.g. with [test.skip()](https://playwright.dev/docs/api/class-test#test-skip-2);
- * - `'failed'` for tests marked as failed with [test.fail()](https://playwright.dev/docs/api/class-test#test-fail-1).
+ * - `'failed'` for tests marked as failed with
+ * [test.fail()](https://playwright.dev/docs/api/class-test#test-fail-1).
*
* Expected status is usually compared with the actual
* [testInfo.status](https://playwright.dev/docs/api/class-testinfo#test-info-status):
@@ -1624,8 +1642,8 @@ export interface TestInfo {
/**
* Marks the currently running test as "should fail". Playwright Test runs this test and ensures that it is actually
- * failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is fixed.
- * This is similar to [test.fail()](https://playwright.dev/docs/api/class-test#test-fail-1).
+ * failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is
+ * fixed. This is similar to [test.fail()](https://playwright.dev/docs/api/class-test#test-fail-1).
*/
fail(): void;
@@ -1667,8 +1685,8 @@ export interface TestInfo {
line: number;
/**
- * Absolute path to the snapshot output directory for this specific test. Each test suite gets its own directory so they
- * cannot conflict.
+ * Absolute path to the snapshot output directory for this specific test. Each test suite gets its own directory so
+ * they cannot conflict.
*
* This property does not account for the
* [testProject.snapshotPathTemplate](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template)
@@ -1677,15 +1695,15 @@ export interface TestInfo {
snapshotDir: string;
/**
- * Absolute path to the output directory for this specific test run. Each test run gets its own directory so they cannot
- * conflict.
+ * Absolute path to the output directory for this specific test run. Each test run gets its own directory so they
+ * cannot conflict.
*/
outputDir: string;
/**
* Returns a path inside the [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir)
- * where the test can safely put a temporary file. Guarantees that tests running in parallel will not interfere with each
- * other.
+ * where the test can safely put a temporary file. Guarantees that tests running in parallel will not interfere with
+ * each other.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -1697,35 +1715,35 @@ export interface TestInfo {
* });
* ```
*
- * > Note that `pathSegments` accepts path segments to the test output directory such as `testInfo.outputPath('relative',
- * 'path', 'to', 'output')`.
+ * > Note that `pathSegments` accepts path segments to the test output directory such as
+ * `testInfo.outputPath('relative', 'path', 'to', 'output')`.
* > However, this path must stay within the
- * [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir) directory for each test (i.e.
- * `test-results/a-test-title`), otherwise it will throw.
+ * [testInfo.outputDir](https://playwright.dev/docs/api/class-testinfo#test-info-output-dir) directory for each test
+ * (i.e. `test-results/a-test-title`), otherwise it will throw.
* @param pathSegments Path segments to append at the end of the resulting path.
*/
outputPath(...pathSegments: Array<string>): string;
/**
- * The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have a
- * different `parallelIndex`. When a worker is restarted, for example after a failure, the new worker process has the same
- * `parallelIndex`.
+ * The index of the worker between `0` and `workers - 1`. It is guaranteed that workers running at the same time have
+ * a different `parallelIndex`. When a worker is restarted, for example after a failure, the new worker process has
+ * the same `parallelIndex`.
*
- * Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
- * with Playwright Test.
+ * Also available as `process.env.TEST_PARALLEL_INDEX`. Learn more about
+ * [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
*/
parallelIndex: number;
/**
- * Specifies a unique repeat index when running in "repeat each" mode. This mode is enabled by passing `--repeat-each` to
- * the [command line](https://playwright.dev/docs/test-cli).
+ * Specifies a unique repeat index when running in "repeat each" mode. This mode is enabled by passing `--repeat-each`
+ * to the [command line](https://playwright.dev/docs/test-cli).
*/
repeatEachIndex: number;
/**
* Specifies the retry number when the test is retried after a failure. The first test run has
- * [testInfo.retry](https://playwright.dev/docs/api/class-testinfo#test-info-retry) equal to zero, the first retry has it
- * equal to one, and so on. Learn more about [retries](https://playwright.dev/docs/test-retries#retries).
+ * [testInfo.retry](https://playwright.dev/docs/api/class-testinfo#test-info-retry) equal to zero, the first retry has
+ * it equal to one, and so on. Learn more about [retries](https://playwright.dev/docs/test-retries#retries).
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -1751,8 +1769,8 @@ export interface TestInfo {
* Changes the timeout for the currently running test. Zero means no timeout. Learn more about
* [various timeouts](https://playwright.dev/docs/test-timeouts).
*
- * Timeout is usually specified in the [configuration file](https://playwright.dev/docs/test-configuration), but it could be useful to change the
- * timeout in certain scenarios:
+ * Timeout is usually specified in the [configuration file](https://playwright.dev/docs/test-configuration), but it could be useful to
+ * change the timeout in certain scenarios:
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -1797,26 +1815,27 @@ export interface TestInfo {
slow(condition: boolean, description?: string): void;
/**
- * Returns a path to a snapshot file with the given `pathSegments`. Learn more about [snapshots](https://playwright.dev/docs/test-snapshots).
+ * Returns a path to a snapshot file with the given `pathSegments`. Learn more about
+ * [snapshots](https://playwright.dev/docs/test-snapshots).
*
- * > Note that `pathSegments` accepts path segments to the snapshot file such as `testInfo.snapshotPath('relative', 'path',
- * 'to', 'snapshot.png')`.
- * > However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`), otherwise
- * it will throw.
+ * > Note that `pathSegments` accepts path segments to the snapshot file such as `testInfo.snapshotPath('relative',
+ * 'path', 'to', 'snapshot.png')`.
+ * > However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`),
+ * otherwise it will throw.
* @param pathSegments The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the same test file are expected to be the same.
*/
snapshotPath(...pathSegments: Array<string>): string;
/**
- * > NOTE: Use of [testInfo.snapshotSuffix](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-suffix) is
- * discouraged. Please use
+ * > NOTE: Use of [testInfo.snapshotSuffix](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-suffix)
+ * is discouraged. Please use
* [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
* to configure snapshot paths.
*
- * Suffix used to differentiate snapshots between multiple test configurations. For example, if snapshots depend on the
- * platform, you can set `testInfo.snapshotSuffix` equal to `process.platform`. In this case
- * `expect(value).toMatchSnapshot(snapshotName)` will use different snapshots depending on the platform. Learn more about
- * [snapshots](https://playwright.dev/docs/test-snapshots).
+ * Suffix used to differentiate snapshots between multiple test configurations. For example, if snapshots depend on
+ * the platform, you can set `testInfo.snapshotSuffix` equal to `process.platform`. In this case
+ * `expect(value).toMatchSnapshot(snapshotName)` will use different snapshots depending on the platform. Learn more
+ * about [snapshots](https://playwright.dev/docs/test-snapshots).
*/
snapshotSuffix: string;
@@ -1886,8 +1905,8 @@ export interface TestInfo {
* The unique index of the worker process that is running the test. When a worker is restarted, for example after a
* failure, the new worker process gets a new unique `workerIndex`.
*
- * Also available as `process.env.TEST_WORKER_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel) with
- * Playwright Test.
+ * Also available as `process.env.TEST_WORKER_INDEX`. Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel)
+ * with Playwright Test.
*/
workerIndex: number;}
@@ -1908,8 +1927,8 @@ interface SuiteFunction {
* ```
*
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in this
- * callback will belong to the group.
+ * @param callback A callback that is run immediately when calling [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
+ * this callback will belong to the group.
*/
(title: string, callback: () => void): void;
/**
@@ -1930,8 +1949,8 @@ interface SuiteFunction {
* });
* ```
*
- * @param callback A callback that is run immediately when calling [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this callback
- * will belong to the group.
+ * @param callback A callback that is run immediately when calling [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this
+ * callback will belong to the group.
*/
(callback: () => void): void;
}
@@ -1941,8 +1960,8 @@ interface TestFunction<TestArgs> {
}
/**
- * Playwright Test provides a `test` function to declare tests and [`expect` function](https://jestjs.io/docs/expect) to
- * write assertions.
+ * Playwright Test provides a `test` function to declare tests and [`expect` function](https://jestjs.io/docs/expect)
+ * to write assertions.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -1985,12 +2004,13 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* ```
*
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in this
- * callback will belong to the group.
+ * @param callback A callback that is run immediately when calling [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
+ * this callback will belong to the group.
*/
describe: SuiteFunction & {
/**
- * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing else.
+ * Declares a focused group of tests. If there are some focused tests or suites, all of them will be run but nothing
+ * else.
*
* ```js
* test.describe.only('focused group', () => {
@@ -2004,14 +2024,14 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* ```
*
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests added in
- * this callback will belong to the group.
+ * @param callback A callback that is run immediately when calling [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests
+ * added in this callback will belong to the group.
*/
only: SuiteFunction;
/**
* Declares a skipped test group, similarly to
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in the skipped group
- * are never run.
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in the skipped
+ * group are never run.
*
* ```js
* test.describe.skip('skipped group', () => {
@@ -2022,14 +2042,14 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* ```
*
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests added in
- * this callback will belong to the group, and will not be run.
+ * @param callback A callback that is run immediately when calling [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests
+ * added in this callback will belong to the group, and will not be run.
*/
skip: SuiteFunction;
/**
* Declares a test group similarly to
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in this group are
- * marked as "fixme" and will not be executed.
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Tests in this group
+ * are marked as "fixme" and will not be executed.
*
* ```js
* test.describe.fixme('broken tests', () => {
@@ -2040,16 +2060,17 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* ```
*
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests added
- * in this callback will belong to the group, and will not be run.
+ * @param callback A callback that is run immediately when calling [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests
+ * added in this callback will belong to the group, and will not be run.
*/
fixme: SuiteFunction;
/**
* Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
* skipped. All tests in a group are retried together.
*
- * > NOTE: See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
- * the preferred way of configuring the execution mode.
+ * > NOTE: See
+ * [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for the
+ * preferred way of configuring the execution mode.
* > NOTE: Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
* independently.
*
@@ -2066,9 +2087,9 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
*/
serial: SuiteFunction & {
/**
- * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent tests
- * are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of them will be
- * run but nothing else.
+ * Declares a focused group of tests that should always be run serially. If one of the tests fails, all subsequent
+ * tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
+ * them will be run but nothing else.
*
* > NOTE: Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
* independently.
@@ -2083,18 +2104,20 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* ```
*
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only). Any
- * tests added in this callback will belong to the group.
+ * @param callback A callback that is run immediately when calling [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
+ * Any tests added in this callback will belong to the group.
*/
only: SuiteFunction;
};
/**
- * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after another,
- * but using [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel)
- * allows them to run in parallel.
+ * Declares a group of tests that could be run in parallel. By default, tests in a single test file run one after
+ * another, but using
+ * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel) allows
+ * them to run in parallel.
*
- * > NOTE: See [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for
- * the preferred way of configuring the execution mode.
+ * > NOTE: See
+ * [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for the
+ * preferred way of configuring the execution mode.
*
* ```js
* test.describe.parallel('group', () => {
@@ -2103,11 +2126,11 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* });
* ```
*
- * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of the
- * parallel tests executes all relevant hooks.
+ * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
+ * the parallel tests executes all relevant hooks.
* @param title Group title.
- * @param callback A callback that is run immediately when calling [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any tests
- * added in this callback will belong to the group.
+ * @param callback A callback that is run immediately when calling [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any
+ * tests added in this callback will belong to the group.
*/
parallel: SuiteFunction & {
/**
@@ -2121,8 +2144,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
only: SuiteFunction;
};
/**
- * Configures the enclosing scope. Can be executed either on the top level or inside a describe. Configuration applies to
- * the entire scope, regardless of whether it run before or after the test declaration.
+ * Configures the enclosing scope. Can be executed either on the top level or inside a describe. Configuration applies
+ * to the entire scope, regardless of whether it run before or after the test declaration.
*
* Learn more about the execution modes [here](https://playwright.dev/docs/test-parallel).
*
@@ -2159,7 +2182,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
};
/**
* Declares a skipped test, similarly to
- * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call). Skipped test is never run.
+ * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call). Skipped test is never
+ * run.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2254,7 +2278,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
skip(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
/**
* Declares a test to be fixed, similarly to
- * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call). This test will not be run.
+ * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call). This test will not be
+ * run.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2281,8 +2306,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* });
* ```
*
- * Mark all tests in a file or [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1)
- * group as "fixme".
+ * Mark all tests in a file or
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group as "fixme".
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2337,8 +2362,9 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
*/
fixme(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
/**
- * Unconditonally marks a test as "should fail". Playwright Test runs this test and ensures that it is actually failing.
- * This is useful for documentation purposes to acknowledge that some functionality is broken until it is fixed.
+ * Unconditonally marks a test as "should fail". Playwright Test runs this test and ensures that it is actually
+ * failing. This is useful for documentation purposes to acknowledge that some functionality is broken until it is
+ * fixed.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2369,7 +2395,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
fail(condition: boolean, description?: string): void;
/**
* Conditionally mark all tests in a file or
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group as "should fail".
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group as "should
+ * fail".
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2401,11 +2428,13 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* ```
*
* > NOTE: [test.slow()](https://playwright.dev/docs/api/class-test#test-slow-1) cannot be used in a `beforeAll` or
- * `afterAll` hook. Use [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout) instead.
+ * `afterAll` hook. Use [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout)
+ * instead.
*/
slow(): void;
/**
- * Conditionally mark a test as "slow" with an optional description. Slow test will be given triple the default timeout.
+ * Conditionally mark a test as "slow" with an optional description. Slow test will be given triple the default
+ * timeout.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2422,8 +2451,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
slow(condition: boolean, description?: string): void;
/**
* Conditionally mark all tests in a file or
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group as "slow". Slow tests
- * will be given triple the default timeout.
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group as "slow". Slow
+ * tests will be given triple the default timeout.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2454,8 +2483,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* });
* ```
*
- * Changing timeout from a slow `beforeEach` or `afterEach` hook. Note that this affects the test timeout that is shared
- * with `beforeEach`/`afterEach` hooks.
+ * Changing timeout from a slow `beforeEach` or `afterEach` hook. Note that this affects the test timeout that is
+ * shared with `beforeEach`/`afterEach` hooks.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2499,13 +2528,14 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
*/
setTimeout(timeout: number): void;
/**
- * Declares a `beforeEach` hook that is executed before each test. When called in the scope of a test file, runs before
- * each test in the file. When called inside a
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs before each
- * test in the group. If multiple `beforeEach` hooks are added, they will run in the order of their registration.
+ * Declares a `beforeEach` hook that is executed before each test. When called in the scope of a test file, runs
+ * before each test in the file. When called inside a
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs before
+ * each test in the group. If multiple `beforeEach` hooks are added, they will run in the order of their
+ * registration.
*
- * You can access all the same [Fixtures] as the test function itself, and also the [TestInfo] object that gives a lot of
- * useful information. For example, you can navigate the page before starting the test.
+ * You can access all the same [Fixtures] as the test function itself, and also the [TestInfo] object that gives a lot
+ * of useful information. For example, you can navigate the page before starting the test.
*
* ```js
* // example.spec.ts
@@ -2521,19 +2551,19 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* });
* ```
*
- * You can use [test.afterEach(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-each) to teardown any
- * resources set up in `beforeEach`.
+ * You can use [test.afterEach(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-each) to teardown
+ * any resources set up in `beforeEach`.
* @param hookFunction Hook function that takes one or two arguments: an object with fixtures and optional [TestInfo].
*/
beforeEach(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<any> | any): void;
/**
- * Declares an `afterEach` hook that is executed after each test. When called in the scope of a test file, runs after each
- * test in the file. When called inside a
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs after each test
- * in the group. If multiple `afterEach` hooks are added, they will run in the order of their registration.
+ * Declares an `afterEach` hook that is executed after each test. When called in the scope of a test file, runs after
+ * each test in the file. When called inside a
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs after each
+ * test in the group. If multiple `afterEach` hooks are added, they will run in the order of their registration.
*
- * You can access all the same [Fixtures] as the test function itself, and also the [TestInfo] object that gives a lot of
- * useful information. For example, you can check whether the test succeeded or failed.
+ * You can access all the same [Fixtures] as the test function itself, and also the [TestInfo] object that gives a lot
+ * of useful information. For example, you can check whether the test succeeded or failed.
*
* ```js
* // example.spec.ts
@@ -2555,8 +2585,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
*/
afterEach(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<any> | any): void;
/**
- * Declares a `beforeAll` hook that is executed once per worker process before all tests. When called in the scope of a
- * test file, runs before all tests in the file. When called inside a
+ * Declares a `beforeAll` hook that is executed once per worker process before all tests. When called in the scope of
+ * a test file, runs before all tests in the file. When called inside a
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs before all
* tests in the group. If multiple `beforeAll` hooks are added, they will run in the order of their registration.
*
@@ -2577,30 +2607,30 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* });
* ```
*
- * Note that worker process is restarted on test failures, and `beforeAll` hook runs again in the new worker. Learn more
- * about [workers and failures](https://playwright.dev/docs/test-retries).
+ * Note that worker process is restarted on test failures, and `beforeAll` hook runs again in the new worker. Learn
+ * more about [workers and failures](https://playwright.dev/docs/test-retries).
*
- * You can use [test.afterAll(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-all) to teardown any
- * resources set up in `beforeAll`.
+ * You can use [test.afterAll(hookFunction)](https://playwright.dev/docs/api/class-test#test-after-all) to teardown
+ * any resources set up in `beforeAll`.
* @param hookFunction Hook function that takes one or two arguments: an object with worker fixtures and optional [TestInfo].
*/
beforeAll(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<any> | any): void;
/**
- * Declares an `afterAll` hook that is executed once per worker after all tests. When called in the scope of a test file,
- * runs after all tests in the file. When called inside a
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs after all tests
- * in the group. If multiple `afterAll` hooks are added, they will run in the order of their registration.
+ * Declares an `afterAll` hook that is executed once per worker after all tests. When called in the scope of a test
+ * file, runs after all tests in the file. When called inside a
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group, runs after all
+ * tests in the group. If multiple `afterAll` hooks are added, they will run in the order of their registration.
*
- * Note that worker process is restarted on test failures, and `afterAll` hook runs again in the new worker. Learn more
- * about [workers and failures](https://playwright.dev/docs/test-retries).
+ * Note that worker process is restarted on test failures, and `afterAll` hook runs again in the new worker. Learn
+ * more about [workers and failures](https://playwright.dev/docs/test-retries).
* @param hookFunction Hook function that takes one or two arguments: an object with worker fixtures and optional [TestInfo].
*/
afterAll(inner: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<any> | any): void;
/**
* Specifies options or fixtures to use in a single test file or a
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group. Most useful to set
- * an option, for example set `locale` to configure `context` fixture. `test.use` can be called either in the global scope
- * or inside `test.describe`. It is an error to call it within `beforeEach` or `beforeAll`.
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) group. Most useful to
+ * set an option, for example set `locale` to configure `context` fixture. `test.use` can be called either in the
+ * global scope or inside `test.describe`. It is an error to call it within `beforeEach` or `beforeAll`.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -2783,8 +2813,8 @@ type ConnectOptions = {
};
/**
- * Playwright Test provides a [testInfo.storage()](https://playwright.dev/docs/api/class-testinfo#test-info-storage) object
- * for passing values between project setup and tests. TODO: examples
+ * Playwright Test provides a [testInfo.storage()](https://playwright.dev/docs/api/class-testinfo#test-info-storage)
+ * object for passing values between project setup and tests. TODO: examples
*/
export interface Storage {
/**
@@ -2838,8 +2868,8 @@ export interface Storage {
*/
export interface PlaywrightWorkerOptions {
/**
- * Name of the browser that runs tests. Defaults to `'chromium'`. Most of the time you should set `browserName` in your
- * [TestConfig]:
+ * Name of the browser that runs tests. Defaults to `'chromium'`. Most of the time you should set `browserName` in
+ * your [TestConfig]:
*
* ```js
* // playwright.config.ts
@@ -2864,16 +2894,17 @@ export interface PlaywrightWorkerOptions {
*/
headless: boolean | undefined;
/**
- * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
- * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
+ * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary",
+ * "msedge", "msedge-beta", "msedge-dev", "msedge-canary". Read more about using
* [Google Chrome and Microsoft Edge](https://playwright.dev/docs/browsers#google-chrome--microsoft-edge).
*/
channel: BrowserChannel | undefined;
/**
* Options used to launch the browser, as passed to
- * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). Specific options
- * [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) and
- * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over this.
+ * [browserType.launch([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch). Specific
+ * options [testOptions.headless](https://playwright.dev/docs/api/class-testoptions#test-options-headless) and
+ * [testOptions.channel](https://playwright.dev/docs/api/class-testoptions#test-options-channel) take priority over
+ * this.
*/
launchOptions: LaunchOptions;
/**
@@ -2915,9 +2946,9 @@ export interface PlaywrightWorkerOptions {
* - `'on-first-retry'`: Record video only when retrying a test for the first time.
*
* To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be
- * equal to [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-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.
+ * equal to [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-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.
*
* Learn more about [recording video](https://playwright.dev/docs/test-configuration#record-video).
*/
@@ -2974,8 +3005,8 @@ export interface PlaywrightTestOptions {
bypassCSP: boolean | undefined;
/**
* Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
- * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details. Passing
- * `null` resets emulation to system defaults. Defaults to `'light'`.
+ * [page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.
+ * Passing `null` resets emulation to system defaults. Defaults to `'light'`.
*/
colorScheme: ColorScheme | undefined;
/**
@@ -3000,8 +3031,8 @@ export interface PlaywrightTestOptions {
*/
ignoreHTTPSErrors: boolean | undefined;
/**
- * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported
- * in Firefox.
+ * Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not
+ * supported in Firefox.
*/
isMobile: boolean | undefined;
/**
@@ -3009,8 +3040,8 @@ export interface PlaywrightTestOptions {
*/
javaScriptEnabled: boolean | undefined;
/**
- * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`
- * request header value as well as number and date formatting rules.
+ * Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,
+ * `Accept-Language` request header value as well as number and date formatting rules.
*/
locale: string | undefined;
/**
@@ -3028,19 +3059,19 @@ export interface PlaywrightTestOptions {
*/
proxy: Proxy | undefined;
/**
- * Populates context with given storage state. This option can be used to initialize context with logged-in information
- * obtained via
+ * Populates context with given storage state. This option can be used to initialize context with logged-in
+ * information obtained via
* [browserContext.storageState([options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-storage-state).
* Either a path to the file with saved storage, or an object with the following fields:
*/
storageState: StorageState | undefined;
/**
* Name of the [Storage] entry that should be used to initialize
- * [testOptions.storageState](https://playwright.dev/docs/api/class-testoptions#test-options-storage-state). The value must
- * be written to the storage before creatiion of a browser context that uses it (usually in
- * [testProject.setup](https://playwright.dev/docs/api/class-testproject#test-project-setup)). If both this property and
- * [testOptions.storageState](https://playwright.dev/docs/api/class-testoptions#test-options-storage-state) are specified,
- * this property will always take precedence.
+ * [testOptions.storageState](https://playwright.dev/docs/api/class-testoptions#test-options-storage-state). The value
+ * must be written to the storage before creatiion of a browser context that uses it (usually in
+ * [testProject.setup](https://playwright.dev/docs/api/class-testproject#test-project-setup)). If both this property
+ * and [testOptions.storageState](https://playwright.dev/docs/api/class-testoptions#test-options-storage-state) are
+ * specified, this property will always take precedence.
*/
storageStateName: string | undefined;
/**
@@ -3061,21 +3092,24 @@ export interface PlaywrightTestOptions {
* When using [page.goto(url[, options])](https://playwright.dev/docs/api/class-page#page-goto),
* [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route),
* [page.waitForURL(url[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-url),
- * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request), or
- * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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. Examples:
+ * [page.waitForRequest(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#page-wait-for-request),
+ * or
+ * [page.waitForResponse(urlOrPredicate[, options])](https://playwright.dev/docs/api/class-page#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.
+ * Examples:
* - baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`
- * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`
+ * - baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in
+ * `http://localhost:3000/foo/bar.html`
* - baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in
* `http://localhost:3000/bar.html`
*/
baseURL: string | undefined;
/**
* Options used to create the context, as passed to
- * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context). Specific options
- * like [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) take priority over
- * this.
+ * [browser.newContext([options])](https://playwright.dev/docs/api/class-browser#browser-new-context). Specific
+ * options like [testOptions.viewport](https://playwright.dev/docs/api/class-testoptions#test-options-viewport) take
+ * priority over this.
*/
contextOptions: BrowserContextOptions;
/**
@@ -3098,26 +3132,27 @@ export interface PlaywrightTestOptions {
navigationTimeout: number | undefined;
/**
* Whether to allow sites to register Service workers. Defaults to `'allow'`.
- * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.
+ * - `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be
+ * registered.
* - `'block'`: Playwright will block all registration of Service Workers.
*/
serviceWorkers: ServiceWorkerPolicy | undefined;
/**
* Custom attribute to be used in
- * [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used by
- * default.
+ * [page.getByTestId(testId)](https://playwright.dev/docs/api/class-page#page-get-by-test-id). `data-testid` is used
+ * by default.
*/
testIdAttribute: string | undefined;
}
/**
- * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to establish
- * environment for each test, giving the test everything it needs and nothing else.
+ * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to
+ * establish environment for each test, giving the test everything it needs and nothing else.
*
- * Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those fixtures
- * specifically for the test. Values prepared by the fixtures are merged into a single object that is available to the
- * `test`, hooks, annotations and other fixtures as a first parameter.
+ * Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those
+ * fixtures specifically for the test. Values prepared by the fixtures are merged into a single object that is
+ * available to the `test`, hooks, annotations and other fixtures as a first parameter.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -3127,11 +3162,11 @@ export interface PlaywrightTestOptions {
* });
* ```
*
- * Given the test above, Playwright Test will set up the `page` fixture before running the test, and tear it down after the
- * test has finished. `page` fixture provides a [Page] object that is available to the test.
+ * Given the test above, Playwright Test will set up the `page` fixture before running the test, and tear it down
+ * after the test has finished. `page` fixture provides a [Page] object that is available to the test.
*
- * Playwright Test comes with builtin fixtures listed below, and you can add your own fixtures as well. Playwright Test
- * also [provides options][TestOptions] to configure
+ * Playwright Test comes with builtin fixtures listed below, and you can add your own fixtures as well. Playwright
+ * Test also [provides options][TestOptions] to configure
* [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser),
* [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and
* [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page).
@@ -3139,8 +3174,8 @@ export interface PlaywrightTestOptions {
export interface PlaywrightWorkerArgs {
playwright: typeof import('playwright-core');
/**
- * [Browser] instance is shared between all tests in the [same worker](https://playwright.dev/docs/test-parallel) - this makes testing efficient.
- * However, each test runs in an isolated [BrowserContext] and gets a fresh environment.
+ * [Browser] instance is shared between all tests in the [same worker](https://playwright.dev/docs/test-parallel) - this makes testing
+ * efficient. However, each test runs in an isolated [BrowserContext] and gets a fresh environment.
*
* Learn how to [configure browser](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
*/
@@ -3148,12 +3183,12 @@ export interface PlaywrightWorkerArgs {
}
/**
- * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to establish
- * environment for each test, giving the test everything it needs and nothing else.
+ * Playwright Test is based on the concept of the [test fixtures](https://playwright.dev/docs/test-fixtures). Test fixtures are used to
+ * establish environment for each test, giving the test everything it needs and nothing else.
*
- * Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those fixtures
- * specifically for the test. Values prepared by the fixtures are merged into a single object that is available to the
- * `test`, hooks, annotations and other fixtures as a first parameter.
+ * Playwright Test looks at each test declaration, analyses the set of fixtures the test needs and prepares those
+ * fixtures specifically for the test. Values prepared by the fixtures are merged into a single object that is
+ * available to the `test`, hooks, annotations and other fixtures as a first parameter.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -3163,19 +3198,19 @@ export interface PlaywrightWorkerArgs {
* });
* ```
*
- * Given the test above, Playwright Test will set up the `page` fixture before running the test, and tear it down after the
- * test has finished. `page` fixture provides a [Page] object that is available to the test.
+ * Given the test above, Playwright Test will set up the `page` fixture before running the test, and tear it down
+ * after the test has finished. `page` fixture provides a [Page] object that is available to the test.
*
- * Playwright Test comes with builtin fixtures listed below, and you can add your own fixtures as well. Playwright Test
- * also [provides options][TestOptions] to configure
+ * Playwright Test comes with builtin fixtures listed below, and you can add your own fixtures as well. Playwright
+ * Test also [provides options][TestOptions] to configure
* [fixtures.browser](https://playwright.dev/docs/api/class-fixtures#fixtures-browser),
* [fixtures.context](https://playwright.dev/docs/api/class-fixtures#fixtures-context) and
* [fixtures.page](https://playwright.dev/docs/api/class-fixtures#fixtures-page).
*/
export interface PlaywrightTestArgs {
/**
- * Isolated [BrowserContext] instance, created for each test. Since contexts are isolated between each other, every test
- * gets a fresh environment, even when multiple tests run in a single [Browser] for maximum efficiency.
+ * Isolated [BrowserContext] instance, created for each test. Since contexts are isolated between each other, every
+ * test gets a fresh environment, even when multiple tests run in a single [Browser] for maximum efficiency.
*
* Learn how to [configure context](https://playwright.dev/docs/test-configuration) and see [available options][TestOptions].
*
@@ -3322,8 +3357,8 @@ export {};
/**
- * The [APIResponseAssertions] class provides assertion methods that can be used to make assertions about the [APIResponse]
- * in the tests. A new instance of [APIResponseAssertions] is created by calling
+ * The [APIResponseAssertions] class provides assertion methods that can be used to make assertions about the
+ * [APIResponse] in the tests. A new instance of [APIResponseAssertions] is created by calling
* [expect(response)](https://playwright.dev/docs/api/class-playwrightassertions#playwright-assertions-expect-api-response):
*
* ```js
@@ -3361,8 +3396,8 @@ interface APIResponseAssertions {
}
/**
- * The [LocatorAssertions] class provides assertion methods that can be used to make assertions about the [Locator] state
- * in the tests. A new instance of [LocatorAssertions] is created by calling
+ * The [LocatorAssertions] class provides assertion methods that can be used to make assertions about the [Locator]
+ * state in the tests. A new instance of [LocatorAssertions] is created by calling
* [expect(locator)](https://playwright.dev/docs/api/class-playwrightassertions#playwright-assertions-expect-locator):
*
* ```js
@@ -3378,8 +3413,8 @@ interface APIResponseAssertions {
*/
interface LocatorAssertions {
/**
- * Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain text
- * `"error"`:
+ * Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain
+ * text `"error"`:
*
* ```js
* await expect(locator).not.toContainText('error');
@@ -3408,8 +3443,9 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures the [Locator] points to a disabled element. Element is disabled if it has "disabled" attribute or is disabled
- * via ['aria-disabled'](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled). Note
+ * Ensures the [Locator] points to a disabled element. Element is disabled if it has "disabled" attribute or is
+ * disabled via
+ * ['aria-disabled'](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled). Note
* that only native control elements such as HTML `button`, `input`, `select`, `textarea`, `option`, `optgroup` can be
* disabled by setting "disabled" attribute. "disabled" attribute on other elements is ignored by the browser.
*
@@ -3518,8 +3554,8 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures that [Locator] points to an [attached](https://playwright.dev/docs/api/actionability#attached) and [visible](https://playwright.dev/docs/api/actionability#visible)
- * DOM node.
+ * Ensures that [Locator] points to an [attached](https://playwright.dev/docs/api/actionability#attached) and
+ * [visible](https://playwright.dev/docs/api/actionability#visible) DOM node.
*
* ```js
* const locator = page.locator('.my-element');
@@ -3538,8 +3574,8 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures the [Locator] points to an element that contains the given text. You can use regular expressions for the value
- * as well.
+ * Ensures the [Locator] points to an element that contains the given text. You can use regular expressions for the
+ * value as well.
*
* ```js
* const locator = page.locator('.title');
@@ -3706,8 +3742,8 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures the [Locator] points to an element with given JavaScript property. Note that this property can be of a primitive
- * type as well as a plain serializable JavaScript object.
+ * Ensures the [Locator] points to an element with given JavaScript property. Note that this property can be of a
+ * primitive type as well as a plain serializable JavaScript object.
*
* ```js
* const locator = page.locator('.component');
@@ -3739,8 +3775,8 @@ interface LocatorAssertions {
*/
toHaveScreenshot(name: string|Array<string>, options?: {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -3749,14 +3785,14 @@ interface LocatorAssertions {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -3779,18 +3815,18 @@ interface LocatorAssertions {
omitBackground?: boolean;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"css"`.
*/
scale?: "css"|"device";
/**
- * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`.
- * Defaults to `0.2`.
+ * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax), default is configurable with
+ * `TestConfig.expect`. Defaults to `0.2`.
*/
threshold?: number;
@@ -3813,8 +3849,8 @@ interface LocatorAssertions {
*/
toHaveScreenshot(options?: {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -3823,14 +3859,14 @@ interface LocatorAssertions {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -3853,18 +3889,18 @@ interface LocatorAssertions {
omitBackground?: boolean;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"css"`.
*/
scale?: "css"|"device";
/**
- * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`.
- * Defaults to `0.2`.
+ * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax), default is configurable with
+ * `TestConfig.expect`. Defaults to `0.2`.
*/
threshold?: number;
@@ -3875,7 +3911,8 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures the [Locator] points to an element with the given text. You can use regular expressions for the value as well.
+ * Ensures the [Locator] points to an element with the given text. You can use regular expressions for the value as
+ * well.
*
* ```js
* const locator = page.locator('.title');
@@ -3936,8 +3973,8 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures the [Locator] points to an element with the given input value. You can use regular expressions for the value as
- * well.
+ * Ensures the [Locator] points to an element with the given input value. You can use regular expressions for the
+ * value as well.
*
* ```js
* const locator = page.locator('input[type=number]');
@@ -3955,8 +3992,8 @@ interface LocatorAssertions {
}): Promise<void>;
/**
- * Ensures the [Locator] points to multi-select/combobox (i.e. a `select` with the `multiple` attribute) and the specified
- * values are selected.
+ * Ensures the [Locator] points to multi-select/combobox (i.e. a `select` with the `multiple` attribute) and the
+ * specified values are selected.
*
* For example, given the following element:
*
@@ -3986,8 +4023,8 @@ interface LocatorAssertions {
}
/**
- * The [PageAssertions] class provides assertion methods that can be used to make assertions about the [Page] state in the
- * tests. A new instance of [PageAssertions] is created by calling
+ * The [PageAssertions] class provides assertion methods that can be used to make assertions about the [Page] state in
+ * the tests. A new instance of [PageAssertions] is created by calling
* [expect(page)](https://playwright.dev/docs/api/class-playwrightassertions#playwright-assertions-expect-page):
*
* ```js
@@ -4003,8 +4040,8 @@ interface LocatorAssertions {
*/
interface PageAssertions {
/**
- * Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain
- * `"error"`:
+ * Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't
+ * contain `"error"`:
*
* ```js
* await expect(page).not.toHaveURL('error');
@@ -4026,8 +4063,8 @@ interface PageAssertions {
*/
toHaveScreenshot(name: string|Array<string>, options?: {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -4036,8 +4073,8 @@ interface PageAssertions {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
@@ -4073,8 +4110,8 @@ interface PageAssertions {
fullPage?: boolean;
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -4097,18 +4134,18 @@ interface PageAssertions {
omitBackground?: boolean;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"css"`.
*/
scale?: "css"|"device";
/**
- * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`.
- * Defaults to `0.2`.
+ * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax), default is configurable with
+ * `TestConfig.expect`. Defaults to `0.2`.
*/
threshold?: number;
@@ -4130,8 +4167,8 @@ interface PageAssertions {
*/
toHaveScreenshot(options?: {
/**
- * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment
- * depending on their duration:
+ * When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different
+ * treatment depending on their duration:
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
@@ -4140,8 +4177,8 @@ interface PageAssertions {
animations?: "disabled"|"allow";
/**
- * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed.
- * Defaults to `"hide"`.
+ * When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
+ * changed. Defaults to `"hide"`.
*/
caret?: "hide"|"initial";
@@ -4177,8 +4214,8 @@ interface PageAssertions {
fullPage?: boolean;
/**
- * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
- * `#FF00FF` that completely covers its bounding box.
+ * Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink
+ * box `#FF00FF` that completely covers its bounding box.
*/
mask?: Array<Locator>;
@@ -4201,18 +4238,18 @@ interface PageAssertions {
omitBackground?: boolean;
/**
- * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
- * keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so screenshots of
- * high-dpi devices will be twice as large or even larger.
+ * When set to `"css"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this
+ * will keep screenshots small. Using `"device"` option will produce a single pixel per each device pixel, so
+ * screenshots of high-dpi devices will be twice as large or even larger.
*
* Defaults to `"css"`.
*/
scale?: "css"|"device";
/**
- * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`.
- * Defaults to `0.2`.
+ * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax), default is configurable with
+ * `TestConfig.expect`. Defaults to `0.2`.
*/
threshold?: number;
@@ -4267,8 +4304,8 @@ interface PageAssertions {
*/
interface ScreenshotAssertions {
/**
- * Ensures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test snapshots
- * directory.
+ * Ensures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test
+ * snapshots directory.
*
* ```js
* // Basic usage.
@@ -4305,16 +4342,16 @@ interface ScreenshotAssertions {
maxDiffPixels?: number;
/**
- * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`.
- * Defaults to `0.2`.
+ * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax), default is configurable with
+ * `TestConfig.expect`. Defaults to `0.2`.
*/
threshold?: number;
}): void;
/**
- * Ensures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test snapshots
- * directory.
+ * Ensures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test
+ * snapshots directory.
*
* ```js
* // Basic usage and the file name is derived from the test name.
@@ -4354,9 +4391,9 @@ interface ScreenshotAssertions {
name?: string|Array<string>;
/**
- * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax), default is configurable with `TestConfig.expect`.
- * Defaults to `0.2`.
+ * An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax), default is configurable with
+ * `TestConfig.expect`. Defaults to `0.2`.
*/
threshold?: number;
}): void;
@@ -4383,15 +4420,16 @@ export interface TestError {
}
/**
- * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in multiple
- * configurations. For example, consider running tests against multiple browsers.
+ * Playwright Test supports running multiple test projects at the same time. This is useful for running tests in
+ * multiple configurations. For example, consider running tests against multiple browsers.
*
* `TestProject` encapsulates configuration specific to a single project. Projects are configured in
* [testConfig.projects](https://playwright.dev/docs/api/class-testconfig#test-config-projects) specified in the
- * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of [TestProject] are available in the top-level
- * [TestConfig], in which case they are shared between all projects.
+ * [configuration file](https://playwright.dev/docs/test-configuration). Note that all properties of [TestProject] are available in the
+ * top-level [TestConfig], in which case they are shared between all projects.
*
- * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile versions.
+ * Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile
+ * versions.
*
* ```js
* // playwright.config.ts
@@ -4445,8 +4483,8 @@ interface TestProject {
/**
* Configuration for the `expect` assertion library.
*
- * Use [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect) to change this option for
- * all projects.
+ * Use [testConfig.expect](https://playwright.dev/docs/api/class-testconfig#test-config-expect) to change this option
+ * for all projects.
*/
expect?: {
/**
@@ -4461,8 +4499,8 @@ interface TestProject {
*/
toHaveScreenshot?: {
/**
- * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
+ * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
*/
threshold?: number;
@@ -4472,25 +4510,26 @@ interface TestProject {
maxDiffPixels?: number;
/**
- * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default.
+ * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
*/
maxDiffPixelRatio?: number;
/**
- * See `animations` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults
- * to `"disabled"`.
+ * See `animations` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot).
+ * Defaults to `"disabled"`.
*/
animations?: "allow"|"disabled";
/**
- * See `caret` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to
- * `"hide"`.
+ * See `caret` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults
+ * to `"hide"`.
*/
caret?: "hide"|"initial";
/**
- * See `scale` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults to
- * `"css"`.
+ * See `scale` in [page.screenshot([options])](https://playwright.dev/docs/api/class-page#page-screenshot). Defaults
+ * to `"css"`.
*/
scale?: "css"|"device";
};
@@ -4502,8 +4541,8 @@ interface TestProject {
*/
toMatchSnapshot?: {
/**
- * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the same
- * pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
+ * an acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
+ * same pixel in compared images, between zero (strict) and one (lax). Defaults to `0.2`.
*/
threshold?: number;
@@ -4513,24 +4552,26 @@ interface TestProject {
maxDiffPixels?: number;
/**
- * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default.
+ * an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by
+ * default.
*/
maxDiffPixelRatio?: number;
};
};
/**
- * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the same
- * time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same worker
- * process.
+ * Playwright Test runs tests in parallel. In order to achieve that, it runs several worker processes that run at the
+ * same time. By default, **test files** are run in parallel. Tests in a single file are run in order, in the same
+ * worker process.
*
* You can configure entire test project to concurrently run all tests in all files using this option.
*/
fullyParallel?: boolean;
/**
- * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run
- * tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
+ * Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
+ * run tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g`
+ * option.
*
* `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
*/
@@ -4538,8 +4579,8 @@ interface TestProject {
/**
* Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of
- * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally and in
- * the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
+ * [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally
+ * and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
*
* `grepInvert` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
*/
@@ -4556,8 +4597,8 @@ interface TestProject {
name?: string;
/**
- * Project setup files that would be executed before all tests in the project. If project setup fails the tests in this
- * project will be skipped. All project setup files will run in every shard if the project is sharded.
+ * Project setup files that would be executed before all tests in the project. If project setup fails the tests in
+ * this project will be skipped. All project setup files will run in every shard if the project is sharded.
*/
setup?: string|RegExp|Array<string|RegExp>;
@@ -4570,8 +4611,8 @@ interface TestProject {
* [testInfo.snapshotPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-path).
*
* This path will serve as the base directory for each test file snapshot directory. Setting `snapshotDir` to
- * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir) would
- * resolve to `snapshots/a.spec.js-snapshots`.
+ * `'snapshots'`, the [testInfo.snapshotDir](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-dir)
+ * would resolve to `snapshots/a.spec.js-snapshots`.
*/
snapshotDir?: string;
@@ -4618,8 +4659,10 @@ interface TestProject {
* ```
*
* The list of supported tokens:
- * - `{testDir}` - Project's [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir).
- * - Value: `/home/playwright/tests` (absolute path is since `testDir` is resolved relative to directory with config)
+ * - `{testDir}` - Project's
+ * [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir).
+ * - Value: `/home/playwright/tests` (absolute path is since `testDir` is resolved relative to directory with
+ * config)
* - `{snapshotDir}` - Project's
* [testConfig.snapshotDir](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-dir).
* - Value: `/home/playwright/tests` (since `snapshotDir` is not provided in config, it defaults to `testDir`)
@@ -4680,8 +4723,8 @@ interface TestProject {
* [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path).
*
* Here is an example that uses
- * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to create a
- * temporary file.
+ * [testInfo.outputPath(...pathSegments)](https://playwright.dev/docs/api/class-testinfo#test-info-output-path) to
+ * create a temporary file.
*
* ```js
* import { test, expect } from '@playwright/test';
@@ -4701,27 +4744,28 @@ interface TestProject {
/**
* The number of times to repeat each test, useful for debugging flaky tests.
*
- * Use [testConfig.repeatEach](https://playwright.dev/docs/api/class-testconfig#test-config-repeat-each) to change this
- * option for all projects.
+ * Use [testConfig.repeatEach](https://playwright.dev/docs/api/class-testconfig#test-config-repeat-each) to change
+ * this option for all projects.
*/
repeatEach?: number;
/**
- * The maximum number of retry attempts given to failed tests. Learn more about [test retries](https://playwright.dev/docs/test-retries#retries).
+ * The maximum number of retry attempts given to failed tests. Learn more about
+ * [test retries](https://playwright.dev/docs/test-retries#retries).
*
- * Use [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) to change
- * the number of retries for a specific file or a group of tests.
+ * Use [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) to
+ * change the number of retries for a specific file or a group of tests.
*
- * Use [testConfig.retries](https://playwright.dev/docs/api/class-testconfig#test-config-retries) to change this option for
- * all projects.
+ * Use [testConfig.retries](https://playwright.dev/docs/api/class-testconfig#test-config-retries) to change this
+ * option for all projects.
*/
retries?: number;
/**
* Directory that will be recursively scanned for test files. Defaults to the directory of the configuration file.
*
- * Each project can use a different directory. Here is an example that runs smoke tests in three browsers and all other
- * tests in stable Chrome browser.
+ * Each project can use a different directory. Here is an example that runs smoke tests in three browsers and all
+ * other tests in stable Chrome browser.
*
* ```js
* // playwright.config.ts
@@ -4763,25 +4807,25 @@ interface TestProject {
* export default config;
* ```
*
- * Use [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) to change this option
- * for all projects.
+ * Use [testConfig.testDir](https://playwright.dev/docs/api/class-testconfig#test-config-test-dir) to change this
+ * option for all projects.
*/
testDir?: string;
/**
- * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute file
- * path. Strings are treated as glob patterns.
+ * Files matching one of these patterns are not executed as test files. Matching is performed against the absolute
+ * file path. Strings are treated as glob patterns.
*
* For example, `'**\/test-assets/**'` will ignore any files in the `test-assets` directory.
*
- * Use [testConfig.testIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-test-ignore) to change this
- * option for all projects.
+ * Use [testConfig.testIgnore](https://playwright.dev/docs/api/class-testconfig#test-config-test-ignore) to change
+ * this option for all projects.
*/
testIgnore?: string|RegExp|Array<string|RegExp>;
/**
- * Only the files matching one of these patterns are executed as test files. Matching is performed against the absolute
- * file path. Strings are treated as glob patterns.
+ * Only the files matching one of these patterns are executed as test files. Matching is performed against the
+ * absolute file path. Strings are treated as glob patterns.
*
* By default, Playwright Test looks for files matching `.*(test|spec)\.(js|ts|mjs)`.
*
@@ -4794,12 +4838,12 @@ interface TestProject {
* Timeout for each test in milliseconds. Defaults to 30 seconds.
*
* This is a base timeout for all tests. Each test can configure its own timeout with
- * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout). Each file or a group of tests
- * can configure the timeout with
+ * [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout). Each file or a group of
+ * tests can configure the timeout with
* [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure).
*
- * Use [testConfig.timeout](https://playwright.dev/docs/api/class-testconfig#test-config-timeout) to change this option for
- * all projects.
+ * Use [testConfig.timeout](https://playwright.dev/docs/api/class-testconfig#test-config-timeout) to change this
+ * option for all projects.
*/
timeout?: number;
}
@@ -4817,8 +4861,8 @@ interface TestConfigWebServer {
port?: number;
/**
- * The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is
- * ready to accept connections. Exactly one of `port` or `url` is required.
+ * The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the
+ * server is ready to accept connections. Exactly one of `port` or `url` is required.
*/
url?: string;
@@ -4833,10 +4877,10 @@ interface TestConfigWebServer {
timeout?: number;
/**
- * If true, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port`
- * or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening
- * on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running
- * tests locally.
+ * If true, it will re-use an existing server on the `port` or `url` when available. If no server is running on that
+ * `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is
+ * listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server
+ * when running tests locally.
*/
reuseExistingServer?: boolean;
diff --git a/packages/playwright-test/types/testReporter.d.ts b/packages/playwright-test/types/testReporter.d.ts
index a443f96ae9..7b90f9108c 100644
--- a/packages/playwright-test/types/testReporter.d.ts
+++ b/packages/playwright-test/types/testReporter.d.ts
@@ -66,8 +66,8 @@ export interface Suite {
/**
* Test cases in the suite. Note that only test cases defined directly in this suite are in the list. Any test cases
- * defined in nested [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) groups
- * are listed in the child [suite.suites](https://playwright.dev/docs/api/class-suite#suite-suites).
+ * defined in nested [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1)
+ * groups are listed in the child [suite.suites](https://playwright.dev/docs/api/class-suite#suite-suites).
*/
tests: Array<TestCase>;
@@ -76,8 +76,8 @@ export interface Suite {
* - Empty for root suite.
* - Project name for project suite.
* - File path for file suite.
- * - Title passed to [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) for a
- * group suite.
+ * - Title passed to [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1)
+ * for a group suite.
*/
title: string;
@@ -87,10 +87,11 @@ export interface Suite {
titlePath(): Array<string>;}
/**
- * `TestCase` corresponds to every [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call)
- * call in a test file. When a single
- * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call) is running in multiple projects
- * or repeated multiple times, it will have multiple `TestCase` objects in corresponding projects' suites.
+ * `TestCase` corresponds to every
+ * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call) call in a test file. When
+ * a single [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call) is running in
+ * multiple projects or repeated multiple times, it will have multiple `TestCase` objects in corresponding projects'
+ * suites.
*/
export interface TestCase {
/**
@@ -98,16 +99,18 @@ export interface TestCase {
* - Tests marked as [test.skip(title, testFunction)](https://playwright.dev/docs/api/class-test#test-skip-1) or
* [test.fixme(title, testFunction)](https://playwright.dev/docs/api/class-test#test-fixme-1) are expected to be
* `'skipped'`.
- * - Tests marked as [test.fail()](https://playwright.dev/docs/api/class-test#test-fail-1) are expected to be `'failed'`.
+ * - Tests marked as [test.fail()](https://playwright.dev/docs/api/class-test#test-fail-1) are expected to be
+ * `'failed'`.
* - Other tests are expected to be `'passed'`.
*
- * See also [testResult.status](https://playwright.dev/docs/api/class-testresult#test-result-status) for the actual status.
+ * See also [testResult.status](https://playwright.dev/docs/api/class-testresult#test-result-status) for the actual
+ * status.
*/
expectedStatus: TestStatus;
/**
* The list of annotations applicable to the current test. Includes annotations from the test, annotations from all
- * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) groups the test belongs to
- * and file-level annotations for the test file.
+ * [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1) groups the test
+ * belongs to and file-level annotations for the test file.
*
* Annotations are available during test execution through
* [testInfo.annotations](https://playwright.dev/docs/api/class-testinfo#test-info-annotations).
@@ -156,8 +159,8 @@ export interface TestCase {
parent: Suite;
/**
- * Contains the repeat index when running in "repeat each" mode. This mode is enabled by passing `--repeat-each` to the
- * [command line](https://playwright.dev/docs/test-cli).
+ * Contains the repeat index when running in "repeat each" mode. This mode is enabled by passing `--repeat-each` to
+ * the [command line](https://playwright.dev/docs/test-cli).
*/
repeatEachIndex: number;
@@ -184,8 +187,8 @@ export interface TestCase {
timeout: number;
/**
- * Test title as passed to the [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call)
- * call.
+ * Test title as passed to the
+ * [test.(call)(title, testFunction)](https://playwright.dev/docs/api/class-test#test-call) call.
*/
title: string;
@@ -214,7 +217,8 @@ export interface TestResult {
name: string;
/**
- * Content type of this attachment to properly present in the report, for example `'application/json'` or `'image/png'`.
+ * Content type of this attachment to properly present in the report, for example `'application/json'` or
+ * `'image/png'`.
*/
contentType: string;
@@ -273,8 +277,8 @@ export interface TestResult {
steps: Array<TestStep>;
/**
- * Index of the worker where the test was run. If the test was not run a single time, for example when the user interrupted
- * testing, the only result will have a `workerIndex` equal to `-1`.
+ * Index of the worker where the test was run. If the test was not run a single time, for example when the user
+ * interrupted testing, the only result will have a `workerIndex` equal to `-1`.
*
* Learn more about [parallelism and sharding](https://playwright.dev/docs/test-parallel) with Playwright Test.
*/
@@ -295,10 +299,11 @@ export interface FullResult {
}
/**
- * Test runner notifies the reporter about various events during test execution. All methods of the reporter are optional.
+ * Test runner notifies the reporter about various events during test execution. All methods of the reporter are
+ * optional.
*
- * You can create a custom reporter by implementing a class with some of the reporter methods. Make sure to export this
- * class as default.
+ * You can create a custom reporter by implementing a class with some of the reporter methods. Make sure to export
+ * this class as default.
*
* ```js
* // my-awesome-reporter.ts
@@ -324,8 +329,9 @@ export interface FullResult {
* export default MyReporter;
* ```
*
- * Now use this reporter with [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter).
- * Learn more about [using reporters](https://playwright.dev/docs/test-reporters).
+ * Now use this reporter with
+ * [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter). Learn more about
+ * [using reporters](https://playwright.dev/docs/test-reporters).
*
* ```js
* // playwright.config.ts
@@ -338,28 +344,29 @@ export interface FullResult {
* ```
*
* Here is a typical order of reporter calls:
- * - [reporter.onBegin(config, suite)](https://playwright.dev/docs/api/class-reporter#reporter-on-begin) is called once
- * with a root suite that contains all other suites and tests. Learn more about [suites hierarchy][Suite].
+ * - [reporter.onBegin(config, suite)](https://playwright.dev/docs/api/class-reporter#reporter-on-begin) is called
+ * once with a root suite that contains all other suites and tests. Learn more about [suites hierarchy][Suite].
* - [reporter.onTestBegin(test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-test-begin) is
- * called for each test run. It is given a [TestCase] that is executed, and a [TestResult] that is almost empty. Test
- * result will be populated while the test runs (for example, with steps and stdio) and will get final `status` once
- * the test finishes.
+ * called for each test run. It is given a [TestCase] that is executed, and a [TestResult] that is almost empty.
+ * Test result will be populated while the test runs (for example, with steps and stdio) and will get final
+ * `status` once the test finishes.
* - [reporter.onStepBegin(test, result, step)](https://playwright.dev/docs/api/class-reporter#reporter-on-step-begin)
- * and [reporter.onStepEnd(test, result, step)](https://playwright.dev/docs/api/class-reporter#reporter-on-step-end)
+ * and
+ * [reporter.onStepEnd(test, result, step)](https://playwright.dev/docs/api/class-reporter#reporter-on-step-end)
* are called for each executed step inside the test. When steps are executed, test run has not finished yet.
- * - [reporter.onTestEnd(test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-test-end) is called
- * when test run has finished. By this time, [TestResult] is complete and you can use
+ * - [reporter.onTestEnd(test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-test-end) is
+ * called when test run has finished. By this time, [TestResult] is complete and you can use
* [testResult.status](https://playwright.dev/docs/api/class-testresult#test-result-status),
* [testResult.error](https://playwright.dev/docs/api/class-testresult#test-result-error) and more.
- * - [reporter.onEnd(result)](https://playwright.dev/docs/api/class-reporter#reporter-on-end) is called once after all
- * tests that should run had finished.
+ * - [reporter.onEnd(result)](https://playwright.dev/docs/api/class-reporter#reporter-on-end) is called once after
+ * all tests that should run had finished.
*
* Additionally,
* [reporter.onStdOut(chunk, test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-std-out) and
- * [reporter.onStdErr(chunk, test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-std-err) are called
- * when standard output is produced in the worker process, possibly during a test execution, and
- * [reporter.onError(error)](https://playwright.dev/docs/api/class-reporter#reporter-on-error) is called when something
- * went wrong outside of the test execution.
+ * [reporter.onStdErr(chunk, test, result)](https://playwright.dev/docs/api/class-reporter#reporter-on-std-err) are
+ * called when standard output is produced in the worker process, possibly during a test execution, and
+ * [reporter.onError(error)](https://playwright.dev/docs/api/class-reporter#reporter-on-error) is called when
+ * something went wrong outside of the test execution.
*/
export interface Reporter {
/**
@@ -369,13 +376,13 @@ export interface Reporter {
*/
onBegin?(config: FullConfig, suite: Suite): void;
/**
- * Called after all tests has been run, or testing has been interrupted. Note that this method may return a [Promise] and
- * Playwright Test will await it.
+ * Called after all tests has been run, or testing has been interrupted. Note that this method may return a [Promise]
+ * and Playwright Test will await it.
* @param result Result of the full test run. - `'passed'` - Everything went as expected.
* - `'failed'` - Any test has failed.
* - `'timedout'` - The
- * [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout) has been
- * reached.
+ * [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout) has
+ * been reached.
* - `'interrupted'` - Interrupted by the user.
*/
onEnd?(result: FullResult): void | Promise<void>;
@@ -432,8 +439,8 @@ export interface Reporter {
onTestEnd?(test: TestCase, result: TestResult): void;
/**
- * Whether this reporter uses stdio for reporting. When it does not, Playwright Test could add some output to enhance user
- * experience.
+ * Whether this reporter uses stdio for reporting. When it does not, Playwright Test could add some output to enhance
+ * user experience.
*/
printsToStdio?(): boolean;}
diff --git a/utils/doclint/documentation.js b/utils/doclint/documentation.js
index 742e6fcc5f..276c0654d8 100644
--- a/utils/doclint/documentation.js
+++ b/utils/doclint/documentation.js
@@ -863,7 +863,8 @@ function generateSourceCodeComment(spec) {
node.text = '> NOTE: ' + node.text;
}
});
- return md.render(comments, 120);
+ // 5 is a typical member doc offset.
+ return md.render(comments, { maxColumns: 120 - 5, omitLastCR: true, flattenText: true });
}
/**
diff --git a/utils/markdown.js b/utils/markdown.js
index 9a6cc696e5..2133ef2de4 100644
--- a/utils/markdown.js
+++ b/utils/markdown.js
@@ -62,6 +62,13 @@
* lines: string[],
* }} MarkdownPropsNode */
+/** @typedef {{
+ * maxColumns?: number,
+ * omitLastCR?: boolean,
+ * flattenText?: boolean
+ * }} RenderOptions
+ */
+
/** @typedef {MarkdownTextNode | MarkdownLiNode | MarkdownCodeNode | MarkdownNoteNode | MarkdownHeaderNode | MarkdownNullNode | MarkdownPropsNode } MarkdownNode */
function flattenWrappedLines(content) {
@@ -87,7 +94,7 @@ function flattenWrappedLines(content) {
flushLastParagraph = true;
}
if (flushLastParagraph && outLineTokens.length) {
- outLines.push(outLineTokens.join(' '));
+ outLines.push(outLineTokens.join('↵'));
outLineTokens = [];
}
if (inCodeBlock || singleLineExpression || codeBlockBoundary)
@@ -96,7 +103,7 @@ function flattenWrappedLines(content) {
outLineTokens.push(outLineTokens.length ? line.trim() : line);
}
if (outLineTokens.length)
- outLines.push(outLineTokens.join(' '));
+ outLines.push(outLineTokens.join('↵'));
return outLines;
}
@@ -197,7 +204,7 @@ function buildTree(lines) {
tokens.push(line.substring(indent.length));
line = lines[++i];
}
- node.text = tokens.join(' ');
+ node.text = tokens.join('↵');
appendNode(indent, node);
continue;
}
@@ -251,17 +258,19 @@ function parse(content) {
/**
* @param {MarkdownNode[]} nodes
- * @param {number=} maxColumns
+ * @param {RenderOptions=} options
*/
-function render(nodes, maxColumns) {
+function render(nodes, options) {
const result = [];
let lastNode;
for (let node of nodes) {
if (node.type === 'null')
continue;
- innerRenderMdNode('', node, /** @type {MarkdownNode} */ (lastNode), result, maxColumns);
+ innerRenderMdNode('', node, /** @type {MarkdownNode} */ (lastNode), result, options);
lastNode = node;
}
+ if (!options?.omitLastCR && result[result.length - 1] !== '')
+ result.push('');
return result.join('\n');
}
@@ -269,12 +278,12 @@ function render(nodes, maxColumns) {
* @param {string} indent
* @param {MarkdownNode} node
* @param {MarkdownNode} lastNode
- * @param {number=} maxColumns
+ * @param {RenderOptions=} options
* @param {string[]} result
*/
-function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
+function innerRenderMdNode(indent, node, lastNode, result, options) {
const newLine = () => {
- if (result[result.length - 1] !== '')
+ if (result.length && result[result.length - 1] !== '')
result.push('');
};
@@ -285,7 +294,7 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
result.push(`${'#'.repeat(depth)} ${headerNode.text}`);
let lastNode = node;
for (const child of node.children || []) {
- innerRenderMdNode('', child, lastNode, result, maxColumns);
+ innerRenderMdNode('', child, lastNode, result, options);
lastNode = child;
}
}
@@ -297,8 +306,7 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
const bothLinks = node.text.match(/\[[^\]]+\]:/) && lastNode && lastNode.type === 'text' && lastNode.text.match(/\[[^\]]+\]:/);
if (!bothTables && !bothGen && !bothComments && !bothLinks && lastNode && lastNode.text)
newLine();
- for (const line of node.text.split('\n'))
- result.push(wrapText(line, maxColumns, indent));
+ result.push(wrapText(node.text, options, indent));
return;
}
@@ -315,7 +323,7 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
if (node.type === 'note') {
newLine();
result.push(`${indent}:::${node.noteType}`);
- result.push(`${wrapText(node.text, maxColumns, indent)}`);
+ result.push(wrapText(node.text, options, indent));
result.push(`${indent}:::`);
newLine();
return;
@@ -337,10 +345,10 @@ function innerRenderMdNode(indent, node, lastNode, result, maxColumns) {
case 'default': char = '-'; break;
case 'ordinal': char = '1.'; break;
}
- result.push(`${wrapText(node.text, maxColumns, `${indent}${char} `)}`);
+ result.push(wrapText(node.text, options, `${indent}${char} `));
const newIndent = indent + ' '.repeat(char.length + 1);
for (const child of node.children || []) {
- innerRenderMdNode(newIndent, child, lastNode, result, maxColumns);
+ innerRenderMdNode(newIndent, child, lastNode, result, options);
lastNode = child;
}
}
@@ -361,18 +369,37 @@ function tokenizeNoBreakLinks(text) {
/**
* @param {string} text
- * @param {number=} maxColumns
- * @param {string=} prefix
+ * @param {RenderOptions|undefined} options
+ * @param {string} prefix
+ * @returns {string}
+ */
+ function wrapText(text, options, prefix) {
+ if (options?.flattenText)
+ text = text.replace(/↵/g, ' ');
+ const lines = text.split(/[\n↵]/);
+ const result = /** @type {string[]} */([]);
+ const indent = ' '.repeat(prefix.length);
+ for (const line of lines) {
+ result.push(wrapLine(line, options?.maxColumns, result.length ? indent : prefix));
+ }
+ return result.join('\n');
+}
+
+/**
+ * @param {string} textLine
+ * @param {number|undefined} maxColumns
+ * @param {string} prefix
+ * @returns {string}
*/
-function wrapText(text, maxColumns = 0, prefix = '') {
+function wrapLine(textLine, maxColumns, prefix) {
if (!maxColumns)
- return prefix + text;
- if (text.trim().startsWith('|'))
- return prefix + text;
+ return prefix + textLine;
+ if (textLine.trim().startsWith('|'))
+ return prefix + textLine;
const indent = ' '.repeat(prefix.length);
const lines = [];
maxColumns -= indent.length;
- const words = tokenizeNoBreakLinks(text);
+ const words = tokenizeNoBreakLinks(textLine);
let line = '';
for (const word of words) {
if (line.length && line.length + word.length < maxColumns) {