chore: follow up to deprecation changes (#19025)
This commit is contained in:
parent
f8355b940e
commit
f9a32e0927
|
|
@ -188,7 +188,7 @@ Raw CSS content to be injected into frame.
|
||||||
|
|
||||||
## async method: Frame.check
|
## async method: Frame.check
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.check`] instead.
|
* discouraged: Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method checks an element matching [`param: selector`] by performing the following steps:
|
This method checks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -232,7 +232,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Frame.click
|
## async method: Frame.click
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.click`] instead.
|
* discouraged: Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method clicks an element matching [`param: selector`] by performing the following steps:
|
This method clicks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -287,7 +287,7 @@ Gets the full HTML contents of the frame, including the doctype.
|
||||||
|
|
||||||
## async method: Frame.dblclick
|
## async method: Frame.dblclick
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.dblclick`] instead.
|
* discouraged: Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md).
|
||||||
* langs:
|
* langs:
|
||||||
- alias-csharp: DblClickAsync
|
- alias-csharp: DblClickAsync
|
||||||
|
|
||||||
|
|
@ -340,7 +340,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Frame.dispatchEvent
|
## async method: Frame.dispatchEvent
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead.
|
* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`
|
The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`
|
||||||
is dispatched. This is equivalent to calling
|
is dispatched. This is equivalent to calling
|
||||||
|
|
@ -469,7 +469,8 @@ Optional event-specific initialization properties.
|
||||||
|
|
||||||
## async method: Frame.evalOnSelector
|
## async method: Frame.evalOnSelector
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Locator.evaluate`] instead.
|
* discouraged: This method does not wait for the element to pass the actionability
|
||||||
|
checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`], other [Locator] helper methods or web-first assertions instead.
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: eval_on_selector
|
- alias-python: eval_on_selector
|
||||||
- alias-js: $eval
|
- alias-js: $eval
|
||||||
|
|
@ -477,11 +478,6 @@ Optional event-specific initialization properties.
|
||||||
|
|
||||||
Returns the return value of [`param: expression`].
|
Returns the return value of [`param: expression`].
|
||||||
|
|
||||||
:::caution
|
|
||||||
This method does not wait for the element to pass actionability checks and therefore can lead to
|
|
||||||
the flaky tests. Use [`method: Locator.evaluate`], other [Locator] helper methods or web-first assertions instead.
|
|
||||||
:::
|
|
||||||
|
|
||||||
The method finds an element matching the specified selector within the frame and passes it as a first argument to
|
The method finds an element matching the specified selector within the frame and passes it as a first argument to
|
||||||
[`param: expression`]. See [Working with selectors](../selectors.md) for more details. If no
|
[`param: expression`]. See [Working with selectors](../selectors.md) for more details. If no
|
||||||
elements match the selector, the method throws an error.
|
elements match the selector, the method throws an error.
|
||||||
|
|
@ -538,7 +534,8 @@ Optional argument to pass to [`param: expression`].
|
||||||
|
|
||||||
## async method: Frame.evalOnSelectorAll
|
## async method: Frame.evalOnSelectorAll
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Locator.evaluateAll`] instead.
|
* discouraged: In most cases, [`method: Locator.evaluateAll`],
|
||||||
|
other [Locator] helper methods and web-first assertions do a better job.
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: eval_on_selector_all
|
- alias-python: eval_on_selector_all
|
||||||
- alias-js: $$eval
|
- alias-js: $$eval
|
||||||
|
|
@ -546,10 +543,6 @@ Optional argument to pass to [`param: expression`].
|
||||||
|
|
||||||
Returns the return value of [`param: expression`].
|
Returns the return value of [`param: expression`].
|
||||||
|
|
||||||
:::note
|
|
||||||
In most cases, [`method: Locator.evaluateAll`], other [Locator] helper methods and web-first assertions do a better job.
|
|
||||||
:::
|
|
||||||
|
|
||||||
The method finds all elements matching the specified selector within the frame and passes an array of matched elements
|
The method finds all elements matching the specified selector within the frame and passes an array of matched elements
|
||||||
as a first argument to [`param: expression`]. See [Working with selectors](../selectors.md) for
|
as a first argument to [`param: expression`]. See [Working with selectors](../selectors.md) for
|
||||||
more details.
|
more details.
|
||||||
|
|
@ -811,7 +804,7 @@ Optional argument to pass to [`param: expression`].
|
||||||
|
|
||||||
## async method: Frame.fill
|
## async method: Frame.fill
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.fill`] instead.
|
* discouraged: Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field.
|
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field.
|
||||||
|
|
||||||
|
|
@ -842,7 +835,7 @@ Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.
|
||||||
|
|
||||||
## async method: Frame.focus
|
## async method: Frame.focus
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.focus`] instead.
|
* discouraged: Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method fetches an element with [`param: selector`] and focuses it. If there's no element matching
|
This method fetches an element with [`param: selector`] and focuses it. If there's no element matching
|
||||||
[`param: selector`], the method waits until a matching element appears in the DOM.
|
[`param: selector`], the method waits until a matching element appears in the DOM.
|
||||||
|
|
@ -940,7 +933,7 @@ await locator.ClickAsync();
|
||||||
|
|
||||||
## async method: Frame.getAttribute
|
## async method: Frame.getAttribute
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.getAttribute`] instead.
|
* discouraged: Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[null]|[string]>
|
- returns: <[null]|[string]>
|
||||||
|
|
||||||
Returns element attribute value.
|
Returns element attribute value.
|
||||||
|
|
@ -1083,7 +1076,7 @@ Referer header value. If provided it will take preference over the referer heade
|
||||||
|
|
||||||
## async method: Frame.hover
|
## async method: Frame.hover
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.hover`] instead.
|
* discouraged: Use locator-based [`method: Locator.hover`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method hovers over an element matching [`param: selector`] by performing the following steps:
|
This method hovers over an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -1123,7 +1116,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Frame.innerHTML
|
## async method: Frame.innerHTML
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.innerHTML`] instead.
|
* discouraged: Use locator-based [`method: Locator.innerHTML`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[string]>
|
- returns: <[string]>
|
||||||
|
|
||||||
Returns `element.innerHTML`.
|
Returns `element.innerHTML`.
|
||||||
|
|
@ -1139,7 +1132,7 @@ Returns `element.innerHTML`.
|
||||||
|
|
||||||
## async method: Frame.innerText
|
## async method: Frame.innerText
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.innerText`] instead.
|
* discouraged: Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[string]>
|
- returns: <[string]>
|
||||||
|
|
||||||
Returns `element.innerText`.
|
Returns `element.innerText`.
|
||||||
|
|
@ -1155,7 +1148,7 @@ Returns `element.innerText`.
|
||||||
|
|
||||||
## async method: Frame.inputValue
|
## async method: Frame.inputValue
|
||||||
* since: v1.13
|
* since: v1.13
|
||||||
* discouraged: Use locator-based [`method: Locator.inputValue`] instead.
|
* discouraged: Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[string]>
|
- returns: <[string]>
|
||||||
|
|
||||||
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
||||||
|
|
@ -1173,7 +1166,7 @@ Throws for non-input elements. However, if the element is inside the `<label>` e
|
||||||
|
|
||||||
## async method: Frame.isChecked
|
## async method: Frame.isChecked
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isChecked`] instead.
|
* discouraged: Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||||
|
|
@ -1195,7 +1188,7 @@ Returns `true` if the frame has been detached, or `false` otherwise.
|
||||||
|
|
||||||
## async method: Frame.isDisabled
|
## async method: Frame.isDisabled
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isDisabled`] instead.
|
* discouraged: Use locator-based [`method: Locator.isDisabled`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).
|
Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).
|
||||||
|
|
@ -1211,7 +1204,7 @@ Returns whether the element is disabled, the opposite of [enabled](../actionabil
|
||||||
|
|
||||||
## async method: Frame.isEditable
|
## async method: Frame.isEditable
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isEditable`] instead.
|
* discouraged: Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is [editable](../actionability.md#editable).
|
Returns whether the element is [editable](../actionability.md#editable).
|
||||||
|
|
@ -1242,7 +1235,7 @@ Returns whether the element is [enabled](../actionability.md#enabled).
|
||||||
|
|
||||||
## async method: Frame.isHidden
|
## async method: Frame.isHidden
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isHidden`] instead.
|
* discouraged: Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered hidden.
|
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered hidden.
|
||||||
|
|
@ -1260,7 +1253,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
|
||||||
|
|
||||||
## async method: Frame.isVisible
|
## async method: Frame.isVisible
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isVisible`] instead.
|
* discouraged: Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered not visible.
|
Returns whether the element is [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered not visible.
|
||||||
|
|
@ -1316,7 +1309,7 @@ Parent frame, if any. Detached frames and main frames return `null`.
|
||||||
|
|
||||||
## async method: Frame.press
|
## async method: Frame.press
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.press`] instead.
|
* discouraged: Use locator-based [`method: Locator.press`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
[`param: key`] can specify the intended
|
[`param: key`] can specify the intended
|
||||||
[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to
|
[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to
|
||||||
|
|
@ -1362,7 +1355,7 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
|
||||||
|
|
||||||
## async method: Frame.querySelector
|
## async method: Frame.querySelector
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Frame.locator`] instead.
|
* discouraged: Use locator-based [`method: Frame.locator`] instead. Read more about [locators](../locators.md).
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: query_selector
|
- alias-python: query_selector
|
||||||
- alias-js: $
|
- alias-js: $
|
||||||
|
|
@ -1386,7 +1379,7 @@ returns `null`.
|
||||||
|
|
||||||
## async method: Frame.querySelectorAll
|
## async method: Frame.querySelectorAll
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Frame.locator`] instead.
|
* discouraged: Use locator-based [`method: Frame.locator`] instead. Read more about [locators](../locators.md).
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: query_selector_all
|
- alias-python: query_selector_all
|
||||||
- alias-js: $$
|
- alias-js: $$
|
||||||
|
|
@ -1407,7 +1400,7 @@ returns empty array.
|
||||||
|
|
||||||
## async method: Frame.selectOption
|
## async method: Frame.selectOption
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.selectOption`] instead.
|
* discouraged: Use locator-based [`method: Locator.selectOption`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[Array]<[string]>>
|
- returns: <[Array]<[string]>>
|
||||||
|
|
||||||
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options.
|
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options.
|
||||||
|
|
@ -1487,7 +1480,7 @@ await frame.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" })
|
||||||
|
|
||||||
## async method: Frame.setChecked
|
## async method: Frame.setChecked
|
||||||
* since: v1.15
|
* since: v1.15
|
||||||
* discouraged: Use locator-based [`method: Locator.setChecked`] instead.
|
* discouraged: Use locator-based [`method: Locator.setChecked`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method checks or unchecks an element matching [`param: selector`] by performing the following steps:
|
This method checks or unchecks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -1545,7 +1538,7 @@ HTML markup to assign to the page.
|
||||||
|
|
||||||
## async method: Frame.setInputFiles
|
## async method: Frame.setInputFiles
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.setInputFiles`] instead.
|
* discouraged: Use locator-based [`method: Locator.setInputFiles`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
||||||
are resolved relative to the current working directory. For empty array, clears the selected files.
|
are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||||
|
|
@ -1570,7 +1563,7 @@ This method expects [`param: selector`] to point to an
|
||||||
|
|
||||||
## async method: Frame.tap
|
## async method: Frame.tap
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.tap`] instead.
|
* discouraged: Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method taps an element matching [`param: selector`] by performing the following steps:
|
This method taps an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -1614,7 +1607,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Frame.textContent
|
## async method: Frame.textContent
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.textContent`] instead.
|
* discouraged: Use locator-based [`method: Locator.textContent`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[null]|[string]>
|
- returns: <[null]|[string]>
|
||||||
|
|
||||||
Returns `element.textContent`.
|
Returns `element.textContent`.
|
||||||
|
|
@ -1636,7 +1629,7 @@ Returns the page title.
|
||||||
|
|
||||||
## async method: Frame.type
|
## async method: Frame.type
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.type`] instead.
|
* discouraged: Use locator-based [`method: Locator.type`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used to
|
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used to
|
||||||
send fine-grained keyboard events. To fill values in form fields, use [`method: Frame.fill`].
|
send fine-grained keyboard events. To fill values in form fields, use [`method: Frame.fill`].
|
||||||
|
|
@ -1698,7 +1691,7 @@ Time to wait between key presses in milliseconds. Defaults to 0.
|
||||||
|
|
||||||
## async method: Frame.uncheck
|
## async method: Frame.uncheck
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.uncheck`] instead.
|
* discouraged: Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method checks an element matching [`param: selector`] by performing the following steps:
|
This method checks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
|
||||||
|
|
@ -701,7 +701,7 @@ Brings page to front (activates tab).
|
||||||
|
|
||||||
## async method: Page.check
|
## async method: Page.check
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.check`] instead.
|
* discouraged: Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method checks an element matching [`param: selector`] by performing the following steps:
|
This method checks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -741,7 +741,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Page.click
|
## async method: Page.click
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.click`] instead.
|
* discouraged: Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method clicks an element matching [`param: selector`] by performing the following steps:
|
This method clicks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -833,7 +833,7 @@ Browser-specific Coverage implementation. See [Coverage](#class-coverage) for mo
|
||||||
|
|
||||||
## async method: Page.dblclick
|
## async method: Page.dblclick
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.dblclick`] instead.
|
* discouraged: Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md).
|
||||||
* langs:
|
* langs:
|
||||||
- alias-csharp: DblClickAsync
|
- alias-csharp: DblClickAsync
|
||||||
|
|
||||||
|
|
@ -886,7 +886,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Page.dispatchEvent
|
## async method: Page.dispatchEvent
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead.
|
* discouraged: Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`
|
The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`
|
||||||
is dispatched. This is equivalent to calling
|
is dispatched. This is equivalent to calling
|
||||||
|
|
@ -1277,17 +1277,14 @@ Emulates `'forced-colors'` media feature, supported values are `'active'` and `'
|
||||||
|
|
||||||
## async method: Page.evalOnSelector
|
## async method: Page.evalOnSelector
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Locator.evaluate`] instead.
|
* discouraged: This method does not wait for the element to pass actionability
|
||||||
|
checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`],
|
||||||
|
other [Locator] helper methods or web-first assertions instead.
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: eval_on_selector
|
- alias-python: eval_on_selector
|
||||||
- alias-js: $eval
|
- alias-js: $eval
|
||||||
- returns: <[Serializable]>
|
- returns: <[Serializable]>
|
||||||
|
|
||||||
:::caution
|
|
||||||
This method does not wait for the element to pass actionability checks and therefore can lead to
|
|
||||||
the flaky tests. Use [`method: Locator.evaluate`], other [Locator] helper methods or web-first assertions instead.
|
|
||||||
:::
|
|
||||||
|
|
||||||
The method finds an element matching the specified selector within the page and passes it as a first argument to
|
The method finds an element matching the specified selector within the page and passes it as a first argument to
|
||||||
[`param: expression`]. If no elements match the selector, the method throws an error. Returns the value of
|
[`param: expression`]. If no elements match the selector, the method throws an error. Returns the value of
|
||||||
[`param: expression`].
|
[`param: expression`].
|
||||||
|
|
@ -1346,16 +1343,13 @@ Optional argument to pass to [`param: expression`].
|
||||||
|
|
||||||
## async method: Page.evalOnSelectorAll
|
## async method: Page.evalOnSelectorAll
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Locator.evaluateAll`] instead.
|
* discouraged: In most cases, [`method: Locator.evaluateAll`],
|
||||||
|
other [Locator] helper methods and web-first assertions do a better job.
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: eval_on_selector_all
|
- alias-python: eval_on_selector_all
|
||||||
- alias-js: $$eval
|
- alias-js: $$eval
|
||||||
- returns: <[Serializable]>
|
- returns: <[Serializable]>
|
||||||
|
|
||||||
:::note
|
|
||||||
In most cases, [`method: Locator.evaluateAll`], other [Locator] helper methods and web-first assertions do a better job.
|
|
||||||
:::
|
|
||||||
|
|
||||||
The method finds all elements matching the specified selector within the page and passes an array of matched elements as
|
The method finds all elements matching the specified selector within the page and passes an array of matched elements as
|
||||||
a first argument to [`param: expression`]. Returns the result of [`param: expression`] invocation.
|
a first argument to [`param: expression`]. Returns the result of [`param: expression`] invocation.
|
||||||
|
|
||||||
|
|
@ -2046,7 +2040,7 @@ Callback function which will be called in Playwright's context.
|
||||||
|
|
||||||
## async method: Page.fill
|
## async method: Page.fill
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.fill`] instead.
|
* discouraged: Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field.
|
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field.
|
||||||
|
|
||||||
|
|
@ -2077,7 +2071,7 @@ Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.
|
||||||
|
|
||||||
## async method: Page.focus
|
## async method: Page.focus
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.focus`] instead.
|
* discouraged: Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method fetches an element with [`param: selector`] and focuses it. If there's no element matching
|
This method fetches an element with [`param: selector`] and focuses it. If there's no element matching
|
||||||
[`param: selector`], the method waits until a matching element appears in the DOM.
|
[`param: selector`], the method waits until a matching element appears in the DOM.
|
||||||
|
|
@ -2210,7 +2204,7 @@ An array of all frames attached to the page.
|
||||||
|
|
||||||
## async method: Page.getAttribute
|
## async method: Page.getAttribute
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.getAttribute`] instead.
|
* discouraged: Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[null]|[string]>
|
- returns: <[null]|[string]>
|
||||||
|
|
||||||
Returns element attribute value.
|
Returns element attribute value.
|
||||||
|
|
@ -2385,7 +2379,7 @@ Referer header value. If provided it will take preference over the referer heade
|
||||||
|
|
||||||
## async method: Page.hover
|
## async method: Page.hover
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.hover`] instead.
|
* discouraged: Use locator-based [`method: Locator.hover`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method hovers over an element matching [`param: selector`] by performing the following steps:
|
This method hovers over an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -2425,7 +2419,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Page.innerHTML
|
## async method: Page.innerHTML
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.innerHTML`] instead.
|
* discouraged: Use locator-based [`method: Locator.innerHTML`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[string]>
|
- returns: <[string]>
|
||||||
|
|
||||||
Returns `element.innerHTML`.
|
Returns `element.innerHTML`.
|
||||||
|
|
@ -2441,7 +2435,7 @@ Returns `element.innerHTML`.
|
||||||
|
|
||||||
## async method: Page.innerText
|
## async method: Page.innerText
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.innerText`] instead.
|
* discouraged: Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[string]>
|
- returns: <[string]>
|
||||||
|
|
||||||
Returns `element.innerText`.
|
Returns `element.innerText`.
|
||||||
|
|
@ -2457,7 +2451,7 @@ Returns `element.innerText`.
|
||||||
|
|
||||||
## async method: Page.inputValue
|
## async method: Page.inputValue
|
||||||
* since: v1.13
|
* since: v1.13
|
||||||
* discouraged: Use locator-based [`method: Locator.inputValue`] instead.
|
* discouraged: Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[string]>
|
- returns: <[string]>
|
||||||
|
|
||||||
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
|
||||||
|
|
@ -2475,7 +2469,7 @@ Throws for non-input elements. However, if the element is inside the `<label>` e
|
||||||
|
|
||||||
## async method: Page.isChecked
|
## async method: Page.isChecked
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isChecked`] instead.
|
* discouraged: Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||||
|
|
@ -2497,7 +2491,7 @@ Indicates that the page has been closed.
|
||||||
|
|
||||||
## async method: Page.isDisabled
|
## async method: Page.isDisabled
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isDisabled`] instead.
|
* discouraged: Use locator-based [`method: Locator.isDisabled`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).
|
Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).
|
||||||
|
|
@ -2513,7 +2507,7 @@ Returns whether the element is disabled, the opposite of [enabled](../actionabil
|
||||||
|
|
||||||
## async method: Page.isEditable
|
## async method: Page.isEditable
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isEditable`] instead.
|
* discouraged: Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is [editable](../actionability.md#editable).
|
Returns whether the element is [editable](../actionability.md#editable).
|
||||||
|
|
@ -2529,7 +2523,7 @@ Returns whether the element is [editable](../actionability.md#editable).
|
||||||
|
|
||||||
## async method: Page.isEnabled
|
## async method: Page.isEnabled
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isEnabled`] instead.
|
* discouraged: Use locator-based [`method: Locator.isEnabled`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is [enabled](../actionability.md#enabled).
|
Returns whether the element is [enabled](../actionability.md#enabled).
|
||||||
|
|
@ -2545,7 +2539,7 @@ Returns whether the element is [enabled](../actionability.md#enabled).
|
||||||
|
|
||||||
## async method: Page.isHidden
|
## async method: Page.isHidden
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isHidden`] instead.
|
* discouraged: Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered hidden.
|
Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered hidden.
|
||||||
|
|
@ -2564,7 +2558,7 @@ Returns whether the element is hidden, the opposite of [visible](../actionabilit
|
||||||
|
|
||||||
## async method: Page.isVisible
|
## async method: Page.isVisible
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.isVisible`] instead.
|
* discouraged: Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[boolean]>
|
- returns: <[boolean]>
|
||||||
|
|
||||||
Returns whether the element is [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered not visible.
|
Returns whether the element is [visible](../actionability.md#visible). [`option: selector`] that does not match any elements is considered not visible.
|
||||||
|
|
@ -2831,7 +2825,7 @@ size.
|
||||||
|
|
||||||
## async method: Page.press
|
## async method: Page.press
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.press`] instead.
|
* discouraged: Use locator-based [`method: Locator.press`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`].
|
Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`].
|
||||||
|
|
||||||
|
|
@ -2939,7 +2933,7 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
|
||||||
|
|
||||||
## async method: Page.querySelector
|
## async method: Page.querySelector
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Page.locator`] instead.
|
* discouraged: Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: query_selector
|
- alias-python: query_selector
|
||||||
- alias-js: $
|
- alias-js: $
|
||||||
|
|
@ -2956,7 +2950,7 @@ return value resolves to `null`. To wait for an element on the page, use [`metho
|
||||||
|
|
||||||
## async method: Page.querySelectorAll
|
## async method: Page.querySelectorAll
|
||||||
* since: v1.9
|
* since: v1.9
|
||||||
* discouraged: Use locator-based [`method: Page.locator`] instead.
|
* discouraged: Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).
|
||||||
* langs:
|
* langs:
|
||||||
- alias-python: query_selector_all
|
- alias-python: query_selector_all
|
||||||
- alias-js: $$
|
- alias-js: $$
|
||||||
|
|
@ -3215,7 +3209,7 @@ Returns the buffer with the captured screenshot.
|
||||||
|
|
||||||
## async method: Page.selectOption
|
## async method: Page.selectOption
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.selectOption`] instead.
|
* discouraged: Use locator-based [`method: Locator.selectOption`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[Array]<[string]>>
|
- returns: <[Array]<[string]>>
|
||||||
|
|
||||||
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options.
|
This method waits for an element matching [`param: selector`], waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options.
|
||||||
|
|
@ -3296,7 +3290,7 @@ await page.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" });
|
||||||
|
|
||||||
## async method: Page.setChecked
|
## async method: Page.setChecked
|
||||||
* since: v1.15
|
* since: v1.15
|
||||||
* discouraged: Use locator-based [`method: Locator.setChecked`] instead.
|
* discouraged: Use locator-based [`method: Locator.setChecked`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method checks or unchecks an element matching [`param: selector`] by performing the following steps:
|
This method checks or unchecks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -3407,7 +3401,7 @@ An object containing additional HTTP headers to be sent with every request. All
|
||||||
|
|
||||||
## async method: Page.setInputFiles
|
## async method: Page.setInputFiles
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.setInputFiles`] instead.
|
* discouraged: Use locator-based [`method: Locator.setInputFiles`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they
|
||||||
are resolved relative to the current working directory. For empty array, clears the selected files.
|
are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||||
|
|
@ -3493,7 +3487,7 @@ await page.GotoAsync("https://www.microsoft.com");
|
||||||
|
|
||||||
## async method: Page.tap
|
## async method: Page.tap
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.tap`] instead.
|
* discouraged: Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method taps an element matching [`param: selector`] by performing the following steps:
|
This method taps an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
@ -3537,7 +3531,7 @@ When all steps combined have not finished during the specified [`option: timeout
|
||||||
|
|
||||||
## async method: Page.textContent
|
## async method: Page.textContent
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.textContent`] instead.
|
* discouraged: Use locator-based [`method: Locator.textContent`] instead. Read more about [locators](../locators.md).
|
||||||
- returns: <[null]|[string]>
|
- returns: <[null]|[string]>
|
||||||
|
|
||||||
Returns `element.textContent`.
|
Returns `element.textContent`.
|
||||||
|
|
@ -3563,7 +3557,7 @@ Returns the page's title.
|
||||||
|
|
||||||
## async method: Page.type
|
## async method: Page.type
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.type`] instead.
|
* discouraged: Use locator-based [`method: Locator.type`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to send
|
Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to send
|
||||||
fine-grained keyboard events. To fill values in form fields, use [`method: Page.fill`].
|
fine-grained keyboard events. To fill values in form fields, use [`method: Page.fill`].
|
||||||
|
|
@ -3625,7 +3619,7 @@ Time to wait between key presses in milliseconds. Defaults to 0.
|
||||||
|
|
||||||
## async method: Page.uncheck
|
## async method: Page.uncheck
|
||||||
* since: v1.8
|
* since: v1.8
|
||||||
* discouraged: Use locator-based [`method: Locator.uncheck`] instead.
|
* discouraged: Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).
|
||||||
|
|
||||||
This method unchecks an element matching [`param: selector`] by performing the following steps:
|
This method unchecks an element matching [`param: selector`] by performing the following steps:
|
||||||
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
1. Find an element matching [`param: selector`]. If there is none, wait until a matching element is attached to
|
||||||
|
|
|
||||||
769
packages/playwright-core/types/types.d.ts
vendored
769
packages/playwright-core/types/types.d.ts
vendored
File diff suppressed because it is too large
Load diff
66
packages/playwright-test/types/test.d.ts
vendored
66
packages/playwright-test/types/test.d.ts
vendored
|
|
@ -436,7 +436,7 @@ interface TestConfig {
|
||||||
* `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
|
* `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
|
||||||
* explicitly configure the `baseURL` (even if it only has one entry).
|
* explicitly configure the `baseURL` (even if it only has one entry).
|
||||||
*
|
*
|
||||||
* > NOTE: It is also recommended to specify
|
* **NOTE** It is also recommended to specify
|
||||||
* [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
|
* [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
|
||||||
* that tests could use relative urls.
|
* that tests could use relative urls.
|
||||||
*
|
*
|
||||||
|
|
@ -764,7 +764,7 @@ interface TestConfig {
|
||||||
outputDir?: string;
|
outputDir?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* > NOTE: Use of [testConfig.snapshotDir](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-dir)
|
* **NOTE** Use of [testConfig.snapshotDir](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-dir)
|
||||||
* is discouraged. Please use
|
* is discouraged. Please use
|
||||||
* [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
|
* [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
|
||||||
* to configure snapshot paths.
|
* to configure snapshot paths.
|
||||||
|
|
@ -1358,7 +1358,7 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
||||||
* `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
|
* `8080` produces `baseURL` equal `http://localhost:8080`. If `webServer` is specified as an array, you must
|
||||||
* explicitly configure the `baseURL` (even if it only has one entry).
|
* explicitly configure the `baseURL` (even if it only has one entry).
|
||||||
*
|
*
|
||||||
* > NOTE: It is also recommended to specify
|
* **NOTE** It is also recommended to specify
|
||||||
* [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
|
* [testOptions.baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the config, so
|
||||||
* that tests could use relative urls.
|
* that tests could use relative urls.
|
||||||
*
|
*
|
||||||
|
|
@ -1571,7 +1571,7 @@ export interface TestInfo {
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* > NOTE: [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach)
|
* **NOTE** [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach)
|
||||||
* automatically takes care of copying attached files to a location that is accessible to reporters. You can safely
|
* automatically takes care of copying attached files to a location that is accessible to reporters. You can safely
|
||||||
* remove the attachment after awaiting the attach call.
|
* remove the attachment after awaiting the attach call.
|
||||||
* @param name Attachment name. The name will also be sanitized and used as the prefix of file name when saving to disk.
|
* @param name Attachment name. The name will also be sanitized and used as the prefix of file name when saving to disk.
|
||||||
|
|
@ -1822,12 +1822,13 @@ export interface TestInfo {
|
||||||
* 'path', 'to', 'snapshot.png')`.
|
* 'path', 'to', 'snapshot.png')`.
|
||||||
* > However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`),
|
* > However, this path must stay within the snapshots directory for each test file (i.e. `a.spec.js-snapshots`),
|
||||||
* otherwise it will throw.
|
* otherwise it will throw.
|
||||||
* @param pathSegments The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the same test file are expected to be the same.
|
* @param pathSegments The name of the snapshot or the path segments to define the snapshot file path. Snapshots with the same name in the
|
||||||
|
* same test file are expected to be the same.
|
||||||
*/
|
*/
|
||||||
snapshotPath(...pathSegments: Array<string>): string;
|
snapshotPath(...pathSegments: Array<string>): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* > NOTE: Use of [testInfo.snapshotSuffix](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-suffix)
|
* **NOTE** Use of [testInfo.snapshotSuffix](https://playwright.dev/docs/api/class-testinfo#test-info-snapshot-suffix)
|
||||||
* is discouraged. Please use
|
* is discouraged. Please use
|
||||||
* [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
|
* [testConfig.snapshotPathTemplate](https://playwright.dev/docs/api/class-testconfig#test-config-snapshot-path-template)
|
||||||
* to configure snapshot paths.
|
* to configure snapshot paths.
|
||||||
|
|
@ -1927,7 +1928,8 @@ interface SuiteFunction {
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
|
||||||
* this callback will belong to the group.
|
* this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
(title: string, callback: () => void): void;
|
(title: string, callback: () => void): void;
|
||||||
|
|
@ -1949,7 +1951,8 @@ interface SuiteFunction {
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param callback A callback that is run immediately when calling [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe(callback)](https://playwright.dev/docs/api/class-test#test-describe-2). Any tests added in this
|
||||||
* callback will belong to the group.
|
* callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
(callback: () => void): void;
|
(callback: () => void): void;
|
||||||
|
|
@ -2004,7 +2007,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-1). Any tests added in
|
||||||
* this callback will belong to the group.
|
* this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
describe: SuiteFunction & {
|
describe: SuiteFunction & {
|
||||||
|
|
@ -2024,7 +2028,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-only). Any tests
|
||||||
* added in this callback will belong to the group.
|
* added in this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
only: SuiteFunction;
|
only: SuiteFunction;
|
||||||
|
|
@ -2042,7 +2047,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.skip(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-skip). Any tests
|
||||||
* added in this callback will belong to the group, and will not be run.
|
* added in this callback will belong to the group, and will not be run.
|
||||||
*/
|
*/
|
||||||
skip: SuiteFunction;
|
skip: SuiteFunction;
|
||||||
|
|
@ -2060,7 +2066,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.fixme(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-fixme). Any tests
|
||||||
* added in this callback will belong to the group, and will not be run.
|
* added in this callback will belong to the group, and will not be run.
|
||||||
*/
|
*/
|
||||||
fixme: SuiteFunction;
|
fixme: SuiteFunction;
|
||||||
|
|
@ -2068,10 +2075,11 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
|
* Declares a group of tests that should always be run serially. If one of the tests fails, all subsequent tests are
|
||||||
* skipped. All tests in a group are retried together.
|
* skipped. All tests in a group are retried together.
|
||||||
*
|
*
|
||||||
* > NOTE: See
|
* **NOTE** See
|
||||||
* [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for the
|
* [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for the
|
||||||
* preferred way of configuring the execution mode.
|
* preferred way of configuring the execution mode.
|
||||||
* > NOTE: Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
|
*
|
||||||
|
* **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
|
||||||
* independently.
|
* independently.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
|
|
@ -2082,7 +2090,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.serial(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial). Any tests
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.serial(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial). Any tests
|
||||||
* added in this callback will belong to the group.
|
* added in this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
serial: SuiteFunction & {
|
serial: SuiteFunction & {
|
||||||
|
|
@ -2091,7 +2100,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
|
* tests are skipped. All tests in a group are retried together. If there are some focused tests or suites, all of
|
||||||
* them will be run but nothing else.
|
* them will be run but nothing else.
|
||||||
*
|
*
|
||||||
* > NOTE: Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
|
* **NOTE** Using serial is not recommended. It is usually better to make your tests isolated, so they can be run
|
||||||
* independently.
|
* independently.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
|
|
@ -2104,7 +2113,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.serial.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-serial-only).
|
||||||
* Any tests added in this callback will belong to the group.
|
* Any tests added in this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
only: SuiteFunction;
|
only: SuiteFunction;
|
||||||
|
|
@ -2115,7 +2125,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel) allows
|
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel) allows
|
||||||
* them to run in parallel.
|
* them to run in parallel.
|
||||||
*
|
*
|
||||||
* > NOTE: See
|
* **NOTE** See
|
||||||
* [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for the
|
* [test.describe.configure([options])](https://playwright.dev/docs/api/class-test#test-describe-configure) for the
|
||||||
* preferred way of configuring the execution mode.
|
* preferred way of configuring the execution mode.
|
||||||
*
|
*
|
||||||
|
|
@ -2129,7 +2139,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
|
* Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of
|
||||||
* the parallel tests executes all relevant hooks.
|
* the parallel tests executes all relevant hooks.
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel). Any
|
||||||
* tests added in this callback will belong to the group.
|
* tests added in this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
parallel: SuiteFunction & {
|
parallel: SuiteFunction & {
|
||||||
|
|
@ -2138,7 +2149,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel), but
|
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel), but
|
||||||
* focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
|
* focuses the group. If there are some focused tests or suites, all of them will be run but nothing else.
|
||||||
* @param title Group title.
|
* @param title Group title.
|
||||||
* @param callback A callback that is run immediately when calling [test.describe.parallel.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
|
* @param callback A callback that is run immediately when calling
|
||||||
|
* [test.describe.parallel.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel-only).
|
||||||
* Any tests added in this callback will belong to the group.
|
* Any tests added in this callback will belong to the group.
|
||||||
*/
|
*/
|
||||||
only: SuiteFunction;
|
only: SuiteFunction;
|
||||||
|
|
@ -2272,7 +2284,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param callback A function that returns whether to skip, based on test fixtures. Test or tests are skipped when the return value is `true`.
|
* @param callback A function that returns whether to skip, based on test fixtures. Test or tests are skipped when the return value is
|
||||||
|
* `true`.
|
||||||
* @param description Optional description that will be reflected in a test report.
|
* @param description Optional description that will be reflected in a test report.
|
||||||
*/
|
*/
|
||||||
skip(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
skip(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
||||||
|
|
@ -2357,7 +2370,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme" when the return value is `true`.
|
* @param callback A function that returns whether to mark as "fixme", based on test fixtures. Test or tests are marked as "fixme"
|
||||||
|
* when the return value is `true`.
|
||||||
* @param description Optional description that will be reflected in a test report.
|
* @param description Optional description that will be reflected in a test report.
|
||||||
*/
|
*/
|
||||||
fixme(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
fixme(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
||||||
|
|
@ -2411,7 +2425,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as "should fail" when the return value is `true`.
|
* @param callback A function that returns whether to mark as "should fail", based on test fixtures. Test or tests are marked as
|
||||||
|
* "should fail" when the return value is `true`.
|
||||||
* @param description Optional description that will be reflected in a test report.
|
* @param description Optional description that will be reflected in a test report.
|
||||||
*/
|
*/
|
||||||
fail(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
fail(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
||||||
|
|
@ -2427,7 +2442,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* > NOTE: [test.slow()](https://playwright.dev/docs/api/class-test#test-slow-1) cannot be used in a `beforeAll` or
|
* **NOTE** [test.slow()](https://playwright.dev/docs/api/class-test#test-slow-1) cannot be used in a `beforeAll` or
|
||||||
* `afterAll` hook. Use [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout)
|
* `afterAll` hook. Use [test.setTimeout(timeout)](https://playwright.dev/docs/api/class-test#test-set-timeout)
|
||||||
* instead.
|
* instead.
|
||||||
*/
|
*/
|
||||||
|
|
@ -2467,7 +2482,8 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param callback A function that returns whether to mark as "slow", based on test fixtures. Test or tests are marked as "slow" when the return value is `true`.
|
* @param callback A function that returns whether to mark as "slow", based on test fixtures. Test or tests are marked as "slow" when
|
||||||
|
* the return value is `true`.
|
||||||
* @param description Optional description that will be reflected in a test report.
|
* @param description Optional description that will be reflected in a test report.
|
||||||
*/
|
*/
|
||||||
slow(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
slow(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
|
||||||
|
|
|
||||||
|
|
@ -378,11 +378,12 @@ export interface Reporter {
|
||||||
/**
|
/**
|
||||||
* Called after all tests has been run, or testing has been interrupted. Note that this method may return a [Promise]
|
* Called after all tests has been run, or testing has been interrupted. Note that this method may return a [Promise]
|
||||||
* and Playwright Test will await it.
|
* and Playwright Test will await it.
|
||||||
* @param result Result of the full test run. - `'passed'` - Everything went as expected.
|
* @param result Result of the full test run.
|
||||||
|
* - `'passed'` - Everything went as expected.
|
||||||
* - `'failed'` - Any test has failed.
|
* - `'failed'` - Any test has failed.
|
||||||
* - `'timedout'` - The
|
* - `'timedout'` - The
|
||||||
* [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout) has
|
* [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout) has
|
||||||
* been reached.
|
* been reached.
|
||||||
* - `'interrupted'` - Interrupted by the user.
|
* - `'interrupted'` - Interrupted by the user.
|
||||||
*/
|
*/
|
||||||
onEnd?(result: FullResult): void | Promise<void>;
|
onEnd?(result: FullResult): void | Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -867,7 +867,7 @@ function generateSourceCodeComment(spec) {
|
||||||
if (node.type === 'note') {
|
if (node.type === 'note') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
node.type = 'text';
|
node.type = 'text';
|
||||||
node.text = '> NOTE: ' + node.text;
|
node.text = '**NOTE** ' + node.text;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 5 is a typical member doc offset.
|
// 5 is a typical member doc offset.
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const toKebabCase = require('lodash/kebabCase')
|
const toKebabCase = require('lodash/kebabCase')
|
||||||
const devices = require('../../packages/playwright-core/lib/server/deviceDescriptors');
|
const devices = require('../../packages/playwright-core/lib/server/deviceDescriptors');
|
||||||
|
const md = require('../markdown');
|
||||||
const docs = require('../doclint/documentation');
|
const docs = require('../doclint/documentation');
|
||||||
const PROJECT_DIR = path.join(__dirname, '..', '..');
|
const PROJECT_DIR = path.join(__dirname, '..', '..');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
@ -471,11 +472,18 @@ class TypesGenerator {
|
||||||
*/
|
*/
|
||||||
memberJSDOC(member, indent) {
|
memberJSDOC(member, indent) {
|
||||||
const lines = [];
|
const lines = [];
|
||||||
|
if (member.discouraged) {
|
||||||
|
lines.push('**NOTE** ' + md.wrapText(member.discouraged, { flattenText: true, maxColumns: 120 - 5 }, ''));
|
||||||
|
lines.push('');
|
||||||
|
}
|
||||||
if (member.comment)
|
if (member.comment)
|
||||||
lines.push(...member.comment.split('\n'));
|
lines.push(...member.comment.split('\n'));
|
||||||
if (member.deprecated)
|
if (member.deprecated)
|
||||||
lines.push('@deprecated ' + member.deprecated);
|
lines.push('@deprecated ' + md.wrapText(member.deprecated, { flattenText: true, maxColumns: 120 - 5 }, ''));
|
||||||
lines.push(...member.argsArray.map(arg => `@param ${arg.alias.replace(/\./g, '')} ${arg.comment.replace('\n', ' ')}`));
|
lines.push(...member.argsArray.map(arg => {
|
||||||
|
const paramPrefix = `@param ${arg.alias.replace(/\./g, '')} `;
|
||||||
|
return paramPrefix + md.wrapText(arg.comment, { flattenText: true, maxColumns: 120 - 5 }, '');
|
||||||
|
}));
|
||||||
if (!lines.length)
|
if (!lines.length)
|
||||||
return indent;
|
return indent;
|
||||||
return this.writeComment(lines.join('\n'), indent) + '\n' + indent;
|
return this.writeComment(lines.join('\n'), indent) + '\n' + indent;
|
||||||
|
|
|
||||||
|
|
@ -491,4 +491,4 @@ function filterNodesForLanguage(nodes, language) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { parse, render, clone, visitAll, visit, generateToc, filterNodesForLanguage };
|
module.exports = { parse, render, clone, visitAll, visit, generateToc, filterNodesForLanguage, wrapText };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue