Skip to content

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

docs: write type names before the type, add Python type names (#43372)

Pavel Feldman9d305c9bb565
diff --git a/docs/src/api/class-apirequest.md b/docs/src/api/class-apirequest.md
index 8e44714334..5a8e1d4ed1 100644
--- a/docs/src/api/class-apirequest.md
+++ b/docs/src/api/class-apirequest.md
@@ -63,8 +63,8 @@ Methods like [`method: APIRequestContext.get`] take the base URL into considerat
### option: APIRequest.newContext.storageState
* since: v1.16
* langs: js, python
-- `storageState` <[path]|[Object]>
- - `cookies` <[Array]<[Object]>>
+- `storageState` "StorageState" <[path]|[Object]>
+ - `cookies` "StorageStateCookie" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
- `domain` <[string]>
@@ -72,10 +72,10 @@ Methods like [`method: APIRequestContext.get`] take the base URL into considerat
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
- - `origins` <[Array]<[Object]>>
+ - `sameSite` "SameSiteAttribute" <"Strict"|"Lax"|"None">
+ - `origins` "OriginState" <[Array]<[Object]>>
- `origin` <[string]>
- - `localStorage` <[Array]<[Object]>>
+ - `localStorage` "LocalStorageEntry" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
diff --git a/docs/src/api/class-apirequestcontext.md b/docs/src/api/class-apirequestcontext.md
index e467b30873..440526be01 100644
--- a/docs/src/api/class-apirequestcontext.md
+++ b/docs/src/api/class-apirequestcontext.md
@@ -217,8 +217,7 @@ await request.ClearCookiesAsync(new() { Name = "session-id", Domain = "my-origin
## async method: APIRequestContext.cookies
* since: v1.64
-- returns: <[Array]<[Object]>>
- * alias: Cookie
+- returns: "Cookie" <[Array]<[Object]>>
* alias-csharp: BrowserContextCookiesResult
- `name` <[string]>
- `value` <[string]>
@@ -227,7 +226,7 @@ await request.ClearCookiesAsync(new() { Name = "session-id", Domain = "my-origin
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
+ - `sameSite` "SameSiteAttribute" <"Strict"|"Lax"|"None">
- `partitionKey` ?<[string]>
If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs
@@ -996,8 +995,8 @@ context cookies from the response. The method will automatically follow redirect
## async method: APIRequestContext.storageState
* since: v1.16
-- returns: <[Object]>
- - `cookies` <[Array]<[Object]>>
+- returns: "StorageState" <[Object]>
+ - `cookies` "StorageStateCookie" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
- `domain` <[string]>
@@ -1005,10 +1004,10 @@ context cookies from the response. The method will automatically follow redirect
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
- - `origins` <[Array]<[Object]>>
+ - `sameSite` "SameSiteAttribute" <"Strict"|"Lax"|"None">
+ - `origins` "OriginState" <[Array]<[Object]>>
- `origin` <[string]>
- - `localStorage` <[Array]<[Object]>>
+ - `localStorage` "LocalStorageEntry" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
diff --git a/docs/src/api/class-apiresponse.md b/docs/src/api/class-apiresponse.md
index ae1f3de440..1755d0f339 100644
--- a/docs/src/api/class-apiresponse.md
+++ b/docs/src/api/class-apiresponse.md
@@ -57,8 +57,7 @@ An object with all the response HTTP headers associated with this response.
## method: APIResponse.headersArray
* since: v1.16
-- returns: <[Array]<[Object]>>
- * alias: HttpHeader
+- returns: "HttpHeader" <[Array]<[Object]>>
* alias-csharp: Header
- `name` <[string]> Name of the header.
- `value` <[string]> Value of the header.
diff --git a/docs/src/api/class-browser.md b/docs/src/api/class-browser.md
index 174a94f254..743930a5a2 100644
--- a/docs/src/api/class-browser.md
+++ b/docs/src/api/class-browser.md
@@ -309,9 +309,8 @@ testing frameworks should explicitly create [`method: Browser.newContext`] follo
## async method: Browser.bind
* since: v1.59
-- returns: <[Object]>
- * alias: BindResult
- * alias-csharp: BrowserBindResult
+- returns: "BrowserBindResult" <[Object]>
+ * alias-java: BindResult
- `endpoint` <[string]>
Binds the browser to a named pipe or web socket, making it available for other clients to connect to.
@@ -401,6 +400,14 @@ browser.stop_tracing()
### param: Browser.startTracing.page
* since: v1.11
+* langs: java, js
+- `page` ?<[Page]>
+
+Optional, if specified, tracing includes screenshots of the given page.
+
+### option: Browser.startTracing.page
+* since: v1.11
+* langs: python
- `page` ?<[Page]>
Optional, if specified, tracing includes screenshots of the given page.
diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md
index 805dcc3e85..c3fe90f395 100644
--- a/docs/src/api/class-browsercontext.md
+++ b/docs/src/api/class-browsercontext.md
@@ -456,7 +456,7 @@ Script to be evaluated in all pages in the browser context.
Optional argument to pass to [`param: script`] (only supported when passing a function).
-### param: BrowserContext.addInitScript.path
+### option: BrowserContext.addInitScript.path
* since: v1.8
* langs: python
- `path` ?<[path]>
@@ -601,8 +601,7 @@ The default browser context cannot be closed.
## async method: BrowserContext.cookies
* since: v1.8
-- returns: <[Array]<[Object]>>
- * alias: Cookie
+- returns: "Cookie" <[Array]<[Object]>>
* alias-csharp: BrowserContextCookiesResult
- `name` <[string]>
- `value` <[string]>
@@ -611,7 +610,7 @@ The default browser context cannot be closed.
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
+ - `sameSite` "SameSiteAttribute" <"Strict"|"Lax"|"None">
- `partitionKey` ?<[string]>
If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs
@@ -760,8 +759,7 @@ Name of the function on the window object.
### param: BrowserContext.exposeBinding.callback
* since: v1.8
-- `callback` <[function]>
- * alias: BindingCallback
+- `callback` "BindingCallback" <[function]>
Callback function that will be called in the Playwright's context.
@@ -952,8 +950,7 @@ Name of the function on the window object.
### param: BrowserContext.exposeFunction.callback
* since: v1.8
-- `callback` <[function]>
- * alias: FunctionCallback
+- `callback` "FunctionCallback" <[function]>
Callback function that will be called in the Playwright's context.
@@ -1262,7 +1259,7 @@ 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">>
+- `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.
@@ -1282,13 +1279,13 @@ A glob pattern, regular expression or predicate to match the request URL. Only r
### option: BrowserContext.routeFromHAR.updateMode
* since: v1.32
-- `updateMode` <[HarMode]<"full"|"minimal">>
+- `updateMode` "HarMode" <"full"|"minimal">
When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `minimal`.
### option: BrowserContext.routeFromHAR.updateContent
* since: v1.32
-- `updateContent` <[RouteFromHarUpdateContentPolicy]<"embed"|"attach">>
+- `updateContent` "RouteFromHarUpdateContentPolicy" <"embed"|"attach">
Optional setting to control resource content management. 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.
@@ -1489,8 +1486,7 @@ its geolocation.
### param: BrowserContext.setGeolocation.geolocation
* since: v1.8
-- `geolocation` <[null]|[Object]>
- * alias: Geolocation
+- `geolocation` "Geolocation" <[null]|[Object]>
- `latitude` <[float]> Latitude between -90 and 90.
- `longitude` <[float]> Longitude between -180 and 180.
- `accuracy` ?<[float]> Non-negative accuracy value. Defaults to `0`.
@@ -1529,8 +1525,8 @@ Offline emulation only affects requests that go through the browser's regular ne
## async method: BrowserContext.storageState
* since: v1.8
-- returns: <[Object]>
- - `cookies` <[Array]<[Object]>>
+- returns: "StorageState" <[Object]>
+ - `cookies` "StorageStateCookie" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
- `domain` <[string]>
@@ -1538,10 +1534,10 @@ Offline emulation only affects requests that go through the browser's regular ne
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
- - `origins` <[Array]<[Object]>>
+ - `sameSite` "SameSiteAttribute" <"Strict"|"Lax"|"None">
+ - `origins` "OriginState" <[Array]<[Object]>>
- `origin` <[string]>
- - `localStorage` <[Array]<[Object]>>
+ - `localStorage` "LocalStorageEntry" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
diff --git a/docs/src/api/class-consolemessage.md b/docs/src/api/class-consolemessage.md
index 020d2efba7..09737fca4f 100644
--- a/docs/src/api/class-consolemessage.md
+++ b/docs/src/api/class-consolemessage.md
@@ -113,7 +113,7 @@ List of arguments passed to a `console` function call. See also [`event: Page.co
## method: ConsoleMessage.location
* since: v1.8
* langs: js, python
-- returns: <[Object]>
+- returns: "SourceLocation" <[Object]>
- `url` <[string]> URL of the resource.
- `line` <[int]> 0-based line number in the resource.
- `column` <[int]> 0-based column number in the resource.
@@ -148,7 +148,7 @@ The timestamp of the console message in milliseconds since the Unix epoch.
## method: ConsoleMessage.type
* since: v1.8
* langs: js, python
-- returns: <[ConsoleMessageType]<"log"|"debug"|"info"|"error"|"warning"|"dir"|"dirxml"|"table"|"trace"|"clear"|"startGroup"|"startGroupCollapsed"|"endGroup"|"assert"|"profile"|"profileEnd"|"count"|"time"|"timeEnd">>
+- returns: "ConsoleMessageType" <"log"|"debug"|"info"|"error"|"warning"|"dir"|"dirxml"|"table"|"trace"|"clear"|"startGroup"|"startGroupCollapsed"|"endGroup"|"assert"|"profile"|"profileEnd"|"count"|"time"|"timeEnd">
## method: ConsoleMessage.type
* since: v1.8
diff --git a/docs/src/api/class-credentials.md b/docs/src/api/class-credentials.md
index 9e8ca76eff..32fc04980a 100644
--- a/docs/src/api/class-credentials.md
+++ b/docs/src/api/class-credentials.md
@@ -299,8 +299,7 @@ page will never see those credentials.
## async method: Credentials.create
* since: v1.61
-- returns: <[Object]>
- * alias: VirtualCredential
+- returns: "VirtualCredential" <[Object]>
- `id` <[string]> Base64url-encoded credential id.
- `rpId` <[string]> Relying party id.
- `userHandle` <[string]> Base64url-encoded user handle.
@@ -372,8 +371,7 @@ Base64url-encoded credential id.
## async method: Credentials.get
* since: v1.61
-- returns: <[Array]<[Object]>>
- * alias: VirtualCredential
+- returns: "VirtualCredential" <[Array]<[Object]>>
- `id` <[string]>
- `rpId` <[string]>
- `userHandle` <[string]>
diff --git a/docs/src/api/class-debugger.md b/docs/src/api/class-debugger.md
index 8f59f7cc68..2a16f6c284 100644
--- a/docs/src/api/class-debugger.md
+++ b/docs/src/api/class-debugger.md
@@ -11,10 +11,9 @@ Emitted when the debugger pauses or resumes.
## method: Debugger.pausedDetails
* since: v1.59
-- returns: <[null]|[Object]>
- * alias: DebuggerPausedDetails
- - `location` <[Object]>
- * alias: Location
+- returns: "DebuggerPausedDetails" <[null]|[Object]>
+ - `location` "Location" <[Object]>
+ * alias-python: DebuggerLocation
- `file` <[string]>
- `line` ?<[int]>
- `column` ?<[int]>
@@ -48,8 +47,8 @@ Resumes script execution and pauses when an action originates from the given sou
### param: Debugger.runTo.location
* since: v1.59
-- `location` <[Object]>
- * alias: Location
+- `location` "Location" <[Object]>
+ * alias-python: DebuggerLocation
- `file` <[string]>
- `line` ?<[int]>
- `column` ?<[int]>
diff --git a/docs/src/api/class-disposable.md b/docs/src/api/class-disposable.md
index 2453f28252..52ab182ed7 100644
--- a/docs/src/api/class-disposable.md
+++ b/docs/src/api/class-disposable.md
@@ -1,10 +1,16 @@
# class: Disposable
* since: v1.59
-* langs: js
+* langs: js, python
[Disposable] is returned from various methods to allow undoing the corresponding action. For example,
[`method: Page.addInitScript`] returns a [Disposable] that can be used to remove the init script.
+## async method: Disposable.close
+* since: v1.59
+* langs: python
+
+Same as [`method: Disposable.dispose`].
+
## async method: Disposable.dispose
* since: v1.59
diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md
index bbd39d23af..58270ba584 100644
--- a/docs/src/api/class-elementhandle.md
+++ b/docs/src/api/class-elementhandle.md
@@ -108,9 +108,9 @@ await locator.ClickAsync();
## async method: ElementHandle.boundingBox
* since: v1.8
-- returns: <[null]|[Object]>
- * alias: BoundingBox
+- returns: "BoundingBox" <[null]|[Object]>
* alias-csharp: ElementHandleBoundingBoxResult
+ * alias-python: FloatRect
- `x` <[float]> the x coordinate of the element in pixels.
- `y` <[float]> the y coordinate of the element in pixels.
- `width` <[float]> the width of the element in pixels.
@@ -912,16 +912,16 @@ await handle.SelectOptionAsync(new[] {
### option: ElementHandle.selectOption.signal = %%-input-signal-%%
-### param: ElementHandle.selectOption.element = %%-python-select-options-element-%%
+### option: ElementHandle.selectOption.element = %%-python-select-options-element-%%
* since: v1.8
-### param: ElementHandle.selectOption.index = %%-python-select-options-index-%%
+### option: ElementHandle.selectOption.index = %%-python-select-options-index-%%
* since: v1.8
### param: ElementHandle.selectOption.value = %%-python-select-options-value-%%
* since: v1.8
-### param: ElementHandle.selectOption.label = %%-python-select-options-label-%%
+### option: ElementHandle.selectOption.label = %%-python-select-options-label-%%
* since: v1.8
## async method: ElementHandle.selectText
@@ -1155,7 +1155,7 @@ If the element does not satisfy the condition for the [`option: timeout`] millis
### param: ElementHandle.waitForElementState.state
* since: v1.8
-- `state` <[ElementState]<"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">>
+- `state` "ElementState" <"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">
A state to wait for, see below for more details.
diff --git a/docs/src/api/class-formdata.md b/docs/src/api/class-formdata.md
index ea714ef79e..8dff5d61b4 100644
--- a/docs/src/api/class-formdata.md
+++ b/docs/src/api/class-formdata.md
@@ -114,8 +114,7 @@ Field name.
### param: FormData.append.value
* since: v1.44
-- `value` <[string]|[boolean]|[int]|[path]|[Object]>
- * alias: FilePayload
+- `value` "FilePayload" <[string]|[boolean]|[int]|[path]|[Object]>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
@@ -125,8 +124,7 @@ Field value.
### param: FormData.append.value
* since: v1.44
* langs: csharp
-- `value` <[string]|[boolean]|[int]|[Object]>
- * alias: FilePayload
+- `value` "FilePayload" <[string]|[boolean]|[int]|[Object]>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
@@ -215,8 +213,7 @@ Field name.
### param: FormData.set.value
* since: v1.18
-- `value` <[string]|[boolean]|[int]|[path]|[Object]>
- * alias: FilePayload
+- `value` "FilePayload" <[string]|[boolean]|[int]|[path]|[Object]>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
@@ -226,8 +223,7 @@ Field value.
### param: FormData.set.value
* since: v1.18
* langs: csharp
-- `value` <[string]|[boolean]|[int]|[Object]>
- * alias: FilePayload
+- `value` "FilePayload" <[string]|[boolean]|[int]|[Object]>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md
index db24dd5229..379fa718ed 100644
--- a/docs/src/api/class-frame.md
+++ b/docs/src/api/class-frame.md
@@ -1411,6 +1411,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
### option: Frame.isHidden.timeout
* since: v1.8
+* langs: js, java, csharp
* deprecated: This option is ignored. [`method: Frame.isHidden`] does not wait for the element to become hidden and returns immediately.
- `timeout` <[float]>
@@ -1429,6 +1430,7 @@ Returns whether the element is [visible](../actionability.md#visible). [`param:
### option: Frame.isVisible.timeout
* since: v1.8
+* langs: js, java, csharp
* deprecated: This option is ignored. [`method: Frame.isVisible`] does not wait for the element to become visible and returns immediately.
- `timeout` <[float]>
@@ -1656,16 +1658,16 @@ await frame.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" })
### option: Frame.selectOption.signal = %%-input-signal-%%
-### param: Frame.selectOption.element = %%-python-select-options-element-%%
+### option: Frame.selectOption.element = %%-python-select-options-element-%%
* since: v1.8
-### param: Frame.selectOption.index = %%-python-select-options-index-%%
+### option: Frame.selectOption.index = %%-python-select-options-index-%%
* since: v1.8
### param: Frame.selectOption.value = %%-python-select-options-value-%%
* since: v1.8
-### param: Frame.selectOption.label = %%-python-select-options-label-%%
+### option: Frame.selectOption.label = %%-python-select-options-label-%%
* since: v1.8
## async method: Frame.setChecked
@@ -2066,6 +2068,14 @@ await page.MainFrame.WaitForFunctionAsync("selector => !!document.querySelector(
### param: Frame.waitForFunction.arg
* since: v1.8
+* langs: js, java, csharp
+- `arg` ?<[EvaluationArgument]>
+
+Optional argument to pass to [`param: expression`].
+
+### option: Frame.waitForFunction.arg
+* since: v1.8
+* langs: python
- `arg` ?<[EvaluationArgument]>
Optional argument to pass to [`param: expression`].
diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md
index a6c731b4e3..effdcf5df5 100644
--- a/docs/src/api/class-locator.md
+++ b/docs/src/api/class-locator.md
@@ -213,7 +213,7 @@ An AI-optimized snapshot, controlled by [`option: Locator.ariaSnapshot.mode`], i
### option: Locator.ariaSnapshot.mode
* since: v1.59
-- `mode` <[AriaSnapshotMode]<"ai"|"default">>
+- `mode` "AriaSnapshotMode" <"ai"|"default">
When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to `"default"`. See details for more information.
@@ -268,7 +268,7 @@ The result is a list of nodes, each node being an object with the following prop
### option: Locator.ariaSnapshotJSON.mode
* since: v1.63
-- `mode` <[AriaSnapshotMode]<"ai"|"default">>
+- `mode` "AriaSnapshotMode" <"ai"|"default">
When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to `"default"`. See details in [`method: Locator.ariaSnapshot`].
@@ -309,9 +309,9 @@ Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur)
## async method: Locator.boundingBox
* since: v1.14
-- returns: <[null]|[Object]>
- * alias: BoundingBox
+- returns: "BoundingBox" <[null]|[Object]>
* alias-csharp: LocatorBoundingBoxResult
+ * alias-python: FloatRect
- `x` <[float]> the x coordinate of the element in pixels.
- `y` <[float]> the y coordinate of the element in pixels.
- `width` <[float]> the width of the element in pixels.
@@ -2546,16 +2546,16 @@ await element.SelectOptionAsync(new[] { "red", "green", "blue" });
### option: Locator.selectOption.signal = %%-input-signal-%%
-### param: Locator.selectOption.element = %%-python-select-options-element-%%
+### option: Locator.selectOption.element = %%-python-select-options-element-%%
* since: v1.14
-### param: Locator.selectOption.index = %%-python-select-options-index-%%
+### option: Locator.selectOption.index = %%-python-select-options-index-%%
* since: v1.14
### param: Locator.selectOption.value = %%-python-select-options-value-%%
* since: v1.14
-### param: Locator.selectOption.label = %%-python-select-options-label-%%
+### option: Locator.selectOption.label = %%-python-select-options-label-%%
* since: v1.14
## async method: Locator.selectText
@@ -3076,6 +3076,14 @@ await page.getByTestId('status').waitForFunction((element, value) => {
### param: Locator.waitForFunction.arg
* since: v1.62
+* langs: js, java, csharp
+- `arg` ?<[EvaluationArgument]>
+
+Optional argument to pass to [`param: expression`].
+
+### option: Locator.waitForFunction.arg
+* since: v1.62
+* langs: python
- `arg` ?<[EvaluationArgument]>
Optional argument to pass to [`param: expression`].
diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md
index 200c4ec204..95c084d0e3 100644
--- a/docs/src/api/class-locatorassertions.md
+++ b/docs/src/api/class-locatorassertions.md
@@ -247,7 +247,7 @@ Whether to use `element.innerText` instead of `element.textContent` when retriev
The opposite of [`method: LocatorAssertions.toHaveAccessibleDescription`].
-### param: LocatorAssertions.NotToHaveAccessibleDescription.name
+### param: LocatorAssertions.NotToHaveAccessibleDescription.description
* since: v1.44
- `description` <[string]|[RegExp]>
@@ -1824,7 +1824,7 @@ CSS property value.
### option: LocatorAssertions.toHaveCSS.pseudo
* since: v1.60
-- `pseudo` <[PseudoElement]<"before"|"after">>
+- `pseudo` "PseudoElement" <"before"|"after">
Pseudo-element to read computed styles from.
diff --git a/docs/src/api/class-logger.md b/docs/src/api/class-logger.md
index bd32e7065d..9e900590ca 100644
--- a/docs/src/api/class-logger.md
+++ b/docs/src/api/class-logger.md
@@ -33,7 +33,7 @@ logger name
### param: Logger.isEnabled.severity
* since: v1.8
-- `severity` <[LogSeverity]<"verbose"|"info"|"warning"|"error">>
+- `severity` "LogSeverity" <"verbose"|"info"|"warning"|"error">
## method: Logger.log
* since: v1.8
@@ -46,7 +46,7 @@ logger name
### param: Logger.log.severity
* since: v1.8
-- `severity` <[LogSeverity]<"verbose"|"info"|"warning"|"error">>
+- `severity` "LogSeverity" <"verbose"|"info"|"warning"|"error">
### param: Logger.log.message
* since: v1.8
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md
index 1a3d68401a..d055e2a71b 100644
--- a/docs/src/api/class-page.md
+++ b/docs/src/api/class-page.md
@@ -643,7 +643,7 @@ Script to be evaluated in all pages in the browser context.
Optional argument to pass to [`param: script`] (only supported when passing a function).
-### param: Page.addInitScript.path
+### option: Page.addInitScript.path
* since: v1.8
* langs: python
- `path` ?<[path]>
@@ -1291,7 +1291,7 @@ await page.EvaluateAsync("matchMedia('(prefers-color-scheme: light)').matches");
### option: Page.emulateMedia.media
* since: v1.9
* langs: js, java
-- `media` <null|[Media]<"screen"|"print">>
+- `media` "Media" <null|"screen"|"print">
Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`.
Passing `null` disables CSS media emulation.
@@ -1299,7 +1299,7 @@ Passing `null` disables CSS media emulation.
### option: Page.emulateMedia.media
* since: v1.9
* langs: csharp, python
-- `media` <[Media]<"screen"|"print"|"null">>
+- `media` "Media" <"screen"|"print"|"null">
Changes the CSS media type of the page. The only allowed values are `'Screen'`, `'Print'` and `'Null'`.
Passing `'Null'` disables CSS media emulation.
@@ -1307,7 +1307,7 @@ Passing `'Null'` disables CSS media emulation.
### option: Page.emulateMedia.colorScheme
* since: v1.9
* langs: js, java
-- `colorScheme` <null|[ColorScheme]<"light"|"dark"|"no-preference">>
+- `colorScheme` "ColorScheme" <null|"light"|"dark"|"no-preference">
Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. Passing
`null` disables color scheme emulation. `'no-preference'` is deprecated.
@@ -1315,7 +1315,7 @@ Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CS
### option: Page.emulateMedia.colorScheme
* since: v1.9
* langs: csharp, python
-- `colorScheme` <[ColorScheme]<"light"|"dark"|"no-preference"|"null">>
+- `colorScheme` "ColorScheme" <"light"|"dark"|"no-preference"|"null">
Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. Passing
`'Null'` disables color scheme emulation. `'no-preference'` is deprecated.
@@ -1323,40 +1323,40 @@ Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CS
### option: Page.emulateMedia.reducedMotion
* since: v1.12
* langs: js, java
-- `reducedMotion` <null|[ReducedMotion]<"reduce"|"no-preference">>
+- `reducedMotion` "ReducedMotion" <null|"reduce"|"no-preference">
Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing `null` disables reduced motion emulation.
### option: Page.emulateMedia.reducedMotion
* since: v1.12
* langs: csharp, python
-- `reducedMotion` <[ReducedMotion]<"reduce"|"no-preference"|"null">>
+- `reducedMotion` "ReducedMotion" <"reduce"|"no-preference"|"null">
Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing `null` disables reduced motion emulation.
### option: Page.emulateMedia.forcedColors
* since: v1.15
* langs: js, java
-- `forcedColors` <null|[ForcedColors]<"active"|"none">>
+- `forcedColors` "ForcedColors" <null|"active"|"none">
Emulates `'forced-colors'` media feature, supported values are `'active'` and `'none'`. Passing `null` disables forced colors emulation.
### option: Page.emulateMedia.forcedColors
* since: v1.15
* langs: csharp, python
-- `forcedColors` <[ForcedColors]<"active"|"none"|"null">>
+- `forcedColors` "ForcedColors" <"active"|"none"|"null">
### option: Page.emulateMedia.contrast
* since: v1.51
* langs: js, java
-- `contrast` <null|[Contrast]<"no-preference"|"more">>
+- `contrast` "Contrast" <null|"no-preference"|"more">
Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. Passing `null` disables contrast emulation.
### option: Page.emulateMedia.contrast
* since: v1.51
* langs: csharp, python
-- `contrast` <[Contrast]<"no-preference"|"more"|"null">>
+- `contrast` "Contrast" <"no-preference"|"more"|"null">
## async method: Page.evalOnSelector
* since: v1.9
@@ -1868,8 +1868,7 @@ Name of the function on the window object.
### param: Page.exposeBinding.callback
* since: v1.8
-- `callback` <[function]>
- * alias: BindingCallback
+- `callback` "BindingCallback" <[function]>
Callback function that will be called in the Playwright's context.
@@ -2062,8 +2061,7 @@ Name of the function on the window object
### param: Page.exposeFunction.callback
* since: v1.8
-- `callback` <[function]>
- * alias: FunctionCallback
+- `callback` "FunctionCallback" <[function]>
Callback function which will be called in Playwright's context.
@@ -2181,7 +2179,7 @@ Frame name or other frame lookup options.
Frame name specified in the `iframe`'s `name` attribute.
-### option: Page.frame.name
+### param: Page.frame.name
* since: v1.8
* langs: python
- `name` ?<[string]>
@@ -2882,7 +2880,7 @@ Returns up to (currently) 200 last console messages from this page. See [`event:
### option: Page.consoleMessages.filter
* since: v1.59
-- `filter` <[ConsoleMessagesFilter]<"all"|"since-navigation">>
+- `filter` "ConsoleMessagesFilter" <"all"|"since-navigation">
Controls which messages are returned:
- `'since-navigation'` (default) — returns only messages logged after the last committed main-frame navigation.
@@ -2905,7 +2903,7 @@ Returns up to (currently) 200 last page errors from this page. See [`event: Page
### option: Page.pageErrors.filter
* since: v1.59
-- `filter` <[PageErrorsFilter]<"all"|"since-navigation">>
+- `filter` "PageErrorsFilter" <"all"|"since-navigation">
Controls which errors are returned:
- `'since-navigation'` (default) — returns only errors thrown after the last committed main-frame navigation.
@@ -3174,7 +3172,7 @@ Paper height, accepts values labeled with units.
### option: Page.pdf.margin
* since: v1.8
* langs: js, python
-- `margin` <[Object]>
+- `margin` "PdfMargins" <[Object]>
- `top` ?<[string]|[float]> Top margin, accepts values labeled with units. Defaults to `0`.
- `right` ?<[string]|[float]> Right margin, accepts values labeled with units. Defaults to `0`.
- `bottom` ?<[string]|[float]> Bottom margin, accepts values labeled with units. Defaults to `0`.
@@ -3940,7 +3938,7 @@ 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">>
+- `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.
@@ -3960,13 +3958,13 @@ A glob pattern, regular expression or predicate to match the request URL. Only r
### option: Page.routeFromHAR.updateMode
* since: v1.32
-- `updateMode` <[HarMode]<"full"|"minimal">>
+- `updateMode` "HarMode" <"full"|"minimal">
When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `minimal`.
### option: Page.routeFromHAR.updateContent
* since: v1.32
-- `updateContent` <[RouteFromHarUpdateContentPolicy]<"embed"|"attach">>
+- `updateContent` "RouteFromHarUpdateContentPolicy" <"embed"|"attach">
Optional setting to control resource content management. 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.
@@ -4193,16 +4191,16 @@ await page.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" });
### option: Page.selectOption.signal = %%-input-signal-%%
-### param: Page.selectOption.element = %%-python-select-options-element-%%
+### option: Page.selectOption.element = %%-python-select-options-element-%%
* since: v1.8
-### param: Page.selectOption.index = %%-python-select-options-index-%%
+### option: Page.selectOption.index = %%-python-select-options-index-%%
* since: v1.8
### param: Page.selectOption.value = %%-python-select-options-value-%%
* since: v1.8
-### param: Page.selectOption.label = %%-python-select-options-label-%%
+### option: Page.selectOption.label = %%-python-select-options-label-%%
* since: v1.8
## async method: Page.setChecked
@@ -4408,7 +4406,7 @@ await page.GotoAsync("https://www.microsoft.com");
### param: Page.setViewportSize.viewportSize
* since: v1.8
* langs: js, python
-- `viewportSize` <[Object]>
+- `viewportSize` "ViewportSize" <[Object]>
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
@@ -4434,7 +4432,7 @@ Captures the aria snapshot of the page. Read more about [aria snapshots](../aria
### option: Page.ariaSnapshot.mode
* since: v1.59
-- `mode` <[AriaSnapshotMode]<"ai"|"default">>
+- `mode` "AriaSnapshotMode" <"ai"|"default">
When set to `"ai"`, returns a snapshot optimized for AI consumption: including element references like `[ref=e2]` and snapshots of `<iframe>`s. Defaults to `"default"`.
@@ -4471,7 +4469,7 @@ See [`method: Locator.ariaSnapshotJSON`] for the details of the format.
### option: Page.ariaSnapshotJSON.mode
* since: v1.63
-- `mode` <[AriaSnapshotMode]<"ai"|"default">>
+- `mode` "AriaSnapshotMode" <"ai"|"default">
When set to `"ai"`, returns a snapshot optimized for AI consumption: including element references like `[ref=e2]` and snapshots of `<iframe>`s. Defaults to `"default"`.
@@ -4720,8 +4718,7 @@ Video object associated with this page. Can be used to access the video file whe
## method: Page.viewportSize
* since: v1.8
-- returns: <[null]|[Object]>
- * alias: ViewportSize
+- returns: "ViewportSize" <[null]|[Object]>
* alias-csharp: PageViewportSizeResult
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
@@ -5069,6 +5066,14 @@ await page.WaitForFunctionAsync("selector => !!document.querySelector(selector)"
### param: Page.waitForFunction.arg
* since: v1.8
+* langs: js, java, csharp
+- `arg` ?<[EvaluationArgument]>
+
+Optional argument to pass to [`param: expression`].
+
+### option: Page.waitForFunction.arg
+* since: v1.8
+* langs: python
- `arg` ?<[EvaluationArgument]>
Optional argument to pass to [`param: expression`].
@@ -5414,10 +5419,12 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/We
### param: Page.waitForRequest.urlOrPredicate
* since: v1.8
-* langs: js
+* langs: js, python
- `urlOrPredicate` <[string]|[RegExp]|[function]\([Request]\):[boolean]|[Promise]<[boolean]>>
Request URL string, regex or predicate receiving [Request] object.
+When a [`option: Browser.newContext.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.
### option: Page.waitForRequest.timeout
* since: v1.8
@@ -5579,7 +5586,7 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/We
### param: Page.waitForResponse.urlOrPredicate
* since: v1.8
-* langs: js
+* langs: js, python
- `urlOrPredicate` <[string]|[RegExp]|[function]\([Response]\):[boolean]|[Promise]<[boolean]>>
Request URL string, regex or predicate receiving [Response] object.
diff --git a/docs/src/api/class-request.md b/docs/src/api/class-request.md
index 439bad74a5..baf216cdad 100644
--- a/docs/src/api/class-request.md
+++ b/docs/src/api/class-request.md
@@ -113,8 +113,7 @@ You can use [`method: Request.allHeaders`] for complete list of headers that inc
## async method: Request.headersArray
* since: v1.15
-- returns: <[Array]<[Object]>>
- * alias: HttpHeader
+- returns: "HttpHeader" <[Array]<[Object]>>
* alias-csharp: Header
- `name` <[string]> Name of the header.
- `value` <[string]> Value of the header.
@@ -312,7 +311,7 @@ Requests originated in a Service Worker do not have a [`method: Request.frame`]
## async method: Request.sizes
* since: v1.15
-- returns: <[Object]>
+- returns: "RequestSizes" <[Object]>
* alias-csharp: RequestSizesResult
* alias-java: Sizes
- `requestBodySize` <[int]> Size of the request body (POST data payload) in bytes. Set to 0 if there was no body.
diff --git a/docs/src/api/class-response.md b/docs/src/api/class-response.md
index 03fa2f5e47..1e1575ba04 100644
--- a/docs/src/api/class-response.md
+++ b/docs/src/api/class-response.md
@@ -26,6 +26,11 @@ Waits for this response to finish, returns always `null`.
* langs: js
- returns: <[null]|[Error]>
+## async method: Response.finished
+* since: v1.8
+* langs: python
+- returns: <[void]>
+
## method: Response.frame
* since: v1.8
- returns: <[Frame]>
@@ -48,8 +53,7 @@ You can use [`method: Response.allHeaders`] for complete list of headers that in
## async method: Response.headersArray
* since: v1.15
-- returns: <[Array]<[Object]>>
- * alias: HttpHeader
+- returns: "HttpHeader" <[Array]<[Object]>>
* alias-csharp: Header
- `name` <[string]> Name of the header.
- `value` <[string]> Value of the header.
diff --git a/docs/src/api/class-screencast.md b/docs/src/api/class-screencast.md
index c7c650bd7d..537c71c129 100644
--- a/docs/src/api/class-screencast.md
+++ b/docs/src/api/class-screencast.md
@@ -41,8 +41,7 @@ Higher frame rates make animations and scrolling smoother at the cost of more CP
### option: Screencast.start.onFrame
* since: v1.59
-- `onFrame` <[function]\([Object]\): [Promise]>
- * alias: ScreencastFrame
+- `onFrame` "ScreencastFrame" <[function]\([Object]\): [Promise]>
- `data` <[Buffer]> JPEG-encoded frame data.
- `timestamp` <[float]> The timestamp of when the frame was presented by the browser, in milliseconds since the Unix epoch.
- `viewportWidth` <[int]> Width of the page viewport at the time the frame was captured.
@@ -64,8 +63,8 @@ The quality of the image, between 0-100.
### option: Screencast.start.size
* since: v1.59
-- `size` ?<[Object]>
- * alias-csharp: ScreencastSize
+- `size` "ScreencastSize" ?<[Object]>
+ * alias-java: Size
- `width` <[int]> Max frame width in pixels.
- `height` <[int]> Max frame height in pixels.
@@ -133,7 +132,7 @@ How long each annotation is displayed in milliseconds. Defaults to `500`.
### option: Screencast.showActions.position
* since: v1.59
-- `position` ?<[AnnotatePosition]<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">>
+- `position` "AnnotatePosition" ?<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">
Position of the action title overlay. Defaults to `"top-right"`.
@@ -146,7 +145,7 @@ Font size of the action title in pixels. Defaults to `24`.
### option: Screencast.showActions.cursor
* since: v1.61
-- `cursor` ?<[ScreencastCursor]<"none"|"pointer">>
+- `cursor` "ScreencastCursor" ?<"none"|"pointer">
Cursor decoration shown for pointer actions. `"pointer"` (the default) renders
a mouse pointer that animates from the previous action point to the next one.
@@ -154,8 +153,7 @@ a mouse pointer that animates from the previous action point to the next one.
### option: Screencast.showActions.style
* since: v1.64
-- `style` ?<[Object]>
- * alias: ScreencastActionStyle
+- `style` "ScreencastActionStyle" ?<[Object]>
- `point` ?<[string]> CSS declarations for the marker at the action point. The marker is positioned at the action point, has zero size and is centered on the point, so its size and look come from this style. Not shown when omitted.
- `highlight` ?<[string]> CSS declarations for the box that covers the target element. The box is positioned and sized to the element bounds. Not shown when omitted.
- `title` ?<[string]> CSS declarations for the action title, for example `'font-size: 32px; background: #333'`. The title is placed according to [`option: Screencast.showActions.position`].
diff --git a/docs/src/api/class-tracing.md b/docs/src/api/class-tracing.md
index 54cfddf8fe..0d407ad12b 100644
--- a/docs/src/api/class-tracing.md
+++ b/docs/src/api/class-tracing.md
@@ -381,13 +381,13 @@ Path on the filesystem to write the HAR file to. If the file name ends with `.zi
### option: Tracing.startHar.content
* since: v1.60
-- `content` <[HarContentPolicy]<"omit"|"embed"|"attach">>
+- `content` "HarContentPolicy" <"omit"|"embed"|"attach">
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.
### option: Tracing.startHar.mode
* since: v1.60
-- `mode` <[HarMode]<"full"|"minimal">>
+- `mode` "HarMode" <"full"|"minimal">
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`.
@@ -468,8 +468,7 @@ Group name shown in the trace viewer.
### option: Tracing.group.location
* since: v1.49
-- `location` ?<[Object]>
- * alias: Location
+- `location` "Location" ?<[Object]>
- `file` <[string]>
- `line` ?<[int]>
- `column` ?<[int]>
diff --git a/docs/src/api/class-weberror.md b/docs/src/api/class-weberror.md
index 8f3c91a960..94d60f70d0 100644
--- a/docs/src/api/class-weberror.md
+++ b/docs/src/api/class-weberror.md
@@ -68,8 +68,7 @@ Unhandled error that was thrown.
## method: WebError.location
* since: v1.60
-- returns: <[Object]>
- * alias: WebErrorLocation
+- returns: "WebErrorLocation" <[Object]>
- `url` <[string]> URL of the resource.
- `line` <[int]> 0-based line number in the resource.
- `column` <[int]> 0-based column number in the resource.
diff --git a/docs/src/api/class-webmcp.md b/docs/src/api/class-webmcp.md
index 2d992a94d3..50b54bbf6b 100644
--- a/docs/src/api/class-webmcp.md
+++ b/docs/src/api/class-webmcp.md
@@ -53,13 +53,11 @@ Input for the tool, matching its `inputSchema`. Defaults to an empty object.
## async method: WebMCP.tools
* since: v1.64
-- returns: <[Array]<[Object]>>
- * alias: WebMCPTool
+- returns: "WebMCPTool" <[Array]<[Object]>>
- `name` <[string]> Tool name, unique within the frame.
- `description` <[string]> Tool description.
- `inputSchema` ?<[Serializable]> JSON Schema of the tool input, when the page provides one.
- - `annotations` ?<[Object]> Hints the page provides about the tool.
- - alias: WebMCPToolAnnotations
+ - `annotations` "WebMCPToolAnnotations" ?<[Object]> Hints the page provides about the tool.
- `readOnly` ?<[boolean]> The tool does not modify any state.
- `untrustedContent` ?<[boolean]> The tool output may contain third-party content.
- `consequential` ?<[boolean]> The tool takes a consequential action, such as placing an order.
diff --git a/docs/src/api/class-websocketroute.md b/docs/src/api/class-websocketroute.md
index c4c8dfc0b7..95e9cf32f7 100644
--- a/docs/src/api/class-websocketroute.md
+++ b/docs/src/api/class-websocketroute.md
@@ -351,7 +351,7 @@ Calling this method again will override the handler with a new one.
### param: WebSocketRoute.onMessage.handler
* since: v1.48
* langs: js, python
-- `handler` <[function]\([string]\): [Promise<any>|any]>
+- `handler` <[function]\([string]|[Buffer]\): [Promise<any>|any]>
Function that will handle messages.
diff --git a/docs/src/api/class-webstorage.md b/docs/src/api/class-webstorage.md
index 76dcf6c95c..e5388a8600 100644
--- a/docs/src/api/class-webstorage.md
+++ b/docs/src/api/class-webstorage.md
@@ -53,8 +53,7 @@ await page.LocalStorage.ClearAsync();
## async method: WebStorage.items
* since: v1.61
-- returns: <[Array]<[Object]>>
- * alias: WebStorageItem
+- returns: "WebStorageItem" <[Array]<[Object]>>
- `name` <[string]>
- `value` <[string]>
diff --git a/docs/src/api/params.md b/docs/src/api/params.md
index 1a0be85da5..749a50eebd 100644
--- a/docs/src/api/params.md
+++ b/docs/src/api/params.md
@@ -1,5 +1,5 @@
## navigation-wait-until
-- `waitUntil` <[WaitUntilState]<"load"|"domcontentloaded"|"networkidle"|"commit">>
+- `waitUntil` "WaitUntilState" <"load"|"domcontentloaded"|"networkidle"|"commit">
When to consider operation succeeded, defaults to `load`. Events can be either:
* `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
@@ -87,7 +87,7 @@ This option has no effect.
Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
## input-scroll
-- `scroll` <[ScrollMode]<"auto"|"none">>
+- `scroll` "ScrollMode" <"auto"|"none">
Controls whether Playwright scrolls the element into view before performing the action. Defaults to `"auto"`,
which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to
@@ -110,8 +110,7 @@ A selector to search for an element to drag. If there are multiple elements sati
A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will be used.
## input-position
-- `position` <[Object]>
- * alias: Position
+- `position` "Position" <[Object]>
- `x` <[float]>
- `y` <[float]>
@@ -129,29 +128,26 @@ Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel bet
Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between the `mousedown` and `mouseup` of the drag. When set to 1, emits a single `mousemove` event at the destination location.
## input-modifiers
-- `modifiers` <[Array]<[KeyboardModifier]<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">>>
+- `modifiers` "KeyboardModifier" <[Array]<"Alt"|"Control"|"ControlOrMeta"|"Meta"|"Shift">>
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. "ControlOrMeta" resolves to "Control" on Windows
and Linux and to "Meta" on macOS.
## input-button
-- `button` <[MouseButton]<"left"|"right"|"middle">>
+- `button` "MouseButton" <"left"|"right"|"middle">
Defaults to `left`.
## input-files
-- `files` <[path]|[Array]<[path]>|[Object]|[Array]<[Object]>>
- * alias: FilePayload
+- `files` "FilePayload" <[path]|[Array]<[path]>|[Object]|[Array]<[Object]>>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
## drop-payload
-- `payload` <[Object]>
- * alias: DropPayload
- - `files` ?<[path]|[Array]<[path]>|[Object]|[Array]<[Object]>>
- * alias: FilePayload
+- `payload` "DropPayload" <[Object]>
+ - `files` "FilePayload" ?<[path]|[Array]<[path]>|[Object]|[Array]<[Object]>>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
@@ -182,16 +178,16 @@ When set, this method only performs the [actionability](../actionability.md) che
When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it. Note that keyboard `modifiers` will be pressed regardless of `trial` to allow testing elements which are only visible when those keys are pressed.
## input-source-position
-- `sourcePosition` <[Object]>
- * alias-java: Position
+- `sourcePosition` "Position" <[Object]>
+ * alias-csharp: SourcePosition
- `x` <[float]>
- `y` <[float]>
Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used.
## input-target-position
-- `targetPosition` <[Object]>
- * alias-java: Position
+- `targetPosition` "Position" <[Object]>
+ * alias-csharp: TargetPosition
- `x` <[float]>
- `y` <[float]>
@@ -220,7 +216,7 @@ A selector to use when resolving DOM element.
A selector or locator to use when resolving DOM element.
## wait-for-selector-state
-- `state` <[WaitForSelectorState]<"attached"|"detached"|"visible"|"hidden">>
+- `state` "WaitForSelectorState" <"attached"|"detached"|"visible"|"hidden">
Defaults to `'visible'`. Can be either:
* `'attached'` - wait for element to be present in DOM.
@@ -266,8 +262,8 @@ If `true`, Playwright does not pass its own configurations args and only uses th
Dangerous option; use with care. Defaults to `false`.
## browser-option-proxy
-- `proxy` <[Object]>
- * alias: Proxy
+- `proxy` "Proxy" <[Object]>
+ * alias-python: ProxySettings
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example
`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP
proxy.
@@ -296,8 +292,8 @@ Specify environment variables that will be visible to the browser. Defaults to `
## js-python-context-option-storage-state
* langs: js, python
-- `storageState` <[path]|[Object]>
- - `cookies` <[Array]<[Object]>> Cookies to set for context
+- `storageState` "StorageState" <[path]|[Object]>
+ - `cookies` "StorageStateCookie" <[Array]<[Object]>> Cookies to set for context
- `name` <[string]>
- `value` <[string]>
- `domain` <[string]> Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com"
@@ -305,10 +301,10 @@ Specify environment variables that will be visible to the browser. Defaults to `
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- - `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">> sameSite flag
- - `origins` <[Array]<[Object]>>
+ - `sameSite` "SameSiteAttribute" <"Strict"|"Lax"|"None"> sameSite flag
+ - `origins` "OriginState" <[Array]<[Object]>>
- `origin` <[string]>
- - `localStorage` <[Array]<[Object]>> localStorage to set for context
+ - `localStorage` "LocalStorageEntry" <[Array]<[Object]>> localStorage to set for context
- `name` <[string]>
- `value` <[string]>
@@ -331,8 +327,8 @@ Populates context with given storage state. This option can be used to initializ
obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.
## add-cookies-param
-- `cookies` <[Array]<[Object]>>
- * alias-java: Cookie
+- `cookies` "Cookie" <[Array]<[Object]>>
+ * alias-python: SetCookieParam
- `name` <[string]>
- `value` <[string]>
- `url` ?<[string]> Either `url` or both `domain` and `path` are required. Optional.
@@ -341,7 +337,7 @@ obtained via [`method: BrowserContext.storageState`]. Path to the file with save
- `expires` ?<[float]> Unix time in seconds. Optional.
- `httpOnly` ?<[boolean]> Optional.
- `secure` ?<[boolean]> Optional.
- - `sameSite` ?<[SameSiteAttribute]<"Strict"|"Lax"|"None">> Optional.
+ - `sameSite` "SameSiteAttribute" ?<"Strict"|"Lax"|"None"> Optional.
- `partitionKey` ?<[string]> For partitioned third-party cookies (aka [CHIPS](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies)), the partition key. Optional.
## clear-cookies-option-name
@@ -397,8 +393,7 @@ When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitFor
## context-option-viewport
* langs: js, java
- alias-java: viewportSize
-- `viewport` <[null]|[Object]>
- * alias: ViewportSize
+- `viewport` "ViewportSize" <[null]|[Object]>
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
@@ -431,8 +426,7 @@ It makes the execution of the tests non-deterministic.
* langs:
- alias-java: screenSize
- alias-csharp: screenSize
-- `screen` <[Object]>
- * alias: ScreenSize
+- `screen` "ScreenSize" <[Object]>
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
@@ -565,7 +559,7 @@ or as file-like object containing file name, mime-type and its content.
## python-fetch-option-multipart
* langs: python
-- `multipart` <[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>|[FormData]>
+- `multipart` "FilePayload" <[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>|[FormData]>
- `name` <[string]> File name
- `mimeType` <[string]> File type
- `buffer` <[Buffer]> File content
@@ -662,7 +656,7 @@ Function to be evaluated in the main Electron process.
## python-context-option-viewport
* langs: python
-- `viewport` <[null]|[Object]>
+- `viewport` "ViewportSize" <[null]|[Object]>
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
@@ -675,8 +669,7 @@ Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_
Does not enforce fixed viewport, allows resizing window in the headed mode.
## context-option-clientCertificates
-- `clientCertificates` <[Array]<[Object]>>
- * alias: ClientCertificate
+- `clientCertificates` "ClientCertificate" <[Array]<[Object]>>
- `origin` <[string]> Exact origin that the certificate is valid for. Origin includes `https` protocol, a hostname and optionally a port.
- `certPath` ?<[path]> Path to the file with the certificate in PEM format.
- `cert` ?<[Buffer]> Direct value of the certificate in PEM format.
@@ -730,8 +723,7 @@ Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromi
for a list of supported timezone IDs. Defaults to the system timezone.
## context-option-geolocation
-- `geolocation` <[Object]>
- * alias: Geolocation
+- `geolocation` "Geolocation" <[Object]>
- `latitude` <[float]> Latitude between -90 and 90.
- `longitude` <[float]> Longitude between -180 and 180.
- `accuracy` ?<[float]> Non-negative accuracy value. Defaults to `0`.
@@ -758,12 +750,11 @@ An object containing additional HTTP headers to be sent with every request. Defa
Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline).
## context-option-httpcredentials
-- `httpCredentials` <[Object]|[Array]<[Object]>>
- * alias: HttpCredentials
+- `httpCredentials` "HttpCredentials" <[Object]|[Array]<[Object]>>
- `username` <[string]>
- `password` <[string]>
- `origin` ?<[string]> Restrain sending http credentials on specific origin (scheme://host:port).
- - `send` ?<[HttpCredentialsSend]<"unauthorized"|"always">> This option only applies to the requests sent from corresponding [APIRequestContext] and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
+ - `send` "HttpCredentialsSend" ?<"unauthorized"|"always"> This option only applies to the requests sent from corresponding [APIRequestContext] and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`.
Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
If no origin is specified, the username and password are sent to any servers upon unauthorized responses.
@@ -772,51 +763,51 @@ Pass an array to use different credentials for different origins. The first entr
## context-option-colorscheme
* langs: js, java
-- `colorScheme` <null|[ColorScheme]<"light"|"dark"|"no-preference">>
+- `colorScheme` "ColorScheme" <null|"light"|"dark"|"no-preference">
Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See
[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`.
## context-option-colorscheme-csharp-python
* langs: csharp, python
-- `colorScheme` <[ColorScheme]<"light"|"dark"|"no-preference"|"null">>
+- `colorScheme` "ColorScheme" <"light"|"dark"|"no-preference"|"null">
Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media feature, supported values are `'light'` and `'dark'`. See
[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`.
## context-option-reducedMotion
* langs: js, java
-- `reducedMotion` <null|[ReducedMotion]<"reduce"|"no-preference">>
+- `reducedMotion` "ReducedMotion" <null|"reduce"|"no-preference">
Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
## context-option-reducedMotion-csharp-python
* langs: csharp, python
-- `reducedMotion` <[ReducedMotion]<"reduce"|"no-preference"|"null">>
+- `reducedMotion` "ReducedMotion" <"reduce"|"no-preference"|"null">
Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`.
## context-option-forcedColors
* langs: js, java
-- `forcedColors` <null|[ForcedColors]<"active"|"none">>
+- `forcedColors` "ForcedColors" <null|"active"|"none">
Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`.
## context-option-forcedColors-csharp-python
* langs: csharp, python
-- `forcedColors` <[ForcedColors]<"active"|"none"|"null">>
+- `forcedColors` "ForcedColors" <"active"|"none"|"null">
Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`.
## context-option-contrast
* langs: js, java
-- `contrast` <null|[Contrast]<"no-preference"|"more">>
+- `contrast` "Contrast" <null|"no-preference"|"more">
Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`.
## context-option-contrast-csharp-python
* langs: csharp, python
-- `contrast` <[Contrast]<"no-preference"|"more"|"null">>
+- `contrast` "Contrast" <"no-preference"|"more"|"null">
Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`.
@@ -832,9 +823,9 @@ Logger sink for Playwright logging.
- `recordHar` <[Object]>
- `omitContent` ?<[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to
`false`. Deprecated, use `content` policy instead.
- - `content` ?<[HarContentPolicy]<"omit"|"embed"|"attach">> 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` "HarContentPolicy" ?<"omit"|"embed"|"attach"> 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.
- `path` <[path]> Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default.
- - `mode` ?<[HarMode]<"full"|"minimal">> 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` "HarMode" ?<"full"|"minimal"> 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`.
- `urlFilter` ?<[string]|[RegExp]> A glob or regex pattern to filter requests that are stored in the HAR. When a [`option: Browser.newContext.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. Defaults to none.
Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not
@@ -860,14 +851,14 @@ Optional setting to control whether to omit request content from the HAR. Defaul
## context-option-recordhar-content
* langs: csharp, java, python
- alias-python: record_har_content
-- `recordHarContent` ?<[HarContentPolicy]<"omit"|"embed"|"attach">>
+- `recordHarContent` "HarContentPolicy" ?<"omit"|"embed"|"attach">
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 and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.
## context-option-recordhar-mode
* langs: csharp, java, python
- alias-python: record_har_mode
-- `recordHarMode` ?<[HarMode]<"full"|"minimal">>
+- `recordHarMode` "HarMode" ?<"full"|"minimal">
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`.
@@ -888,9 +879,9 @@ When set to `minimal`, only record information necessary for routing from HAR. T
- `fps` ?<[int]> Frame rate of the recorded videos in frames per second. Defaults to `25`. Firefox and WebKit currently capture up to 25 frames per second.
- `showActions` ?<[Object]> If specified, enables visual annotations on interacted elements during video recording.
- `duration` ?<[float]> How long each annotation is displayed in milliseconds. Defaults to `500`.
- - `position` ?<[AnnotatePosition]<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">> Position of the action title overlay. Defaults to `"top-right"`.
+ - `position` "AnnotatePosition" ?<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right"> Position of the action title overlay. Defaults to `"top-right"`.
- `fontSize` ?<[int]> Font size of the action title in pixels. Defaults to `24`. Deprecated, use `style.title` instead.
- - `cursor` ?<[ScreencastCursor]<"none"|"pointer">> Cursor decoration shown for pointer actions. `"pointer"` (the default) renders a mouse pointer that animates from the previous action point to the next one. `"none"` disables the cursor decoration.
+ - `cursor` "ScreencastCursor" ?<"none"|"pointer"> Cursor decoration shown for pointer actions. `"pointer"` (the default) renders a mouse pointer that animates from the previous action point to the next one. `"none"` disables the cursor decoration.
- `style` ?<[Object]> Styles of the action decorations.
- `point` ?<[string]> CSS declarations for the zero-sized marker centered on the action point. Not shown when omitted.
- `highlight` ?<[string]> CSS declarations for the box that covers the target element. Not shown when omitted.
@@ -910,8 +901,7 @@ not recorded. Make sure to call [`method: BrowserContext.close`] for videos to b
## context-option-recordvideo-size
* langs: csharp, java, python
- alias-python: record_video_size
-- `recordVideoSize` <[Object]>
- * alias-java: RecordVideoSize
+- `recordVideoSize` "RecordVideoSize" <[Object]>
- `width` <[int]> Video frame width.
- `height` <[int]> Video frame height.
@@ -927,8 +917,8 @@ Actual picture of each page will be scaled down if necessary to fit the specifie
Frame rate of the recorded videos in frames per second. Defaults to `25`. Firefox and WebKit currently capture up to 25 frames per second.
## context-option-proxy
-- `proxy` <[Object]>
- * alias: Proxy
+- `proxy` "Proxy" <[Object]>
+ * alias-python: ProxySettings
- `server` <[string]> Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example
`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.
- `bypass` ?<[string]> Optional comma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
@@ -946,7 +936,7 @@ This option does not affect any Locator APIs (Locators are always strict). Defau
See [Locator] to learn more about the strict mode.
## context-option-service-worker-policy
-- `serviceWorkers` <[ServiceWorkerPolicy]<"allow"|"block">>
+- `serviceWorkers` "ServiceWorkerPolicy" <"allow"|"block">
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.
@@ -955,7 +945,7 @@ Whether to allow sites to register Service workers. Defaults to `'allow'`.
## remove-all-listeners-options-behavior
* langs: js
* since: v1.47
-- `behavior` <[RemoveAllListenersBehavior]<"wait"|"ignoreErrors"|"default">>
+- `behavior` "RemoveAllListenersBehavior" <"wait"|"ignoreErrors"|"default">
Specifies whether to wait for already running listeners and what to do if they throw errors:
* `'default'` - do not wait for current listener calls (if any) to finish, if the listener throws, it may result in unhandled error
@@ -965,7 +955,7 @@ Specifies whether to wait for already running listeners and what to do if they t
## unroute-all-options-behavior
* langs: js, csharp, python
* since: v1.41
-- `behavior` <[UnrouteBehavior]<"wait"|"ignoreErrors"|"default">>
+- `behavior` "UnrouteBehavior" <"wait"|"ignoreErrors"|"default">
Specifies whether to wait for already running handlers and what to do if they throw errors:
* `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may result in unhandled error
@@ -1008,7 +998,7 @@ equal to the string.
Event name, same one typically passed into `*.on(event)`.
## wait-for-load-state-state
-- `state` ?<[LoadState]<"load"|"domcontentloaded"|"networkidle">>
+- `state` "LoadState" ?<"load"|"domcontentloaded"|"networkidle">
Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the
method resolves immediately. Can be one of:
@@ -1344,7 +1334,7 @@ Only matches visible or invisible elements. Prefer the [`method: Locator.visible
- %%-locator-option-has-%%
## screenshot-option-animations
-- `animations` <[ScreenshotAnimations]<"disabled"|"allow">>
+- `animations` "ScreenshotAnimations" <"disabled"|"allow">
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.
@@ -1353,7 +1343,7 @@ When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animatio
Defaults to `"allow"` that leaves animations untouched.
## screenshot-option-animations-default-disabled
-- `animations` <[ScreenshotAnimations]<"disabled"|"allow">>
+- `animations` "ScreenshotAnimations" <"disabled"|"allow">
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.
@@ -1381,7 +1371,7 @@ relative path, then it is resolved relative to the current working directory. If
saved to the disk.
## screenshot-option-type
-- `type` <[ScreenshotType]<"png"|"jpeg"|"webp">>
+- `type` "ScreenshotType" <"png"|"jpeg"|"webp">
Specify screenshot type, defaults to `png`.
@@ -1405,8 +1395,7 @@ When true, takes a screenshot of the full scrollable page, instead of the curren
`false`.
## screenshot-option-clip
-- `clip` <[Object]>
- * alias-java: Clip
+- `clip` "Clip" <[Object]>
- `x` <[float]> x-coordinate of top-left corner of clip area
- `y` <[float]> y-coordinate of top-left corner of clip area
- `width` <[float]> width of clipping area
@@ -1415,21 +1404,21 @@ When true, takes a screenshot of the full scrollable page, instead of the curren
An object which specifies clipping of the resulting image.
## screenshot-option-scale
-- `scale` <[ScreenshotScale]<"css"|"device">>
+- `scale` "ScreenshotScale" <"css"|"device">
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"`.
## screenshot-option-scale-default-css
-- `scale` <[ScreenshotScale]<"css"|"device">>
+- `scale` "ScreenshotScale" <"css"|"device">
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"`.
## screenshot-option-caret
-- `caret` <[ScreenshotCaret]<"hide"|"initial">>
+- `caret` "ScreenshotCaret" <"hide"|"initial">
When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be changed. Defaults to `"hide"`.
@@ -1474,7 +1463,7 @@ Text to locate the element for.
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.
## get-by-role-to-have-role-role
-- `role` <[AriaRole]<"alert"|"alertdialog"|"application"|"article"|"banner"|"blockquote"|"button"|"caption"|"cell"|"checkbox"|"code"|"columnheader"|"combobox"|"complementary"|"contentinfo"|"definition"|"deletion"|"dialog"|"directory"|"document"|"emphasis"|"feed"|"figure"|"form"|"generic"|"grid"|"gridcell"|"group"|"heading"|"img"|"insertion"|"link"|"list"|"listbox"|"listitem"|"log"|"main"|"marquee"|"math"|"meter"|"menu"|"menubar"|"menuitem"|"menuitemcheckbox"|"menuitemradio"|"navigation"|"none"|"note"|"option"|"paragraph"|"presentation"|"progressbar"|"radio"|"radiogroup"|"region"|"row"|"rowgroup"|"rowheader"|"scrollbar"|"search"|"searchbox"|"separator"|"slider"|"spinbutton"|"status"|"strong"|"subscript"|"superscript"|"switch"|"tab"|"table"|"tablist"|"tabpanel"|"term"|"textbox"|"time"|"timer"|"toolbar"|"tooltip"|"tree"|"treegrid"|"treeitem">>
+- `role` "AriaRole" <"alert"|"alertdialog"|"application"|"article"|"banner"|"blockquote"|"button"|"caption"|"cell"|"checkbox"|"code"|"columnheader"|"combobox"|"complementary"|"contentinfo"|"definition"|"deletion"|"dialog"|"directory"|"document"|"emphasis"|"feed"|"figure"|"form"|"generic"|"grid"|"gridcell"|"group"|"heading"|"img"|"insertion"|"link"|"list"|"listbox"|"listitem"|"log"|"main"|"marquee"|"math"|"meter"|"menu"|"menubar"|"menuitem"|"menuitemcheckbox"|"menuitemradio"|"navigation"|"none"|"note"|"option"|"paragraph"|"presentation"|"progressbar"|"radio"|"radiogroup"|"region"|"row"|"rowgroup"|"rowheader"|"scrollbar"|"search"|"searchbox"|"separator"|"slider"|"spinbutton"|"status"|"strong"|"subscript"|"superscript"|"switch"|"tab"|"table"|"tablist"|"tabpanel"|"term"|"textbox"|"time"|"timer"|"toolbar"|"tooltip"|"tree"|"treegrid"|"treeitem">
Required aria role.
@@ -2068,8 +2057,7 @@ In this config:
1. Forward slashes `"/"` can be used as path separators on any platform.
## response-security-details
-- returns: <[null]|[Object]>
- * alias: SecurityDetails
+- returns: "SecurityDetails" <[null]|[Object]>
* alias-csharp: ResponseSecurityDetailsResult
- `issuer` ?<[string]> Common Name component of the Issuer field.
from the certificate. This should only be used for informational purposes. Optional.
@@ -2082,14 +2070,14 @@ In this config:
when this cert becomes invalid. Optional.
## response-server-addr
-- returns: <[null]|[Object]>
+- returns: "RemoteAddr" <[null]|[Object]>
* alias-csharp: ResponseServerAddrResult
* alias-java: ServerAddr
- `ipAddress` <[string]> IPv4 or IPV6 address of the server.
- `port` <[int]>
## resource-timing
-- returns: <[Object]>
+- returns: "ResourceTiming" <[Object]>
* alias-csharp: RequestTimingResult
* alias-java: Timing
- `startTime` <[float]> Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
diff --git a/docs/src/mobile-api/class-androiddevice.md b/docs/src/mobile-api/class-androiddevice.md
index 86b003638b..0aecaecd02 100644
--- a/docs/src/mobile-api/class-androiddevice.md
+++ b/docs/src/mobile-api/class-androiddevice.md
@@ -82,7 +82,7 @@ Selector to fling.
### param: AndroidDevice.fling.direction
* since: v1.9
-- `direction` <[AndroidFlingDirection]<"down"|"up"|"left"|"right">>
+- `direction` "AndroidFlingDirection" <"down"|"up"|"left"|"right">
Fling direction.
@@ -303,7 +303,7 @@ Selector to scroll.
### param: AndroidDevice.scroll.direction
* since: v1.9
-- `direction` <[AndroidScrollDirection]<"down"|"up"|"left"|"right">>
+- `direction` "AndroidScrollDirection" <"down"|"up"|"left"|"right">
Scroll direction.
@@ -364,7 +364,7 @@ Selector to swipe.
### param: AndroidDevice.swipe.direction
* since: v1.9
-- `direction` <[AndroidSwipeDirection]<"down"|"up"|"left"|"right">>
+- `direction` "AndroidSwipeDirection" <"down"|"up"|"left"|"right">
Swipe direction.
@@ -416,7 +416,7 @@ Selector to wait for.
### option: AndroidDevice.wait.state
* since: v1.9
-- `state` <[AndroidDeviceState]<"gone">>
+- `state` "AndroidDeviceState" <"gone">
Optional state. Can be either:
* default - wait for element to be present.
diff --git a/docs/src/test-api/class-fixtures.md b/docs/src/test-api/class-fixtures.md
index 96c4926982..055f85a58e 100644
--- a/docs/src/test-api/class-fixtures.md
+++ b/docs/src/test-api/class-fixtures.md
@@ -37,7 +37,7 @@ test.beforeAll(async ({ browser }) => {
## property: Fixtures.browserName
* since: v1.10
-- type: <[BrowserName]<"chromium"|"firefox"|"webkit">>
+- type: "BrowserName" <"chromium"|"firefox"|"webkit">
Name of the browser that runs tests. Defaults to `'chromium'`. Useful to [annotate tests](../test-annotations.md) based on the browser.
diff --git a/docs/src/test-api/class-fullconfig.md b/docs/src/test-api/class-fullconfig.md
index 0e49d2e04d..ef8003df76 100644
--- a/docs/src/test-api/class-fullconfig.md
+++ b/docs/src/test-api/class-fullconfig.md
@@ -89,7 +89,7 @@ See [`property: TestConfig.metadata`].
## property: FullConfig.preserveOutput
* since: v1.10
-- type: <[PreserveOutput]<"always"|"never"|"failures-only">>
+- type: "PreserveOutput" <"always"|"never"|"failures-only">
See [`property: TestConfig.preserveOutput`].
@@ -107,7 +107,7 @@ See [`property: TestConfig.quiet`].
## property: FullConfig.reporter
* since: v1.10
-- type: <[string]|[Array]<[Object]>|[BuiltInReporter]<"list"|"dot"|"failures"|"line"|"github"|"json"|"junit"|"null"|"html"|"blob"|"perfetto">>
+- type: "BuiltInReporter" <[string]|[Array]<[Object]>|"list"|"dot"|"failures"|"line"|"github"|"json"|"junit"|"null"|"html"|"blob"|"perfetto">
- `0` <[string]> Reporter name or module or file path
- `1` <[Object]> An object with reporter options if any
@@ -143,13 +143,13 @@ Resolved global tags. See [`property: TestConfig.tag`].
## property: FullConfig.updateSnapshots
* since: v1.10
-- type: <[UpdateSnapshots]<"all"|"changed"|"missing"|"none"|"default">>
+- type: "UpdateSnapshots" <"all"|"changed"|"missing"|"none"|"default">
See [`property: TestConfig.updateSnapshots`].
## property: FullConfig.updateSourceMethod
* since: v1.50
-- type: <[UpdateSourceMethod]<"overwrite"|"3way"|"patch">>
+- type: "UpdateSourceMethod" <"overwrite"|"3way"|"patch">
See [`property: TestConfig.updateSourceMethod`].
diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md
index 294f7b13c7..0be6108225 100644
--- a/docs/src/test-api/class-test.md
+++ b/docs/src/test-api/class-test.md
@@ -575,7 +575,7 @@ Additional named locks for all tests in the enclosing scope, including nested gr
### option: Test.describe.configure.mode
* since: v1.10
-- `mode` <[TestMode]<"default"|"parallel"|"serial">>
+- `mode` "TestMode" <"default"|"parallel"|"serial">
Execution mode. Learn more about the execution modes [here](../test-parallel.md).
diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md
index 1191937e4a..c73705f1d6 100644
--- a/docs/src/test-api/class-testconfig.md
+++ b/docs/src/test-api/class-testconfig.md
@@ -73,14 +73,14 @@ The structure of the git commit metadata is subject to change.
- type: ?<[Object]>
- `timeout` ?<[int]> Default timeout for async expect matchers in milliseconds, defaults to 5000ms.
- `toHaveScreenshot` ?<[Object]> Configuration for the [`method: PageAssertions.toHaveScreenshot#1`] method.
- - `animations` ?<[ScreenshotAnimations]<"allow"|"disabled">> See [`option: Page.screenshot.animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
- - `caret` ?<[ScreenshotCaret]<"hide"|"initial">> See [`option: Page.screenshot.caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
+ - `animations` "ScreenshotAnimations" ?<"allow"|"disabled"> See [`option: Page.screenshot.animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
+ - `caret` "ScreenshotCaret" ?<"hide"|"initial"> See [`option: Page.screenshot.caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
- `maxDiffPixels` ?<[int]> An acceptable amount of pixels that could be different, unset by default. Note that `threshold` defines which pixels are considered different.
- `maxDiffPixelRatio` ?<[float]> An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default. Note that `threshold` defines which pixels are considered different.
- - `scale` ?<[ScreenshotScale]<"css"|"device">> See [`option: Page.screenshot.scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
+ - `scale` "ScreenshotScale" ?<"css"|"device"> See [`option: Page.screenshot.scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
- `stylePath` ?<[string]|[Array]<[string]>> See [`option: Page.screenshot.style`] in [`method: Page.screenshot`].
- `threshold` ?<[float]> An acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
- - `type` ?<[ScreenshotType]<"png"|"webp">> Format of the screenshots taken when the snapshot name is omitted, defaults to `"png"`. Snapshots with an explicit name use the format matching their `.png` or `.webp` extension.
+ - `type` "ScreenshotType" ?<"png"|"webp"> Format of the screenshots taken when the snapshot name is omitted, defaults to `"png"`. Snapshots with an explicit name use the format matching their `.png` or `.webp` extension.
- `pathTemplate` ?<[string]> A template controlling location of the screenshots. See [`property: TestConfig.snapshotPathTemplate`] for details.
- `toMatchAriaSnapshot` ?<[Object]> Configuration for the [`method: LocatorAssertions.toMatchAriaSnapshot#2`] method.
- `pathTemplate` ?<[string]> A template controlling location of the aria snapshots. See [`property: TestConfig.snapshotPathTemplate`] for details.
@@ -378,7 +378,7 @@ This path will serve as the base directory for each test file snapshot directory
## property: TestConfig.preserveOutput
* since: v1.10
-- type: ?<[PreserveOutput]<"always"|"never"|"failures-only">>
+- type: "PreserveOutput" ?<"always"|"never"|"failures-only">
Whether to preserve test output in the [`property: TestConfig.outputDir`]. Defaults to `'always'`.
* `'always'` - preserve output for all tests;
@@ -449,7 +449,7 @@ export default defineConfig({
## property: TestConfig.reporter
* since: v1.10
-- type: ?<[string]|[Array]<[Object]>|[BuiltInReporter]<"list"|"dot"|"failures"|"line"|"github"|"json"|"junit"|"null"|"html"|"blob"|"perfetto">>
+- type: "BuiltInReporter" ?<[string]|[Array]<[Object]>|"list"|"dot"|"failures"|"line"|"github"|"json"|"junit"|"null"|"html"|"blob"|"perfetto">
- `0` <[string]> Reporter name or module or file path
- `1` <[Object]> An object with reporter options if any
@@ -518,7 +518,7 @@ export default defineConfig({
## property: TestConfig.retryStrategy
* since: v1.62
-- type: ?<[RetryStrategy]<"immediate"|"isolated">>
+- type: "RetryStrategy" ?<"immediate"|"isolated">
Controls when failed tests are retried. Defaults to `'immediate'`.
* `'immediate'` - A failed test is retried as soon as a worker is available, interleaved with the rest of the run. This is the default.
@@ -665,7 +665,7 @@ export default defineConfig({
## property: TestConfig.updateSnapshots
* since: v1.10
-- type: ?<[UpdateSnapshots]<"all"|"changed"|"missing"|"none"|"default">>
+- type: "UpdateSnapshots" ?<"all"|"changed"|"missing"|"none"|"default">
Whether to update expected snapshots with the actual results produced by the test run. Defaults to `'default'`.
* `'all'` - All tests that are executed will update snapshots.
@@ -688,7 +688,7 @@ export default defineConfig({
## property: TestConfig.updateSourceMethod
* since: v1.50
-- type: ?<[UpdateSourceMethod]<"overwrite"|"3way"|"patch">>
+- type: "UpdateSourceMethod" ?<"overwrite"|"3way"|"patch">
Defines how to update snapshots in the source code.
* `'patch'` - Create a unified diff file that can be used to update the source code later. This is the default.
diff --git a/docs/src/test-api/class-testinfo.md b/docs/src/test-api/class-testinfo.md
index 9f577cad9c..d1f1ed9340 100644
--- a/docs/src/test-api/class-testinfo.md
+++ b/docs/src/test-api/class-testinfo.md
@@ -135,7 +135,7 @@ Errors thrown during test execution, if any.
## property: TestInfo.expectedStatus
* since: v1.10
-- type: <[TestStatus]<"passed"|"failed"|"timedOut"|"skipped"|"interrupted">>
+- type: "TestStatus" <"passed"|"failed"|"timedOut"|"skipped"|"interrupted">
Expected status for the currently running test. This is usually `'passed'`, except for a few cases:
* `'skipped'` for skipped tests, e.g. with [`method: Test.skip`];
@@ -423,7 +423,7 @@ When passing [`option: kind`], multiple name segments are not supported.
### option: TestInfo.snapshotPath.kind
* since: v1.53
-- `kind` <[SnapshotKind]<"snapshot"|"screenshot"|"aria">>
+- `kind` "SnapshotKind" <"snapshot"|"screenshot"|"aria">
The snapshot kind controls which snapshot path template is used. See [`property: TestConfig.snapshotPathTemplate`] for more details. Defaults to `'snapshot'`.
@@ -440,7 +440,7 @@ Suffix used to differentiate snapshots between multiple test configurations. For
## property: TestInfo.status
* since: v1.10
-- type: ?<[TestStatus]<"passed"|"failed"|"timedOut"|"skipped"|"interrupted">>
+- type: "TestStatus" ?<"passed"|"failed"|"timedOut"|"skipped"|"interrupted">
Actual status for the currently running test. Available after the test has finished in [`method: Test.afterEach`] hook and fixtures.
diff --git a/docs/src/test-api/class-testoptions.md b/docs/src/test-api/class-testoptions.md
index 16a82e25b0..e4241bb9e2 100644
--- a/docs/src/test-api/class-testoptions.md
+++ b/docs/src/test-api/class-testoptions.md
@@ -64,7 +64,7 @@ export default defineConfig({
## property: TestOptions.browserName
* since: v1.10
-- type: <[BrowserName]<"chromium"|"firefox"|"webkit">>
+- type: "BrowserName" <"chromium"|"firefox"|"webkit">
Name of the browser that runs tests. Defaults to `'chromium'`. Most of the time you should set `browserName` in your [TestConfig]:
@@ -595,8 +595,8 @@ export default defineConfig({
## property: TestOptions.screenshot
* since: v1.10
-- type: <[Object]|[ScreenshotMode]<"off"|"on"|"only-on-failure"|"on-first-failure">>
- - `mode` <[ScreenshotMode]<"off"|"on"|"only-on-failure"|"on-first-failure">> Automatic screenshot mode.
+- type: "ScreenshotMode" <[Object]|"off"|"on"|"only-on-failure"|"on-first-failure">
+ - `mode` "ScreenshotMode" <"off"|"on"|"only-on-failure"|"on-first-failure"> Automatic screenshot mode.
- `fullPage` ?<[boolean]> When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to `false`.
- `omitBackground` ?<[boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.
@@ -697,8 +697,8 @@ export default defineConfig({
## property: TestOptions.trace
* since: v1.10
-- type: <[Object]|[TraceMode]<"off"|"on"|"on-first-retry"|"on-all-retries"|"retain-on-failure"|"retain-on-first-failure"|"retain-on-failure-and-retries">>
- - `mode` <[TraceMode]<"off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries"|"retain-on-first-failure"|"retain-on-failure-and-retries">> Trace recording mode.
+- type: "TraceMode" <[Object]|"off"|"on"|"on-first-retry"|"on-all-retries"|"retain-on-failure"|"retain-on-first-failure"|"retain-on-failure-and-retries">
+ - `mode` "TraceMode" <"off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries"|"retain-on-first-failure"|"retain-on-failure-and-retries"> Trace recording mode.
- `attachments` ?<[boolean]> Whether to include test attachments. Defaults to true. Optional.
- `screenshots` ?<[boolean]> Whether to capture screenshots during tracing. Screenshots are used to build a timeline preview. Defaults to true. Optional.
- `snapshots` ?<[boolean]|[Object]> Which snapshots to capture on every action. Passing `true` is a shortcut for `{ dom: true }`. Defaults to true. Optional.
@@ -751,8 +751,8 @@ export default defineConfig({
## property: TestOptions.video
* since: v1.10
-- type: <[Object]|[VideoMode]<"off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries"|"retain-on-first-failure"|"retain-on-failure-and-retries">>
- - `mode` <[VideoMode]<"off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries"|"retain-on-first-failure"|"retain-on-failure-and-retries">> Video recording mode.
+- type: "VideoMode" <[Object]|"off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries"|"retain-on-first-failure"|"retain-on-failure-and-retries">
+ - `mode` "VideoMode" <"off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries"|"retain-on-first-failure"|"retain-on-failure-and-retries"> Video recording mode.
- `size` ?<[Object]> Size of the recorded video. Optional.
- `width` <[int]>
- `height` <[int]>
@@ -760,16 +760,16 @@ export default defineConfig({
- `show` ?<[Object]> If specified, visually annotates the video with test information and action highlights.
- `actions` ?<[Object]> Controls visual annotations on interacted elements.
- `duration` ?<[float]> How long each annotation is displayed in milliseconds. Defaults to `500`.
- - `position` ?<[AnnotatePosition]<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">> Position of the action title overlay. Defaults to `"top-right"`.
+ - `position` "AnnotatePosition" ?<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right"> Position of the action title overlay. Defaults to `"top-right"`.
- `fontSize` ?<[int]> Font size of the action title in pixels. Defaults to `24`. Deprecated, use `style.title` instead.
- - `cursor` ?<[ScreencastCursor]<"none"|"pointer">> Cursor decoration shown for pointer actions. `"pointer"` (the default) renders a mouse pointer that animates from the previous action point to the next one. `"none"` disables the cursor decoration.
+ - `cursor` "ScreencastCursor" ?<"none"|"pointer"> Cursor decoration shown for pointer actions. `"pointer"` (the default) renders a mouse pointer that animates from the previous action point to the next one. `"none"` disables the cursor decoration.
- `style` ?<[Object]> Styles of the action decorations.
- `point` ?<[string]> CSS declarations for the zero-sized marker centered on the action point. Not shown when omitted.
- `highlight` ?<[string]> CSS declarations for the box that covers the target element. Not shown when omitted.
- `title` ?<[string]> CSS declarations for the action title.
- `test` ?<[Object]> Controls test information displayed as a status overlay in the video.
- - `level` ?<[TestAnnotationLevel]<"file"|"title"|"step">> Level of the detail to include about the current test.
- - `position` ?<[AnnotatePosition]<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right">> Position of the test information overlay. Defaults to `"top-left"`.
+ - `level` "TestAnnotationLevel" ?<"file"|"title"|"step"> Level of the detail to include about the current test.
+ - `position` "AnnotatePosition" ?<"top-left"|"top"|"top-right"|"bottom-left"|"bottom"|"bottom-right"> Position of the test information overlay. Defaults to `"top-left"`.
- `fontSize` ?<[int]> Font size of the test information in pixels. Defaults to `14`.
Whether to record video for each test. Defaults to `'off'`. The initial run of a test is the "first run"; subsequent runs caused by [retries](../test-retries.md) are "retries".
diff --git a/docs/src/test-api/class-testproject.md b/docs/src/test-api/class-testproject.md
index 5a05879516..784877dcc7 100644
--- a/docs/src/test-api/class-testproject.md
+++ b/docs/src/test-api/class-testproject.md
@@ -126,11 +126,11 @@ Now `npx playwright test` only runs `chromium`, while `npx playwright test --pro
- `threshold` ?<[float]> an acceptable perceived color difference between the same pixel in compared images, ranging from `0` (strict) and `1` (lax). `"pixelmatch"` comparator computes color difference in [YIQ color space](https://en.wikipedia.org/wiki/YIQ) and defaults `threshold` value to `0.2`.
- `maxDiffPixels` ?<[int]> an acceptable amount of pixels that could be different, unset by default. Note that `threshold` defines which pixels are considered different.
- `maxDiffPixelRatio` ?<[float]> an acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1` , unset by default. Note that `threshold` defines which pixels are considered different.
- - `animations` ?<[ScreenshotAnimations]<"allow"|"disabled">> See [`option: Page.screenshot.animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
- - `caret` ?<[ScreenshotCaret]<"hide"|"initial">> See [`option: Page.screenshot.caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
- - `scale` ?<[ScreenshotScale]<"css"|"device">> See [`option: Page.screenshot.scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
+ - `animations` "ScreenshotAnimations" ?<"allow"|"disabled"> See [`option: Page.screenshot.animations`] in [`method: Page.screenshot`]. Defaults to `"disabled"`.
+ - `caret` "ScreenshotCaret" ?<"hide"|"initial"> See [`option: Page.screenshot.caret`] in [`method: Page.screenshot`]. Defaults to `"hide"`.
+ - `scale` "ScreenshotScale" ?<"css"|"device"> See [`option: Page.screenshot.scale`] in [`method: Page.screenshot`]. Defaults to `"css"`.
- `stylePath` ?<[string]|[Array]<[string]>> See [`option: Page.screenshot.style`] in [`method: Page.screenshot`].
- - `type` ?<[ScreenshotType]<"png"|"webp">> Format of the screenshots taken when the snapshot name is omitted, defaults to `"png"`. Snapshots with an explicit name use the format matching their `.png` or `.webp` extension.
+ - `type` "ScreenshotType" ?<"png"|"webp"> Format of the screenshots taken when the snapshot name is omitted, defaults to `"png"`. Snapshots with an explicit name use the format matching their `.png` or `.webp` extension.
- `pathTemplate` ?<[string]> A template controlling location of the screenshots. See [`property: TestProject.snapshotPathTemplate`] for details.
- `timeout` ?<[int]> Default timeout for [`method: PageAssertions.toHaveScreenshot#1`] in milliseconds, defaults to the global expect timeout. Setting to `0` disables the timeout.
- `toMatchAriaSnapshot` ?<[Object]> Configuration for the [`method: LocatorAssertions.toMatchAriaSnapshot#2`] method.
diff --git a/docs/src/test-reporter-api/class-reporter.md b/docs/src/test-reporter-api/class-reporter.md
index 8b92b9e326..ebcd892541 100644
--- a/docs/src/test-reporter-api/class-reporter.md
+++ b/docs/src/test-reporter-api/class-reporter.md
@@ -123,7 +123,7 @@ The root suite that contains all projects, files and test cases.
## optional async method: Reporter.onEnd
* since: v1.10
- `result` ?<[Object]>
- - `status` ?<[FullStatus]<"passed"|"failed"|"timedout"|"interrupted">>
+ - `status` "FullStatus" ?<"passed"|"failed"|"timedout"|"interrupted">
Called after all tests have been run, or testing has been interrupted. Note that this method may return a [Promise] and Playwright Test will await it.
Reporter is allowed to override the status and hence affect the exit code of the test runner.
@@ -131,7 +131,7 @@ Reporter is allowed to override the status and hence affect the exit code of the
### param: Reporter.onEnd.result
* since: v1.10
- `result` <[Object]>
- - `status` <[FullStatus]<"passed"|"failed"|"timedout"|"interrupted">> Test run status.
+ - `status` "FullStatus" <"passed"|"failed"|"timedout"|"interrupted"> Test run status.
- `startTime` <[Date]> Test run start wall time.
- `duration` <[int]> Test run duration in milliseconds.
diff --git a/docs/src/test-reporter-api/class-suite.md b/docs/src/test-reporter-api/class-suite.md
index 1d458c842b..fdfccd90c6 100644
--- a/docs/src/test-reporter-api/class-suite.md
+++ b/docs/src/test-reporter-api/class-suite.md
@@ -81,7 +81,7 @@ Returns a list of titles from the root down to this suite.
## property: Suite.type
* since: v1.44
-- returns: <[SuiteType]<"root"|"project"|"file"|"describe">>
+- returns: "SuiteType" <"root"|"project"|"file"|"describe">
Returns the type of the suite. The Suites form the following hierarchy:
`root` -> `project` -> `file` -> `describe` -> ...`describe` -> `test`.
diff --git a/docs/src/test-reporter-api/class-testcase.md b/docs/src/test-reporter-api/class-testcase.md
index 22a8588fb0..2e002356e7 100644
--- a/docs/src/test-reporter-api/class-testcase.md
+++ b/docs/src/test-reporter-api/class-testcase.md
@@ -15,7 +15,7 @@
## property: TestCase.expectedStatus
* since: v1.10
-- type: <[TestStatus]<"passed"|"failed"|"timedOut"|"skipped"|"interrupted">>
+- type: "TestStatus" <"passed"|"failed"|"timedOut"|"skipped"|"interrupted">
Expected test status.
* Tests marked as [`method: Test.skip`] or [`method: Test.fixme`] are expected to be `'skipped'`.
@@ -44,7 +44,7 @@ Whether the test is considered running fine. Non-ok tests fail the test run with
## method: TestCase.outcome
* since: v1.10
-- returns: <[TestOutcome]<"skipped"|"expected"|"unexpected"|"flaky">>
+- returns: "TestOutcome" <"skipped"|"expected"|"unexpected"|"flaky">
Testing outcome for this test. Note that outcome is not the same as [`property: TestResult.status`]:
* Test that is expected to fail and actually fails is `'expected'`.
@@ -104,6 +104,6 @@ Returns a list of titles from the root down to this test.
## property: TestCase.type
* since: v1.44
-- returns: <[TestCaseType]<"test">>
+- returns: "TestCaseType" <"test">
Returns "test". Useful for detecting test cases in [`method: Suite.entries`].
diff --git a/docs/src/test-reporter-api/class-testresult.md b/docs/src/test-reporter-api/class-testresult.md
index ef41200b40..ca833d4780 100644
--- a/docs/src/test-reporter-api/class-testresult.md
+++ b/docs/src/test-reporter-api/class-testresult.md
@@ -65,7 +65,7 @@ Start time of this particular test run.
## property: TestResult.status
* since: v1.10
-- type: <[TestStatus]<"passed"|"failed"|"timedOut"|"skipped"|"interrupted">>
+- type: "TestStatus" <"passed"|"failed"|"timedOut"|"skipped"|"interrupted">
The status of this test result. See also [`property: TestCase.expectedStatus`].
diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts
index 5d89ffc88d..ccf7297f56 100644
--- a/packages/playwright-client/types/types.d.ts
+++ b/packages/playwright-client/types/types.d.ts
@@ -5685,6 +5685,9 @@ export interface Page {
* ```
*
* @param urlOrPredicate Request URL string, regex or predicate receiving [Request](https://playwright.dev/docs/api/class-request) object.
+ * When a [`baseURL`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-base-url) via the
+ * context options was provided and the passed URL is a path, it gets merged via the
+ * [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
* @param options
*/
waitForRequest(urlOrPredicate: string|RegExp|((request: Request) => boolean|Promise<boolean>), options?: {
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 5d89ffc88d..ccf7297f56 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -5685,6 +5685,9 @@ export interface Page {
* ```
*
* @param urlOrPredicate Request URL string, regex or predicate receiving [Request](https://playwright.dev/docs/api/class-request) object.
+ * When a [`baseURL`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-base-url) via the
+ * context options was provided and the passed URL is a path, it gets merged via the
+ * [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
* @param options
*/
waitForRequest(urlOrPredicate: string|RegExp|((request: Request) => boolean|Promise<boolean>), options?: {
diff --git a/utils/doclint/api_parser.js b/utils/doclint/api_parser.js
index 8dbddbd81c..968b6b8aed 100644
--- a/utils/doclint/api_parser.js
+++ b/utils/doclint/api_parser.js
@@ -210,10 +210,7 @@ class ApiParser {
const text = /** @type {string}*/(param.text);
if (text.substring(text.lastIndexOf('>') + 1).trim())
throw new Error(`Extra information after type while processing "${memberName}".\nYou probably need an extra empty line before the description.\n================\n${text}`);
- let typeStart = text.indexOf('<');
- while ('?e'.includes(text[typeStart - 1]))
- typeStart--;
- const name = text.substring(0, typeStart).replace(/\`/g, '').trim();
+ const { name } = parseVariable(text);
const comments = extractComments(spec);
const metainfo = extractMetainfo(spec);
if (metainfo.hidden)
@@ -229,14 +226,28 @@ class ApiParser {
*/
parseType(spec, since) {
const arg = parseVariable(spec.text);
+ if (!arg.alias && /\[\w+\]<"/.test(arg.type))
+ throw new Error(`Write the enum name before the type, for example: \`sameSite\` "SameSiteAttribute" <"Strict"|"Lax"|"None">\nin: ${spec.text}`);
+ let expression = arg.type;
const properties = [];
/** @type {Object<string, string>} */
const langAliases = {};
+ if (arg.alias) {
+ // The name before the type names the enum, if the type has one.
+ // Otherwise, it is the default alias of the type.
+ const named = nameStringUnion(expression, arg.alias);
+ if (named)
+ expression = named;
+ else
+ langAliases.default = arg.alias;
+ }
for (const child of /** @type {MarkdownLiNode[]} */ (spec.children) || []) {
const childText = /** @type {string} */(child.text);
const aliasMatch = childText.match(/^alias(?:-(\w+))?\s*:\s*(.*)$/);
if (aliasMatch) {
- langAliases[aliasMatch[1] || 'default'] = aliasMatch[2].trim();
+ if (!aliasMatch[1])
+ throw new Error(`Write the alias before the type, for example: \`cookies\` "Cookie" <[Array]<[Object]>>\nin: ${spec.text}`);
+ langAliases[aliasMatch[1]] = aliasMatch[2].trim();
continue;
}
const { name, text } = parseVariable(childText);
@@ -244,14 +255,33 @@ class ApiParser {
const childType = this.parseType(child, since);
properties.push(docs.Member.createProperty({ langs: {}, since, deprecated: undefined, discouraged: undefined }, name, childType.type, comments, !childType.optional));
}
- const type = docs.Type.parse(arg.type, properties, langAliases);
+ const type = docs.Type.parse(expression, properties, langAliases);
return { type, optional: arg.optional };
}
}
/**
+ * Names the string union in a type expression: `null|"a"|"b"` named `E`
+ * becomes `null|[E]<"a"|"b">`.
+ * @param {string} expression
+ * @param {string} name
+ * @returns {string | null} null if the expression has no string union
+ */
+function nameStringUnion(expression, name) {
+ const unions = [...expression.matchAll(/"[^"]*"(?:\|"[^"]*")*/g)];
+ if (!unions.length)
+ return null;
+ if (unions.length > 1)
+ throw new Error(`Cannot name "${name}" in "${expression}": it has more than one string union`);
+ const [union] = unions;
+ const start = /** @type {number} */ (union.index);
+ return expression.substring(0, start) + `[${name}]<${union[0]}>` + expression.substring(start + union[0].length);
+}
+
+/**
+ * Parses a type line: `` `name` "Alias" ?<type> text ``. The alias and `?` are optional.
* @param {string} line
- * @returns {{ name: string, type: string, text: string, optional: boolean }}
+ * @returns {{ name: string, type: string, text: string, optional: boolean, alias: string | undefined }}
*/
function parseVariable(line) {
let match = line.match(/^`([^`]+)` (.*)/);
@@ -265,6 +295,12 @@ function parseVariable(line) {
throw new Error('Invalid argument: ' + line);
const name = match[1];
let remainder = match[2];
+ let alias;
+ const aliasMatch = remainder.match(/^"([^"]+)"\s+/);
+ if (aliasMatch) {
+ alias = aliasMatch[1];
+ remainder = remainder.substring(aliasMatch[0].length);
+ }
let optional = false;
while ('?'.includes(remainder[0])) {
if (remainder[0] === '?')
@@ -281,7 +317,7 @@ function parseVariable(line) {
if (c === '>')
--depth;
if (depth === 0)
- return { name, type: remainder.substring(1, i), text: remainder.substring(i + 2), optional };
+ return { name, type: remainder.substring(1, i), text: remainder.substring(i + 2), optional, alias };
}
throw new Error('Should not be reached, line: ' + line);
}
diff --git a/utils/doclint/documentation.js b/utils/doclint/documentation.js
index 3858d8f9bc..e4ab2e8a67 100644
--- a/utils/doclint/documentation.js
+++ b/utils/doclint/documentation.js
@@ -780,22 +780,23 @@ function patchLinksInText(classOrMember, text, classesMap, membersMap, linkRende
member = maybeMember;
name = p2;
}
- if (p1 === 'param') {
- const param = member.argsArray.find(a => a.name === name);
+ const param = member.argsArray.find(a => a.name === name);
+ const options = member.argsArray.find(a => a.name === 'options');
+ const parts = name.split('.');
+ const optionName = parts[0];
+ const option = options?.type?.properties?.find(a => a.name === optionName);
+ // An argument can be a param in one language and an option in another,
+ // so a link of either kind also finds an argument of the other kind.
+ const asParam = p1 === 'param' ? !!param || !option : !option && !!param;
+ if (asParam) {
if (!param)
throw new Error(`Referenced parameter ${match} not found in the parent method ${member.name}\n=========\n${text}`);
return linkRenderer({ member, param: { name, alias: param.alias }, href }) || match;
- } else {
- // p1 === 'option'
- const options = member.argsArray.find(a => a.name === 'options');
- const parts = name.split('.');
- const optionName = parts[0];
- const option = options?.type?.properties?.find(a => a.name === optionName);
- if (!option)
- throw new Error(`Referenced option ${match} not found in the parent method ${member.name}\n=========\n${text}`);
- parts[0] = option.alias;
- return linkRenderer({ member, option: { name: optionName, alias: parts.join('.') }, href }) || match;
}
+ if (!option)
+ throw new Error(`Referenced option ${match} not found in the parent method ${member.name}\n=========\n${text}`);
+ parts[0] = option.alias;
+ return linkRenderer({ member, option: { name: optionName, alias: parts.join('.') }, href }) || match;
}
throw new Error(`Undefined link prefix, expected event|method|property|param|option, got: ` + match);
});