Skip to content

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

feat: support AbortSignal on server-side methods (#41141)

Simon Knotteb9eb4888906
diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md
index 10a862cfcf..a14f91156a 100644
--- a/docs/src/api/class-elementhandle.md
+++ b/docs/src/api/class-elementhandle.md
@@ -191,6 +191,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.check.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.check.signal = %%-input-signal-%%
+
### option: ElementHandle.check.trial = %%-input-trial-%%
* since: v1.11
@@ -239,6 +241,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.click.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.click.signal = %%-input-signal-%%
+
### option: ElementHandle.click.trial = %%-input-trial-%%
* since: v1.11
@@ -298,6 +302,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.dblclick.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.dblclick.signal = %%-input-signal-%%
+
### option: ElementHandle.dblclick.trial = %%-input-trial-%%
* since: v1.11
@@ -560,6 +566,8 @@ Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: ElementHandle.fill.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.fill.signal = %%-input-signal-%%
+
## async method: ElementHandle.focus
* since: v1.8
* discouraged: Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).
@@ -611,6 +619,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.hover.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.hover.signal = %%-input-signal-%%
+
### option: ElementHandle.hover.trial = %%-input-trial-%%
* since: v1.11
@@ -739,6 +749,8 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
### option: ElementHandle.press.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.press.signal = %%-input-signal-%%
+
## async method: ElementHandle.querySelector
* since: v1.9
* discouraged: Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).
@@ -788,6 +800,8 @@ Returns the buffer with the captured screenshot.
### option: ElementHandle.screenshot.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.screenshot.signal = %%-input-signal-%%
+
### option: ElementHandle.screenshot.maskColor = %%-screenshot-option-mask-color-%%
* since: v1.34
@@ -813,6 +827,8 @@ See [scrolling](../input.md#scrolling) for alternative ways to scroll.
### option: ElementHandle.scrollIntoViewIfNeeded.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.scrollIntoViewIfNeeded.signal = %%-input-signal-%%
+
## async method: ElementHandle.selectOption
* since: v1.8
* discouraged: Use locator-based [`method: Locator.selectOption`] instead. Read more about [locators](../locators.md).
@@ -895,6 +911,8 @@ await handle.SelectOptionAsync(new[] {
### option: ElementHandle.selectOption.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.selectOption.signal = %%-input-signal-%%
+
### param: ElementHandle.selectOption.element = %%-python-select-options-element-%%
* since: v1.8
@@ -925,6 +943,8 @@ If the element is inside the `<label>` element that has an associated [control](
### option: ElementHandle.selectText.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.selectText.signal = %%-input-signal-%%
+
## async method: ElementHandle.setChecked
* discouraged: Use locator-based [`method: Locator.setChecked`] instead. Read more about [locators](../locators.md).
* since: v1.15
@@ -962,6 +982,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.setChecked.timeout = %%-input-timeout-js-%%
* since: v1.15
+### option: ElementHandle.setChecked.signal = %%-input-signal-%%
+
### option: ElementHandle.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -988,6 +1010,8 @@ This method expects [ElementHandle] to point to an
### option: ElementHandle.setInputFiles.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.setInputFiles.signal = %%-input-signal-%%
+
## async method: ElementHandle.tap
* since: v1.8
* discouraged: Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).
@@ -1027,6 +1051,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.tap.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.tap.signal = %%-input-signal-%%
+
### option: ElementHandle.tap.trial = %%-input-trial-%%
* since: v1.11
@@ -1068,6 +1094,8 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: ElementHandle.type.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.type.signal = %%-input-signal-%%
+
## async method: ElementHandle.uncheck
* since: v1.8
* discouraged: Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).
@@ -1103,6 +1131,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: ElementHandle.uncheck.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.uncheck.signal = %%-input-signal-%%
+
### option: ElementHandle.uncheck.trial = %%-input-trial-%%
* since: v1.11
@@ -1136,6 +1166,8 @@ A state to wait for, see below for more details.
### option: ElementHandle.waitForElementState.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.waitForElementState.signal = %%-input-signal-%%
+
## async method: ElementHandle.waitForSelector
* since: v1.8
* discouraged: Use web assertions that assert visibility or a locator-based [`method: Locator.waitFor`] instead.
@@ -1203,5 +1235,7 @@ This method does not work across navigations, use [`method: Page.waitForSelector
### option: ElementHandle.waitForSelector.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: ElementHandle.waitForSelector.signal = %%-input-signal-%%
+
### option: ElementHandle.waitForSelector.strict = %%-input-strict-%%
* since: v1.15
diff --git a/docs/src/api/class-filechooser.md b/docs/src/api/class-filechooser.md
index 82502c8d5e..8d03638cbd 100644
--- a/docs/src/api/class-filechooser.md
+++ b/docs/src/api/class-filechooser.md
@@ -73,3 +73,5 @@ they are resolved relative to the current working directory. For empty array, cl
### option: FileChooser.setFiles.timeout = %%-input-timeout-js-%%
* since: v1.8
+
+### option: FileChooser.setFiles.signal = %%-input-signal-%%
diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md
index 28e7820b4a..8836c3c5f3 100644
--- a/docs/src/api/class-frame.md
+++ b/docs/src/api/class-frame.md
@@ -227,6 +227,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.check.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.check.signal = %%-input-signal-%%
+
### option: Frame.check.trial = %%-input-trial-%%
* since: v1.11
@@ -286,6 +288,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.click.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.click.signal = %%-input-signal-%%
+
### option: Frame.click.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -350,6 +354,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.dblclick.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.dblclick.signal = %%-input-signal-%%
+
### option: Frame.dblclick.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -458,6 +464,8 @@ Optional event-specific initialization properties.
### option: Frame.dispatchEvent.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.dispatchEvent.signal = %%-input-signal-%%
+
## async method: Frame.dragAndDrop
* since: v1.13
@@ -485,6 +493,8 @@ Optional event-specific initialization properties.
### option: Frame.dragAndDrop.timeout = %%-input-timeout-js-%%
* since: v1.13
+### option: Frame.dragAndDrop.signal = %%-input-signal-%%
+
### option: Frame.dragAndDrop.trial = %%-input-trial-%%
* since: v1.13
@@ -881,6 +891,8 @@ Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: Frame.fill.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.fill.signal = %%-input-signal-%%
+
## async method: Frame.focus
* since: v1.8
* discouraged: Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).
@@ -900,6 +912,8 @@ This method fetches an element with [`param: selector`] and focuses it. If there
### option: Frame.focus.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.focus.signal = %%-input-signal-%%
+
## async method: Frame.frameElement
* since: v1.8
- returns: <[ElementHandle]>
@@ -1007,6 +1021,8 @@ Attribute name to get the value for.
### option: Frame.getAttribute.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.getAttribute.signal = %%-input-signal-%%
+
## method: Frame.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -1129,6 +1145,8 @@ URL to navigate frame to. The url should include scheme, e.g. `https://`.
### option: Frame.goto.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Frame.goto.signal = %%-input-signal-%%
+
### option: Frame.goto.referer
* since: v1.8
- `referer` <[string]>
@@ -1175,6 +1193,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.hover.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.hover.signal = %%-input-signal-%%
+
### option: Frame.hover.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -1200,6 +1220,8 @@ Returns `element.innerHTML`.
### option: Frame.innerHTML.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.innerHTML.signal = %%-input-signal-%%
+
## async method: Frame.innerText
* since: v1.8
* discouraged: Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).
@@ -1219,6 +1241,8 @@ Returns `element.innerText`.
### option: Frame.innerText.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.innerText.signal = %%-input-signal-%%
+
## async method: Frame.inputValue
* since: v1.13
* discouraged: Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).
@@ -1240,6 +1264,8 @@ Throws for non-input elements. However, if the element is inside the `<label>` e
### option: Frame.inputValue.timeout = %%-input-timeout-js-%%
* since: v1.13
+### option: Frame.inputValue.signal = %%-input-signal-%%
+
## async method: Frame.isChecked
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).
@@ -1259,6 +1285,8 @@ Returns whether the element is checked. Throws if the element is not a checkbox
### option: Frame.isChecked.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.isChecked.signal = %%-input-signal-%%
+
## method: Frame.isDetached
* since: v1.8
- returns: <[boolean]>
@@ -1284,6 +1312,8 @@ Returns whether the element is disabled, the opposite of [enabled](../actionabil
### option: Frame.isDisabled.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.isDisabled.signal = %%-input-signal-%%
+
## async method: Frame.isEditable
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).
@@ -1303,6 +1333,8 @@ Returns whether the element is [editable](../actionability.md#editable).
### option: Frame.isEditable.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.isEditable.signal = %%-input-signal-%%
+
## async method: Frame.isEnabled
* since: v1.8
- returns: <[boolean]>
@@ -1321,6 +1353,8 @@ Returns whether the element is [enabled](../actionability.md#enabled).
### option: Frame.isEnabled.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.isEnabled.signal = %%-input-signal-%%
+
## async method: Frame.isHidden
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).
@@ -1451,6 +1485,8 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
### option: Frame.press.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.press.signal = %%-input-signal-%%
+
## async method: Frame.querySelector
* since: v1.9
* discouraged: Use locator-based [`method: Frame.locator`] instead. Read more about [locators](../locators.md).
@@ -1577,6 +1613,8 @@ await frame.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" })
### option: Frame.selectOption.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.selectOption.signal = %%-input-signal-%%
+
### param: Frame.selectOption.element = %%-python-select-options-element-%%
* since: v1.8
@@ -1634,6 +1672,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.setChecked.timeout = %%-input-timeout-js-%%
* since: v1.15
+### option: Frame.setChecked.signal = %%-input-signal-%%
+
### option: Frame.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -1654,6 +1694,8 @@ HTML markup to assign to the page.
### option: Frame.setContent.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Frame.setContent.signal = %%-input-signal-%%
+
### option: Frame.setContent.waitUntil = %%-navigation-wait-until-%%
* since: v1.8
@@ -1685,6 +1727,8 @@ This method expects [`param: selector`] to point to an
### option: Frame.setInputFiles.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.setInputFiles.signal = %%-input-signal-%%
+
## async method: Frame.tap
* since: v1.8
* discouraged: Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).
@@ -1731,6 +1775,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.tap.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.tap.signal = %%-input-signal-%%
+
### option: Frame.tap.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -1753,6 +1799,8 @@ Returns `element.textContent`.
### option: Frame.textContent.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.textContent.signal = %%-input-signal-%%
+
## async method: Frame.title
* since: v1.8
- returns: <[string]>
@@ -1797,6 +1845,8 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Frame.type.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.type.signal = %%-input-signal-%%
+
## async method: Frame.uncheck
* since: v1.8
* discouraged: Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).
@@ -1839,6 +1889,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Frame.uncheck.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.uncheck.signal = %%-input-signal-%%
+
### option: Frame.uncheck.trial = %%-input-trial-%%
* since: v1.11
@@ -1989,6 +2041,8 @@ Optional argument to pass to [`param: expression`].
### option: Frame.waitForFunction.timeout = %%-wait-for-function-timeout-js-%%
* since: v1.8
+### option: Frame.waitForFunction.signal = %%-input-signal-%%
+
## async method: Frame.waitForLoadState
* since: v1.8
@@ -2258,6 +2312,8 @@ class FrameExamples
### option: Frame.waitForSelector.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Frame.waitForSelector.signal = %%-input-signal-%%
+
## async method: Frame.waitForTimeout
* since: v1.8
* discouraged: Never wait for timeout in production. Tests that wait for time are
diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md
index fd0e717843..3cb294302d 100644
--- a/docs/src/api/class-locator.md
+++ b/docs/src/api/class-locator.md
@@ -223,6 +223,8 @@ When set to `"ai"`, returns a snapshot optimized for AI consumption. Defaults to
### option: Locator.ariaSnapshot.timeout = %%-input-timeout-js-%%
* since: v1.49
+### option: Locator.ariaSnapshot.signal = %%-input-signal-%%
+
### option: Locator.ariaSnapshot.depth
* since: v1.59
- `depth` <[int]>
@@ -248,6 +250,8 @@ Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur)
### option: Locator.blur.timeout = %%-input-timeout-js-%%
* since: v1.28
+### option: Locator.blur.signal = %%-input-signal-%%
+
## async method: Locator.boundingBox
* since: v1.14
- returns: <[null]|[Object]>
@@ -306,6 +310,8 @@ await page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);
### option: Locator.boundingBox.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.boundingBox.signal = %%-input-signal-%%
+
## async method: Locator.check
* since: v1.14
@@ -366,6 +372,8 @@ await page.GetByRole(AriaRole.Checkbox).CheckAsync();
### option: Locator.check.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.check.signal = %%-input-signal-%%
+
### option: Locator.check.trial = %%-input-trial-%%
* since: v1.14
@@ -416,6 +424,8 @@ await page.GetByRole(AriaRole.Textbox).ClearAsync();
### option: Locator.clear.timeout = %%-input-timeout-js-%%
* since: v1.28
+### option: Locator.clear.signal = %%-input-signal-%%
+
## async method: Locator.click
* since: v1.14
@@ -527,6 +537,8 @@ await page.Locator("canvas").ClickAsync(new() {
### option: Locator.click.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.click.signal = %%-input-signal-%%
+
### option: Locator.click.trial = %%-input-trial-with-modifiers-%%
* since: v1.14
@@ -616,6 +628,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.dblclick.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.dblclick.signal = %%-input-signal-%%
+
### option: Locator.dblclick.trial = %%-input-trial-with-modifiers-%%
* since: v1.14
@@ -820,6 +834,8 @@ Optional event-specific initialization properties.
### option: Locator.dispatchEvent.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.dispatchEvent.signal = %%-input-signal-%%
+
## async method: Locator.dragTo
* since: v1.18
@@ -915,6 +931,8 @@ Locator of the element to drag to.
### option: Locator.dragTo.timeout = %%-input-timeout-js-%%
* since: v1.18
+### option: Locator.dragTo.signal = %%-input-signal-%%
+
### option: Locator.dragTo.trial = %%-input-trial-%%
* since: v1.18
@@ -975,6 +993,8 @@ await page.locator('#dropzone').drop({
### option: Locator.drop.timeout = %%-input-timeout-js-%%
* since: v1.60
+### option: Locator.drop.signal = %%-input-signal-%%
+
## async method: Locator.elementHandle
* since: v1.14
* discouraged: Always prefer using [Locator]s and web assertions over [ElementHandle]s because latter are inherently racy.
@@ -988,6 +1008,8 @@ Resolves given locator to the first matching DOM element. If there are no matchi
### option: Locator.elementHandle.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.elementHandle.signal = %%-input-signal-%%
+
## async method: Locator.elementHandles
* since: v1.14
* discouraged: Always prefer using [Locator]s and web assertions over [ElementHandle]s because latter are inherently racy.
@@ -1265,6 +1287,8 @@ Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: Locator.fill.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.fill.signal = %%-input-signal-%%
+
## method: Locator.filter
* since: v1.22
- returns: <[Locator]>
@@ -1351,6 +1375,8 @@ Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
### option: Locator.focus.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.focus.signal = %%-input-signal-%%
+
## method: Locator.frameLocator
* since: v1.17
- returns: <[FrameLocator]>
@@ -1410,6 +1436,8 @@ Attribute name to get the value for.
### option: Locator.getAttribute.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.getAttribute.signal = %%-input-signal-%%
+
## method: Locator.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -1574,6 +1602,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.hover.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.hover.signal = %%-input-signal-%%
+
### option: Locator.hover.trial = %%-input-trial-with-modifiers-%%
* since: v1.14
@@ -1592,6 +1622,8 @@ Returns the [`element.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/A
### option: Locator.innerHTML.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.innerHTML.signal = %%-input-signal-%%
+
## async method: Locator.innerText
* since: v1.14
- returns: <[string]>
@@ -1608,6 +1640,8 @@ If you need to assert text on the page, prefer [`method: LocatorAssertions.toHav
### option: Locator.innerText.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.innerText.signal = %%-input-signal-%%
+
## async method: Locator.inputValue
* since: v1.14
- returns: <[string]>
@@ -1650,6 +1684,8 @@ Throws elements that are not an input, textarea or a select. However, if the ele
### option: Locator.inputValue.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.inputValue.signal = %%-input-signal-%%
+
## async method: Locator.isChecked
* since: v1.14
- returns: <[boolean]>
@@ -1688,6 +1724,8 @@ var isChecked = await page.GetByRole(AriaRole.Checkbox).IsCheckedAsync();
### option: Locator.isChecked.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.isChecked.signal = %%-input-signal-%%
+
## async method: Locator.isDisabled
* since: v1.14
- returns: <[boolean]>
@@ -1726,6 +1764,8 @@ Boolean disabled = await page.GetByRole(AriaRole.Button).IsDisabledAsync();
### option: Locator.isDisabled.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.isDisabled.signal = %%-input-signal-%%
+
## async method: Locator.isEditable
* since: v1.14
- returns: <[boolean]>
@@ -1764,6 +1804,8 @@ Boolean editable = await page.GetByRole(AriaRole.Textbox).IsEditableAsync();
### option: Locator.isEditable.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.isEditable.signal = %%-input-signal-%%
+
## async method: Locator.isEnabled
* since: v1.14
- returns: <[boolean]>
@@ -1802,6 +1844,8 @@ Boolean enabled = await page.GetByRole(AriaRole.Button).IsEnabledAsync();
### option: Locator.isEnabled.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.isEnabled.signal = %%-input-signal-%%
+
## async method: Locator.isHidden
* since: v1.14
- returns: <[boolean]>
@@ -2110,6 +2154,8 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
### option: Locator.press.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.press.signal = %%-input-signal-%%
+
## async method: Locator.pressSequentially
* since: v1.38
@@ -2202,6 +2248,8 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Locator.pressSequentially.timeout = %%-input-timeout-js-%%
* since: v1.38
+### option: Locator.pressSequentially.signal = %%-input-signal-%%
+
## async method: Locator.screenshot
* since: v1.14
@@ -2276,6 +2324,8 @@ Returns the buffer with the captured screenshot.
### option: Locator.screenshot.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.screenshot.signal = %%-input-signal-%%
+
### option: Locator.screenshot.maskColor = %%-screenshot-option-mask-color-%%
* since: v1.34
@@ -2297,6 +2347,8 @@ See [scrolling](../input.md#scrolling) for alternative ways to scroll.
### option: Locator.scrollIntoViewIfNeeded.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.scrollIntoViewIfNeeded.signal = %%-input-signal-%%
+
## async method: Locator.selectOption
* since: v1.14
- returns: <[Array]<[string]>>
@@ -2385,6 +2437,8 @@ await element.SelectOptionAsync(new[] { "red", "green", "blue" });
### option: Locator.selectOption.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.selectOption.signal = %%-input-signal-%%
+
### param: Locator.selectOption.element = %%-python-select-options-element-%%
* since: v1.14
@@ -2414,6 +2468,8 @@ If the element is inside the `<label>` element that has an associated [control](
### option: Locator.selectText.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.selectText.signal = %%-input-signal-%%
+
## async method: Locator.setChecked
* since: v1.15
@@ -2476,6 +2532,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.setChecked.timeout = %%-input-timeout-js-%%
* since: v1.15
+### option: Locator.setChecked.signal = %%-input-signal-%%
+
### option: Locator.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -2614,6 +2672,8 @@ This method expects [Locator] to point to an
### option: Locator.setInputFiles.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.setInputFiles.signal = %%-input-signal-%%
+
## async method: Locator.tap
* since: v1.14
@@ -2657,6 +2717,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.tap.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.tap.signal = %%-input-signal-%%
+
### option: Locator.tap.trial = %%-input-trial-with-modifiers-%%
* since: v1.14
@@ -2676,6 +2738,8 @@ If you need to assert text on the page, prefer [`method: LocatorAssertions.toHav
### option: Locator.textContent.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.textContent.signal = %%-input-signal-%%
+
## method: Locator.toString
* since: v1.57
* langs: js
@@ -2714,6 +2778,8 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Locator.type.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.type.signal = %%-input-signal-%%
+
## async method: Locator.uncheck
* since: v1.14
@@ -2774,6 +2840,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Locator.uncheck.timeout = %%-input-timeout-js-%%
* since: v1.14
+### option: Locator.uncheck.signal = %%-input-signal-%%
+
### option: Locator.uncheck.trial = %%-input-trial-%%
* since: v1.14
@@ -2821,6 +2889,8 @@ orderSent.WaitForAsync();
### option: Locator.waitFor.timeout = %%-input-timeout-js-%%
* since: v1.16
+### option: Locator.waitFor.signal = %%-input-signal-%%
+
## async method: Locator.waitForFunction
* since: v1.62
@@ -2867,3 +2937,6 @@ Optional argument to pass to [`param: expression`].
### option: Locator.waitForFunction.timeout = %%-wait-for-function-timeout-js-%%
* since: v1.62
+
+### option: Locator.waitForFunction.signal = %%-input-signal-%%
+* since: v1.62
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md
index 30c14dbe92..3f0febb599 100644
--- a/docs/src/api/class-page.md
+++ b/docs/src/api/class-page.md
@@ -763,6 +763,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.check.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.check.signal = %%-input-signal-%%
+
### option: Page.check.trial = %%-input-trial-%%
* since: v1.11
@@ -818,6 +820,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.click.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.click.signal = %%-input-signal-%%
+
### option: Page.click.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -924,6 +928,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.dblclick.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.dblclick.signal = %%-input-signal-%%
+
### option: Page.dblclick.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -1031,6 +1037,8 @@ Optional event-specific initialization properties.
### option: Page.dispatchEvent.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.dispatchEvent.signal = %%-input-signal-%%
+
## async method: Page.dragAndDrop
* since: v1.13
@@ -1112,6 +1120,8 @@ await Page.DragAndDropAsync("#source", "#target", new()
### option: Page.dragAndDrop.timeout = %%-input-timeout-js-%%
* since: v1.13
+### option: Page.dragAndDrop.signal = %%-input-signal-%%
+
### option: Page.dragAndDrop.trial = %%-input-trial-%%
* since: v1.13
@@ -2073,6 +2083,8 @@ Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.
### option: Page.fill.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.fill.signal = %%-input-signal-%%
+
## async method: Page.focus
* since: v1.8
* discouraged: Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).
@@ -2092,6 +2104,8 @@ This method fetches an element with [`param: selector`] and focuses it. If there
### option: Page.focus.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.focus.signal = %%-input-signal-%%
+
## method: Page.frame
* since: v1.8
- returns: <[null]|[Frame]>
@@ -2248,6 +2262,8 @@ Attribute name to get the value for.
### option: Page.getAttribute.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.getAttribute.signal = %%-input-signal-%%
+
## method: Page.getByAltText
* since: v1.27
- returns: <[Locator]>
@@ -2343,6 +2359,8 @@ Navigate to the previous page in history.
### option: Page.goBack.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Page.goBack.signal = %%-input-signal-%%
+
## async method: Page.goForward
* since: v1.8
- returns: <[null]|[Response]>
@@ -2413,6 +2431,8 @@ Assert.True(await Page.EvaluateAsync("!globalThis.suspectWeakRef.deref()"));
### option: Page.goForward.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Page.goForward.signal = %%-input-signal-%%
+
## async method: Page.goto
* since: v1.8
* langs:
@@ -2460,6 +2480,8 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/We
### option: Page.goto.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Page.goto.signal = %%-input-signal-%%
+
### option: Page.goto.referer
* since: v1.8
- `referer` <[string]>
@@ -2511,6 +2533,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.hover.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.hover.signal = %%-input-signal-%%
+
### option: Page.hover.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -2536,6 +2560,8 @@ Returns `element.innerHTML`.
### option: Page.innerHTML.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.innerHTML.signal = %%-input-signal-%%
+
## async method: Page.innerText
* since: v1.8
* discouraged: Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).
@@ -2555,6 +2581,8 @@ Returns `element.innerText`.
### option: Page.innerText.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.innerText.signal = %%-input-signal-%%
+
## async method: Page.inputValue
* since: v1.13
* discouraged: Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).
@@ -2576,6 +2604,8 @@ Throws for non-input elements. However, if the element is inside the `<label>` e
### option: Page.inputValue.timeout = %%-input-timeout-js-%%
* since: v1.13
+### option: Page.inputValue.signal = %%-input-signal-%%
+
## async method: Page.isChecked
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).
@@ -2595,6 +2625,8 @@ Returns whether the element is checked. Throws if the element is not a checkbox
### option: Page.isChecked.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.isChecked.signal = %%-input-signal-%%
+
## method: Page.isClosed
* since: v1.8
- returns: <[boolean]>
@@ -2620,6 +2652,8 @@ Returns whether the element is disabled, the opposite of [enabled](../actionabil
### option: Page.isDisabled.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.isDisabled.signal = %%-input-signal-%%
+
## async method: Page.isEditable
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).
@@ -2639,6 +2673,8 @@ Returns whether the element is [editable](../actionability.md#editable).
### option: Page.isEditable.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.isEditable.signal = %%-input-signal-%%
+
## async method: Page.isEnabled
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isEnabled`] instead. Read more about [locators](../locators.md).
@@ -2658,6 +2694,8 @@ Returns whether the element is [enabled](../actionability.md#enabled).
### option: Page.isEnabled.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.isEnabled.signal = %%-input-signal-%%
+
## async method: Page.isHidden
* since: v1.8
* discouraged: Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).
@@ -3219,6 +3257,8 @@ Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
### option: Page.press.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.press.signal = %%-input-signal-%%
+
## async method: Page.querySelector
* since: v1.9
* discouraged: Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).
@@ -3584,6 +3624,8 @@ last redirect.
### option: Page.reload.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Page.reload.signal = %%-input-signal-%%
+
## property: Page.request
* since: v1.16
* langs:
@@ -3948,6 +3990,8 @@ Returns the buffer with the captured screenshot.
### option: Page.screenshot.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.screenshot.signal = %%-input-signal-%%
+
### option: Page.screenshot.fullPage = %%-screenshot-option-full-page-%%
* since: v1.8
@@ -4044,6 +4088,8 @@ await page.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" });
### option: Page.selectOption.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.selectOption.signal = %%-input-signal-%%
+
### param: Page.selectOption.element = %%-python-select-options-element-%%
* since: v1.8
@@ -4101,6 +4147,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.setChecked.timeout = %%-input-timeout-js-%%
* since: v1.15
+### option: Page.setChecked.signal = %%-input-signal-%%
+
### option: Page.setChecked.trial = %%-input-trial-%%
* since: v1.15
@@ -4121,6 +4169,8 @@ HTML markup to assign to the page.
### option: Page.setContent.timeout = %%-navigation-timeout-js-%%
* since: v1.8
+### option: Page.setContent.signal = %%-input-signal-%%
+
### option: Page.setContent.waitUntil = %%-navigation-wait-until-%%
* since: v1.8
@@ -4206,6 +4256,8 @@ This method expects [`param: selector`] to point to an
### option: Page.setInputFiles.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.setInputFiles.signal = %%-input-signal-%%
+
## async method: Page.setViewportSize
* since: v1.8
@@ -4289,6 +4341,8 @@ When set to `"ai"`, returns a snapshot optimized for AI consumption: including e
### option: Page.ariaSnapshot.timeout = %%-input-timeout-js-%%
* since: v1.59
+### option: Page.ariaSnapshot.signal = %%-input-signal-%%
+
### option: Page.ariaSnapshot.depth
* since: v1.59
- `depth` <[int]>
@@ -4349,6 +4403,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.tap.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.tap.signal = %%-input-signal-%%
+
### option: Page.tap.trial = %%-input-trial-with-modifiers-%%
* since: v1.11
@@ -4371,6 +4427,8 @@ Returns `element.textContent`.
### option: Page.textContent.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.textContent.signal = %%-input-signal-%%
+
## async method: Page.title
* since: v1.8
- returns: <[string]>
@@ -4419,6 +4477,8 @@ Time to wait between key presses in milliseconds. Defaults to 0.
### option: Page.type.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.type.signal = %%-input-signal-%%
+
## async method: Page.uncheck
* since: v1.8
* discouraged: Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).
@@ -4461,6 +4521,8 @@ When all steps combined have not finished during the specified [`option: timeout
### option: Page.uncheck.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.uncheck.signal = %%-input-signal-%%
+
### option: Page.uncheck.trial = %%-input-trial-%%
* since: v1.11
@@ -4829,6 +4891,8 @@ Optional argument to pass to [`param: expression`].
### option: Page.waitForFunction.timeout = %%-wait-for-function-timeout-js-%%
* since: v1.8
+### option: Page.waitForFunction.signal = %%-input-signal-%%
+
## async method: Page.waitForLoadState
* since: v1.8
@@ -5439,6 +5503,8 @@ class FrameExamples
### option: Page.waitForSelector.timeout = %%-input-timeout-js-%%
* since: v1.8
+### option: Page.waitForSelector.signal = %%-input-signal-%%
+
## async method: Page.waitForCondition
* since: v1.32
* langs: java
diff --git a/docs/src/api/params.md b/docs/src/api/params.md
index 8000f7e5ba..b139898cfa 100644
--- a/docs/src/api/params.md
+++ b/docs/src/api/params.md
@@ -1005,7 +1005,15 @@ The default value can be changed by using the [`method: BrowserContext.setDefaul
- `signal` <[AbortSignal]>
Allows to cancel the waiting using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the waiting will be aborted and the operation will throw an error.
-Note that providing a signal does not disable the default timeout; pass `timeout: 0` to disable the timeout entirely.
+Note that providing a signal does not disable the default timeout, which can be changed using [`method: BrowserContext.setDefaultTimeout`]; pass `timeout: 0` to disable the timeout entirely.
+
+## input-signal
+* langs: js
+* since: v1.61
+- `signal` <[AbortSignal]>
+
+Allows to cancel the operation using an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the operation will be aborted and throw an error.
+Note that providing a signal does not disable the default timeout, which can be changed using [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`]; pass `timeout: 0` to disable the timeout entirely.
## android-timeout
* langs: js
diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts
index 0e37993306..9df5611d2a 100644
--- a/packages/playwright-client/types/types.d.ts
+++ b/packages/playwright-client/types/types.d.ts
@@ -2070,6 +2070,17 @@ export interface Page {
*/
mode?: "ai"|"default";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -2146,6 +2157,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2261,6 +2283,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2408,6 +2441,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2479,6 +2523,17 @@ export interface Page {
* @param options
*/
dispatchEvent(selector: string, type: string, eventInit?: EvaluationArgument, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2535,6 +2590,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* 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.
@@ -2734,6 +2800,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2762,6 +2839,17 @@ export interface Page {
* @param options
*/
focus(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2839,6 +2927,17 @@ export interface Page {
* @param options
*/
getAttribute(selector: string, name: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3194,6 +3293,17 @@ export interface Page {
* @param options
*/
goBack(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -3224,6 +3334,17 @@ export interface Page {
* @param options
*/
goForward(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -3281,6 +3402,17 @@ export interface Page {
*/
referer?: string;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -3370,6 +3502,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3403,6 +3546,17 @@ export interface Page {
* @param options
*/
innerHTML(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3428,6 +3582,17 @@ export interface Page {
* @param options
*/
innerText(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3458,6 +3623,17 @@ export interface Page {
* @param options
*/
inputValue(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3483,6 +3659,17 @@ export interface Page {
* @param options
*/
isChecked(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3514,6 +3701,17 @@ export interface Page {
* @param options
*/
isDisabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3540,6 +3738,17 @@ export interface Page {
* @param options
*/
isEditable(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3565,6 +3774,17 @@ export interface Page {
* @param options
*/
isEnabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3959,6 +4179,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3981,6 +4212,17 @@ export interface Page {
* @param options
*/
reload(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -4287,6 +4529,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4361,6 +4614,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4389,6 +4653,17 @@ export interface Page {
* @param options
*/
setContent(html: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -4512,6 +4787,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4630,6 +4916,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4664,6 +4961,17 @@ export interface Page {
* @param options
*/
textContent(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4714,6 +5022,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4786,6 +5105,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -5101,7 +5431,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5146,7 +5478,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5207,7 +5541,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5251,7 +5587,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5305,7 +5643,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -6315,6 +6655,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6419,6 +6770,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6523,6 +6885,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6594,6 +6967,17 @@ export interface Frame {
* @param options
*/
dispatchEvent(selector: string, type: string, eventInit?: EvaluationArgument, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6636,6 +7020,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* 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.
@@ -6716,6 +7111,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6744,6 +7150,17 @@ export interface Frame {
* @param options
*/
focus(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6809,6 +7226,17 @@ export interface Frame {
* @param options
*/
getAttribute(selector: string, name: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7188,6 +7616,17 @@ export interface Frame {
*/
referer?: string;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -7272,6 +7711,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7305,6 +7755,17 @@ export interface Frame {
* @param options
*/
innerHTML(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7330,6 +7791,17 @@ export interface Frame {
* @param options
*/
innerText(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7360,6 +7832,17 @@ export interface Frame {
* @param options
*/
inputValue(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7385,6 +7868,17 @@ export interface Frame {
* @param options
*/
isChecked(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7416,6 +7910,17 @@ export interface Frame {
* @param options
*/
isDisabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7442,6 +7947,17 @@ export interface Frame {
* @param options
*/
isEditable(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7464,6 +7980,17 @@ export interface Frame {
* @param options
*/
isEnabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7645,6 +8172,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7740,6 +8278,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7814,6 +8363,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7842,6 +8402,17 @@ export interface Frame {
* @param options
*/
setContent(html: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -7918,6 +8489,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7997,6 +8579,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8031,6 +8624,17 @@ export interface Frame {
* @param options
*/
textContent(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8081,6 +8685,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8153,6 +8768,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8209,7 +8835,9 @@ export interface Frame {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -8253,7 +8881,9 @@ export interface Frame {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -8319,7 +8949,9 @@ export interface Frame {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -11877,6 +12509,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -11969,6 +12612,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -12066,6 +12720,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -12164,6 +12829,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12248,6 +12924,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12402,6 +13089,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12485,6 +13183,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scale?: "css"|"device";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make
* elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces
@@ -12522,6 +13231,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* @param options
*/
scrollIntoViewIfNeeded(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12608,6 +13328,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12636,6 +13367,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
force?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12696,7 +13438,18 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the
* viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
*/
- scroll?: "auto"|"none";
+ scroll?: "auto"|"none";
+
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
@@ -12766,6 +13519,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12834,6 +13598,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12885,6 +13660,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12946,6 +13732,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12985,6 +13782,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* @param options
*/
waitForElementState(state: "visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable", options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13137,7 +13945,7 @@ export interface Locator {
* [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-wait-for-function-option-expression).
* @param options
*/
- waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number }): Promise<void>;
+ waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise<void>;
/**
* **NOTE** Always prefer using [Locator](https://playwright.dev/docs/api/class-locator)s and web assertions over
* [ElementHandle](https://playwright.dev/docs/api/class-elementhandle)s because latter are inherently racy.
@@ -13298,6 +14106,17 @@ export interface Locator {
*/
mode?: "ai"|"default";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13312,6 +14131,17 @@ export interface Locator {
* @param options
*/
blur(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13348,6 +14178,17 @@ export interface Locator {
* @param options
*/
boundingBox(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13436,6 +14277,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13484,6 +14336,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13589,6 +14452,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -13720,6 +14594,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -13824,6 +14709,17 @@ export interface Locator {
* @param options
*/
dispatchEvent(type: string, eventInit?: EvaluationArgument, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13878,6 +14774,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* 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.
@@ -14001,6 +14908,17 @@ export interface Locator {
y: number;
};
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14054,6 +14972,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14133,6 +15062,17 @@ export interface Locator {
* @param options
*/
focus(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14168,6 +15108,17 @@ export interface Locator {
* @param options
*/
getAttribute(name: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14578,6 +15529,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14600,6 +15562,17 @@ export interface Locator {
* @param options
*/
innerHTML(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14621,6 +15594,17 @@ export interface Locator {
* @param options
*/
innerText(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14652,6 +15636,17 @@ export interface Locator {
* @param options
*/
inputValue(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14677,6 +15672,17 @@ export interface Locator {
* @param options
*/
isChecked(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14702,6 +15708,17 @@ export interface Locator {
* @param options
*/
isDisabled(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14729,6 +15746,17 @@ export interface Locator {
* @param options
*/
isEditable(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14754,6 +15782,17 @@ export interface Locator {
* @param options
*/
isEnabled(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14976,6 +16015,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15026,6 +16076,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15073,6 +16134,17 @@ export interface Locator {
* @param options
*/
scrollIntoViewIfNeeded(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15167,6 +16239,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15191,6 +16274,17 @@ export interface Locator {
*/
force?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15258,6 +16352,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15352,6 +16457,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15422,6 +16538,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15449,6 +16576,17 @@ export interface Locator {
* @param options
*/
textContent(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15485,6 +16623,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15552,6 +16701,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15585,6 +16745,17 @@ export interface Locator {
* @param options
*/
waitFor(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
@@ -19622,6 +20793,17 @@ export interface FileChooser {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -23845,6 +25027,17 @@ export interface LocatorScreenshotOptions {
*/
scale?: "css"|"device";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make
* elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces
@@ -23867,6 +25060,17 @@ export interface LocatorScreenshotOptions {
}
interface ElementHandleWaitForSelectorOptions {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
@@ -24383,6 +25587,17 @@ export interface Cookie {
}
interface PageWaitForSelectorOptions {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
@@ -24419,6 +25634,17 @@ interface PageWaitForFunctionOptions {
*/
polling?: number|"raf";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `actionTimeout` option in the config, or by using the
@@ -24518,6 +25744,17 @@ export interface PageScreenshotOptions {
*/
scale?: "css"|"device";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make
* elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces
diff --git a/packages/playwright-core/src/client/android.ts b/packages/playwright-core/src/client/android.ts
index 3fa887bb5a..62db6ef1cd 100644
--- a/packages/playwright-core/src/client/android.ts
+++ b/packages/playwright-core/src/client/android.ts
@@ -57,7 +57,7 @@ export class Android extends ChannelOwner<channels.AndroidChannel> implements ap
}
async devices(options: { port?: number } = {}): Promise<AndroidDevice[]> {
- const { devices } = await this._channel.devices(options);
+ const { devices } = await this._channel.devices(options, undefined);
return devices.map(d => AndroidDevice.from(d));
}
@@ -166,11 +166,11 @@ export class AndroidDevice extends ChannelOwner<channels.AndroidDeviceChannel> i
}
async wait(selector: api.AndroidSelector, options: { state?: 'gone' } & types.TimeoutOptions = {}) {
- await this._channel.wait({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.wait({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async fill(selector: api.AndroidSelector, text: string, options: types.TimeoutOptions = {}) {
- await this._channel.fill({ androidSelector: toSelectorChannel(selector), text, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.fill({ androidSelector: toSelectorChannel(selector), text, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async press(selector: api.AndroidSelector, key: api.AndroidKey, options: types.TimeoutOptions = {}) {
@@ -179,43 +179,43 @@ export class AndroidDevice extends ChannelOwner<channels.AndroidDeviceChannel> i
}
async tap(selector: api.AndroidSelector, options: { duration?: number } & types.TimeoutOptions = {}) {
- await this._channel.tap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.tap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async drag(selector: api.AndroidSelector, dest: types.Point, options: SpeedOptions & types.TimeoutOptions = {}) {
- await this._channel.drag({ androidSelector: toSelectorChannel(selector), dest, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.drag({ androidSelector: toSelectorChannel(selector), dest, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async fling(selector: api.AndroidSelector, direction: Direction, options: SpeedOptions & types.TimeoutOptions = {}) {
- await this._channel.fling({ androidSelector: toSelectorChannel(selector), direction, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.fling({ androidSelector: toSelectorChannel(selector), direction, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async longTap(selector: api.AndroidSelector, options: types.TimeoutOptions = {}) {
- await this._channel.longTap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.longTap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async pinchClose(selector: api.AndroidSelector, percent: number, options: SpeedOptions & types.TimeoutOptions = {}) {
- await this._channel.pinchClose({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.pinchClose({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async pinchOpen(selector: api.AndroidSelector, percent: number, options: SpeedOptions & types.TimeoutOptions = {}) {
- await this._channel.pinchOpen({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.pinchOpen({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async scroll(selector: api.AndroidSelector, direction: Direction, percent: number, options: SpeedOptions & types.TimeoutOptions = {}) {
- await this._channel.scroll({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.scroll({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async swipe(selector: api.AndroidSelector, direction: Direction, percent: number, options: SpeedOptions & types.TimeoutOptions = {}) {
- await this._channel.swipe({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) });
+ await this._channel.swipe({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) }, options.signal);
}
async info(selector: api.AndroidSelector): Promise<api.AndroidElementInfo> {
- return (await this._channel.info({ androidSelector: toSelectorChannel(selector) })).info;
+ return (await this._channel.info({ androidSelector: toSelectorChannel(selector) }, undefined)).info;
}
async screenshot(options: { path?: string } = {}): Promise<Buffer> {
- const { binary } = await this._channel.screenshot();
+ const { binary } = await this._channel.screenshot({}, undefined);
if (options.path)
await fs.promises.writeFile(options.path, binary);
return binary;
@@ -230,7 +230,7 @@ export class AndroidDevice extends ChannelOwner<channels.AndroidDeviceChannel> i
if (this._shouldCloseConnectionOnClose)
this._connection.close();
else
- await this._channel.close();
+ await this._channel.close({}, undefined);
} catch (e) {
if (isTargetClosedError(e))
return;
@@ -243,25 +243,25 @@ export class AndroidDevice extends ChannelOwner<channels.AndroidDeviceChannel> i
}
async shell(command: string): Promise<Buffer> {
- const { result } = await this._channel.shell({ command });
+ const { result } = await this._channel.shell({ command }, undefined);
return result;
}
async open(command: string): Promise<AndroidSocket> {
- return AndroidSocket.from((await this._channel.open({ command })).socket);
+ return AndroidSocket.from((await this._channel.open({ command }, undefined)).socket);
}
async installApk(file: string | Buffer, options?: { args: string[] }): Promise<void> {
- await this._channel.installApk({ file: await loadFile(file), args: options && options.args });
+ await this._channel.installApk({ file: await loadFile(file), args: options && options.args }, undefined);
}
async push(file: string | Buffer, path: string, options?: { mode: number }): Promise<void> {
- await this._channel.push({ file: await loadFile(file), path, mode: options ? options.mode : undefined });
+ await this._channel.push({ file: await loadFile(file), path, mode: options ? options.mode : undefined }, undefined);
}
async launchBrowser(options: types.BrowserContextOptions & { pkg?: string } = {}): Promise<BrowserContext> {
const contextOptions = await prepareBrowserContextParams(options);
- const result = await this._channel.launchBrowser(contextOptions);
+ const result = await this._channel.launchBrowser(contextOptions, undefined);
const context = BrowserContext.from(result.context);
const selectors = this._android._playwright.selectors;
selectors._contextsForSelectors.add(context);
@@ -299,11 +299,11 @@ export class AndroidSocket extends ChannelOwner<channels.AndroidSocketChannel> i
}
async write(data: Buffer): Promise<void> {
- await this._channel.write({ data });
+ await this._channel.write({ data }, undefined);
}
async close(): Promise<void> {
- await this._channel.close();
+ await this._channel.close({}, undefined);
}
async [Symbol.asyncDispose]() {
@@ -325,23 +325,23 @@ export class AndroidInput implements api.AndroidInput {
}
async type(text: string) {
- await this._device._channel.inputType({ text });
+ await this._device._channel.inputType({ text }, undefined);
}
async press(key: api.AndroidKey) {
- await this._device._channel.inputPress({ key });
+ await this._device._channel.inputPress({ key }, undefined);
}
async tap(point: types.Point) {
- await this._device._channel.inputTap({ point });
+ await this._device._channel.inputTap({ point }, undefined);
}
async swipe(from: types.Point, segments: types.Point[], steps: number) {
- await this._device._channel.inputSwipe({ segments, steps });
+ await this._device._channel.inputSwipe({ segments, steps }, undefined);
}
async drag(from: types.Point, to: types.Point, steps: number) {
- await this._device._channel.inputDrag({ from, to, steps });
+ await this._device._channel.inputDrag({ from, to, steps }, undefined);
}
}
@@ -425,7 +425,7 @@ export class AndroidWebView extends EventEmitter implements api.AndroidWebView {
}
private async _fetchPage(): Promise<Page> {
- const { context } = await this._device._channel.connectToWebView({ socketName: this._data.socketName });
+ const { context } = await this._device._channel.connectToWebView({ socketName: this._data.socketName }, undefined);
return BrowserContext.from(context).pages()[0];
}
}
diff --git a/packages/playwright-core/src/client/artifact.ts b/packages/playwright-core/src/client/artifact.ts
index f8e8ae1a9e..add07a472e 100644
--- a/packages/playwright-core/src/client/artifact.ts
+++ b/packages/playwright-core/src/client/artifact.ts
@@ -31,16 +31,16 @@ export class Artifact extends ChannelOwner<channels.ArtifactChannel> {
async pathAfterFinished(): Promise<string> {
if (this._connection.isRemote())
throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`);
- return (await this._channel.pathAfterFinished()).value;
+ return (await this._channel.pathAfterFinished({}, undefined)).value;
}
async saveAs(path: string): Promise<void> {
if (!this._connection.isRemote()) {
- await this._channel.saveAs({ path });
+ await this._channel.saveAs({ path }, undefined);
return;
}
- const result = await this._channel.saveAsStream();
+ const result = await this._channel.saveAsStream({}, undefined);
const stream = Stream.from(result.stream);
await mkdirIfNeeded(path);
await new Promise((resolve, reject) => {
@@ -51,11 +51,11 @@ export class Artifact extends ChannelOwner<channels.ArtifactChannel> {
}
async failure(): Promise<string | null> {
- return (await this._channel.failure()).error || null;
+ return (await this._channel.failure({}, undefined)).error || null;
}
async createReadStream(): Promise<Readable> {
- const result = await this._channel.stream();
+ const result = await this._channel.stream({}, undefined);
const stream = Stream.from(result.stream);
return stream.stream();
}
@@ -75,10 +75,10 @@ export class Artifact extends ChannelOwner<channels.ArtifactChannel> {
}
async cancel(): Promise<void> {
- return await this._channel.cancel();
+ return await this._channel.cancel({}, undefined);
}
async delete(): Promise<void> {
- return await this._channel.delete();
+ return await this._channel.delete({}, undefined);
}
}
diff --git a/packages/playwright-core/src/client/browser.ts b/packages/playwright-core/src/client/browser.ts
index 5f1dfc2203..803a53f969 100644
--- a/packages/playwright-core/src/client/browser.ts
+++ b/packages/playwright-core/src/client/browser.ts
@@ -75,14 +75,14 @@ export class Browser extends ChannelOwner<channels.BrowserChannel> implements ap
for (const page of context.pages())
page._onClose();
context._onClose();
- await this._channel.disconnectFromReusedContext({ reason });
+ await this._channel.disconnectFromReusedContext({ reason }, undefined);
}
async _innerNewContext(userOptions: BrowserContextOptions = {}, forReuse: boolean): Promise<BrowserContext> {
const options = this._browserType._playwright.selectors._withSelectorOptions(userOptions);
await this._instrumentation.runBeforeCreateBrowserContext(options);
const contextOptions = await prepareBrowserContextParams(options);
- const response = forReuse ? await this._channel.newContextForReuse(contextOptions) : await this._channel.newContext(contextOptions);
+ const response = forReuse ? await this._channel.newContextForReuse(contextOptions, undefined) : await this._channel.newContext(contextOptions, undefined);
const context = BrowserContext.from(response.context);
if (forReuse)
context._forReuse = true;
@@ -132,12 +132,12 @@ export class Browser extends ChannelOwner<channels.BrowserChannel> implements ap
}
async bind(title: string, options: { workspaceDir?: string, metadata?: Record<string, any>, host?: string, port?: number } = {}): Promise<{ endpoint: string }> {
- const { endpoint } = await this._channel.startServer({ title, ...options });
+ const { endpoint } = await this._channel.startServer({ title, ...options }, undefined);
return { endpoint };
}
async unbind(): Promise<void> {
- await this._channel.stopServer();
+ await this._channel.stopServer({}, undefined);
}
async newPage(options: BrowserContextOptions = {}): Promise<Page> {
@@ -155,16 +155,16 @@ export class Browser extends ChannelOwner<channels.BrowserChannel> implements ap
}
async newBrowserCDPSession(): Promise<api.CDPSession> {
- return CDPSession.from((await this._channel.newBrowserCDPSession()).session);
+ return CDPSession.from((await this._channel.newBrowserCDPSession({}, undefined)).session);
}
async startTracing(page?: Page, options: { path?: string; screenshots?: boolean; categories?: string[]; } = {}) {
this._path = options.path;
- await this._channel.startTracing({ ...options, page: page ? page._channel : undefined });
+ await this._channel.startTracing({ ...options, page: page ? page._channel : undefined }, undefined);
}
async stopTracing(): Promise<Buffer> {
- const artifact = Artifact.from((await this._channel.stopTracing()).artifact);
+ const artifact = Artifact.from((await this._channel.stopTracing({}, undefined)).artifact);
const buffer = await artifact.readIntoBuffer();
await artifact.delete();
if (this._path) {
@@ -185,7 +185,7 @@ export class Browser extends ChannelOwner<channels.BrowserChannel> implements ap
if (this._shouldCloseConnectionOnClose)
this._connection.close();
else
- await this._channel.close(options);
+ await this._channel.close(options, undefined);
await this._closedPromise;
} catch (e) {
if (isTargetClosedError(e))
diff --git a/packages/playwright-core/src/client/browserContext.ts b/packages/playwright-core/src/client/browserContext.ts
index 71f744aa64..7720782eac 100644
--- a/packages/playwright-core/src/client/browserContext.ts
+++ b/packages/playwright-core/src/client/browserContext.ts
@@ -149,9 +149,9 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
// a) removing "dialog" listener subscription (client->server)
// b) actual "dialog" event (server->client)
if (dialogObject.type() === 'beforeunload')
- dialog.accept({}).catch(() => {});
+ dialog.accept({}, undefined).catch(() => {});
else
- dialog.dismiss().catch(() => {});
+ dialog.dismiss({}, undefined).catch(() => {});
}
});
this._channel.on('request', ({ request, page }) => this._onRequest(network.Request.from(request), Page.fromNullable(page)));
@@ -304,7 +304,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
async newPage(): Promise<Page> {
if (this._ownerPage)
throw new Error('Please use browser.newContext()');
- return Page.from((await this._channel.newPage()).page);
+ return Page.from((await this._channel.newPage({}, undefined)).page);
}
async cookies(urls?: string | string[]): Promise<network.NetworkCookie[]> {
@@ -312,11 +312,11 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
urls = [];
if (urls && typeof urls === 'string')
urls = [urls];
- return (await this._channel.cookies({ urls: urls as string[] })).cookies;
+ return (await this._channel.cookies({ urls: urls as string[] }, undefined)).cookies;
}
async addCookies(cookies: network.SetNetworkCookieParam[]): Promise<void> {
- await this._channel.addCookies({ cookies });
+ await this._channel.addCookies({ cookies }, undefined);
}
async clearCookies(options: network.ClearNetworkCookieOptions = {}): Promise<void> {
@@ -330,47 +330,47 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
path: isString(options.path) ? options.path : undefined,
pathRegexSource: isRegExp(options.path) ? options.path.source : undefined,
pathRegexFlags: isRegExp(options.path) ? options.path.flags : undefined,
- });
+ }, undefined);
}
async grantPermissions(permissions: string[], options?: { origin?: string }): Promise<void> {
- await this._channel.grantPermissions({ permissions, ...options });
+ await this._channel.grantPermissions({ permissions, ...options }, undefined);
}
async clearPermissions(): Promise<void> {
- await this._channel.clearPermissions();
+ await this._channel.clearPermissions({}, undefined);
}
async setGeolocation(geolocation: { longitude: number, latitude: number, accuracy?: number } | null): Promise<void> {
- await this._channel.setGeolocation({ geolocation: geolocation || undefined });
+ await this._channel.setGeolocation({ geolocation: geolocation || undefined }, undefined);
}
async setExtraHTTPHeaders(headers: Headers): Promise<void> {
network.validateHeaders(headers);
- await this._channel.setExtraHTTPHeaders({ headers: headersObjectToArray(headers) });
+ await this._channel.setExtraHTTPHeaders({ headers: headersObjectToArray(headers) }, undefined);
}
async setOffline(offline: boolean): Promise<void> {
- await this._channel.setOffline({ offline });
+ await this._channel.setOffline({ offline }, undefined);
}
async setHTTPCredentials(httpCredentials: { username: string, password: string } | null): Promise<void> {
- await this._channel.setHTTPCredentials({ httpCredentials: httpCredentials || undefined });
+ await this._channel.setHTTPCredentials({ httpCredentials: httpCredentials || undefined }, undefined);
}
async addInitScript(script: Function | string | { path?: string, content?: string }, arg?: any) {
const source = await evaluationScript(script, arg);
- return DisposableObject.from((await this._channel.addInitScript({ source })).disposable);
+ return DisposableObject.from((await this._channel.addInitScript({ source }, undefined)).disposable);
}
async exposeBinding(name: string, callback: (source: structs.BindingSource, ...args: any[]) => any): Promise<DisposableObject> {
- const result = await this._channel.exposeBinding({ name });
+ const result = await this._channel.exposeBinding({ name }, undefined);
this._bindings.set(name, callback);
return DisposableObject.from(result.disposable);
}
async exposeFunction(name: string, callback: Function): Promise<DisposableObject> {
- const result = await this._channel.exposeBinding({ name });
+ const result = await this._channel.exposeBinding({ name }, undefined);
const binding = (source: structs.BindingSource, ...args: any[]) => callback(...args);
this._bindings.set(name, binding);
return DisposableObject.from(result.disposable);
@@ -433,12 +433,12 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
private async _updateInterceptionPatterns(options: { internal: true } | { title: string }) {
const patterns = network.RouteHandler.prepareInterceptionPatterns(this._routes);
- await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }), options);
+ await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }, undefined), options);
}
private async _updateWebSocketInterceptionPatterns(options: { internal: true } | { title: string }) {
const patterns = network.WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes);
- await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }), options);
+ await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }, undefined), options);
}
_effectiveCloseReason(): string | undefined {
@@ -462,7 +462,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
}
async storageState(options: { path?: string, indexedDB?: boolean, credentials?: boolean } = {}): Promise<StorageState> {
- const state = await this._channel.storageState({ indexedDB: options.indexedDB, credentials: options.credentials });
+ const state = await this._channel.storageState({ indexedDB: options.indexedDB, credentials: options.credentials }, undefined);
if (options.path) {
await mkdirIfNeeded(options.path);
await fs.promises.writeFile(options.path, JSON.stringify(state, undefined, 2), 'utf8');
@@ -472,7 +472,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
async setStorageState(storageState: string | SetStorageState): Promise<void> {
const state = await prepareStorageState(storageState);
- await this._channel.setStorageState({ storageState: state });
+ await this._channel.setStorageState({ storageState: state }, undefined);
}
backgroundPages(): Page[] {
@@ -487,7 +487,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
// channelOwner.ts's validation messages don't handle the pseudo-union type, so we're explicit here
if (!(page instanceof Page) && !(page instanceof Frame))
throw new Error('page: expected Page or Frame');
- const result = await this._channel.newCDPSession(page instanceof Page ? { page: page._channel } : { frame: page._channel });
+ const result = await this._channel.newCDPSession(page instanceof Page ? { page: page._channel } : { frame: page._channel }, undefined);
return CDPSession.from(result.session);
}
@@ -513,23 +513,23 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
await this.request.dispose(options);
await this._instrumentation.runBeforeCloseBrowserContext(this);
await this.tracing._exportAllHars();
- await this._channel.close(options);
+ await this._channel.close(options, undefined);
await this._closedPromise;
}
async _enableRecorder(params: channels.BrowserContextEnableRecorderParams, eventSink?: RecorderEventSink) {
if (eventSink)
this._onRecorderEventSink = eventSink;
- await this._channel.enableRecorder(params);
+ await this._channel.enableRecorder(params, undefined);
}
async _disableRecorder() {
this._onRecorderEventSink = undefined;
- await this._channel.disableRecorder();
+ await this._channel.disableRecorder({}, undefined);
}
async _exposeConsoleApi() {
- await this._channel.exposeConsoleApi();
+ await this._channel.exposeConsoleApi({}, undefined);
}
}
diff --git a/packages/playwright-core/src/client/browserType.ts b/packages/playwright-core/src/client/browserType.ts
index 06c0ce17d5..9b6d42cc6b 100644
--- a/packages/playwright-core/src/client/browserType.ts
+++ b/packages/playwright-core/src/client/browserType.ts
@@ -77,7 +77,7 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel> imple
timeout: new TimeoutSettings().launchTimeout(options),
};
return await this._wrapApiCall(async () => {
- const browser = Browser.from((await this._channel.launch(launchOptions)).browser);
+ const browser = Browser.from((await this._channel.launch(launchOptions, options.signal)).browser);
browser._connectToBrowserType(this, options, logger);
return browser;
});
@@ -110,7 +110,7 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel> imple
timeout: new TimeoutSettings().launchTimeout(options),
};
const context = await this._wrapApiCall(async () => {
- const result = await this._channel.launchPersistentContext(persistentParams);
+ const result = await this._channel.launchPersistentContext(persistentParams, options.signal);
const browser = Browser.from(result.browser);
browser._connectToBrowserType(this, options, logger);
const context = BrowserContext.from(result.context);
@@ -172,7 +172,7 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel> imple
isLocal: params.isLocal,
noDefaults: params.noDefaults,
artifactsDir: params.artifactsDir,
- });
+ }, undefined);
return await this._browserFromConnectResult(result);
}
@@ -190,7 +190,7 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel> imple
const result = await this._channel.connectToWorker({
endpoint,
timeout: new TimeoutSettings().timeout(options),
- });
+ }, undefined);
return Worker.from(result.worker);
}
}
diff --git a/packages/playwright-core/src/client/cdpSession.ts b/packages/playwright-core/src/client/cdpSession.ts
index 57a08aefa5..0353411054 100644
--- a/packages/playwright-core/src/client/cdpSession.ts
+++ b/packages/playwright-core/src/client/cdpSession.ts
@@ -48,11 +48,11 @@ export class CDPSession extends ChannelOwner<channels.CDPSessionChannel> impleme
method: T,
params?: Protocol.CommandParameters[T]
): Promise<Protocol.CommandReturnValues[T]> {
- const result = await this._channel.send({ method, params });
+ const result = await this._channel.send({ method, params }, undefined);
return result.result as Protocol.CommandReturnValues[T];
}
async detach() {
- return await this._channel.detach();
+ return await this._channel.detach({}, undefined);
}
}
diff --git a/packages/playwright-core/src/client/channelOwner.ts b/packages/playwright-core/src/client/channelOwner.ts
index 422b1cfacb..0c860aabc0 100644
--- a/packages/playwright-core/src/client/channelOwner.ts
+++ b/packages/playwright-core/src/client/channelOwner.ts
@@ -151,7 +151,7 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
const validator = maybeFindValidator(this._type, prop, 'Params');
const { internal } = getMetainfo({ type: this._type, method: prop }) || {};
if (validator) {
- return async (params: any) => {
+ return async (params: any, signal: AbortSignal | undefined) => {
return await this._wrapApiCall(async apiZone => {
const validatedParams = validator(params, '', this._validatorToWireContext());
if (!apiZone.internal && !apiZone.reported) {
@@ -159,11 +159,11 @@ export abstract class ChannelOwner<T extends channels.Channel = channels.Channel
apiZone.reported = true;
this._instrumentation.onApiCallBegin(apiZone, { type: this._type, method: prop, params });
logApiCall(this._logger, `=> ${apiZone.apiName} started`);
- return await this._connection.sendMessageToServer(this, prop, validatedParams, apiZone);
+ return await this._connection.sendMessageToServer(this, prop, validatedParams, { ...apiZone, signal });
}
// Since this api call is either internal, or has already been reported/traced once,
// passing as internal.
- return await this._connection.sendMessageToServer(this, prop, validatedParams, { internal: true });
+ return await this._connection.sendMessageToServer(this, prop, validatedParams, { internal: true, signal });
}, { internal });
};
}
diff --git a/packages/playwright-core/src/client/channels.d.ts b/packages/playwright-core/src/client/channels.d.ts
index d797efe34a..91d2ffbeb5 100644
--- a/packages/playwright-core/src/client/channels.d.ts
+++ b/packages/playwright-core/src/client/channels.d.ts
@@ -138,7 +138,7 @@ export interface AndroidEventTarget {
}
export interface AndroidChannel extends AndroidEventTarget, Channel {
_type_Android: boolean;
- devices(params: AndroidDevicesParams): Promise<AndroidDevicesResult>;
+ devices(params: AndroidDevicesParams, signal: AbortSignal | undefined): Promise<AndroidDevicesResult>;
}
export type AndroidDevicesParams = {
host?: string,
@@ -165,8 +165,8 @@ export interface AndroidSocketEventTarget {
}
export interface AndroidSocketChannel extends AndroidSocketEventTarget, Channel {
_type_AndroidSocket: boolean;
- write(params: AndroidSocketWriteParams): Promise<AndroidSocketWriteResult>;
- close(params?: AndroidSocketCloseParams): Promise<AndroidSocketCloseResult>;
+ write(params: AndroidSocketWriteParams, signal: AbortSignal | undefined): Promise<AndroidSocketWriteResult>;
+ close(params: AndroidSocketCloseParams, signal: AbortSignal | undefined): Promise<AndroidSocketCloseResult>;
}
export type AndroidSocketDataEvent = {
data: Binary,
@@ -200,30 +200,30 @@ export interface AndroidDeviceEventTarget {
}
export interface AndroidDeviceChannel extends AndroidDeviceEventTarget, Channel {
_type_AndroidDevice: boolean;
- wait(params: AndroidDeviceWaitParams): Promise<AndroidDeviceWaitResult>;
- fill(params: AndroidDeviceFillParams): Promise<AndroidDeviceFillResult>;
- tap(params: AndroidDeviceTapParams): Promise<AndroidDeviceTapResult>;
- drag(params: AndroidDeviceDragParams): Promise<AndroidDeviceDragResult>;
- fling(params: AndroidDeviceFlingParams): Promise<AndroidDeviceFlingResult>;
- longTap(params: AndroidDeviceLongTapParams): Promise<AndroidDeviceLongTapResult>;
- pinchClose(params: AndroidDevicePinchCloseParams): Promise<AndroidDevicePinchCloseResult>;
- pinchOpen(params: AndroidDevicePinchOpenParams): Promise<AndroidDevicePinchOpenResult>;
- scroll(params: AndroidDeviceScrollParams): Promise<AndroidDeviceScrollResult>;
- swipe(params: AndroidDeviceSwipeParams): Promise<AndroidDeviceSwipeResult>;
- info(params: AndroidDeviceInfoParams): Promise<AndroidDeviceInfoResult>;
- screenshot(params?: AndroidDeviceScreenshotParams): Promise<AndroidDeviceScreenshotResult>;
- inputType(params: AndroidDeviceInputTypeParams): Promise<AndroidDeviceInputTypeResult>;
- inputPress(params: AndroidDeviceInputPressParams): Promise<AndroidDeviceInputPressResult>;
- inputTap(params: AndroidDeviceInputTapParams): Promise<AndroidDeviceInputTapResult>;
- inputSwipe(params: AndroidDeviceInputSwipeParams): Promise<AndroidDeviceInputSwipeResult>;
- inputDrag(params: AndroidDeviceInputDragParams): Promise<AndroidDeviceInputDragResult>;
- launchBrowser(params: AndroidDeviceLaunchBrowserParams): Promise<AndroidDeviceLaunchBrowserResult>;
- open(params: AndroidDeviceOpenParams): Promise<AndroidDeviceOpenResult>;
- shell(params: AndroidDeviceShellParams): Promise<AndroidDeviceShellResult>;
- installApk(params: AndroidDeviceInstallApkParams): Promise<AndroidDeviceInstallApkResult>;
- push(params: AndroidDevicePushParams): Promise<AndroidDevicePushResult>;
- connectToWebView(params: AndroidDeviceConnectToWebViewParams): Promise<AndroidDeviceConnectToWebViewResult>;
- close(params?: AndroidDeviceCloseParams): Promise<AndroidDeviceCloseResult>;
+ wait(params: AndroidDeviceWaitParams, signal: AbortSignal | undefined): Promise<AndroidDeviceWaitResult>;
+ fill(params: AndroidDeviceFillParams, signal: AbortSignal | undefined): Promise<AndroidDeviceFillResult>;
+ tap(params: AndroidDeviceTapParams, signal: AbortSignal | undefined): Promise<AndroidDeviceTapResult>;
+ drag(params: AndroidDeviceDragParams, signal: AbortSignal | undefined): Promise<AndroidDeviceDragResult>;
+ fling(params: AndroidDeviceFlingParams, signal: AbortSignal | undefined): Promise<AndroidDeviceFlingResult>;
+ longTap(params: AndroidDeviceLongTapParams, signal: AbortSignal | undefined): Promise<AndroidDeviceLongTapResult>;
+ pinchClose(params: AndroidDevicePinchCloseParams, signal: AbortSignal | undefined): Promise<AndroidDevicePinchCloseResult>;
+ pinchOpen(params: AndroidDevicePinchOpenParams, signal: AbortSignal | undefined): Promise<AndroidDevicePinchOpenResult>;
+ scroll(params: AndroidDeviceScrollParams, signal: AbortSignal | undefined): Promise<AndroidDeviceScrollResult>;
+ swipe(params: AndroidDeviceSwipeParams, signal: AbortSignal | undefined): Promise<AndroidDeviceSwipeResult>;
+ info(params: AndroidDeviceInfoParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInfoResult>;
+ screenshot(params: AndroidDeviceScreenshotParams, signal: AbortSignal | undefined): Promise<AndroidDeviceScreenshotResult>;
+ inputType(params: AndroidDeviceInputTypeParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInputTypeResult>;
+ inputPress(params: AndroidDeviceInputPressParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInputPressResult>;
+ inputTap(params: AndroidDeviceInputTapParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInputTapResult>;
+ inputSwipe(params: AndroidDeviceInputSwipeParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInputSwipeResult>;
+ inputDrag(params: AndroidDeviceInputDragParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInputDragResult>;
+ launchBrowser(params: AndroidDeviceLaunchBrowserParams, signal: AbortSignal | undefined): Promise<AndroidDeviceLaunchBrowserResult>;
+ open(params: AndroidDeviceOpenParams, signal: AbortSignal | undefined): Promise<AndroidDeviceOpenResult>;
+ shell(params: AndroidDeviceShellParams, signal: AbortSignal | undefined): Promise<AndroidDeviceShellResult>;
+ installApk(params: AndroidDeviceInstallApkParams, signal: AbortSignal | undefined): Promise<AndroidDeviceInstallApkResult>;
+ push(params: AndroidDevicePushParams, signal: AbortSignal | undefined): Promise<AndroidDevicePushResult>;
+ connectToWebView(params: AndroidDeviceConnectToWebViewParams, signal: AbortSignal | undefined): Promise<AndroidDeviceConnectToWebViewResult>;
+ close(params: AndroidDeviceCloseParams, signal: AbortSignal | undefined): Promise<AndroidDeviceCloseResult>;
}
export type AndroidDeviceCloseEvent = {};
export type AndroidDeviceWebViewAddedEvent = {
@@ -590,12 +590,12 @@ export interface APIRequestContextEventTarget {
}
export interface APIRequestContextChannel extends APIRequestContextEventTarget, Channel {
_type_APIRequestContext: boolean;
- fetch(params: APIRequestContextFetchParams): Promise<APIRequestContextFetchResult>;
- fetchResponseBody(params: APIRequestContextFetchResponseBodyParams): Promise<APIRequestContextFetchResponseBodyResult>;
- fetchLog(params: APIRequestContextFetchLogParams): Promise<APIRequestContextFetchLogResult>;
- storageState(params: APIRequestContextStorageStateParams): Promise<APIRequestContextStorageStateResult>;
- disposeAPIResponse(params: APIRequestContextDisposeAPIResponseParams): Promise<APIRequestContextDisposeAPIResponseResult>;
- dispose(params: APIRequestContextDisposeParams): Promise<APIRequestContextDisposeResult>;
+ fetch(params: APIRequestContextFetchParams, signal: AbortSignal | undefined): Promise<APIRequestContextFetchResult>;
+ fetchResponseBody(params: APIRequestContextFetchResponseBodyParams, signal: AbortSignal | undefined): Promise<APIRequestContextFetchResponseBodyResult>;
+ fetchLog(params: APIRequestContextFetchLogParams, signal: AbortSignal | undefined): Promise<APIRequestContextFetchLogResult>;
+ storageState(params: APIRequestContextStorageStateParams, signal: AbortSignal | undefined): Promise<APIRequestContextStorageStateResult>;
+ disposeAPIResponse(params: APIRequestContextDisposeAPIResponseParams, signal: AbortSignal | undefined): Promise<APIRequestContextDisposeAPIResponseResult>;
+ dispose(params: APIRequestContextDisposeParams, signal: AbortSignal | undefined): Promise<APIRequestContextDisposeResult>;
}
export type APIRequestContextFetchParams = {
url: string,
@@ -684,13 +684,13 @@ export interface ArtifactEventTarget {
}
export interface ArtifactChannel extends ArtifactEventTarget, Channel {
_type_Artifact: boolean;
- pathAfterFinished(params?: ArtifactPathAfterFinishedParams): Promise<ArtifactPathAfterFinishedResult>;
- saveAs(params: ArtifactSaveAsParams): Promise<ArtifactSaveAsResult>;
- saveAsStream(params?: ArtifactSaveAsStreamParams): Promise<ArtifactSaveAsStreamResult>;
- failure(params?: ArtifactFailureParams): Promise<ArtifactFailureResult>;
- stream(params?: ArtifactStreamParams): Promise<ArtifactStreamResult>;
- cancel(params?: ArtifactCancelParams): Promise<ArtifactCancelResult>;
- delete(params?: ArtifactDeleteParams): Promise<ArtifactDeleteResult>;
+ pathAfterFinished(params: ArtifactPathAfterFinishedParams, signal: AbortSignal | undefined): Promise<ArtifactPathAfterFinishedResult>;
+ saveAs(params: ArtifactSaveAsParams, signal: AbortSignal | undefined): Promise<ArtifactSaveAsResult>;
+ saveAsStream(params: ArtifactSaveAsStreamParams, signal: AbortSignal | undefined): Promise<ArtifactSaveAsStreamResult>;
+ failure(params: ArtifactFailureParams, signal: AbortSignal | undefined): Promise<ArtifactFailureResult>;
+ stream(params: ArtifactStreamParams, signal: AbortSignal | undefined): Promise<ArtifactStreamResult>;
+ cancel(params: ArtifactCancelParams, signal: AbortSignal | undefined): Promise<ArtifactCancelResult>;
+ delete(params: ArtifactDeleteParams, signal: AbortSignal | undefined): Promise<ArtifactDeleteResult>;
}
export type ArtifactPathAfterFinishedParams = {};
export type ArtifactPathAfterFinishedOptions = {};
@@ -735,8 +735,8 @@ export interface StreamEventTarget {
}
export interface StreamChannel extends StreamEventTarget, Channel {
_type_Stream: boolean;
- read(params: StreamReadParams): Promise<StreamReadResult>;
- close(params?: StreamCloseParams): Promise<StreamCloseResult>;
+ read(params: StreamReadParams, signal: AbortSignal | undefined): Promise<StreamReadResult>;
+ close(params: StreamCloseParams, signal: AbortSignal | undefined): Promise<StreamCloseResult>;
}
export type StreamReadParams = {
size?: number,
@@ -760,8 +760,8 @@ export interface WritableStreamEventTarget {
}
export interface WritableStreamChannel extends WritableStreamEventTarget, Channel {
_type_WritableStream: boolean;
- write(params: WritableStreamWriteParams): Promise<WritableStreamWriteResult>;
- close(params?: WritableStreamCloseParams): Promise<WritableStreamCloseResult>;
+ write(params: WritableStreamWriteParams, signal: AbortSignal | undefined): Promise<WritableStreamWriteResult>;
+ close(params: WritableStreamCloseParams, signal: AbortSignal | undefined): Promise<WritableStreamCloseResult>;
}
export type WritableStreamWriteParams = {
binary: Binary,
@@ -789,17 +789,17 @@ export interface BrowserEventTarget {
}
export interface BrowserChannel extends BrowserEventTarget, Channel {
_type_Browser: boolean;
- startServer(params: BrowserStartServerParams): Promise<BrowserStartServerResult>;
- stopServer(params?: BrowserStopServerParams): Promise<BrowserStopServerResult>;
- close(params: BrowserCloseParams): Promise<BrowserCloseResult>;
- killForTests(params?: BrowserKillForTestsParams): Promise<BrowserKillForTestsResult>;
- defaultUserAgentForTest(params?: BrowserDefaultUserAgentForTestParams): Promise<BrowserDefaultUserAgentForTestResult>;
- newContext(params: BrowserNewContextParams): Promise<BrowserNewContextResult>;
- newContextForReuse(params: BrowserNewContextForReuseParams): Promise<BrowserNewContextForReuseResult>;
- disconnectFromReusedContext(params: BrowserDisconnectFromReusedContextParams): Promise<BrowserDisconnectFromReusedContextResult>;
- newBrowserCDPSession(params?: BrowserNewBrowserCDPSessionParams): Promise<BrowserNewBrowserCDPSessionResult>;
- startTracing(params: BrowserStartTracingParams): Promise<BrowserStartTracingResult>;
- stopTracing(params?: BrowserStopTracingParams): Promise<BrowserStopTracingResult>;
+ startServer(params: BrowserStartServerParams, signal: AbortSignal | undefined): Promise<BrowserStartServerResult>;
+ stopServer(params: BrowserStopServerParams, signal: AbortSignal | undefined): Promise<BrowserStopServerResult>;
+ close(params: BrowserCloseParams, signal: AbortSignal | undefined): Promise<BrowserCloseResult>;
+ killForTests(params: BrowserKillForTestsParams, signal: AbortSignal | undefined): Promise<BrowserKillForTestsResult>;
+ defaultUserAgentForTest(params: BrowserDefaultUserAgentForTestParams, signal: AbortSignal | undefined): Promise<BrowserDefaultUserAgentForTestResult>;
+ newContext(params: BrowserNewContextParams, signal: AbortSignal | undefined): Promise<BrowserNewContextResult>;
+ newContextForReuse(params: BrowserNewContextForReuseParams, signal: AbortSignal | undefined): Promise<BrowserNewContextForReuseResult>;
+ disconnectFromReusedContext(params: BrowserDisconnectFromReusedContextParams, signal: AbortSignal | undefined): Promise<BrowserDisconnectFromReusedContextResult>;
+ newBrowserCDPSession(params: BrowserNewBrowserCDPSessionParams, signal: AbortSignal | undefined): Promise<BrowserNewBrowserCDPSessionResult>;
+ startTracing(params: BrowserStartTracingParams, signal: AbortSignal | undefined): Promise<BrowserStartTracingResult>;
+ stopTracing(params: BrowserStopTracingParams, signal: AbortSignal | undefined): Promise<BrowserStopTracingResult>;
}
export type BrowserContextEvent = {
context: BrowserContextChannel,
@@ -1267,43 +1267,43 @@ export interface BrowserContextEventTarget {
}
export interface BrowserContextChannel extends BrowserContextEventTarget, Channel {
_type_BrowserContext: boolean;
- addCookies(params: BrowserContextAddCookiesParams): Promise<BrowserContextAddCookiesResult>;
- addInitScript(params: BrowserContextAddInitScriptParams): Promise<BrowserContextAddInitScriptResult>;
- clearCookies(params: BrowserContextClearCookiesParams): Promise<BrowserContextClearCookiesResult>;
- clearPermissions(params?: BrowserContextClearPermissionsParams): Promise<BrowserContextClearPermissionsResult>;
- close(params: BrowserContextCloseParams): Promise<BrowserContextCloseResult>;
- cookies(params: BrowserContextCookiesParams): Promise<BrowserContextCookiesResult>;
- exposeBinding(params: BrowserContextExposeBindingParams): Promise<BrowserContextExposeBindingResult>;
- grantPermissions(params: BrowserContextGrantPermissionsParams): Promise<BrowserContextGrantPermissionsResult>;
- newPage(params?: BrowserContextNewPageParams): Promise<BrowserContextNewPageResult>;
- registerSelectorEngine(params: BrowserContextRegisterSelectorEngineParams): Promise<BrowserContextRegisterSelectorEngineResult>;
- setTestIdAttributeName(params: BrowserContextSetTestIdAttributeNameParams): Promise<BrowserContextSetTestIdAttributeNameResult>;
- setExtraHTTPHeaders(params: BrowserContextSetExtraHTTPHeadersParams): Promise<BrowserContextSetExtraHTTPHeadersResult>;
- setGeolocation(params: BrowserContextSetGeolocationParams): Promise<BrowserContextSetGeolocationResult>;
- setHTTPCredentials(params: BrowserContextSetHTTPCredentialsParams): Promise<BrowserContextSetHTTPCredentialsResult>;
- setNetworkInterceptionPatterns(params: BrowserContextSetNetworkInterceptionPatternsParams): Promise<BrowserContextSetNetworkInterceptionPatternsResult>;
- setWebSocketInterceptionPatterns(params: BrowserContextSetWebSocketInterceptionPatternsParams): Promise<BrowserContextSetWebSocketInterceptionPatternsResult>;
- setOffline(params: BrowserContextSetOfflineParams): Promise<BrowserContextSetOfflineResult>;
- storageState(params: BrowserContextStorageStateParams): Promise<BrowserContextStorageStateResult>;
- setStorageState(params: BrowserContextSetStorageStateParams): Promise<BrowserContextSetStorageStateResult>;
- pause(params?: BrowserContextPauseParams): Promise<BrowserContextPauseResult>;
- enableRecorder(params: BrowserContextEnableRecorderParams): Promise<BrowserContextEnableRecorderResult>;
- disableRecorder(params?: BrowserContextDisableRecorderParams): Promise<BrowserContextDisableRecorderResult>;
- exposeConsoleApi(params?: BrowserContextExposeConsoleApiParams): Promise<BrowserContextExposeConsoleApiResult>;
- newCDPSession(params: BrowserContextNewCDPSessionParams): Promise<BrowserContextNewCDPSessionResult>;
- createTempFiles(params: BrowserContextCreateTempFilesParams): Promise<BrowserContextCreateTempFilesResult>;
- updateSubscription(params: BrowserContextUpdateSubscriptionParams): Promise<BrowserContextUpdateSubscriptionResult>;
- clockFastForward(params: BrowserContextClockFastForwardParams): Promise<BrowserContextClockFastForwardResult>;
- clockInstall(params: BrowserContextClockInstallParams): Promise<BrowserContextClockInstallResult>;
- clockPauseAt(params: BrowserContextClockPauseAtParams): Promise<BrowserContextClockPauseAtResult>;
- clockResume(params?: BrowserContextClockResumeParams): Promise<BrowserContextClockResumeResult>;
- clockRunFor(params: BrowserContextClockRunForParams): Promise<BrowserContextClockRunForResult>;
- clockSetFixedTime(params: BrowserContextClockSetFixedTimeParams): Promise<BrowserContextClockSetFixedTimeResult>;
- clockSetSystemTime(params: BrowserContextClockSetSystemTimeParams): Promise<BrowserContextClockSetSystemTimeResult>;
- credentialsInstall(params?: BrowserContextCredentialsInstallParams): Promise<BrowserContextCredentialsInstallResult>;
- credentialsCreate(params: BrowserContextCredentialsCreateParams): Promise<BrowserContextCredentialsCreateResult>;
- credentialsGet(params: BrowserContextCredentialsGetParams): Promise<BrowserContextCredentialsGetResult>;
- credentialsDelete(params: BrowserContextCredentialsDeleteParams): Promise<BrowserContextCredentialsDeleteResult>;
+ addCookies(params: BrowserContextAddCookiesParams, signal: AbortSignal | undefined): Promise<BrowserContextAddCookiesResult>;
+ addInitScript(params: BrowserContextAddInitScriptParams, signal: AbortSignal | undefined): Promise<BrowserContextAddInitScriptResult>;
+ clearCookies(params: BrowserContextClearCookiesParams, signal: AbortSignal | undefined): Promise<BrowserContextClearCookiesResult>;
+ clearPermissions(params: BrowserContextClearPermissionsParams, signal: AbortSignal | undefined): Promise<BrowserContextClearPermissionsResult>;
+ close(params: BrowserContextCloseParams, signal: AbortSignal | undefined): Promise<BrowserContextCloseResult>;
+ cookies(params: BrowserContextCookiesParams, signal: AbortSignal | undefined): Promise<BrowserContextCookiesResult>;
+ exposeBinding(params: BrowserContextExposeBindingParams, signal: AbortSignal | undefined): Promise<BrowserContextExposeBindingResult>;
+ grantPermissions(params: BrowserContextGrantPermissionsParams, signal: AbortSignal | undefined): Promise<BrowserContextGrantPermissionsResult>;
+ newPage(params: BrowserContextNewPageParams, signal: AbortSignal | undefined): Promise<BrowserContextNewPageResult>;
+ registerSelectorEngine(params: BrowserContextRegisterSelectorEngineParams, signal: AbortSignal | undefined): Promise<BrowserContextRegisterSelectorEngineResult>;
+ setTestIdAttributeName(params: BrowserContextSetTestIdAttributeNameParams, signal: AbortSignal | undefined): Promise<BrowserContextSetTestIdAttributeNameResult>;
+ setExtraHTTPHeaders(params: BrowserContextSetExtraHTTPHeadersParams, signal: AbortSignal | undefined): Promise<BrowserContextSetExtraHTTPHeadersResult>;
+ setGeolocation(params: BrowserContextSetGeolocationParams, signal: AbortSignal | undefined): Promise<BrowserContextSetGeolocationResult>;
+ setHTTPCredentials(params: BrowserContextSetHTTPCredentialsParams, signal: AbortSignal | undefined): Promise<BrowserContextSetHTTPCredentialsResult>;
+ setNetworkInterceptionPatterns(params: BrowserContextSetNetworkInterceptionPatternsParams, signal: AbortSignal | undefined): Promise<BrowserContextSetNetworkInterceptionPatternsResult>;
+ setWebSocketInterceptionPatterns(params: BrowserContextSetWebSocketInterceptionPatternsParams, signal: AbortSignal | undefined): Promise<BrowserContextSetWebSocketInterceptionPatternsResult>;
+ setOffline(params: BrowserContextSetOfflineParams, signal: AbortSignal | undefined): Promise<BrowserContextSetOfflineResult>;
+ storageState(params: BrowserContextStorageStateParams, signal: AbortSignal | undefined): Promise<BrowserContextStorageStateResult>;
+ setStorageState(params: BrowserContextSetStorageStateParams, signal: AbortSignal | undefined): Promise<BrowserContextSetStorageStateResult>;
+ pause(params: BrowserContextPauseParams, signal: AbortSignal | undefined): Promise<BrowserContextPauseResult>;
+ enableRecorder(params: BrowserContextEnableRecorderParams, signal: AbortSignal | undefined): Promise<BrowserContextEnableRecorderResult>;
+ disableRecorder(params: BrowserContextDisableRecorderParams, signal: AbortSignal | undefined): Promise<BrowserContextDisableRecorderResult>;
+ exposeConsoleApi(params: BrowserContextExposeConsoleApiParams, signal: AbortSignal | undefined): Promise<BrowserContextExposeConsoleApiResult>;
+ newCDPSession(params: BrowserContextNewCDPSessionParams, signal: AbortSignal | undefined): Promise<BrowserContextNewCDPSessionResult>;
+ createTempFiles(params: BrowserContextCreateTempFilesParams, signal: AbortSignal | undefined): Promise<BrowserContextCreateTempFilesResult>;
+ updateSubscription(params: BrowserContextUpdateSubscriptionParams, signal: AbortSignal | undefined): Promise<BrowserContextUpdateSubscriptionResult>;
+ clockFastForward(params: BrowserContextClockFastForwardParams, signal: AbortSignal | undefined): Promise<BrowserContextClockFastForwardResult>;
+ clockInstall(params: BrowserContextClockInstallParams, signal: AbortSignal | undefined): Promise<BrowserContextClockInstallResult>;
+ clockPauseAt(params: BrowserContextClockPauseAtParams, signal: AbortSignal | undefined): Promise<BrowserContextClockPauseAtResult>;
+ clockResume(params: BrowserContextClockResumeParams, signal: AbortSignal | undefined): Promise<BrowserContextClockResumeResult>;
+ clockRunFor(params: BrowserContextClockRunForParams, signal: AbortSignal | undefined): Promise<BrowserContextClockRunForResult>;
+ clockSetFixedTime(params: BrowserContextClockSetFixedTimeParams, signal: AbortSignal | undefined): Promise<BrowserContextClockSetFixedTimeResult>;
+ clockSetSystemTime(params: BrowserContextClockSetSystemTimeParams, signal: AbortSignal | undefined): Promise<BrowserContextClockSetSystemTimeResult>;
+ credentialsInstall(params: BrowserContextCredentialsInstallParams, signal: AbortSignal | undefined): Promise<BrowserContextCredentialsInstallResult>;
+ credentialsCreate(params: BrowserContextCredentialsCreateParams, signal: AbortSignal | undefined): Promise<BrowserContextCredentialsCreateResult>;
+ credentialsGet(params: BrowserContextCredentialsGetParams, signal: AbortSignal | undefined): Promise<BrowserContextCredentialsGetResult>;
+ credentialsDelete(params: BrowserContextCredentialsDeleteParams, signal: AbortSignal | undefined): Promise<BrowserContextCredentialsDeleteResult>;
}
export type BrowserContextBindingCallEvent = {
binding: BindingCallChannel,
@@ -1754,10 +1754,10 @@ export interface BrowserTypeEventTarget {
}
export interface BrowserTypeChannel extends BrowserTypeEventTarget, Channel {
_type_BrowserType: boolean;
- launch(params: BrowserTypeLaunchParams): Promise<BrowserTypeLaunchResult>;
- launchPersistentContext(params: BrowserTypeLaunchPersistentContextParams): Promise<BrowserTypeLaunchPersistentContextResult>;
- connectOverCDP(params: BrowserTypeConnectOverCDPParams): Promise<BrowserTypeConnectOverCDPResult>;
- connectToWorker(params: BrowserTypeConnectToWorkerParams): Promise<BrowserTypeConnectToWorkerResult>;
+ launch(params: BrowserTypeLaunchParams, signal: AbortSignal | undefined): Promise<BrowserTypeLaunchResult>;
+ launchPersistentContext(params: BrowserTypeLaunchPersistentContextParams, signal: AbortSignal | undefined): Promise<BrowserTypeLaunchPersistentContextResult>;
+ connectOverCDP(params: BrowserTypeConnectOverCDPParams, signal: AbortSignal | undefined): Promise<BrowserTypeConnectOverCDPResult>;
+ connectToWorker(params: BrowserTypeConnectToWorkerParams, signal: AbortSignal | undefined): Promise<BrowserTypeConnectToWorkerResult>;
}
export type BrowserTypeLaunchParams = {
channel?: string,
@@ -2036,7 +2036,7 @@ export interface DisposableEventTarget {
}
export interface DisposableChannel extends DisposableEventTarget, Channel {
_type_Disposable: boolean;
- dispose(params?: DisposableDisposeParams): Promise<DisposableDisposeResult>;
+ dispose(params: DisposableDisposeParams, signal: AbortSignal | undefined): Promise<DisposableDisposeResult>;
}
export type DisposableDisposeParams = {};
export type DisposableDisposeOptions = {};
@@ -2051,7 +2051,7 @@ export interface ElectronEventTarget {
}
export interface ElectronChannel extends ElectronEventTarget, Channel {
_type_Electron: boolean;
- launch(params: ElectronLaunchParams): Promise<ElectronLaunchResult>;
+ launch(params: ElectronLaunchParams, signal: AbortSignal | undefined): Promise<ElectronLaunchResult>;
}
export type ElectronLaunchParams = {
executablePath?: string,
@@ -2157,10 +2157,10 @@ export interface ElectronApplicationEventTarget {
}
export interface ElectronApplicationChannel extends ElectronApplicationEventTarget, Channel {
_type_ElectronApplication: boolean;
- browserWindow(params: ElectronApplicationBrowserWindowParams): Promise<ElectronApplicationBrowserWindowResult>;
- evaluateExpression(params: ElectronApplicationEvaluateExpressionParams): Promise<ElectronApplicationEvaluateExpressionResult>;
- evaluateExpressionHandle(params: ElectronApplicationEvaluateExpressionHandleParams): Promise<ElectronApplicationEvaluateExpressionHandleResult>;
- updateSubscription(params: ElectronApplicationUpdateSubscriptionParams): Promise<ElectronApplicationUpdateSubscriptionResult>;
+ browserWindow(params: ElectronApplicationBrowserWindowParams, signal: AbortSignal | undefined): Promise<ElectronApplicationBrowserWindowResult>;
+ evaluateExpression(params: ElectronApplicationEvaluateExpressionParams, signal: AbortSignal | undefined): Promise<ElectronApplicationEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: ElectronApplicationEvaluateExpressionHandleParams, signal: AbortSignal | undefined): Promise<ElectronApplicationEvaluateExpressionHandleResult>;
+ updateSubscription(params: ElectronApplicationUpdateSubscriptionParams, signal: AbortSignal | undefined): Promise<ElectronApplicationUpdateSubscriptionResult>;
}
export type ElectronApplicationCloseEvent = {};
export type ElectronApplicationConsoleEvent = {
@@ -2232,55 +2232,55 @@ export interface FrameEventTarget {
}
export interface FrameChannel extends FrameEventTarget, Channel {
_type_Frame: boolean;
- evalOnSelector(params: FrameEvalOnSelectorParams): Promise<FrameEvalOnSelectorResult>;
- evalOnSelectorAll(params: FrameEvalOnSelectorAllParams): Promise<FrameEvalOnSelectorAllResult>;
- addScriptTag(params: FrameAddScriptTagParams): Promise<FrameAddScriptTagResult>;
- addStyleTag(params: FrameAddStyleTagParams): Promise<FrameAddStyleTagResult>;
- ariaSnapshot(params: FrameAriaSnapshotParams): Promise<FrameAriaSnapshotResult>;
- blur(params: FrameBlurParams): Promise<FrameBlurResult>;
- check(params: FrameCheckParams): Promise<FrameCheckResult>;
- click(params: FrameClickParams): Promise<FrameClickResult>;
- content(params?: FrameContentParams): Promise<FrameContentResult>;
- dragAndDrop(params: FrameDragAndDropParams): Promise<FrameDragAndDropResult>;
- drop(params: FrameDropParams): Promise<FrameDropResult>;
- dblclick(params: FrameDblclickParams): Promise<FrameDblclickResult>;
- dispatchEvent(params: FrameDispatchEventParams): Promise<FrameDispatchEventResult>;
- evaluateExpression(params: FrameEvaluateExpressionParams): Promise<FrameEvaluateExpressionResult>;
- evaluateExpressionHandle(params: FrameEvaluateExpressionHandleParams): Promise<FrameEvaluateExpressionHandleResult>;
- fill(params: FrameFillParams): Promise<FrameFillResult>;
- focus(params: FrameFocusParams): Promise<FrameFocusResult>;
- frameElement(params?: FrameFrameElementParams): Promise<FrameFrameElementResult>;
- resolveSelector(params: FrameResolveSelectorParams): Promise<FrameResolveSelectorResult>;
- highlight(params: FrameHighlightParams): Promise<FrameHighlightResult>;
- hideHighlight(params: FrameHideHighlightParams): Promise<FrameHideHighlightResult>;
- getAttribute(params: FrameGetAttributeParams): Promise<FrameGetAttributeResult>;
- goto(params: FrameGotoParams): Promise<FrameGotoResult>;
- hover(params: FrameHoverParams): Promise<FrameHoverResult>;
- innerHTML(params: FrameInnerHTMLParams): Promise<FrameInnerHTMLResult>;
- innerText(params: FrameInnerTextParams): Promise<FrameInnerTextResult>;
- inputValue(params: FrameInputValueParams): Promise<FrameInputValueResult>;
- isChecked(params: FrameIsCheckedParams): Promise<FrameIsCheckedResult>;
- isDisabled(params: FrameIsDisabledParams): Promise<FrameIsDisabledResult>;
- isEnabled(params: FrameIsEnabledParams): Promise<FrameIsEnabledResult>;
- isHidden(params: FrameIsHiddenParams): Promise<FrameIsHiddenResult>;
- isVisible(params: FrameIsVisibleParams): Promise<FrameIsVisibleResult>;
- isEditable(params: FrameIsEditableParams): Promise<FrameIsEditableResult>;
- press(params: FramePressParams): Promise<FramePressResult>;
- querySelector(params: FrameQuerySelectorParams): Promise<FrameQuerySelectorResult>;
- querySelectorAll(params: FrameQuerySelectorAllParams): Promise<FrameQuerySelectorAllResult>;
- queryCount(params: FrameQueryCountParams): Promise<FrameQueryCountResult>;
- selectOption(params: FrameSelectOptionParams): Promise<FrameSelectOptionResult>;
- setContent(params: FrameSetContentParams): Promise<FrameSetContentResult>;
- setInputFiles(params: FrameSetInputFilesParams): Promise<FrameSetInputFilesResult>;
- tap(params: FrameTapParams): Promise<FrameTapResult>;
- textContent(params: FrameTextContentParams): Promise<FrameTextContentResult>;
- title(params?: FrameTitleParams): Promise<FrameTitleResult>;
- type(params: FrameTypeParams): Promise<FrameTypeResult>;
- uncheck(params: FrameUncheckParams): Promise<FrameUncheckResult>;
- waitForTimeout(params: FrameWaitForTimeoutParams): Promise<FrameWaitForTimeoutResult>;
- waitForFunction(params: FrameWaitForFunctionParams): Promise<FrameWaitForFunctionResult>;
- waitForSelector(params: FrameWaitForSelectorParams): Promise<FrameWaitForSelectorResult>;
- expect(params: FrameExpectParams): Promise<FrameExpectResult>;
+ evalOnSelector(params: FrameEvalOnSelectorParams, signal: AbortSignal | undefined): Promise<FrameEvalOnSelectorResult>;
+ evalOnSelectorAll(params: FrameEvalOnSelectorAllParams, signal: AbortSignal | undefined): Promise<FrameEvalOnSelectorAllResult>;
+ addScriptTag(params: FrameAddScriptTagParams, signal: AbortSignal | undefined): Promise<FrameAddScriptTagResult>;
+ addStyleTag(params: FrameAddStyleTagParams, signal: AbortSignal | undefined): Promise<FrameAddStyleTagResult>;
+ ariaSnapshot(params: FrameAriaSnapshotParams, signal: AbortSignal | undefined): Promise<FrameAriaSnapshotResult>;
+ blur(params: FrameBlurParams, signal: AbortSignal | undefined): Promise<FrameBlurResult>;
+ check(params: FrameCheckParams, signal: AbortSignal | undefined): Promise<FrameCheckResult>;
+ click(params: FrameClickParams, signal: AbortSignal | undefined): Promise<FrameClickResult>;
+ content(params: FrameContentParams, signal: AbortSignal | undefined): Promise<FrameContentResult>;
+ dragAndDrop(params: FrameDragAndDropParams, signal: AbortSignal | undefined): Promise<FrameDragAndDropResult>;
+ drop(params: FrameDropParams, signal: AbortSignal | undefined): Promise<FrameDropResult>;
+ dblclick(params: FrameDblclickParams, signal: AbortSignal | undefined): Promise<FrameDblclickResult>;
+ dispatchEvent(params: FrameDispatchEventParams, signal: AbortSignal | undefined): Promise<FrameDispatchEventResult>;
+ evaluateExpression(params: FrameEvaluateExpressionParams, signal: AbortSignal | undefined): Promise<FrameEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: FrameEvaluateExpressionHandleParams, signal: AbortSignal | undefined): Promise<FrameEvaluateExpressionHandleResult>;
+ fill(params: FrameFillParams, signal: AbortSignal | undefined): Promise<FrameFillResult>;
+ focus(params: FrameFocusParams, signal: AbortSignal | undefined): Promise<FrameFocusResult>;
+ frameElement(params: FrameFrameElementParams, signal: AbortSignal | undefined): Promise<FrameFrameElementResult>;
+ resolveSelector(params: FrameResolveSelectorParams, signal: AbortSignal | undefined): Promise<FrameResolveSelectorResult>;
+ highlight(params: FrameHighlightParams, signal: AbortSignal | undefined): Promise<FrameHighlightResult>;
+ hideHighlight(params: FrameHideHighlightParams, signal: AbortSignal | undefined): Promise<FrameHideHighlightResult>;
+ getAttribute(params: FrameGetAttributeParams, signal: AbortSignal | undefined): Promise<FrameGetAttributeResult>;
+ goto(params: FrameGotoParams, signal: AbortSignal | undefined): Promise<FrameGotoResult>;
+ hover(params: FrameHoverParams, signal: AbortSignal | undefined): Promise<FrameHoverResult>;
+ innerHTML(params: FrameInnerHTMLParams, signal: AbortSignal | undefined): Promise<FrameInnerHTMLResult>;
+ innerText(params: FrameInnerTextParams, signal: AbortSignal | undefined): Promise<FrameInnerTextResult>;
+ inputValue(params: FrameInputValueParams, signal: AbortSignal | undefined): Promise<FrameInputValueResult>;
+ isChecked(params: FrameIsCheckedParams, signal: AbortSignal | undefined): Promise<FrameIsCheckedResult>;
+ isDisabled(params: FrameIsDisabledParams, signal: AbortSignal | undefined): Promise<FrameIsDisabledResult>;
+ isEnabled(params: FrameIsEnabledParams, signal: AbortSignal | undefined): Promise<FrameIsEnabledResult>;
+ isHidden(params: FrameIsHiddenParams, signal: AbortSignal | undefined): Promise<FrameIsHiddenResult>;
+ isVisible(params: FrameIsVisibleParams, signal: AbortSignal | undefined): Promise<FrameIsVisibleResult>;
+ isEditable(params: FrameIsEditableParams, signal: AbortSignal | undefined): Promise<FrameIsEditableResult>;
+ press(params: FramePressParams, signal: AbortSignal | undefined): Promise<FramePressResult>;
+ querySelector(params: FrameQuerySelectorParams, signal: AbortSignal | undefined): Promise<FrameQuerySelectorResult>;
+ querySelectorAll(params: FrameQuerySelectorAllParams, signal: AbortSignal | undefined): Promise<FrameQuerySelectorAllResult>;
+ queryCount(params: FrameQueryCountParams, signal: AbortSignal | undefined): Promise<FrameQueryCountResult>;
+ selectOption(params: FrameSelectOptionParams, signal: AbortSignal | undefined): Promise<FrameSelectOptionResult>;
+ setContent(params: FrameSetContentParams, signal: AbortSignal | undefined): Promise<FrameSetContentResult>;
+ setInputFiles(params: FrameSetInputFilesParams, signal: AbortSignal | undefined): Promise<FrameSetInputFilesResult>;
+ tap(params: FrameTapParams, signal: AbortSignal | undefined): Promise<FrameTapResult>;
+ textContent(params: FrameTextContentParams, signal: AbortSignal | undefined): Promise<FrameTextContentResult>;
+ title(params: FrameTitleParams, signal: AbortSignal | undefined): Promise<FrameTitleResult>;
+ type(params: FrameTypeParams, signal: AbortSignal | undefined): Promise<FrameTypeResult>;
+ uncheck(params: FrameUncheckParams, signal: AbortSignal | undefined): Promise<FrameUncheckResult>;
+ waitForTimeout(params: FrameWaitForTimeoutParams, signal: AbortSignal | undefined): Promise<FrameWaitForTimeoutResult>;
+ waitForFunction(params: FrameWaitForFunctionParams, signal: AbortSignal | undefined): Promise<FrameWaitForFunctionResult>;
+ waitForSelector(params: FrameWaitForSelectorParams, signal: AbortSignal | undefined): Promise<FrameWaitForSelectorResult>;
+ expect(params: FrameExpectParams, signal: AbortSignal | undefined): Promise<FrameExpectResult>;
}
export type FrameLoadstateEvent = {
add?: LifecycleEvent,
@@ -2980,12 +2980,12 @@ export interface JSHandleEventTarget {
}
export interface JSHandleChannel extends JSHandleEventTarget, Channel {
_type_JSHandle: boolean;
- dispose(params?: JSHandleDisposeParams): Promise<JSHandleDisposeResult>;
- evaluateExpression(params: JSHandleEvaluateExpressionParams): Promise<JSHandleEvaluateExpressionResult>;
- evaluateExpressionHandle(params: JSHandleEvaluateExpressionHandleParams): Promise<JSHandleEvaluateExpressionHandleResult>;
- getPropertyList(params?: JSHandleGetPropertyListParams): Promise<JSHandleGetPropertyListResult>;
- getProperty(params: JSHandleGetPropertyParams): Promise<JSHandleGetPropertyResult>;
- jsonValue(params?: JSHandleJsonValueParams): Promise<JSHandleJsonValueResult>;
+ dispose(params: JSHandleDisposeParams, signal: AbortSignal | undefined): Promise<JSHandleDisposeResult>;
+ evaluateExpression(params: JSHandleEvaluateExpressionParams, signal: AbortSignal | undefined): Promise<JSHandleEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: JSHandleEvaluateExpressionHandleParams, signal: AbortSignal | undefined): Promise<JSHandleEvaluateExpressionHandleResult>;
+ getPropertyList(params: JSHandleGetPropertyListParams, signal: AbortSignal | undefined): Promise<JSHandleGetPropertyListResult>;
+ getProperty(params: JSHandleGetPropertyParams, signal: AbortSignal | undefined): Promise<JSHandleGetPropertyResult>;
+ jsonValue(params: JSHandleJsonValueParams, signal: AbortSignal | undefined): Promise<JSHandleJsonValueResult>;
}
export type JSHandlePreviewUpdatedEvent = {
preview: string,
@@ -3048,42 +3048,42 @@ export interface ElementHandleEventTarget {
}
export interface ElementHandleChannel extends ElementHandleEventTarget, JSHandleChannel {
_type_ElementHandle: boolean;
- evalOnSelector(params: ElementHandleEvalOnSelectorParams): Promise<ElementHandleEvalOnSelectorResult>;
- evalOnSelectorAll(params: ElementHandleEvalOnSelectorAllParams): Promise<ElementHandleEvalOnSelectorAllResult>;
- boundingBox(params?: ElementHandleBoundingBoxParams): Promise<ElementHandleBoundingBoxResult>;
- check(params: ElementHandleCheckParams): Promise<ElementHandleCheckResult>;
- click(params: ElementHandleClickParams): Promise<ElementHandleClickResult>;
- contentFrame(params?: ElementHandleContentFrameParams): Promise<ElementHandleContentFrameResult>;
- dblclick(params: ElementHandleDblclickParams): Promise<ElementHandleDblclickResult>;
- dispatchEvent(params: ElementHandleDispatchEventParams): Promise<ElementHandleDispatchEventResult>;
- fill(params: ElementHandleFillParams): Promise<ElementHandleFillResult>;
- focus(params?: ElementHandleFocusParams): Promise<ElementHandleFocusResult>;
- getAttribute(params: ElementHandleGetAttributeParams): Promise<ElementHandleGetAttributeResult>;
- hover(params: ElementHandleHoverParams): Promise<ElementHandleHoverResult>;
- innerHTML(params?: ElementHandleInnerHTMLParams): Promise<ElementHandleInnerHTMLResult>;
- innerText(params?: ElementHandleInnerTextParams): Promise<ElementHandleInnerTextResult>;
- inputValue(params?: ElementHandleInputValueParams): Promise<ElementHandleInputValueResult>;
- isChecked(params?: ElementHandleIsCheckedParams): Promise<ElementHandleIsCheckedResult>;
- isDisabled(params?: ElementHandleIsDisabledParams): Promise<ElementHandleIsDisabledResult>;
- isEditable(params?: ElementHandleIsEditableParams): Promise<ElementHandleIsEditableResult>;
- isEnabled(params?: ElementHandleIsEnabledParams): Promise<ElementHandleIsEnabledResult>;
- isHidden(params?: ElementHandleIsHiddenParams): Promise<ElementHandleIsHiddenResult>;
- isVisible(params?: ElementHandleIsVisibleParams): Promise<ElementHandleIsVisibleResult>;
- ownerFrame(params?: ElementHandleOwnerFrameParams): Promise<ElementHandleOwnerFrameResult>;
- press(params: ElementHandlePressParams): Promise<ElementHandlePressResult>;
- querySelector(params: ElementHandleQuerySelectorParams): Promise<ElementHandleQuerySelectorResult>;
- querySelectorAll(params: ElementHandleQuerySelectorAllParams): Promise<ElementHandleQuerySelectorAllResult>;
- screenshot(params: ElementHandleScreenshotParams): Promise<ElementHandleScreenshotResult>;
- scrollIntoViewIfNeeded(params: ElementHandleScrollIntoViewIfNeededParams): Promise<ElementHandleScrollIntoViewIfNeededResult>;
- selectOption(params: ElementHandleSelectOptionParams): Promise<ElementHandleSelectOptionResult>;
- selectText(params: ElementHandleSelectTextParams): Promise<ElementHandleSelectTextResult>;
- setInputFiles(params: ElementHandleSetInputFilesParams): Promise<ElementHandleSetInputFilesResult>;
- tap(params: ElementHandleTapParams): Promise<ElementHandleTapResult>;
- textContent(params?: ElementHandleTextContentParams): Promise<ElementHandleTextContentResult>;
- type(params: ElementHandleTypeParams): Promise<ElementHandleTypeResult>;
- uncheck(params: ElementHandleUncheckParams): Promise<ElementHandleUncheckResult>;
- waitForElementState(params: ElementHandleWaitForElementStateParams): Promise<ElementHandleWaitForElementStateResult>;
- waitForSelector(params: ElementHandleWaitForSelectorParams): Promise<ElementHandleWaitForSelectorResult>;
+ evalOnSelector(params: ElementHandleEvalOnSelectorParams, signal: AbortSignal | undefined): Promise<ElementHandleEvalOnSelectorResult>;
+ evalOnSelectorAll(params: ElementHandleEvalOnSelectorAllParams, signal: AbortSignal | undefined): Promise<ElementHandleEvalOnSelectorAllResult>;
+ boundingBox(params: ElementHandleBoundingBoxParams, signal: AbortSignal | undefined): Promise<ElementHandleBoundingBoxResult>;
+ check(params: ElementHandleCheckParams, signal: AbortSignal | undefined): Promise<ElementHandleCheckResult>;
+ click(params: ElementHandleClickParams, signal: AbortSignal | undefined): Promise<ElementHandleClickResult>;
+ contentFrame(params: ElementHandleContentFrameParams, signal: AbortSignal | undefined): Promise<ElementHandleContentFrameResult>;
+ dblclick(params: ElementHandleDblclickParams, signal: AbortSignal | undefined): Promise<ElementHandleDblclickResult>;
+ dispatchEvent(params: ElementHandleDispatchEventParams, signal: AbortSignal | undefined): Promise<ElementHandleDispatchEventResult>;
+ fill(params: ElementHandleFillParams, signal: AbortSignal | undefined): Promise<ElementHandleFillResult>;
+ focus(params: ElementHandleFocusParams, signal: AbortSignal | undefined): Promise<ElementHandleFocusResult>;
+ getAttribute(params: ElementHandleGetAttributeParams, signal: AbortSignal | undefined): Promise<ElementHandleGetAttributeResult>;
+ hover(params: ElementHandleHoverParams, signal: AbortSignal | undefined): Promise<ElementHandleHoverResult>;
+ innerHTML(params: ElementHandleInnerHTMLParams, signal: AbortSignal | undefined): Promise<ElementHandleInnerHTMLResult>;
+ innerText(params: ElementHandleInnerTextParams, signal: AbortSignal | undefined): Promise<ElementHandleInnerTextResult>;
+ inputValue(params: ElementHandleInputValueParams, signal: AbortSignal | undefined): Promise<ElementHandleInputValueResult>;
+ isChecked(params: ElementHandleIsCheckedParams, signal: AbortSignal | undefined): Promise<ElementHandleIsCheckedResult>;
+ isDisabled(params: ElementHandleIsDisabledParams, signal: AbortSignal | undefined): Promise<ElementHandleIsDisabledResult>;
+ isEditable(params: ElementHandleIsEditableParams, signal: AbortSignal | undefined): Promise<ElementHandleIsEditableResult>;
+ isEnabled(params: ElementHandleIsEnabledParams, signal: AbortSignal | undefined): Promise<ElementHandleIsEnabledResult>;
+ isHidden(params: ElementHandleIsHiddenParams, signal: AbortSignal | undefined): Promise<ElementHandleIsHiddenResult>;
+ isVisible(params: ElementHandleIsVisibleParams, signal: AbortSignal | undefined): Promise<ElementHandleIsVisibleResult>;
+ ownerFrame(params: ElementHandleOwnerFrameParams, signal: AbortSignal | undefined): Promise<ElementHandleOwnerFrameResult>;
+ press(params: ElementHandlePressParams, signal: AbortSignal | undefined): Promise<ElementHandlePressResult>;
+ querySelector(params: ElementHandleQuerySelectorParams, signal: AbortSignal | undefined): Promise<ElementHandleQuerySelectorResult>;
+ querySelectorAll(params: ElementHandleQuerySelectorAllParams, signal: AbortSignal | undefined): Promise<ElementHandleQuerySelectorAllResult>;
+ screenshot(params: ElementHandleScreenshotParams, signal: AbortSignal | undefined): Promise<ElementHandleScreenshotResult>;
+ scrollIntoViewIfNeeded(params: ElementHandleScrollIntoViewIfNeededParams, signal: AbortSignal | undefined): Promise<ElementHandleScrollIntoViewIfNeededResult>;
+ selectOption(params: ElementHandleSelectOptionParams, signal: AbortSignal | undefined): Promise<ElementHandleSelectOptionResult>;
+ selectText(params: ElementHandleSelectTextParams, signal: AbortSignal | undefined): Promise<ElementHandleSelectTextResult>;
+ setInputFiles(params: ElementHandleSetInputFilesParams, signal: AbortSignal | undefined): Promise<ElementHandleSetInputFilesResult>;
+ tap(params: ElementHandleTapParams, signal: AbortSignal | undefined): Promise<ElementHandleTapResult>;
+ textContent(params: ElementHandleTextContentParams, signal: AbortSignal | undefined): Promise<ElementHandleTextContentResult>;
+ type(params: ElementHandleTypeParams, signal: AbortSignal | undefined): Promise<ElementHandleTypeResult>;
+ uncheck(params: ElementHandleUncheckParams, signal: AbortSignal | undefined): Promise<ElementHandleUncheckResult>;
+ waitForElementState(params: ElementHandleWaitForElementStateParams, signal: AbortSignal | undefined): Promise<ElementHandleWaitForElementStateResult>;
+ waitForSelector(params: ElementHandleWaitForSelectorParams, signal: AbortSignal | undefined): Promise<ElementHandleWaitForSelectorResult>;
}
export type ElementHandleEvalOnSelectorParams = {
selector: string,
@@ -3497,16 +3497,16 @@ export interface LocalUtilsEventTarget {
}
export interface LocalUtilsChannel extends LocalUtilsEventTarget, Channel {
_type_LocalUtils: boolean;
- zip(params: LocalUtilsZipParams): Promise<LocalUtilsZipResult>;
- harOpen(params: LocalUtilsHarOpenParams): Promise<LocalUtilsHarOpenResult>;
- harLookup(params: LocalUtilsHarLookupParams): Promise<LocalUtilsHarLookupResult>;
- harClose(params: LocalUtilsHarCloseParams): Promise<LocalUtilsHarCloseResult>;
- harUnzip(params: LocalUtilsHarUnzipParams): Promise<LocalUtilsHarUnzipResult>;
- connect(params: LocalUtilsConnectParams): Promise<LocalUtilsConnectResult>;
- tracingStarted(params: LocalUtilsTracingStartedParams): Promise<LocalUtilsTracingStartedResult>;
- addStackToTracingNoReply(params: LocalUtilsAddStackToTracingNoReplyParams): Promise<LocalUtilsAddStackToTracingNoReplyResult>;
- traceDiscarded(params: LocalUtilsTraceDiscardedParams): Promise<LocalUtilsTraceDiscardedResult>;
- globToRegex(params: LocalUtilsGlobToRegexParams): Promise<LocalUtilsGlobToRegexResult>;
+ zip(params: LocalUtilsZipParams, signal: AbortSignal | undefined): Promise<LocalUtilsZipResult>;
+ harOpen(params: LocalUtilsHarOpenParams, signal: AbortSignal | undefined): Promise<LocalUtilsHarOpenResult>;
+ harLookup(params: LocalUtilsHarLookupParams, signal: AbortSignal | undefined): Promise<LocalUtilsHarLookupResult>;
+ harClose(params: LocalUtilsHarCloseParams, signal: AbortSignal | undefined): Promise<LocalUtilsHarCloseResult>;
+ harUnzip(params: LocalUtilsHarUnzipParams, signal: AbortSignal | undefined): Promise<LocalUtilsHarUnzipResult>;
+ connect(params: LocalUtilsConnectParams, signal: AbortSignal | undefined): Promise<LocalUtilsConnectResult>;
+ tracingStarted(params: LocalUtilsTracingStartedParams, signal: AbortSignal | undefined): Promise<LocalUtilsTracingStartedResult>;
+ addStackToTracingNoReply(params: LocalUtilsAddStackToTracingNoReplyParams, signal: AbortSignal | undefined): Promise<LocalUtilsAddStackToTracingNoReplyResult>;
+ traceDiscarded(params: LocalUtilsTraceDiscardedParams, signal: AbortSignal | undefined): Promise<LocalUtilsTraceDiscardedResult>;
+ globToRegex(params: LocalUtilsGlobToRegexParams, signal: AbortSignal | undefined): Promise<LocalUtilsGlobToRegexResult>;
}
export type LocalUtilsZipParams = {
zipFile: string,
@@ -3642,8 +3642,8 @@ export interface RequestEventTarget {
}
export interface RequestChannel extends RequestEventTarget, Channel {
_type_Request: boolean;
- response(params?: RequestResponseParams): Promise<RequestResponseResult>;
- rawRequestHeaders(params?: RequestRawRequestHeadersParams): Promise<RequestRawRequestHeadersResult>;
+ response(params: RequestResponseParams, signal: AbortSignal | undefined): Promise<RequestResponseResult>;
+ rawRequestHeaders(params: RequestRawRequestHeadersParams, signal: AbortSignal | undefined): Promise<RequestRawRequestHeadersResult>;
}
export type RequestResponseParams = {};
export type RequestResponseOptions = {};
@@ -3667,10 +3667,10 @@ export interface RouteEventTarget {
}
export interface RouteChannel extends RouteEventTarget, Channel {
_type_Route: boolean;
- redirectNavigationRequest(params: RouteRedirectNavigationRequestParams): Promise<RouteRedirectNavigationRequestResult>;
- abort(params: RouteAbortParams): Promise<RouteAbortResult>;
- continue(params: RouteContinueParams): Promise<RouteContinueResult>;
- fulfill(params: RouteFulfillParams): Promise<RouteFulfillResult>;
+ redirectNavigationRequest(params: RouteRedirectNavigationRequestParams, signal: AbortSignal | undefined): Promise<RouteRedirectNavigationRequestResult>;
+ abort(params: RouteAbortParams, signal: AbortSignal | undefined): Promise<RouteAbortResult>;
+ continue(params: RouteContinueParams, signal: AbortSignal | undefined): Promise<RouteContinueResult>;
+ fulfill(params: RouteFulfillParams, signal: AbortSignal | undefined): Promise<RouteFulfillResult>;
}
export type RouteRedirectNavigationRequestParams = {
url: string,
@@ -3732,12 +3732,12 @@ export interface WebSocketRouteEventTarget {
}
export interface WebSocketRouteChannel extends WebSocketRouteEventTarget, Channel {
_type_WebSocketRoute: boolean;
- connect(params?: WebSocketRouteConnectParams): Promise<WebSocketRouteConnectResult>;
- ensureOpened(params?: WebSocketRouteEnsureOpenedParams): Promise<WebSocketRouteEnsureOpenedResult>;
- sendToPage(params: WebSocketRouteSendToPageParams): Promise<WebSocketRouteSendToPageResult>;
- sendToServer(params: WebSocketRouteSendToServerParams): Promise<WebSocketRouteSendToServerResult>;
- closePage(params: WebSocketRouteClosePageParams): Promise<WebSocketRouteClosePageResult>;
- closeServer(params: WebSocketRouteCloseServerParams): Promise<WebSocketRouteCloseServerResult>;
+ connect(params: WebSocketRouteConnectParams, signal: AbortSignal | undefined): Promise<WebSocketRouteConnectResult>;
+ ensureOpened(params: WebSocketRouteEnsureOpenedParams, signal: AbortSignal | undefined): Promise<WebSocketRouteEnsureOpenedResult>;
+ sendToPage(params: WebSocketRouteSendToPageParams, signal: AbortSignal | undefined): Promise<WebSocketRouteSendToPageResult>;
+ sendToServer(params: WebSocketRouteSendToServerParams, signal: AbortSignal | undefined): Promise<WebSocketRouteSendToServerResult>;
+ closePage(params: WebSocketRouteClosePageParams, signal: AbortSignal | undefined): Promise<WebSocketRouteClosePageResult>;
+ closeServer(params: WebSocketRouteCloseServerParams, signal: AbortSignal | undefined): Promise<WebSocketRouteCloseServerResult>;
}
export type WebSocketRouteMessageFromPageEvent = {
message: string,
@@ -3821,12 +3821,12 @@ export interface ResponseEventTarget {
}
export interface ResponseChannel extends ResponseEventTarget, Channel {
_type_Response: boolean;
- body(params?: ResponseBodyParams): Promise<ResponseBodyResult>;
- securityDetails(params?: ResponseSecurityDetailsParams): Promise<ResponseSecurityDetailsResult>;
- serverAddr(params?: ResponseServerAddrParams): Promise<ResponseServerAddrResult>;
- rawResponseHeaders(params?: ResponseRawResponseHeadersParams): Promise<ResponseRawResponseHeadersResult>;
- httpVersion(params?: ResponseHttpVersionParams): Promise<ResponseHttpVersionResult>;
- sizes(params?: ResponseSizesParams): Promise<ResponseSizesResult>;
+ body(params: ResponseBodyParams, signal: AbortSignal | undefined): Promise<ResponseBodyResult>;
+ securityDetails(params: ResponseSecurityDetailsParams, signal: AbortSignal | undefined): Promise<ResponseSecurityDetailsResult>;
+ serverAddr(params: ResponseServerAddrParams, signal: AbortSignal | undefined): Promise<ResponseServerAddrResult>;
+ rawResponseHeaders(params: ResponseRawResponseHeadersParams, signal: AbortSignal | undefined): Promise<ResponseRawResponseHeadersResult>;
+ httpVersion(params: ResponseHttpVersionParams, signal: AbortSignal | undefined): Promise<ResponseHttpVersionResult>;
+ sizes(params: ResponseSizesParams, signal: AbortSignal | undefined): Promise<ResponseSizesResult>;
}
export type ResponseBodyParams = {};
export type ResponseBodyOptions = {};
@@ -3927,64 +3927,64 @@ export interface PageEventTarget {
}
export interface PageChannel extends PageEventTarget, Channel {
_type_Page: boolean;
- addInitScript(params: PageAddInitScriptParams): Promise<PageAddInitScriptResult>;
- close(params: PageCloseParams): Promise<PageCloseResult>;
- runBeforeUnload(params?: PageRunBeforeUnloadParams): Promise<PageRunBeforeUnloadResult>;
- clearConsoleMessages(params?: PageClearConsoleMessagesParams): Promise<PageClearConsoleMessagesResult>;
- consoleMessages(params: PageConsoleMessagesParams): Promise<PageConsoleMessagesResult>;
- emulateMedia(params: PageEmulateMediaParams): Promise<PageEmulateMediaResult>;
- exposeBinding(params: PageExposeBindingParams): Promise<PageExposeBindingResult>;
- goBack(params: PageGoBackParams): Promise<PageGoBackResult>;
- goForward(params: PageGoForwardParams): Promise<PageGoForwardResult>;
- requestGC(params?: PageRequestGCParams): Promise<PageRequestGCResult>;
- registerLocatorHandler(params: PageRegisterLocatorHandlerParams): Promise<PageRegisterLocatorHandlerResult>;
- resolveLocatorHandlerNoReply(params: PageResolveLocatorHandlerNoReplyParams): Promise<PageResolveLocatorHandlerNoReplyResult>;
- unregisterLocatorHandler(params: PageUnregisterLocatorHandlerParams): Promise<PageUnregisterLocatorHandlerResult>;
- reload(params: PageReloadParams): Promise<PageReloadResult>;
- expectScreenshot(params: PageExpectScreenshotParams): Promise<PageExpectScreenshotResult>;
- screenshot(params: PageScreenshotParams): Promise<PageScreenshotResult>;
- setExtraHTTPHeaders(params: PageSetExtraHTTPHeadersParams): Promise<PageSetExtraHTTPHeadersResult>;
- setNetworkInterceptionPatterns(params: PageSetNetworkInterceptionPatternsParams): Promise<PageSetNetworkInterceptionPatternsResult>;
- setWebSocketInterceptionPatterns(params: PageSetWebSocketInterceptionPatternsParams): Promise<PageSetWebSocketInterceptionPatternsResult>;
- setViewportSize(params: PageSetViewportSizeParams): Promise<PageSetViewportSizeResult>;
- keyboardDown(params: PageKeyboardDownParams): Promise<PageKeyboardDownResult>;
- keyboardUp(params: PageKeyboardUpParams): Promise<PageKeyboardUpResult>;
- keyboardInsertText(params: PageKeyboardInsertTextParams): Promise<PageKeyboardInsertTextResult>;
- keyboardType(params: PageKeyboardTypeParams): Promise<PageKeyboardTypeResult>;
- keyboardPress(params: PageKeyboardPressParams): Promise<PageKeyboardPressResult>;
- mouseMove(params: PageMouseMoveParams): Promise<PageMouseMoveResult>;
- mouseDown(params: PageMouseDownParams): Promise<PageMouseDownResult>;
- mouseUp(params: PageMouseUpParams): Promise<PageMouseUpResult>;
- mouseClick(params: PageMouseClickParams): Promise<PageMouseClickResult>;
- mouseWheel(params: PageMouseWheelParams): Promise<PageMouseWheelResult>;
- touchscreenTap(params: PageTouchscreenTapParams): Promise<PageTouchscreenTapResult>;
- clearPageErrors(params?: PageClearPageErrorsParams): Promise<PageClearPageErrorsResult>;
- pageErrors(params: PagePageErrorsParams): Promise<PagePageErrorsResult>;
- pdf(params: PagePdfParams): Promise<PagePdfResult>;
- requests(params?: PageRequestsParams): Promise<PageRequestsResult>;
- startJSCoverage(params: PageStartJSCoverageParams): Promise<PageStartJSCoverageResult>;
- stopJSCoverage(params?: PageStopJSCoverageParams): Promise<PageStopJSCoverageResult>;
- startCSSCoverage(params: PageStartCSSCoverageParams): Promise<PageStartCSSCoverageResult>;
- stopCSSCoverage(params?: PageStopCSSCoverageParams): Promise<PageStopCSSCoverageResult>;
- bringToFront(params?: PageBringToFrontParams): Promise<PageBringToFrontResult>;
- pickLocator(params?: PagePickLocatorParams): Promise<PagePickLocatorResult>;
- cancelPickLocator(params?: PageCancelPickLocatorParams): Promise<PageCancelPickLocatorResult>;
- hideHighlight(params?: PageHideHighlightParams): Promise<PageHideHighlightResult>;
- screencastShowOverlay(params: PageScreencastShowOverlayParams): Promise<PageScreencastShowOverlayResult>;
- screencastRemoveOverlay(params: PageScreencastRemoveOverlayParams): Promise<PageScreencastRemoveOverlayResult>;
- screencastChapter(params: PageScreencastChapterParams): Promise<PageScreencastChapterResult>;
- screencastSetOverlayVisible(params: PageScreencastSetOverlayVisibleParams): Promise<PageScreencastSetOverlayVisibleResult>;
- screencastShowActions(params: PageScreencastShowActionsParams): Promise<PageScreencastShowActionsResult>;
- screencastHideActions(params?: PageScreencastHideActionsParams): Promise<PageScreencastHideActionsResult>;
- screencastStart(params: PageScreencastStartParams): Promise<PageScreencastStartResult>;
- screencastStop(params?: PageScreencastStopParams): Promise<PageScreencastStopResult>;
- updateSubscription(params: PageUpdateSubscriptionParams): Promise<PageUpdateSubscriptionResult>;
- setDockTile(params: PageSetDockTileParams): Promise<PageSetDockTileResult>;
- webStorageItems(params: PageWebStorageItemsParams): Promise<PageWebStorageItemsResult>;
- webStorageGetItem(params: PageWebStorageGetItemParams): Promise<PageWebStorageGetItemResult>;
- webStorageSetItem(params: PageWebStorageSetItemParams): Promise<PageWebStorageSetItemResult>;
- webStorageRemoveItem(params: PageWebStorageRemoveItemParams): Promise<PageWebStorageRemoveItemResult>;
- webStorageClear(params: PageWebStorageClearParams): Promise<PageWebStorageClearResult>;
+ addInitScript(params: PageAddInitScriptParams, signal: AbortSignal | undefined): Promise<PageAddInitScriptResult>;
+ close(params: PageCloseParams, signal: AbortSignal | undefined): Promise<PageCloseResult>;
+ runBeforeUnload(params: PageRunBeforeUnloadParams, signal: AbortSignal | undefined): Promise<PageRunBeforeUnloadResult>;
+ clearConsoleMessages(params: PageClearConsoleMessagesParams, signal: AbortSignal | undefined): Promise<PageClearConsoleMessagesResult>;
+ consoleMessages(params: PageConsoleMessagesParams, signal: AbortSignal | undefined): Promise<PageConsoleMessagesResult>;
+ emulateMedia(params: PageEmulateMediaParams, signal: AbortSignal | undefined): Promise<PageEmulateMediaResult>;
+ exposeBinding(params: PageExposeBindingParams, signal: AbortSignal | undefined): Promise<PageExposeBindingResult>;
+ goBack(params: PageGoBackParams, signal: AbortSignal | undefined): Promise<PageGoBackResult>;
+ goForward(params: PageGoForwardParams, signal: AbortSignal | undefined): Promise<PageGoForwardResult>;
+ requestGC(params: PageRequestGCParams, signal: AbortSignal | undefined): Promise<PageRequestGCResult>;
+ registerLocatorHandler(params: PageRegisterLocatorHandlerParams, signal: AbortSignal | undefined): Promise<PageRegisterLocatorHandlerResult>;
+ resolveLocatorHandlerNoReply(params: PageResolveLocatorHandlerNoReplyParams, signal: AbortSignal | undefined): Promise<PageResolveLocatorHandlerNoReplyResult>;
+ unregisterLocatorHandler(params: PageUnregisterLocatorHandlerParams, signal: AbortSignal | undefined): Promise<PageUnregisterLocatorHandlerResult>;
+ reload(params: PageReloadParams, signal: AbortSignal | undefined): Promise<PageReloadResult>;
+ expectScreenshot(params: PageExpectScreenshotParams, signal: AbortSignal | undefined): Promise<PageExpectScreenshotResult>;
+ screenshot(params: PageScreenshotParams, signal: AbortSignal | undefined): Promise<PageScreenshotResult>;
+ setExtraHTTPHeaders(params: PageSetExtraHTTPHeadersParams, signal: AbortSignal | undefined): Promise<PageSetExtraHTTPHeadersResult>;
+ setNetworkInterceptionPatterns(params: PageSetNetworkInterceptionPatternsParams, signal: AbortSignal | undefined): Promise<PageSetNetworkInterceptionPatternsResult>;
+ setWebSocketInterceptionPatterns(params: PageSetWebSocketInterceptionPatternsParams, signal: AbortSignal | undefined): Promise<PageSetWebSocketInterceptionPatternsResult>;
+ setViewportSize(params: PageSetViewportSizeParams, signal: AbortSignal | undefined): Promise<PageSetViewportSizeResult>;
+ keyboardDown(params: PageKeyboardDownParams, signal: AbortSignal | undefined): Promise<PageKeyboardDownResult>;
+ keyboardUp(params: PageKeyboardUpParams, signal: AbortSignal | undefined): Promise<PageKeyboardUpResult>;
+ keyboardInsertText(params: PageKeyboardInsertTextParams, signal: AbortSignal | undefined): Promise<PageKeyboardInsertTextResult>;
+ keyboardType(params: PageKeyboardTypeParams, signal: AbortSignal | undefined): Promise<PageKeyboardTypeResult>;
+ keyboardPress(params: PageKeyboardPressParams, signal: AbortSignal | undefined): Promise<PageKeyboardPressResult>;
+ mouseMove(params: PageMouseMoveParams, signal: AbortSignal | undefined): Promise<PageMouseMoveResult>;
+ mouseDown(params: PageMouseDownParams, signal: AbortSignal | undefined): Promise<PageMouseDownResult>;
+ mouseUp(params: PageMouseUpParams, signal: AbortSignal | undefined): Promise<PageMouseUpResult>;
+ mouseClick(params: PageMouseClickParams, signal: AbortSignal | undefined): Promise<PageMouseClickResult>;
+ mouseWheel(params: PageMouseWheelParams, signal: AbortSignal | undefined): Promise<PageMouseWheelResult>;
+ touchscreenTap(params: PageTouchscreenTapParams, signal: AbortSignal | undefined): Promise<PageTouchscreenTapResult>;
+ clearPageErrors(params: PageClearPageErrorsParams, signal: AbortSignal | undefined): Promise<PageClearPageErrorsResult>;
+ pageErrors(params: PagePageErrorsParams, signal: AbortSignal | undefined): Promise<PagePageErrorsResult>;
+ pdf(params: PagePdfParams, signal: AbortSignal | undefined): Promise<PagePdfResult>;
+ requests(params: PageRequestsParams, signal: AbortSignal | undefined): Promise<PageRequestsResult>;
+ startJSCoverage(params: PageStartJSCoverageParams, signal: AbortSignal | undefined): Promise<PageStartJSCoverageResult>;
+ stopJSCoverage(params: PageStopJSCoverageParams, signal: AbortSignal | undefined): Promise<PageStopJSCoverageResult>;
+ startCSSCoverage(params: PageStartCSSCoverageParams, signal: AbortSignal | undefined): Promise<PageStartCSSCoverageResult>;
+ stopCSSCoverage(params: PageStopCSSCoverageParams, signal: AbortSignal | undefined): Promise<PageStopCSSCoverageResult>;
+ bringToFront(params: PageBringToFrontParams, signal: AbortSignal | undefined): Promise<PageBringToFrontResult>;
+ pickLocator(params: PagePickLocatorParams, signal: AbortSignal | undefined): Promise<PagePickLocatorResult>;
+ cancelPickLocator(params: PageCancelPickLocatorParams, signal: AbortSignal | undefined): Promise<PageCancelPickLocatorResult>;
+ hideHighlight(params: PageHideHighlightParams, signal: AbortSignal | undefined): Promise<PageHideHighlightResult>;
+ screencastShowOverlay(params: PageScreencastShowOverlayParams, signal: AbortSignal | undefined): Promise<PageScreencastShowOverlayResult>;
+ screencastRemoveOverlay(params: PageScreencastRemoveOverlayParams, signal: AbortSignal | undefined): Promise<PageScreencastRemoveOverlayResult>;
+ screencastChapter(params: PageScreencastChapterParams, signal: AbortSignal | undefined): Promise<PageScreencastChapterResult>;
+ screencastSetOverlayVisible(params: PageScreencastSetOverlayVisibleParams, signal: AbortSignal | undefined): Promise<PageScreencastSetOverlayVisibleResult>;
+ screencastShowActions(params: PageScreencastShowActionsParams, signal: AbortSignal | undefined): Promise<PageScreencastShowActionsResult>;
+ screencastHideActions(params: PageScreencastHideActionsParams, signal: AbortSignal | undefined): Promise<PageScreencastHideActionsResult>;
+ screencastStart(params: PageScreencastStartParams, signal: AbortSignal | undefined): Promise<PageScreencastStartResult>;
+ screencastStop(params: PageScreencastStopParams, signal: AbortSignal | undefined): Promise<PageScreencastStopResult>;
+ updateSubscription(params: PageUpdateSubscriptionParams, signal: AbortSignal | undefined): Promise<PageUpdateSubscriptionResult>;
+ setDockTile(params: PageSetDockTileParams, signal: AbortSignal | undefined): Promise<PageSetDockTileResult>;
+ webStorageItems(params: PageWebStorageItemsParams, signal: AbortSignal | undefined): Promise<PageWebStorageItemsResult>;
+ webStorageGetItem(params: PageWebStorageGetItemParams, signal: AbortSignal | undefined): Promise<PageWebStorageGetItemResult>;
+ webStorageSetItem(params: PageWebStorageSetItemParams, signal: AbortSignal | undefined): Promise<PageWebStorageSetItemResult>;
+ webStorageRemoveItem(params: PageWebStorageRemoveItemParams, signal: AbortSignal | undefined): Promise<PageWebStorageRemoveItemResult>;
+ webStorageClear(params: PageWebStorageClearParams, signal: AbortSignal | undefined): Promise<PageWebStorageClearResult>;
}
export type PageBindingCallEvent = {
binding: BindingCallChannel,
@@ -4663,7 +4663,7 @@ export interface RootEventTarget {
}
export interface RootChannel extends RootEventTarget, Channel {
_type_Root: boolean;
- initialize(params: RootInitializeParams): Promise<RootInitializeResult>;
+ initialize(params: RootInitializeParams, signal: AbortSignal | undefined): Promise<RootInitializeResult>;
}
export type RootInitializeParams = {
sdkLanguage: SDKLanguage,
@@ -4694,7 +4694,7 @@ export interface PlaywrightEventTarget {
}
export interface PlaywrightChannel extends PlaywrightEventTarget, Channel {
_type_Playwright: boolean;
- newRequest(params: PlaywrightNewRequestParams): Promise<PlaywrightNewRequestResult>;
+ newRequest(params: PlaywrightNewRequestParams, signal: AbortSignal | undefined): Promise<PlaywrightNewRequestResult>;
}
export type PlaywrightNewRequestParams = {
baseURL?: string,
@@ -4778,13 +4778,13 @@ export interface DebugControllerEventTarget {
}
export interface DebugControllerChannel extends DebugControllerEventTarget, Channel {
_type_DebugController: boolean;
- initialize(params: DebugControllerInitializeParams): Promise<DebugControllerInitializeResult>;
- setReportStateChanged(params: DebugControllerSetReportStateChangedParams): Promise<DebugControllerSetReportStateChangedResult>;
- setRecorderMode(params: DebugControllerSetRecorderModeParams): Promise<DebugControllerSetRecorderModeResult>;
- highlight(params: DebugControllerHighlightParams): Promise<DebugControllerHighlightResult>;
- hideHighlight(params?: DebugControllerHideHighlightParams): Promise<DebugControllerHideHighlightResult>;
- resume(params?: DebugControllerResumeParams): Promise<DebugControllerResumeResult>;
- kill(params?: DebugControllerKillParams): Promise<DebugControllerKillResult>;
+ initialize(params: DebugControllerInitializeParams, signal: AbortSignal | undefined): Promise<DebugControllerInitializeResult>;
+ setReportStateChanged(params: DebugControllerSetReportStateChangedParams, signal: AbortSignal | undefined): Promise<DebugControllerSetReportStateChangedResult>;
+ setRecorderMode(params: DebugControllerSetRecorderModeParams, signal: AbortSignal | undefined): Promise<DebugControllerSetRecorderModeResult>;
+ highlight(params: DebugControllerHighlightParams, signal: AbortSignal | undefined): Promise<DebugControllerHighlightResult>;
+ hideHighlight(params: DebugControllerHideHighlightParams, signal: AbortSignal | undefined): Promise<DebugControllerHideHighlightResult>;
+ resume(params: DebugControllerResumeParams, signal: AbortSignal | undefined): Promise<DebugControllerResumeResult>;
+ kill(params: DebugControllerKillParams, signal: AbortSignal | undefined): Promise<DebugControllerKillResult>;
}
export type DebugControllerInspectRequestedEvent = {
selector: string,
@@ -4867,11 +4867,11 @@ export interface SocksSupportEventTarget {
}
export interface SocksSupportChannel extends SocksSupportEventTarget, Channel {
_type_SocksSupport: boolean;
- socksConnected(params: SocksSupportSocksConnectedParams): Promise<SocksSupportSocksConnectedResult>;
- socksFailed(params: SocksSupportSocksFailedParams): Promise<SocksSupportSocksFailedResult>;
- socksData(params: SocksSupportSocksDataParams): Promise<SocksSupportSocksDataResult>;
- socksError(params: SocksSupportSocksErrorParams): Promise<SocksSupportSocksErrorResult>;
- socksEnd(params: SocksSupportSocksEndParams): Promise<SocksSupportSocksEndResult>;
+ socksConnected(params: SocksSupportSocksConnectedParams, signal: AbortSignal | undefined): Promise<SocksSupportSocksConnectedResult>;
+ socksFailed(params: SocksSupportSocksFailedParams, signal: AbortSignal | undefined): Promise<SocksSupportSocksFailedResult>;
+ socksData(params: SocksSupportSocksDataParams, signal: AbortSignal | undefined): Promise<SocksSupportSocksDataResult>;
+ socksError(params: SocksSupportSocksErrorParams, signal: AbortSignal | undefined): Promise<SocksSupportSocksErrorResult>;
+ socksEnd(params: SocksSupportSocksEndParams, signal: AbortSignal | undefined): Promise<SocksSupportSocksEndResult>;
}
export type SocksSupportSocksRequestedEvent = {
uid: string,
@@ -4940,8 +4940,8 @@ export interface JsonPipeEventTarget {
}
export interface JsonPipeChannel extends JsonPipeEventTarget, Channel {
_type_JsonPipe: boolean;
- send(params: JsonPipeSendParams): Promise<JsonPipeSendResult>;
- close(params?: JsonPipeCloseParams): Promise<JsonPipeCloseResult>;
+ send(params: JsonPipeSendParams, signal: AbortSignal | undefined): Promise<JsonPipeSendResult>;
+ close(params: JsonPipeCloseParams, signal: AbortSignal | undefined): Promise<JsonPipeCloseResult>;
}
export type JsonPipeMessageEvent = {
message: any,
@@ -4973,8 +4973,8 @@ export interface CDPSessionEventTarget {
}
export interface CDPSessionChannel extends CDPSessionEventTarget, Channel {
_type_CDPSession: boolean;
- send(params: CDPSessionSendParams): Promise<CDPSessionSendResult>;
- detach(params?: CDPSessionDetachParams): Promise<CDPSessionDetachResult>;
+ send(params: CDPSessionSendParams, signal: AbortSignal | undefined): Promise<CDPSessionSendResult>;
+ detach(params: CDPSessionDetachParams, signal: AbortSignal | undefined): Promise<CDPSessionDetachResult>;
}
export type CDPSessionEventEvent = {
method: string,
@@ -5010,8 +5010,8 @@ export interface BindingCallEventTarget {
}
export interface BindingCallChannel extends BindingCallEventTarget, Channel {
_type_BindingCall: boolean;
- reject(params: BindingCallRejectParams): Promise<BindingCallRejectResult>;
- resolve(params: BindingCallResolveParams): Promise<BindingCallResolveResult>;
+ reject(params: BindingCallRejectParams, signal: AbortSignal | undefined): Promise<BindingCallRejectResult>;
+ resolve(params: BindingCallResolveParams, signal: AbortSignal | undefined): Promise<BindingCallResolveResult>;
}
export type BindingCallRejectParams = {
error: SerializedError,
@@ -5038,10 +5038,10 @@ export interface DebuggerEventTarget {
}
export interface DebuggerChannel extends DebuggerEventTarget, Channel {
_type_Debugger: boolean;
- requestPause(params?: DebuggerRequestPauseParams): Promise<DebuggerRequestPauseResult>;
- resume(params?: DebuggerResumeParams): Promise<DebuggerResumeResult>;
- next(params?: DebuggerNextParams): Promise<DebuggerNextResult>;
- runTo(params: DebuggerRunToParams): Promise<DebuggerRunToResult>;
+ requestPause(params: DebuggerRequestPauseParams, signal: AbortSignal | undefined): Promise<DebuggerRequestPauseResult>;
+ resume(params: DebuggerResumeParams, signal: AbortSignal | undefined): Promise<DebuggerResumeResult>;
+ next(params: DebuggerNextParams, signal: AbortSignal | undefined): Promise<DebuggerNextResult>;
+ runTo(params: DebuggerRunToParams, signal: AbortSignal | undefined): Promise<DebuggerRunToResult>;
}
export type DebuggerPausedStateChangedEvent = {
pausedDetails?: {
@@ -5090,8 +5090,8 @@ export interface DialogEventTarget {
}
export interface DialogChannel extends DialogEventTarget, Channel {
_type_Dialog: boolean;
- accept(params: DialogAcceptParams): Promise<DialogAcceptResult>;
- dismiss(params?: DialogDismissParams): Promise<DialogDismissResult>;
+ accept(params: DialogAcceptParams, signal: AbortSignal | undefined): Promise<DialogAcceptResult>;
+ dismiss(params: DialogDismissParams, signal: AbortSignal | undefined): Promise<DialogDismissResult>;
}
export type DialogAcceptParams = {
promptText?: string,
@@ -5113,14 +5113,14 @@ export interface TracingEventTarget {
}
export interface TracingChannel extends TracingEventTarget, Channel {
_type_Tracing: boolean;
- tracingStart(params: TracingTracingStartParams): Promise<TracingTracingStartResult>;
- tracingStartChunk(params: TracingTracingStartChunkParams): Promise<TracingTracingStartChunkResult>;
- tracingGroup(params: TracingTracingGroupParams): Promise<TracingTracingGroupResult>;
- tracingGroupEnd(params?: TracingTracingGroupEndParams): Promise<TracingTracingGroupEndResult>;
- tracingStopChunk(params: TracingTracingStopChunkParams): Promise<TracingTracingStopChunkResult>;
- tracingStop(params?: TracingTracingStopParams): Promise<TracingTracingStopResult>;
- harStart(params: TracingHarStartParams): Promise<TracingHarStartResult>;
- harExport(params: TracingHarExportParams): Promise<TracingHarExportResult>;
+ tracingStart(params: TracingTracingStartParams, signal: AbortSignal | undefined): Promise<TracingTracingStartResult>;
+ tracingStartChunk(params: TracingTracingStartChunkParams, signal: AbortSignal | undefined): Promise<TracingTracingStartChunkResult>;
+ tracingGroup(params: TracingTracingGroupParams, signal: AbortSignal | undefined): Promise<TracingTracingGroupResult>;
+ tracingGroupEnd(params: TracingTracingGroupEndParams, signal: AbortSignal | undefined): Promise<TracingTracingGroupEndResult>;
+ tracingStopChunk(params: TracingTracingStopChunkParams, signal: AbortSignal | undefined): Promise<TracingTracingStopChunkResult>;
+ tracingStop(params: TracingTracingStopParams, signal: AbortSignal | undefined): Promise<TracingTracingStopResult>;
+ harStart(params: TracingHarStartParams, signal: AbortSignal | undefined): Promise<TracingHarStartResult>;
+ harExport(params: TracingHarExportParams, signal: AbortSignal | undefined): Promise<TracingHarExportResult>;
}
export type TracingTracingStartParams = {
name?: string,
@@ -5213,10 +5213,10 @@ export interface WorkerEventTarget {
}
export interface WorkerChannel extends WorkerEventTarget, Channel {
_type_Worker: boolean;
- disconnect(params: WorkerDisconnectParams): Promise<WorkerDisconnectResult>;
- evaluateExpression(params: WorkerEvaluateExpressionParams): Promise<WorkerEvaluateExpressionResult>;
- evaluateExpressionHandle(params: WorkerEvaluateExpressionHandleParams): Promise<WorkerEvaluateExpressionHandleResult>;
- updateSubscription(params: WorkerUpdateSubscriptionParams): Promise<WorkerUpdateSubscriptionResult>;
+ disconnect(params: WorkerDisconnectParams, signal: AbortSignal | undefined): Promise<WorkerDisconnectResult>;
+ evaluateExpression(params: WorkerEvaluateExpressionParams, signal: AbortSignal | undefined): Promise<WorkerEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: WorkerEvaluateExpressionHandleParams, signal: AbortSignal | undefined): Promise<WorkerEvaluateExpressionHandleResult>;
+ updateSubscription(params: WorkerUpdateSubscriptionParams, signal: AbortSignal | undefined): Promise<WorkerUpdateSubscriptionResult>;
}
export type WorkerConsoleEvent = {
type: string,
diff --git a/packages/playwright-core/src/client/clock.ts b/packages/playwright-core/src/client/clock.ts
index fdc7789b59..6fa6074110 100644
--- a/packages/playwright-core/src/client/clock.ts
+++ b/packages/playwright-core/src/client/clock.ts
@@ -25,31 +25,31 @@ export class Clock implements api.Clock {
}
async install(options: { time?: number | string | Date } = { }) {
- await this._browserContext._channel.clockInstall(options.time !== undefined ? parseTime(options.time) : {});
+ await this._browserContext._channel.clockInstall({ ...(options.time !== undefined ? parseTime(options.time) : {}) }, undefined);
}
async fastForward(ticks: number | string) {
- await this._browserContext._channel.clockFastForward(parseTicks(ticks));
+ await this._browserContext._channel.clockFastForward({ ...parseTicks(ticks) }, undefined);
}
async pauseAt(time: number | string | Date) {
- await this._browserContext._channel.clockPauseAt(parseTime(time));
+ await this._browserContext._channel.clockPauseAt({ ...parseTime(time) }, undefined);
}
async resume() {
- await this._browserContext._channel.clockResume({});
+ await this._browserContext._channel.clockResume({}, undefined);
}
async runFor(ticks: number | string) {
- await this._browserContext._channel.clockRunFor(parseTicks(ticks));
+ await this._browserContext._channel.clockRunFor({ ...parseTicks(ticks) }, undefined);
}
async setFixedTime(time: string | number | Date) {
- await this._browserContext._channel.clockSetFixedTime(parseTime(time));
+ await this._browserContext._channel.clockSetFixedTime({ ...parseTime(time) }, undefined);
}
async setSystemTime(time: string | number | Date) {
- await this._browserContext._channel.clockSetSystemTime(parseTime(time));
+ await this._browserContext._channel.clockSetSystemTime({ ...parseTime(time) }, undefined);
}
}
diff --git a/packages/playwright-core/src/client/connect.ts b/packages/playwright-core/src/client/connect.ts
index 52003a4ef0..6f06c320f2 100644
--- a/packages/playwright-core/src/client/connect.ts
+++ b/packages/playwright-core/src/client/connect.ts
@@ -116,13 +116,13 @@ class JsonPipeTransport implements Transport {
}
async connect(params: channels.LocalUtilsConnectParams) {
- const { pipe, headers: connectHeaders } = await this._owner._channel.connect(params);
+ const { pipe, headers: connectHeaders } = await this._owner._channel.connect(params, undefined);
this._pipe = pipe;
return connectHeaders;
}
async send(message: object) {
- await this._pipe!.send({ message });
+ await this._pipe!.send({ message }, undefined);
}
onMessage(callback: (message: object) => void) {
@@ -134,7 +134,7 @@ class JsonPipeTransport implements Transport {
}
async close() {
- await this._pipe!.close().catch(() => {});
+ await this._pipe!.close({}, undefined).catch(() => {});
}
}
diff --git a/packages/playwright-core/src/client/connection.ts b/packages/playwright-core/src/client/connection.ts
index ffd36db81f..064195471f 100644
--- a/packages/playwright-core/src/client/connection.ts
+++ b/packages/playwright-core/src/client/connection.ts
@@ -33,7 +33,7 @@ import { Dialog } from './dialog';
import { DisposableObject } from './disposable';
import { Electron, ElectronApplication } from './electron';
import { ElementHandle } from './elementHandle';
-import { TargetClosedError, parseError } from './errors';
+import { AbortError, TargetClosedError, parseError } from './errors';
import { APIRequestContext } from './fetch';
import { Frame } from './frame';
import { JSHandle } from './jsHandle';
@@ -60,7 +60,7 @@ class Root extends ChannelOwner<channels.RootChannel> {
async initialize(): Promise<Playwright> {
return Playwright.from((await this._channel.initialize({
sdkLanguage: 'javascript',
- })).playwright);
+ }, undefined)).playwright);
}
}
@@ -73,7 +73,7 @@ export class Connection extends EventEmitter {
readonly _objects = new Map<string, ChannelOwner>();
onmessage = (message: object): void => {};
private _lastId = 0;
- private _callbacks = new Map<number, { resolve: (a: any) => void, reject: (a: Error) => void, title: string | undefined, type: string, method: string }>();
+ private _callbacks = new Map<number, { resolve: (a: any) => void, reject: (a: Error) => void, signal: AbortSignal | undefined, title: string | undefined, type: string, method: string }>();
private _rootObject: Root;
private _closedError: Error | undefined;
private _isRemote = false;
@@ -174,7 +174,7 @@ export class Connection extends EventEmitter {
this._tracingCount--;
}
- async sendMessageToServer(object: ChannelOwner, method: string, params: any, options: { apiName?: string, title?: string, internal?: boolean, frames?: channels.StackFrame[], stepId?: string }): Promise<any> {
+ async sendMessageToServer(object: ChannelOwner, method: string, params: any, options: { apiName?: string, title?: string, internal?: boolean, frames?: channels.StackFrame[], stepId?: string, signal?: AbortSignal }): Promise<any> {
// Fire-and-forget: server intentionally never replies to __waitInfo__,
// so silently drop it after the connection is closed or the object was collected.
if (method === '__waitInfo__' && (this._closedError || object._wasCollected))
@@ -184,6 +184,10 @@ export class Connection extends EventEmitter {
if (object._wasCollected)
throw new Error('The object has been collected to prevent unbounded heap growth.');
+ const signal = options.signal;
+ if (signal?.aborted)
+ throw new AbortError(undefined, { cause: signal.reason });
+
const guid = object._guid;
const type = object._type;
const id = ++this._lastId;
@@ -202,7 +206,20 @@ export class Connection extends EventEmitter {
// Fire-and-forget: server intentionally never replies to __waitInfo__.
if (method === '__waitInfo__')
return;
- return await new Promise((resolve, reject) => this._callbacks.set(id, { resolve, reject, title: options.title, type, method }));
+ let abortListener: (() => void) | undefined;
+ if (signal) {
+ abortListener = () => {
+ const reason = signal.reason instanceof Error ? signal.reason.message : String(signal.reason);
+ emptyZone.run(() => this.onmessage({ guid, method: '__abort__', params: { id, reason } }));
+ };
+ signal.addEventListener('abort', abortListener, { once: true });
+ }
+ try {
+ return await new Promise((resolve, reject) => this._callbacks.set(id, { resolve, reject, signal, title: options.title, type, method }));
+ } finally {
+ if (abortListener)
+ signal!.removeEventListener('abort', abortListener);
+ }
}
private _validatorFromWireContext(): ValidatorContext {
@@ -227,6 +244,8 @@ export class Connection extends EventEmitter {
this._callbacks.delete(id);
if (error && !result) {
const parsedError = parseError(error);
+ if (callback.signal?.aborted && parsedError instanceof AbortError)
+ parsedError.cause = callback.signal.reason;
parsedError.log = log || [];
rewriteErrorMessage(parsedError, parsedError.message + formatCallLog(log));
const detailsValidator = maybeFindValidator(callback.type, callback.method, 'ErrorDetails');
diff --git a/packages/playwright-core/src/client/coverage.ts b/packages/playwright-core/src/client/coverage.ts
index 5251ef9f65..0ce0bb2348 100644
--- a/packages/playwright-core/src/client/coverage.ts
+++ b/packages/playwright-core/src/client/coverage.ts
@@ -25,18 +25,18 @@ export class Coverage implements api.Coverage {
}
async startJSCoverage(options: channels.PageStartJSCoverageOptions = {}) {
- await this._channel.startJSCoverage(options);
+ await this._channel.startJSCoverage(options, undefined);
}
async stopJSCoverage(): Promise<channels.PageStopJSCoverageResult['entries']> {
- return (await this._channel.stopJSCoverage()).entries;
+ return (await this._channel.stopJSCoverage({}, undefined)).entries;
}
async startCSSCoverage(options: channels.PageStartCSSCoverageOptions = {}) {
- await this._channel.startCSSCoverage(options);
+ await this._channel.startCSSCoverage(options, undefined);
}
async stopCSSCoverage(): Promise<channels.PageStopCSSCoverageResult['entries']> {
- return (await this._channel.stopCSSCoverage()).entries;
+ return (await this._channel.stopCSSCoverage({}, undefined)).entries;
}
}
diff --git a/packages/playwright-core/src/client/credentials.ts b/packages/playwright-core/src/client/credentials.ts
index 81b3d68986..e46c36bdba 100644
--- a/packages/playwright-core/src/client/credentials.ts
+++ b/packages/playwright-core/src/client/credentials.ts
@@ -26,20 +26,20 @@ export class Credentials implements api.Credentials {
}
async install(): Promise<void> {
- await this._browserContext._channel.credentialsInstall({});
+ await this._browserContext._channel.credentialsInstall({}, undefined);
}
async create(rpId: string, options: Omit<channels.BrowserContextCredentialsCreateParams, 'rpId'> = {}): Promise<channels.VirtualCredential> {
- const { credential } = await this._browserContext._channel.credentialsCreate({ ...options, rpId });
+ const { credential } = await this._browserContext._channel.credentialsCreate({ ...options, rpId }, undefined);
return credential;
}
async get(options: channels.BrowserContextCredentialsGetParams = {}): Promise<channels.VirtualCredential[]> {
- const { credentials } = await this._browserContext._channel.credentialsGet(options);
+ const { credentials } = await this._browserContext._channel.credentialsGet(options, undefined);
return credentials;
}
async delete(id: string): Promise<void> {
- await this._browserContext._channel.credentialsDelete({ id });
+ await this._browserContext._channel.credentialsDelete({ id }, undefined);
}
}
diff --git a/packages/playwright-core/src/client/debugger.ts b/packages/playwright-core/src/client/debugger.ts
index 55fb8a6639..c61d7e6cbc 100644
--- a/packages/playwright-core/src/client/debugger.ts
+++ b/packages/playwright-core/src/client/debugger.ts
@@ -38,19 +38,19 @@ export class Debugger extends ChannelOwner<channels.DebuggerChannel> implements
}
async requestPause(): Promise<void> {
- await this._channel.requestPause();
+ await this._channel.requestPause({}, undefined);
}
async resume(): Promise<void> {
- await this._channel.resume();
+ await this._channel.resume({}, undefined);
}
async next(): Promise<void> {
- await this._channel.next();
+ await this._channel.next({}, undefined);
}
async runTo(location: { file: string, line?: number, column?: number }): Promise<void> {
- await this._channel.runTo({ location });
+ await this._channel.runTo({ location }, undefined);
}
pausedDetails(): PausedDetails | null {
diff --git a/packages/playwright-core/src/client/dialog.ts b/packages/playwright-core/src/client/dialog.ts
index dd38c1ff6d..d169a46b6a 100644
--- a/packages/playwright-core/src/client/dialog.ts
+++ b/packages/playwright-core/src/client/dialog.ts
@@ -53,12 +53,12 @@ export class Dialog extends ChannelOwner<channels.DialogChannel> implements api.
}
async accept(promptText: string | undefined) {
- await this._channel.accept({ promptText });
+ await this._channel.accept({ promptText }, undefined);
}
async dismiss() {
try {
- await this._channel.dismiss();
+ await this._channel.dismiss({}, undefined);
} catch (e) {
if (isTargetClosedError(e))
return;
diff --git a/packages/playwright-core/src/client/disposable.ts b/packages/playwright-core/src/client/disposable.ts
index 129eae1b2c..061de9bc57 100644
--- a/packages/playwright-core/src/client/disposable.ts
+++ b/packages/playwright-core/src/client/disposable.ts
@@ -34,7 +34,7 @@ export class DisposableObject<T extends channels.DisposableChannel = channels.Di
async dispose() {
try {
- await this._channel.dispose();
+ await this._channel.dispose({}, undefined);
} catch (e) {
if (isTargetClosedError(e))
return;
diff --git a/packages/playwright-core/src/client/electron.ts b/packages/playwright-core/src/client/electron.ts
index 01af87aa2a..81ec6c1cdc 100644
--- a/packages/playwright-core/src/client/electron.ts
+++ b/packages/playwright-core/src/client/electron.ts
@@ -64,7 +64,7 @@ export class Electron extends ChannelOwner<channels.ElectronChannel> implements
artifactsDir: options.artifactsDir,
timeout: new TimeoutSettings().launchTimeout(options),
};
- const app = ElectronApplication.from((await this._channel.launch(params)).electronApplication);
+ const app = ElectronApplication.from((await this._channel.launch(params, undefined)).electronApplication);
this._playwright.selectors._contextsForSelectors.add(app._context);
app.once(Events.ElectronApplication.Close, () => this._playwright.selectors._contextsForSelectors.delete(app._context));
await app._context._initializeHarFromOptions(options.recordHar);
@@ -155,17 +155,17 @@ export class ElectronApplication extends ChannelOwner<channels.ElectronApplicati
}
async browserWindow(page: Page): Promise<JSHandle<BrowserWindow>> {
- const result = await this._channel.browserWindow({ page: page._channel });
+ const result = await this._channel.browserWindow({ page: page._channel }, undefined);
return JSHandle.from(result.handle);
}
async evaluate<R, Arg>(pageFunction: structs.PageFunctionOn<ElectronAppType, Arg, R>, arg: Arg): Promise<R> {
- const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async evaluateHandle<R, Arg>(pageFunction: structs.PageFunctionOn<ElectronAppType, Arg, R>, arg: Arg): Promise<structs.SmartHandle<R>> {
- const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return JSHandle.from(result.handle) as any as structs.SmartHandle<R>;
}
}
diff --git a/packages/playwright-core/src/client/elementHandle.ts b/packages/playwright-core/src/client/elementHandle.ts
index d75d64366e..effa91c589 100644
--- a/packages/playwright-core/src/client/elementHandle.ts
+++ b/packages/playwright-core/src/client/elementHandle.ts
@@ -57,94 +57,94 @@ export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements
}
async ownerFrame(): Promise<Frame | null> {
- return Frame.fromNullable((await this._elementChannel.ownerFrame()).frame);
+ return Frame.fromNullable((await this._elementChannel.ownerFrame({}, undefined)).frame);
}
async contentFrame(): Promise<Frame | null> {
- return Frame.fromNullable((await this._elementChannel.contentFrame()).frame);
+ return Frame.fromNullable((await this._elementChannel.contentFrame({}, undefined)).frame);
}
async getAttribute(name: string): Promise<string | null> {
- const value = (await this._elementChannel.getAttribute({ name })).value;
+ const value = (await this._elementChannel.getAttribute({ name }, undefined)).value;
return value === undefined ? null : value;
}
async inputValue(): Promise<string> {
- return (await this._elementChannel.inputValue()).value;
+ return (await this._elementChannel.inputValue({}, undefined)).value;
}
async textContent(): Promise<string | null> {
- const value = (await this._elementChannel.textContent()).value;
+ const value = (await this._elementChannel.textContent({}, undefined)).value;
return value === undefined ? null : value;
}
async innerText(): Promise<string> {
- return (await this._elementChannel.innerText()).value;
+ return (await this._elementChannel.innerText({}, undefined)).value;
}
async innerHTML(): Promise<string> {
- return (await this._elementChannel.innerHTML()).value;
+ return (await this._elementChannel.innerHTML({}, undefined)).value;
}
async isChecked(): Promise<boolean> {
- return (await this._elementChannel.isChecked()).value;
+ return (await this._elementChannel.isChecked({}, undefined)).value;
}
async isDisabled(): Promise<boolean> {
- return (await this._elementChannel.isDisabled()).value;
+ return (await this._elementChannel.isDisabled({}, undefined)).value;
}
async isEditable(): Promise<boolean> {
- return (await this._elementChannel.isEditable()).value;
+ return (await this._elementChannel.isEditable({}, undefined)).value;
}
async isEnabled(): Promise<boolean> {
- return (await this._elementChannel.isEnabled()).value;
+ return (await this._elementChannel.isEnabled({}, undefined)).value;
}
async isHidden(): Promise<boolean> {
- return (await this._elementChannel.isHidden()).value;
+ return (await this._elementChannel.isHidden({}, undefined)).value;
}
async isVisible(): Promise<boolean> {
- return (await this._elementChannel.isVisible()).value;
+ return (await this._elementChannel.isVisible({}, undefined)).value;
}
async dispatchEvent(type: string, eventInit: Object = {}) {
- await this._elementChannel.dispatchEvent({ type, eventInit: serializeArgument(eventInit) });
+ await this._elementChannel.dispatchEvent({ type, eventInit: serializeArgument(eventInit) }, undefined);
}
async scrollIntoViewIfNeeded(options: channels.ElementHandleScrollIntoViewIfNeededOptions & TimeoutOptions = {}) {
- await this._elementChannel.scrollIntoViewIfNeeded({ ...options, timeout: this._frame._timeout(options) });
+ await this._elementChannel.scrollIntoViewIfNeeded({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async hover(options: channels.ElementHandleHoverOptions & TimeoutOptions = {}): Promise<void> {
- await this._elementChannel.hover({ ...options, timeout: this._frame._timeout(options) });
+ await this._elementChannel.hover({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async click(options: channels.ElementHandleClickOptions & TimeoutOptions = {}): Promise<void> {
- return await this._elementChannel.click({ ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.click({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async dblclick(options: channels.ElementHandleDblclickOptions & TimeoutOptions = {}): Promise<void> {
- return await this._elementChannel.dblclick({ ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.dblclick({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async tap(options: channels.ElementHandleTapOptions & TimeoutOptions = {}): Promise<void> {
- return await this._elementChannel.tap({ ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.tap({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async selectOption(values: string | api.ElementHandle | SelectOption | string[] | api.ElementHandle[] | SelectOption[] | null, options: SelectOptionOptions = {}): Promise<string[]> {
- const result = await this._elementChannel.selectOption({ ...convertSelectOptionValues(values), ...options, timeout: this._frame._timeout(options) });
+ const result = await this._elementChannel.selectOption({ ...convertSelectOptionValues(values), ...options, timeout: this._frame._timeout(options) }, options.signal);
return result.values;
}
async fill(value: string, options: channels.ElementHandleFillOptions & TimeoutOptions = {}): Promise<void> {
- return await this._elementChannel.fill({ value, ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.fill({ value, ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async selectText(options: channels.ElementHandleSelectTextOptions & TimeoutOptions = {}): Promise<void> {
- await this._elementChannel.selectText({ ...options, timeout: this._frame._timeout(options) });
+ await this._elementChannel.selectText({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async setInputFiles(files: string | FilePayload | string[] | FilePayload[], options: channels.ElementHandleSetInputFilesOptions & TimeoutOptions = {}) {
@@ -152,27 +152,27 @@ export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements
if (!frame)
throw new Error('Cannot set input files to detached element');
const converted = await convertInputFiles(files, frame.page().context());
- await this._elementChannel.setInputFiles({ ...converted, ...options, timeout: this._frame._timeout(options) });
+ await this._elementChannel.setInputFiles({ ...converted, ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async focus(): Promise<void> {
- await this._elementChannel.focus();
+ await this._elementChannel.focus({}, undefined);
}
async type(text: string, options: channels.ElementHandleTypeOptions & TimeoutOptions = {}): Promise<void> {
- await this._elementChannel.type({ text, ...options, timeout: this._frame._timeout(options) });
+ await this._elementChannel.type({ text, ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async press(key: string, options: channels.ElementHandlePressOptions & TimeoutOptions = {}): Promise<void> {
- await this._elementChannel.press({ key, ...options, timeout: this._frame._timeout(options) });
+ await this._elementChannel.press({ key, ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async check(options: channels.ElementHandleCheckOptions & TimeoutOptions = {}) {
- return await this._elementChannel.check({ ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.check({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async uncheck(options: channels.ElementHandleUncheckOptions & TimeoutOptions = {}) {
- return await this._elementChannel.uncheck({ ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.uncheck({ ...options, timeout: this._frame._timeout(options) }, options.signal);
}
async setChecked(checked: boolean, options?: channels.ElementHandleCheckOptions) {
@@ -183,7 +183,7 @@ export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements
}
async boundingBox(): Promise<Rect | null> {
- const value = (await this._elementChannel.boundingBox()).value;
+ const value = (await this._elementChannel.boundingBox({}, undefined)).value;
return value === undefined ? null : value;
}
@@ -198,7 +198,7 @@ export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements
selector: locator._selector,
}));
}
- const result = await this._elementChannel.screenshot(copy);
+ const result = await this._elementChannel.screenshot(copy, options.signal);
if (options.path) {
await mkdirIfNeeded(options.path);
await fs.promises.writeFile(options.path, result.binary);
@@ -207,32 +207,32 @@ export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements
}
async $(selector: string): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
- return ElementHandle.fromNullable((await this._elementChannel.querySelector({ selector })).element) as ElementHandle<SVGElement | HTMLElement> | null;
+ return ElementHandle.fromNullable((await this._elementChannel.querySelector({ selector }, undefined)).element) as ElementHandle<SVGElement | HTMLElement> | null;
}
async $$(selector: string): Promise<ElementHandle<SVGElement | HTMLElement>[]> {
- const result = await this._elementChannel.querySelectorAll({ selector });
+ const result = await this._elementChannel.querySelectorAll({ selector }, undefined);
return result.elements.map(h => ElementHandle.from(h) as ElementHandle<SVGElement | HTMLElement>);
}
async $eval<R, Arg>(selector: string, pageFunction: structs.PageFunctionOn<Element, Arg, R>, arg?: Arg): Promise<R> {
- const result = await this._elementChannel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._elementChannel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async $$eval<R, Arg>(selector: string, pageFunction: structs.PageFunctionOn<Element[], Arg, R>, arg?: Arg): Promise<R> {
- const result = await this._elementChannel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._elementChannel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async waitForElementState(state: 'visible' | 'hidden' | 'stable' | 'enabled' | 'disabled', options: TimeoutOptions = {}): Promise<void> {
- return await this._elementChannel.waitForElementState({ state, ...options, timeout: this._frame._timeout(options) });
+ return await this._elementChannel.waitForElementState({ state, ...options, timeout: this._frame._timeout(options) }, options.signal);
}
waitForSelector(selector: string, options: channels.ElementHandleWaitForSelectorOptions & TimeoutOptions & { state: 'attached' | 'visible' }): Promise<ElementHandle<SVGElement | HTMLElement>>;
waitForSelector(selector: string, options?: channels.ElementHandleWaitForSelectorOptions & TimeoutOptions): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
async waitForSelector(selector: string, options: channels.ElementHandleWaitForSelectorOptions & TimeoutOptions = {}): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
- const result = await this._elementChannel.waitForSelector({ selector, ...options, timeout: this._frame._timeout(options) });
+ const result = await this._elementChannel.waitForSelector({ selector, ...options, timeout: this._frame._timeout(options) }, options.signal);
return ElementHandle.fromNullable(result.element) as ElementHandle<SVGElement | HTMLElement> | null;
}
}
@@ -298,7 +298,7 @@ export async function convertInputFiles(files: string | FilePayload | string[] |
lastModifiedMs
};
})),
- }), { internal: true });
+ }, undefined), { internal: true });
for (let i = 0; i < files.length; i++) {
const writable = WritableStream.from(writableStreams[i]);
await stream.promises.pipeline(fs.createReadStream(files[i]), writable.stream());
diff --git a/packages/playwright-core/src/client/errors.ts b/packages/playwright-core/src/client/errors.ts
index 92169c09d4..0ef84ee489 100644
--- a/packages/playwright-core/src/client/errors.ts
+++ b/packages/playwright-core/src/client/errors.ts
@@ -37,6 +37,14 @@ export class TargetClosedError extends PlaywrightError {
}
}
+// mirrors https://github.com/nodejs/node/blob/4e7c07dfe2b253393702545c0ffe2712b21fd3dd/lib/internal/errors.js#L976-L988
+export class AbortError extends PlaywrightError {
+ constructor(message = 'The operation was aborted', options?: ErrorOptions) {
+ super(message, options);
+ this.name = 'AbortError';
+ }
+}
+
export function isTargetClosedError(error: Error) {
return error instanceof TargetClosedError;
}
@@ -58,6 +66,8 @@ export function parseError(error: SerializedError): PlaywrightError {
e = new TimeoutError(error.error.message);
else if (error.error.name === 'TargetClosedError')
e = new TargetClosedError(error.error.message);
+ else if (error.error.name === 'AbortError')
+ e = new AbortError(error.error.message);
else
e = Object.assign(new PlaywrightError(error.error.message), { name: error.error.name });
e.stack = error.error.stack || '';
diff --git a/packages/playwright-core/src/client/fetch.ts b/packages/playwright-core/src/client/fetch.ts
index dd061e5848..6439951aa4 100644
--- a/packages/playwright-core/src/client/fetch.ts
+++ b/packages/playwright-core/src/client/fetch.ts
@@ -78,7 +78,7 @@ export class APIRequest implements api.APIRequest {
storageState,
tracesDir: this._playwright._defaultLaunchOptions?.tracesDir, // We do not expose tracesDir in the API, so do not allow options to accidentally override it.
clientCertificates: await toClientCertificatesProtocol(options.clientCertificates),
- })).request);
+ }, options.signal)).request);
this._contexts.add(context);
context._request = this;
context._timeoutSettings.setDefaultTimeout(options.timeout ?? this._playwright._defaultContextTimeout);
@@ -113,7 +113,7 @@ export class APIRequestContext extends ChannelOwner<channels.APIRequestContextCh
await this._instrumentation.runBeforeCloseRequestContext(this);
await this.tracing._exportAllHars();
try {
- await this._channel.dispose(options);
+ await this._channel.dispose(options, undefined);
} catch (e) {
if (isTargetClosedError(e))
return;
@@ -260,13 +260,13 @@ export class APIRequestContext extends ChannelOwner<channels.APIRequestContextCh
maxRedirects: options.maxRedirects,
maxRetries: options.maxRetries,
...fixtures
- });
+ }, undefined);
return new APIResponse(this, result.response);
});
}
async storageState(options: { path?: string, indexedDB?: boolean } = {}): Promise<StorageState> {
- const state = await this._channel.storageState({ indexedDB: options.indexedDB });
+ const state = await this._channel.storageState({ indexedDB: options.indexedDB }, undefined);
if (options.path) {
await mkdirIfNeeded(options.path);
await fs.promises.writeFile(options.path, JSON.stringify(state, undefined, 2), 'utf8');
@@ -353,7 +353,7 @@ export class APIResponse implements api.APIResponse {
async body(): Promise<Buffer> {
return await this._request._wrapApiCall(async () => {
try {
- const result = await this._request._channel.fetchResponseBody({ fetchUid: this._fetchUid() });
+ const result = await this._request._channel.fetchResponseBody({ fetchUid: this._fetchUid() }, undefined);
if (result.binary === undefined)
throw new Error('Response has been disposed');
return result.binary;
@@ -380,7 +380,7 @@ export class APIResponse implements api.APIResponse {
}
async dispose(): Promise<void> {
- await this._request._channel.disposeAPIResponse({ fetchUid: this._fetchUid() });
+ await this._request._channel.disposeAPIResponse({ fetchUid: this._fetchUid() }, undefined);
}
private _inspect() {
@@ -393,7 +393,7 @@ export class APIResponse implements api.APIResponse {
}
async _fetchLog(): Promise<string[]> {
- const { log } = await this._request._channel.fetchLog({ fetchUid: this._fetchUid() });
+ const { log } = await this._request._channel.fetchLog({ fetchUid: this._fetchUid() }, undefined);
return log;
}
}
diff --git a/packages/playwright-core/src/client/frame.ts b/packages/playwright-core/src/client/frame.ts
index b941d665bc..cccf10172a 100644
--- a/packages/playwright-core/src/client/frame.ts
+++ b/packages/playwright-core/src/client/frame.ts
@@ -118,7 +118,7 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
async goto(url: string, options: channels.FrameGotoOptions & TimeoutOptions = {}): Promise<network.Response | null> {
const waitUntil = verifyLoadState('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil);
- return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);
+ return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) }, options.signal)).response);
}
private _setupNavigationWaiter(options: TimeoutOptions): Waiter {
@@ -194,29 +194,29 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
}
async frameElement(): Promise<ElementHandle> {
- return ElementHandle.from((await this._channel.frameElement()).element);
+ return ElementHandle.from((await this._channel.frameElement({}, undefined)).element);
}
async evaluateHandle<R, Arg>(pageFunction: structs.PageFunction<Arg, R>, arg?: Arg): Promise<structs.SmartHandle<R>> {
assertMaxArguments(arguments.length, 2);
- const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return JSHandle.from(result.handle) as any as structs.SmartHandle<R>;
}
async evaluate<R, Arg>(pageFunction: structs.PageFunction<Arg, R>, arg?: Arg): Promise<R> {
assertMaxArguments(arguments.length, 2);
- const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async _evaluateExposeUtilityScript<R, Arg>(pageFunction: structs.PageFunction<Arg, R>, arg?: Arg): Promise<R> {
assertMaxArguments(arguments.length, 2);
- const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async $(selector: string, options?: { strict?: boolean }): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
- const result = await this._channel.querySelector({ selector, ...options });
+ const result = await this._channel.querySelector({ selector, ...options }, undefined);
return ElementHandle.fromNullable(result.element) as ElementHandle<SVGElement | HTMLElement> | null;
}
@@ -227,42 +227,42 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
throw new Error('options.visibility is not supported, did you mean options.state?');
if ((options as any).waitFor && (options as any).waitFor !== 'visible')
throw new Error('options.waitFor is not supported, did you mean options.state?');
- const result = await this._channel.waitForSelector({ selector, ...options, timeout: this._timeout(options) });
+ const result = await this._channel.waitForSelector({ selector, ...options, timeout: this._timeout(options) }, options.signal);
return ElementHandle.fromNullable(result.element) as ElementHandle<SVGElement | HTMLElement> | null;
}
async dispatchEvent(selector: string, type: string, eventInit?: any, options: channels.FrameDispatchEventOptions & TimeoutOptions = {}): Promise<void> {
- await this._channel.dispatchEvent({ selector, type, eventInit: serializeArgument(eventInit), ...options, timeout: this._timeout(options) });
+ await this._channel.dispatchEvent({ selector, type, eventInit: serializeArgument(eventInit), ...options, timeout: this._timeout(options) }, options.signal);
}
async $eval<R, Arg>(selector: string, pageFunction: structs.PageFunctionOn<Element, Arg, R>, arg?: Arg): Promise<R> {
assertMaxArguments(arguments.length, 3);
- const result = await this._channel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async $$eval<R, Arg>(selector: string, pageFunction: structs.PageFunctionOn<Element[], Arg, R>, arg?: Arg): Promise<R> {
assertMaxArguments(arguments.length, 3);
- const result = await this._channel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async $$(selector: string): Promise<ElementHandle<SVGElement | HTMLElement>[]> {
- const result = await this._channel.querySelectorAll({ selector });
+ const result = await this._channel.querySelectorAll({ selector }, undefined);
return result.elements.map(e => ElementHandle.from(e) as ElementHandle<SVGElement | HTMLElement>);
}
async _queryCount(selector: string, options?: {}): Promise<number> {
- return (await this._channel.queryCount({ selector, ...options })).value;
+ return (await this._channel.queryCount({ selector, ...options }, undefined)).value;
}
async content(): Promise<string> {
- return (await this._channel.content()).value;
+ return (await this._channel.content({}, undefined)).value;
}
async setContent(html: string, options: channels.FrameSetContentOptions & TimeoutOptions = {}): Promise<void> {
const waitUntil = verifyLoadState('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil);
- await this._channel.setContent({ html, ...options, waitUntil, timeout: this._navigationTimeout(options) });
+ await this._channel.setContent({ html, ...options, waitUntil, timeout: this._navigationTimeout(options) }, options.signal);
}
name(): string {
@@ -291,7 +291,7 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
copy.content = (await fs.promises.readFile(copy.path)).toString();
copy.content = addSourceUrlToScript(copy.content, copy.path);
}
- return ElementHandle.from((await this._channel.addScriptTag({ ...copy })).element);
+ return ElementHandle.from((await this._channel.addScriptTag({ ...copy }, undefined)).element);
}
async addStyleTag(options: { url?: string; path?: string; content?: string; } = {}): Promise<ElementHandle> {
@@ -300,19 +300,19 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
copy.content = (await fs.promises.readFile(copy.path)).toString();
copy.content += '/*# sourceURL=' + copy.path.replace(/\n/g, '') + '*/';
}
- return ElementHandle.from((await this._channel.addStyleTag({ ...copy })).element);
+ return ElementHandle.from((await this._channel.addStyleTag({ ...copy }, undefined)).element);
}
async click(selector: string, options: channels.FrameClickOptions & TimeoutOptions = {}) {
- return await this._channel.click({ selector, ...options, timeout: this._timeout(options) });
+ return await this._channel.click({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async dblclick(selector: string, options: channels.FrameDblclickOptions & TimeoutOptions = {}) {
- return await this._channel.dblclick({ selector, ...options, timeout: this._timeout(options) });
+ return await this._channel.dblclick({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async dragAndDrop(source: string, target: string, options: channels.FrameDragAndDropOptions & TimeoutOptions = {}) {
- return await this._channel.dragAndDrop({ source, target, ...options, timeout: this._timeout(options) });
+ return await this._channel.dragAndDrop({ source, target, ...options, timeout: this._timeout(options) }, options.signal);
}
async _drop(selector: string, payload: DropPayload, options: Omit<channels.FrameDropOptions, 'payloads' | 'localPaths' | 'streams' | 'data'> & TimeoutOptions = {}) {
@@ -330,23 +330,23 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
data: dataArray,
...options,
timeout: this._timeout(options),
- });
+ }, options.signal);
}
async tap(selector: string, options: channels.FrameTapOptions & TimeoutOptions = {}) {
- return await this._channel.tap({ selector, ...options, timeout: this._timeout(options) });
+ return await this._channel.tap({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async fill(selector: string, value: string, options: channels.FrameFillOptions & TimeoutOptions = {}) {
- return await this._channel.fill({ selector, value, ...options, timeout: this._timeout(options) });
+ return await this._channel.fill({ selector, value, ...options, timeout: this._timeout(options) }, options.signal);
}
async _highlight(selector: string, style?: string) {
- return await this._channel.highlight({ selector, style });
+ return await this._channel.highlight({ selector, style }, undefined);
}
async _hideHighlight(selector: string) {
- return await this._channel.hideHighlight({ selector });
+ return await this._channel.hideHighlight({ selector }, undefined);
}
locator(selector: string, options?: LocatorOptions): Locator {
@@ -386,82 +386,82 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
}
async focus(selector: string, options: channels.FrameFocusOptions & TimeoutOptions = {}) {
- await this._channel.focus({ selector, ...options, timeout: this._timeout(options) });
+ await this._channel.focus({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async textContent(selector: string, options: channels.FrameTextContentOptions & TimeoutOptions = {}): Promise<null|string> {
- const value = (await this._channel.textContent({ selector, ...options, timeout: this._timeout(options) })).value;
+ const value = (await this._channel.textContent({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
return value === undefined ? null : value;
}
async innerText(selector: string, options: channels.FrameInnerTextOptions & TimeoutOptions = {}): Promise<string> {
- return (await this._channel.innerText({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.innerText({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async innerHTML(selector: string, options: channels.FrameInnerHTMLOptions & TimeoutOptions = {}): Promise<string> {
- return (await this._channel.innerHTML({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.innerHTML({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async getAttribute(selector: string, name: string, options: channels.FrameGetAttributeOptions & TimeoutOptions = {}): Promise<string | null> {
- const value = (await this._channel.getAttribute({ selector, name, ...options, timeout: this._timeout(options) })).value;
+ const value = (await this._channel.getAttribute({ selector, name, ...options, timeout: this._timeout(options) }, options.signal)).value;
return value === undefined ? null : value;
}
async inputValue(selector: string, options: channels.FrameInputValueOptions & TimeoutOptions = {}): Promise<string> {
- return (await this._channel.inputValue({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.inputValue({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async isChecked(selector: string, options: channels.FrameIsCheckedOptions & TimeoutOptions = {}): Promise<boolean> {
- return (await this._channel.isChecked({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.isChecked({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async isDisabled(selector: string, options: channels.FrameIsDisabledOptions & TimeoutOptions = {}): Promise<boolean> {
- return (await this._channel.isDisabled({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.isDisabled({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async isEditable(selector: string, options: channels.FrameIsEditableOptions & TimeoutOptions = {}): Promise<boolean> {
- return (await this._channel.isEditable({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.isEditable({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async isEnabled(selector: string, options: channels.FrameIsEnabledOptions & TimeoutOptions = {}): Promise<boolean> {
- return (await this._channel.isEnabled({ selector, ...options, timeout: this._timeout(options) })).value;
+ return (await this._channel.isEnabled({ selector, ...options, timeout: this._timeout(options) }, options.signal)).value;
}
async isHidden(selector: string, options: channels.FrameIsHiddenOptions & TimeoutOptions = {}): Promise<boolean> {
- return (await this._channel.isHidden({ selector, ...options })).value;
+ return (await this._channel.isHidden({ selector, ...options }, options.signal)).value;
}
async isVisible(selector: string, options: channels.FrameIsVisibleOptions & TimeoutOptions = {}): Promise<boolean> {
- return (await this._channel.isVisible({ selector, ...options })).value;
+ return (await this._channel.isVisible({ selector, ...options }, options.signal)).value;
}
async hover(selector: string, options: channels.FrameHoverOptions & TimeoutOptions = {}) {
- await this._channel.hover({ selector, ...options, timeout: this._timeout(options) });
+ await this._channel.hover({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async selectOption(selector: string, values: string | api.ElementHandle | SelectOption | string[] | api.ElementHandle[] | SelectOption[] | null, options: SelectOptionOptions & StrictOptions = {}): Promise<string[]> {
- return (await this._channel.selectOption({ selector, ...convertSelectOptionValues(values), ...options, timeout: this._timeout(options) })).values;
+ return (await this._channel.selectOption({ selector, ...convertSelectOptionValues(values), ...options, timeout: this._timeout(options) }, options.signal)).values;
}
async setInputFiles(selector: string, files: string | FilePayload | string[] | FilePayload[], options: channels.FrameSetInputFilesOptions & TimeoutOptions = {}): Promise<void> {
const converted = await convertInputFiles(files, this.page().context());
- await this._channel.setInputFiles({ selector, ...converted, ...options, timeout: this._timeout(options) });
+ await this._channel.setInputFiles({ selector, ...converted, ...options, timeout: this._timeout(options) }, options.signal);
}
async type(selector: string, text: string, options: channels.FrameTypeOptions & TimeoutOptions = {}) {
- await this._channel.type({ selector, text, ...options, timeout: this._timeout(options) });
+ await this._channel.type({ selector, text, ...options, timeout: this._timeout(options) }, options.signal);
}
async press(selector: string, key: string, options: channels.FramePressOptions & TimeoutOptions = {}) {
- await this._channel.press({ selector, key, ...options, timeout: this._timeout(options) });
+ await this._channel.press({ selector, key, ...options, timeout: this._timeout(options) }, options.signal);
}
async check(selector: string, options: channels.FrameCheckOptions & TimeoutOptions = {}) {
- await this._channel.check({ selector, ...options, timeout: this._timeout(options) });
+ await this._channel.check({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async uncheck(selector: string, options: channels.FrameUncheckOptions & TimeoutOptions = {}) {
- await this._channel.uncheck({ selector, ...options, timeout: this._timeout(options) });
+ await this._channel.uncheck({ selector, ...options, timeout: this._timeout(options) }, options.signal);
}
async setChecked(selector: string, checked: boolean, options?: channels.FrameCheckOptions) {
@@ -472,7 +472,7 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
}
async waitForTimeout(timeout: number) {
- await this._channel.waitForTimeout({ waitTimeout: timeout });
+ await this._channel.waitForTimeout({ waitTimeout: timeout }, undefined);
}
async waitForFunction<R, Arg>(pageFunction: structs.PageFunction<Arg, R>, arg?: Arg, options: WaitForFunctionOptions = {}): Promise<structs.SmartHandle<R>> {
@@ -485,19 +485,19 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr
isFunction: typeof pageFunction === 'function',
arg: serializeArgument(arg),
timeout: this._timeout(options),
- });
+ }, options.signal);
return JSHandle.from(result.handle!) as any as structs.SmartHandle<R>;
}
async title(): Promise<string> {
- return (await this._channel.title()).value;
+ return (await this._channel.title({}, undefined)).value;
}
- async _expect(expression: string, options: Omit<channels.FrameExpectParams, 'expression'>): Promise<ExpectResult> {
+ async _expect(expression: string, options: Omit<channels.FrameExpectParams, 'expression'>, signal: AbortSignal | undefined): Promise<ExpectResult> {
const params: channels.FrameExpectParams = { expression, ...options, isNot: !!options.isNot };
params.expectedValue = serializeArgument(options.expectedValue);
try {
- await this._channel.expect(params);
+ await this._channel.expect(params, signal);
return { matches: !params.isNot };
} catch (e) {
if (!(e instanceof PlaywrightError))
diff --git a/packages/playwright-core/src/client/input.ts b/packages/playwright-core/src/client/input.ts
index cb4a551d68..d5c2780b5b 100644
--- a/packages/playwright-core/src/client/input.ts
+++ b/packages/playwright-core/src/client/input.ts
@@ -27,23 +27,23 @@ export class Keyboard implements api.Keyboard {
}
async down(key: string) {
- await this._page._channel.keyboardDown({ key });
+ await this._page._channel.keyboardDown({ key }, undefined);
}
async up(key: string) {
- await this._page._channel.keyboardUp({ key });
+ await this._page._channel.keyboardUp({ key }, undefined);
}
async insertText(text: string) {
- await this._page._channel.keyboardInsertText({ text });
+ await this._page._channel.keyboardInsertText({ text }, undefined);
}
async type(text: string, options: channels.PageKeyboardTypeOptions = {}) {
- await this._page._channel.keyboardType({ text, ...options });
+ await this._page._channel.keyboardType({ text, ...options }, undefined);
}
async press(key: string, options: channels.PageKeyboardPressOptions = {}) {
- await this._page._channel.keyboardPress({ key, ...options });
+ await this._page._channel.keyboardPress({ key, ...options }, undefined);
}
}
@@ -55,19 +55,19 @@ export class Mouse implements api.Mouse {
}
async move(x: number, y: number, options: { steps?: number } = {}) {
- await this._page._channel.mouseMove({ x, y, ...options });
+ await this._page._channel.mouseMove({ x, y, ...options }, undefined);
}
async down(options: channels.PageMouseDownOptions = {}) {
- await this._page._channel.mouseDown({ ...options });
+ await this._page._channel.mouseDown({ ...options }, undefined);
}
async up(options: channels.PageMouseUpOptions = {}) {
- await this._page._channel.mouseUp(options);
+ await this._page._channel.mouseUp(options, undefined);
}
async click(x: number, y: number, options: channels.PageMouseClickOptions = {}) {
- await this._page._channel.mouseClick({ x, y, ...options });
+ await this._page._channel.mouseClick({ x, y, ...options }, undefined);
}
async dblclick(x: number, y: number, options: Omit<channels.PageMouseClickOptions, 'clickCount'> = {}) {
@@ -77,7 +77,7 @@ export class Mouse implements api.Mouse {
}
async wheel(deltaX: number, deltaY: number) {
- await this._page._channel.mouseWheel({ deltaX, deltaY });
+ await this._page._channel.mouseWheel({ deltaX, deltaY }, undefined);
}
}
@@ -89,6 +89,6 @@ export class Touchscreen implements api.Touchscreen {
}
async tap(x: number, y: number) {
- await this._page._channel.touchscreenTap({ x, y });
+ await this._page._channel.touchscreenTap({ x, y }, undefined);
}
}
diff --git a/packages/playwright-core/src/client/jsHandle.ts b/packages/playwright-core/src/client/jsHandle.ts
index a6ca8a038f..e0bed9425a 100644
--- a/packages/playwright-core/src/client/jsHandle.ts
+++ b/packages/playwright-core/src/client/jsHandle.ts
@@ -37,29 +37,29 @@ export class JSHandle<T = any> extends ChannelOwner<channels.JSHandleChannel> im
}
async evaluate<R, Arg>(pageFunction: structs.PageFunctionOn<T, Arg, R>, arg?: Arg): Promise<R> {
- const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async evaluateHandle<R, Arg>(pageFunction: structs.PageFunctionOn<T, Arg, R>, arg?: Arg): Promise<structs.SmartHandle<R>> {
- const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return JSHandle.from(result.handle) as any as structs.SmartHandle<R>;
}
async getProperty(propertyName: string): Promise<JSHandle> {
- const result = await this._channel.getProperty({ name: propertyName });
+ const result = await this._channel.getProperty({ name: propertyName }, undefined);
return JSHandle.from(result.handle);
}
async getProperties(): Promise<Map<string, JSHandle>> {
const map = new Map<string, JSHandle>();
- for (const { name, value } of (await this._channel.getPropertyList()).properties)
+ for (const { name, value } of (await this._channel.getPropertyList({}, undefined)).properties)
map.set(name, JSHandle.from(value));
return map;
}
async jsonValue(): Promise<T> {
- return parseResult((await this._channel.jsonValue()).value);
+ return parseResult((await this._channel.jsonValue({}, undefined)).value);
}
asElement(): T extends Node ? api.ElementHandle<T> : null {
@@ -72,7 +72,7 @@ export class JSHandle<T = any> extends ChannelOwner<channels.JSHandleChannel> im
async dispose() {
try {
- await this._channel.dispose();
+ await this._channel.dispose({}, undefined);
} catch (e) {
if (isTargetClosedError(e))
return;
diff --git a/packages/playwright-core/src/client/localUtils.ts b/packages/playwright-core/src/client/localUtils.ts
index 5d34adc053..f02be30075 100644
--- a/packages/playwright-core/src/client/localUtils.ts
+++ b/packages/playwright-core/src/client/localUtils.ts
@@ -40,34 +40,34 @@ export class LocalUtils extends ChannelOwner<channels.LocalUtilsChannel> {
}
async zip(params: channels.LocalUtilsZipParams): Promise<void> {
- return await this._channel.zip(params);
+ return await this._channel.zip(params, undefined);
}
async harOpen(params: channels.LocalUtilsHarOpenParams): Promise<channels.LocalUtilsHarOpenResult> {
- return await this._channel.harOpen(params);
+ return await this._channel.harOpen(params, undefined);
}
async harLookup(params: channels.LocalUtilsHarLookupParams): Promise<channels.LocalUtilsHarLookupResult> {
- return await this._channel.harLookup(params);
+ return await this._channel.harLookup(params, undefined);
}
async harClose(params: channels.LocalUtilsHarCloseParams): Promise<void> {
- return await this._channel.harClose(params);
+ return await this._channel.harClose(params, undefined);
}
async harUnzip(params: channels.LocalUtilsHarUnzipParams): Promise<void> {
- return await this._channel.harUnzip(params);
+ return await this._channel.harUnzip(params, undefined);
}
async tracingStarted(params: channels.LocalUtilsTracingStartedParams): Promise<channels.LocalUtilsTracingStartedResult> {
- return await this._channel.tracingStarted(params);
+ return await this._channel.tracingStarted(params, undefined);
}
async traceDiscarded(params: channels.LocalUtilsTraceDiscardedParams): Promise<void> {
- return await this._channel.traceDiscarded(params);
+ return await this._channel.traceDiscarded(params, undefined);
}
async addStackToTracingNoReply(params: channels.LocalUtilsAddStackToTracingNoReplyParams): Promise<void> {
- return await this._channel.addStackToTracingNoReply(params);
+ return await this._channel.addStackToTracingNoReply(params, undefined);
}
}
diff --git a/packages/playwright-core/src/client/locator.ts b/packages/playwright-core/src/client/locator.ts
index 38eec35cf2..d5f027fa33 100644
--- a/packages/playwright-core/src/client/locator.ts
+++ b/packages/playwright-core/src/client/locator.ts
@@ -77,12 +77,12 @@ export class Locator implements api.Locator {
(this as any)[inspect.custom] = () => this._inspect();
}
- private async _withElement<R>(task: (handle: ElementHandle<SVGElement | HTMLElement>, timeout?: number) => Promise<R>, options: { title: string, internal?: boolean, timeout?: number }): Promise<R> {
+ private async _withElement<R>(task: (handle: ElementHandle<SVGElement | HTMLElement>, timeout?: number) => Promise<R>, options: { title: string, internal?: boolean, timeout?: number, signal?: AbortSignal }): Promise<R> {
const timeout = this._frame._timeout({ timeout: options.timeout });
const deadline = timeout ? monotonicTime() + timeout : 0;
return await this._frame._wrapApiCall<R>(async () => {
- const result = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: 'attached', timeout });
+ const result = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: 'attached', timeout }, options.signal);
const handle = ElementHandle.fromNullable(result.element) as ElementHandle<SVGElement | HTMLElement> | null;
if (!handle)
throw new Error(`Could not resolve ${this._selector} to DOM Element`);
@@ -103,7 +103,7 @@ export class Locator implements api.Locator {
}
async boundingBox(options?: TimeoutOptions): Promise<Rect | null> {
- return await this._withElement(h => h.boundingBox(), { title: 'Bounding box', timeout: options?.timeout });
+ return await this._withElement(h => h.boundingBox(), { title: 'Bounding box', timeout: options?.timeout, signal: options?.signal });
}
async check(options: channels.ElementHandleCheckOptions & TimeoutOptions = {}) {
@@ -261,7 +261,7 @@ export class Locator implements api.Locator {
}
async blur(options?: TimeoutOptions): Promise<void> {
- await this._frame._channel.blur({ selector: this._selector, strict: true, ...options, timeout: this._frame._timeout(options) });
+ await this._frame._channel.blur({ selector: this._selector, strict: true, ...options, timeout: this._frame._timeout(options) }, options?.signal);
}
// options are only here for testing
@@ -270,7 +270,7 @@ export class Locator implements api.Locator {
}
async normalize(): Promise<Locator> {
- const { resolvedSelector } = await this._frame._channel.resolveSelector({ selector: this._selector });
+ const { resolvedSelector } = await this._frame._channel.resolveSelector({ selector: this._selector }, undefined);
return new Locator(this._frame, resolvedSelector);
}
@@ -324,16 +324,16 @@ export class Locator implements api.Locator {
async screenshot(options: Omit<channels.ElementHandleScreenshotOptions, 'mask'> & TimeoutOptions & { path?: string, mask?: api.Locator[] } = {}): Promise<Buffer> {
const mask = options.mask as Locator[] | undefined;
- return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), { title: 'Screenshot', timeout: options.timeout });
+ return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), { title: 'Screenshot', timeout: options.timeout, signal: options.signal });
}
async ariaSnapshot(options: TimeoutOptions & { mode?: 'ai' | 'default', depth?: number, boxes?: boolean } = {}): Promise<string> {
- const result = await this._frame._channel.ariaSnapshot({ timeout: this._frame._timeout(options), mode: options.mode, selector: this._selector, depth: options.depth, boxes: options.boxes });
+ const result = await this._frame._channel.ariaSnapshot({ timeout: this._frame._timeout(options), mode: options.mode, selector: this._selector, depth: options.depth, boxes: options.boxes }, options.signal);
return result.snapshot;
}
async scrollIntoViewIfNeeded(options: channels.ElementHandleScrollIntoViewIfNeededOptions & TimeoutOptions = {}) {
- return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), { title: 'Scroll into view', timeout: options.timeout });
+ return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), { title: 'Scroll into view', timeout: options.timeout, signal: options.signal });
}
async selectOption(values: string | api.ElementHandle | SelectOption | string[] | api.ElementHandle[] | SelectOption[] | null, options: SelectOptionOptions = {}): Promise<string[]> {
@@ -341,7 +341,7 @@ export class Locator implements api.Locator {
}
async selectText(options: channels.ElementHandleSelectTextOptions & TimeoutOptions = {}): Promise<void> {
- return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), { title: 'Select text', timeout: options.timeout });
+ return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), { title: 'Select text', timeout: options.timeout, signal: options.signal });
}
async setChecked(checked: boolean, options?: channels.ElementHandleCheckOptions & TimeoutOptions) {
@@ -390,7 +390,7 @@ export class Locator implements api.Locator {
waitFor(options: channels.FrameWaitForSelectorOptions & TimeoutOptions & { state: 'attached' | 'visible' }): Promise<void>;
waitFor(options?: channels.FrameWaitForSelectorOptions & TimeoutOptions): Promise<void>;
async waitFor(options?: channels.FrameWaitForSelectorOptions & TimeoutOptions): Promise<void> {
- await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options, timeout: this._frame._timeout(options) });
+ await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options, timeout: this._frame._timeout(options) }, options?.signal);
}
async waitForFunction<R, Arg>(pageFunction: structs.PageFunctionOn<SVGElement | HTMLElement, Arg, R>, arg?: Arg, options?: TimeoutOptions): Promise<void> {
@@ -402,15 +402,15 @@ export class Locator implements api.Locator {
arg: serializeArgument(arg),
timeout: this._frame._timeout(options),
pollingInterval: 100,
- });
+ }, options?.signal);
}
- async _expect(expression: string, options: FrameExpectParams): Promise<ExpectResult> {
+ async _expect(expression: string, options: FrameExpectParams, signal: AbortSignal | undefined): Promise<ExpectResult> {
return this._frame._expect(expression, {
...options,
selector: this._selector,
- });
+ }, signal);
}
private _inspect() {
diff --git a/packages/playwright-core/src/client/network.ts b/packages/playwright-core/src/client/network.ts
index 820d136c17..e1efd76691 100644
--- a/packages/playwright-core/src/client/network.ts
+++ b/packages/playwright-core/src/client/network.ts
@@ -179,7 +179,7 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
if (!this._actualHeadersPromise) {
this._actualHeadersPromise = this._wrapApiCall(async () => {
- return new RawHeaders((await this._channel.rawRequestHeaders()).headers);
+ return new RawHeaders((await this._channel.rawRequestHeaders({}, undefined)).headers);
}, { internal: true });
}
return await this._actualHeadersPromise;
@@ -198,11 +198,11 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
}
async response(): Promise<Response | null> {
- return Response.fromNullable((await this._channel.response()).response);
+ return Response.fromNullable((await this._channel.response({}, undefined)).response);
}
async _internalResponse(): Promise<Response | null> {
- return Response.fromNullable((await this._channel.response()).response);
+ return Response.fromNullable((await this._channel.response({}, undefined)).response);
}
existingResponse(): Response | null {
@@ -261,7 +261,7 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
const response = await this.response();
if (!response)
throw new Error('Unable to fetch sizes for failed request');
- return (await response._channel.sizes()).sizes;
+ return (await response._channel.sizes({}, undefined)).sizes;
}
_setResponseEndTiming(responseEndTiming: number) {
@@ -336,13 +336,13 @@ export class Route extends ChannelOwner<channels.RouteChannel> implements api.Ro
async abort(errorCode?: string) {
await this._handleRoute(async () => {
- await this._raceWithTargetClose(this._channel.abort({ errorCode }));
+ await this._raceWithTargetClose(this._channel.abort({ errorCode }, undefined));
});
}
async _redirectNavigationRequest(url: string) {
await this._handleRoute(async () => {
- await this._raceWithTargetClose(this._channel.redirectNavigationRequest({ url }));
+ await this._raceWithTargetClose(this._channel.redirectNavigationRequest({ url }, undefined));
});
}
@@ -423,7 +423,7 @@ export class Route extends ChannelOwner<channels.RouteChannel> implements api.Ro
body,
isBase64,
fetchResponseUid
- }));
+ }, undefined));
}
async continue(options: FallbackOverrides = {}) {
@@ -452,7 +452,7 @@ export class Route extends ChannelOwner<channels.RouteChannel> implements api.Ro
headers: options.headers ? headersObjectToArray(options.headers) : undefined,
postData: options.postDataBuffer,
isFallback,
- }));
+ }, undefined));
}
}
@@ -493,14 +493,14 @@ export class WebSocketRoute extends ChannelOwner<channels.WebSocketRouteChannel>
},
close: async (options: { code?: number, reason?: string } = {}) => {
- await this._channel.closeServer({ ...options, wasClean: true }).catch(() => {});
+ await this._channel.closeServer({ ...options, wasClean: true }, undefined).catch(() => {});
},
send: (message: string | Buffer) => {
if (isString(message))
- this._channel.sendToServer({ message, isBase64: false }).catch(() => {});
+ this._channel.sendToServer({ message, isBase64: false }, undefined).catch(() => {});
else
- this._channel.sendToServer({ message: message.toString('base64'), isBase64: true }).catch(() => {});
+ this._channel.sendToServer({ message: message.toString('base64'), isBase64: true }, undefined).catch(() => {});
},
async [Symbol.asyncDispose]() {
@@ -512,28 +512,28 @@ export class WebSocketRoute extends ChannelOwner<channels.WebSocketRouteChannel>
if (this._onPageMessage)
this._onPageMessage(isBase64 ? Buffer.from(message, 'base64') : message);
else if (this._connected)
- this._channel.sendToServer({ message, isBase64 }).catch(() => {});
+ this._channel.sendToServer({ message, isBase64 }, undefined).catch(() => {});
});
this._channel.on('messageFromServer', ({ message, isBase64 }) => {
if (this._onServerMessage)
this._onServerMessage(isBase64 ? Buffer.from(message, 'base64') : message);
else
- this._channel.sendToPage({ message, isBase64 }).catch(() => {});
+ this._channel.sendToPage({ message, isBase64 }, undefined).catch(() => {});
});
this._channel.on('closePage', ({ code, reason, wasClean }) => {
if (this._onPageClose)
this._onPageClose(code, reason);
else
- this._channel.closeServer({ code, reason, wasClean }).catch(() => {});
+ this._channel.closeServer({ code, reason, wasClean }, undefined).catch(() => {});
});
this._channel.on('closeServer', ({ code, reason, wasClean }) => {
if (this._onServerClose)
this._onServerClose(code, reason);
else
- this._channel.closePage({ code, reason, wasClean }).catch(() => {});
+ this._channel.closePage({ code, reason, wasClean }, undefined).catch(() => {});
});
}
@@ -546,22 +546,22 @@ export class WebSocketRoute extends ChannelOwner<channels.WebSocketRouteChannel>
}
async close(options: { code?: number, reason?: string } = {}) {
- await this._channel.closePage({ ...options, wasClean: true }).catch(() => {});
+ await this._channel.closePage({ ...options, wasClean: true }, undefined).catch(() => {});
}
connectToServer() {
if (this._connected)
throw new Error('Already connected to the server');
this._connected = true;
- this._channel.connect().catch(() => {});
+ this._channel.connect({}, undefined).catch(() => {});
return this._server;
}
send(message: string | Buffer) {
if (isString(message))
- this._channel.sendToPage({ message, isBase64: false }).catch(() => {});
+ this._channel.sendToPage({ message, isBase64: false }, undefined).catch(() => {});
else
- this._channel.sendToPage({ message: message.toString('base64'), isBase64: true }).catch(() => {});
+ this._channel.sendToPage({ message: message.toString('base64'), isBase64: true }, undefined).catch(() => {});
}
onMessage(handler: (message: string | Buffer) => any) {
@@ -581,7 +581,7 @@ export class WebSocketRoute extends ChannelOwner<channels.WebSocketRouteChannel>
return;
// Ensure that websocket is "open" and can send messages without an actual server connection.
// If this happens after the page has been closed, ignore the error.
- await this._channel.ensureOpened().catch(() => {});
+ await this._channel.ensureOpened({}, undefined).catch(() => {});
}
}
@@ -701,7 +701,7 @@ export class Response extends ChannelOwner<channels.ResponseChannel> implements
async _actualHeaders(): Promise<RawHeaders> {
if (!this._actualHeadersPromise) {
this._actualHeadersPromise = (async () => {
- return new RawHeaders((await this._channel.rawResponseHeaders()).headers);
+ return new RawHeaders((await this._channel.rawResponseHeaders({}, undefined)).headers);
})();
}
return await this._actualHeadersPromise;
@@ -728,7 +728,7 @@ export class Response extends ChannelOwner<channels.ResponseChannel> implements
}
async body(): Promise<Buffer> {
- return (await this._channel.body()).binary;
+ return (await this._channel.body({}, undefined)).binary;
}
async text(): Promise<string> {
@@ -750,15 +750,15 @@ export class Response extends ChannelOwner<channels.ResponseChannel> implements
}
async serverAddr(): Promise<RemoteAddr|null> {
- return (await this._channel.serverAddr()).value || null;
+ return (await this._channel.serverAddr({}, undefined)).value || null;
}
async securityDetails(): Promise<SecurityDetails|null> {
- return (await this._channel.securityDetails()).value || null;
+ return (await this._channel.securityDetails({}, undefined)).value || null;
}
async httpVersion(): Promise<string> {
- return (await this._channel.httpVersion()).value;
+ return (await this._channel.httpVersion({}, undefined)).value;
}
}
diff --git a/packages/playwright-core/src/client/page.ts b/packages/playwright-core/src/client/page.ts
index bd79b161ef..cbf6882e64 100644
--- a/packages/playwright-core/src/client/page.ts
+++ b/packages/playwright-core/src/client/page.ts
@@ -306,16 +306,16 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async pickLocator(): Promise<Locator> {
- const { selector } = await this._channel.pickLocator({});
+ const { selector } = await this._channel.pickLocator({}, undefined);
return this.locator(selector);
}
async cancelPickLocator(): Promise<void> {
- await this._channel.cancelPickLocator({});
+ await this._channel.cancelPickLocator({}, undefined);
}
async hideHighlight(): Promise<void> {
- await this._channel.hideHighlight({});
+ await this._channel.hideHighlight({}, undefined);
}
async $(selector: string, options?: { strict?: boolean }): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
@@ -360,21 +360,21 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async exposeFunction(name: string, callback: Function) {
- const result = await this._channel.exposeBinding({ name });
+ const result = await this._channel.exposeBinding({ name }, undefined);
const binding = (source: structs.BindingSource, ...args: any[]) => callback(...args);
this._bindings.set(name, binding);
return DisposableObject.from(result.disposable);
}
async exposeBinding(name: string, callback: (source: structs.BindingSource, ...args: any[]) => any) {
- const result = await this._channel.exposeBinding({ name });
+ const result = await this._channel.exposeBinding({ name }, undefined);
this._bindings.set(name, callback);
return DisposableObject.from(result.disposable);
}
async setExtraHTTPHeaders(headers: Headers) {
validateHeaders(headers);
- await this._channel.setExtraHTTPHeaders({ headers: headersObjectToArray(headers) });
+ await this._channel.setExtraHTTPHeaders({ headers: headersObjectToArray(headers) }, undefined);
}
url(): string {
@@ -395,7 +395,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
async reload(options: channels.PageReloadOptions & TimeoutOptions = {}): Promise<Response | null> {
const waitUntil = verifyLoadState('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil);
- return Response.fromNullable((await this._channel.reload({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
+ return Response.fromNullable((await this._channel.reload({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) }, options.signal)).response);
}
async addLocatorHandler(locator: Locator, handler: (locator: Locator) => any, options: { times?: number, noWaitAfter?: boolean } = {}): Promise<void> {
@@ -403,7 +403,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
throw new Error(`Locator must belong to the main frame of this page`);
if (options.times === 0)
return;
- const { uid } = await this._channel.registerLocatorHandler({ selector: locator._selector, noWaitAfter: options.noWaitAfter });
+ const { uid } = await this._channel.registerLocatorHandler({ selector: locator._selector, noWaitAfter: options.noWaitAfter }, undefined);
this._locatorHandlers.set(uid, { locator, handler, times: options.times });
}
@@ -420,7 +420,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
} finally {
if (remove)
this._locatorHandlers.delete(uid);
- this._channel.resolveLocatorHandlerNoReply({ uid, remove }).catch(() => {});
+ this._channel.resolveLocatorHandlerNoReply({ uid, remove }, undefined).catch(() => {});
}
}
@@ -428,7 +428,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
for (const [uid, data] of this._locatorHandlers) {
if (data.locator._equals(locator)) {
this._locatorHandlers.delete(uid);
- await this._channel.unregisterLocatorHandler({ uid }).catch(() => {});
+ await this._channel.unregisterLocatorHandler({ uid }, undefined).catch(() => {});
}
}
}
@@ -497,16 +497,16 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
async goBack(options: channels.PageGoBackOptions & TimeoutOptions = {}): Promise<Response | null> {
const waitUntil = verifyLoadState('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil);
- return Response.fromNullable((await this._channel.goBack({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
+ return Response.fromNullable((await this._channel.goBack({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) }, options.signal)).response);
}
async goForward(options: channels.PageGoForwardOptions & TimeoutOptions = {}): Promise<Response | null> {
const waitUntil = verifyLoadState('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil);
- return Response.fromNullable((await this._channel.goForward({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
+ return Response.fromNullable((await this._channel.goForward({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) }, options.signal)).response);
}
async requestGC() {
- await this._channel.requestGC();
+ await this._channel.requestGC({}, undefined);
}
async emulateMedia(options: { media?: 'screen' | 'print' | null, colorScheme?: 'dark' | 'light' | 'no-preference' | null, reducedMotion?: 'reduce' | 'no-preference' | null, forcedColors?: 'active' | 'none' | null, contrast?: 'no-preference' | 'more' | null } = {}) {
@@ -516,12 +516,12 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
reducedMotion: options.reducedMotion === null ? 'no-override' : options.reducedMotion,
forcedColors: options.forcedColors === null ? 'no-override' : options.forcedColors,
contrast: options.contrast === null ? 'no-override' : options.contrast,
- });
+ }, undefined);
}
async setViewportSize(viewportSize: Size) {
this._viewportSize = viewportSize;
- await this._channel.setViewportSize({ viewportSize });
+ await this._channel.setViewportSize({ viewportSize }, undefined);
}
viewportSize(): Size | null {
@@ -535,7 +535,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
async addInitScript(script: Function | string | { path?: string, content?: string }, arg?: any) {
const source = await evaluationScript(script, arg);
- return DisposableObject.from((await this._channel.addInitScript({ source })).disposable);
+ return DisposableObject.from((await this._channel.addInitScript({ source }, undefined)).disposable);
}
async route(url: URLMatch, handler: RouteHandlerCallback, options: { times?: number } = {}): Promise<DisposableStub> {
@@ -595,12 +595,12 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
private async _updateInterceptionPatterns(options: { internal: true } | { title: string }) {
const patterns = RouteHandler.prepareInterceptionPatterns(this._routes);
- await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }), options);
+ await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }, undefined), options);
}
private async _updateWebSocketInterceptionPatterns(options: { internal: true } | { title: string }) {
const patterns = WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes);
- await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }), options);
+ await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }, undefined), options);
}
async screenshot(options: Omit<channels.PageScreenshotOptions, 'mask'> & TimeoutOptions & { path?: string, mask?: api.Locator[] } = {}): Promise<Buffer> {
@@ -614,7 +614,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
selector: locator._selector,
}));
}
- const result = await this._channel.screenshot(copy);
+ const result = await this._channel.screenshot(copy, options.signal);
if (options.path) {
await mkdirIfNeeded(options.path);
await fs.promises.writeFile(options.path, result.binary);
@@ -637,7 +637,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
isNot: !!options.isNot,
locator,
mask,
- });
+ }, undefined);
return { actual: result.actual };
} catch (e) {
if (!(e instanceof PlaywrightError))
@@ -652,7 +652,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async bringToFront(): Promise<void> {
- await this._channel.bringToFront();
+ await this._channel.bringToFront({}, undefined);
}
async [Symbol.asyncDispose]() {
@@ -667,9 +667,9 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
if (this._ownedContext)
await this._ownedContext.close();
else if (options.runBeforeUnload)
- await this._channel.runBeforeUnload();
+ await this._channel.runBeforeUnload({}, undefined);
else
- await this._channel.close({ reason: options.reason });
+ await this._channel.close({ reason: options.reason }, undefined);
} catch (e) {
if (isTargetClosedError(e) && !options.runBeforeUnload)
return;
@@ -702,20 +702,20 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async clearConsoleMessages(): Promise<void> {
- await this._channel.clearConsoleMessages();
+ await this._channel.clearConsoleMessages({}, undefined);
}
async consoleMessages(options?: { filter?: 'all' | 'since-navigation' }): Promise<ConsoleMessage[]> {
- const { messages } = await this._channel.consoleMessages({ filter: options?.filter });
+ const { messages } = await this._channel.consoleMessages({ filter: options?.filter }, undefined);
return messages.map(message => new ConsoleMessage(message, this, null));
}
async clearPageErrors(): Promise<void> {
- await this._channel.clearPageErrors();
+ await this._channel.clearPageErrors({}, undefined);
}
async pageErrors(options?: { filter?: 'all' | 'since-navigation' }): Promise<Error[]> {
- const { errors } = await this._channel.pageErrors({ filter: options?.filter });
+ const { errors } = await this._channel.pageErrors({ filter: options?.filter }, undefined);
return errors.map(error => parseError(error));
}
@@ -844,7 +844,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async requests() {
- const { requests } = await this._channel.requests();
+ const { requests } = await this._channel.requests({}, undefined);
return requests.map(request => Request.from(request));
}
@@ -861,7 +861,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
this._browserContext.setDefaultNavigationTimeout(0);
this._browserContext.setDefaultTimeout(0);
this._instrumentation?.onWillPause({ keepTestTimeout: !!_options?.__testHookKeepTestTimeout });
- await this._closedOrCrashedScope.safeRace(this.context()._channel.pause());
+ await this._closedOrCrashedScope.safeRace(this.context()._channel.pause({}, undefined));
this._browserContext.setDefaultNavigationTimeout(defaultNavigationTimeout);
this._browserContext.setDefaultTimeout(defaultTimeout);
}
@@ -879,7 +879,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
if (options.margin && typeof options.margin[index] === 'number')
transportOptions.margin![index] = transportOptions.margin![index] + 'px';
}
- const result = await this._channel.pdf(transportOptions);
+ const result = await this._channel.pdf(transportOptions, undefined);
if (options.path) {
await fs.promises.mkdir(path.dirname(options.path), { recursive: true });
await fs.promises.writeFile(options.path, result.pdf);
@@ -888,12 +888,12 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
}
async ariaSnapshot(options: TimeoutOptions & { mode?: 'ai' | 'default', depth?: number, boxes?: boolean, _track?: string } = {}): Promise<string> {
- const result = await this.mainFrame()._channel.ariaSnapshot({ timeout: this._timeoutSettings.timeout(options), track: options._track, mode: options.mode, depth: options.depth, boxes: options.boxes });
+ const result = await this.mainFrame()._channel.ariaSnapshot({ timeout: this._timeoutSettings.timeout(options), track: options._track, mode: options.mode, depth: options.depth, boxes: options.boxes }, options.signal);
return result.snapshot;
}
async _setDockTile(image: Buffer) {
- await this._channel.setDockTile({ image });
+ await this._channel.setDockTile({ image }, undefined);
}
}
@@ -915,9 +915,9 @@ export class BindingCall extends ChannelOwner<channels.BindingCallChannel> {
frame
};
const result = await func(source, ...this._initializer.args.map(parseResult));
- this._channel.resolve({ result: serializeArgument(result) }).catch(() => {});
+ this._channel.resolve({ result: serializeArgument(result) }, undefined).catch(() => {});
} catch (e) {
- this._channel.reject({ error: serializeError(e) }).catch(() => {});
+ this._channel.reject({ error: serializeError(e) }, undefined).catch(() => {});
}
}
}
diff --git a/packages/playwright-core/src/client/screencast.ts b/packages/playwright-core/src/client/screencast.ts
index de6f463311..6b838a80ea 100644
--- a/packages/playwright-core/src/client/screencast.ts
+++ b/packages/playwright-core/src/client/screencast.ts
@@ -45,7 +45,7 @@ export class Screencast implements api.Screencast {
quality: options.quality,
sendFrames: !!options.onFrame,
record: !!options.path,
- });
+ }, undefined);
if (result.artifact) {
this._artifact = Artifact.from(result.artifact);
this._savePath = options.path;
@@ -57,7 +57,7 @@ export class Screencast implements api.Screencast {
await this._page._wrapApiCall(async () => {
this._started = false;
this._onFrame = null;
- await this._page._channel.screencastStop();
+ await this._page._channel.screencastStop({}, undefined);
if (this._savePath)
await this._artifact?.saveAs(this._savePath);
this._artifact = undefined;
@@ -66,28 +66,28 @@ export class Screencast implements api.Screencast {
}
async showActions(options?: { duration?: number, position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right', fontSize?: number, cursor?: 'none' | 'pointer' }): Promise<DisposableStub> {
- await this._page._channel.screencastShowActions({ duration: options?.duration, position: options?.position, fontSize: options?.fontSize, cursor: options?.cursor });
- return new DisposableStub(() => this._page._channel.screencastHideActions());
+ await this._page._channel.screencastShowActions({ duration: options?.duration, position: options?.position, fontSize: options?.fontSize, cursor: options?.cursor }, undefined);
+ return new DisposableStub(() => this._page._channel.screencastHideActions({}, undefined));
}
async hideActions(): Promise<void> {
- await this._page._channel.screencastHideActions();
+ await this._page._channel.screencastHideActions({}, undefined);
}
async showOverlay(html: string, options?: { duration?: number }): Promise<DisposableStub> {
- const { id } = await this._page._channel.screencastShowOverlay({ html, duration: options?.duration });
- return new DisposableStub(() => this._page._channel.screencastRemoveOverlay({ id }));
+ const { id } = await this._page._channel.screencastShowOverlay({ html, duration: options?.duration }, undefined);
+ return new DisposableStub(() => this._page._channel.screencastRemoveOverlay({ id }, undefined));
}
async showChapter(title: string, options?: { description?: string, duration?: number }): Promise<void> {
- await this._page._channel.screencastChapter({ title, ...options });
+ await this._page._channel.screencastChapter({ title, ...options }, undefined);
}
async showOverlays(): Promise<void> {
- await this._page._channel.screencastSetOverlayVisible({ visible: true });
+ await this._page._channel.screencastSetOverlayVisible({ visible: true }, undefined);
}
async hideOverlays(): Promise<void> {
- await this._page._channel.screencastSetOverlayVisible({ visible: false });
+ await this._page._channel.screencastSetOverlayVisible({ visible: false }, undefined);
}
}
diff --git a/packages/playwright-core/src/client/selectors.ts b/packages/playwright-core/src/client/selectors.ts
index a75e14c4fb..43ce5ca431 100644
--- a/packages/playwright-core/src/client/selectors.ts
+++ b/packages/playwright-core/src/client/selectors.ts
@@ -34,7 +34,7 @@ export class Selectors implements api.Selectors {
const source = await evaluationScript(script, undefined, false);
const selectorEngine: channels.SelectorEngine = { ...options, name, source };
for (const context of this._contextsForSelectors)
- await context._channel.registerSelectorEngine({ selectorEngine });
+ await context._channel.registerSelectorEngine({ selectorEngine }, undefined);
this._selectorEngines.push(selectorEngine);
}
@@ -43,7 +43,7 @@ export class Selectors implements api.Selectors {
setTestIdAttribute(attributeName);
for (const context of this._contextsForSelectors) {
context._options.testIdAttributeName = attributeName;
- context._channel.setTestIdAttributeName({ testIdAttributeName: attributeName }).catch(() => {});
+ context._channel.setTestIdAttributeName({ testIdAttributeName: attributeName }, undefined).catch(() => {});
}
}
diff --git a/packages/playwright-core/src/client/stream.ts b/packages/playwright-core/src/client/stream.ts
index 86e8b538b9..eb3a43081b 100644
--- a/packages/playwright-core/src/client/stream.ts
+++ b/packages/playwright-core/src/client/stream.ts
@@ -43,7 +43,7 @@ class ReadableStreamImpl extends Readable {
}
override async _read() {
- const result = await this._channel.read({ size: 1024 * 1024 });
+ const result = await this._channel.read({ size: 1024 * 1024 }, undefined);
if (result.binary.byteLength)
this.push(result.binary);
else
@@ -52,7 +52,7 @@ class ReadableStreamImpl extends Readable {
override _destroy(error: Error | null, callback: (error: Error | null | undefined) => void): void {
// Stream might be destroyed after the connection was closed.
- this._channel.close().catch(e => null);
+ this._channel.close({}, undefined).catch(e => null);
super._destroy(error, callback);
}
}
diff --git a/packages/playwright-core/src/client/tracing.ts b/packages/playwright-core/src/client/tracing.ts
index b4ed8f2a7d..5f09f4c778 100644
--- a/packages/playwright-core/src/client/tracing.ts
+++ b/packages/playwright-core/src/client/tracing.ts
@@ -50,15 +50,15 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
snapshots: options.snapshots,
screenshots: options.screenshots,
live: options.live,
- });
- const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title });
+ }, undefined);
+ const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title }, undefined);
await this._startCollectingStacks(traceName, this._isLive);
});
}
async startChunk(options: { name?: string, title?: string } = {}) {
await this._wrapApiCall(async () => {
- const { traceName } = await this._channel.tracingStartChunk(options);
+ const { traceName } = await this._channel.tracingStartChunk(options, undefined);
await this._startCollectingStacks(traceName, this._isLive);
});
}
@@ -66,12 +66,12 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
async group(name: string, options: { location?: { file: string, line?: number, column?: number } } = {}) {
if (options.location)
this._additionalSources.add(options.location.file);
- await this._channel.tracingGroup({ name, location: options.location });
+ await this._channel.tracingGroup({ name, location: options.location }, undefined);
return new DisposableStub(() => this.groupEnd());
}
async groupEnd() {
- await this._channel.tracingGroupEnd();
+ await this._channel.tracingGroupEnd({}, undefined);
}
private async _startCollectingStacks(traceName: string, live: boolean) {
@@ -92,7 +92,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
async stop(options: { path?: string } = {}) {
await this._wrapApiCall(async () => {
await this._doStopChunk(options.path);
- await this._channel.tracingStop();
+ await this._channel.tracingStop({}, undefined);
});
}
@@ -136,7 +136,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
harPath: isZip ? undefined : har,
resourcesDir: options.resourcesDir,
},
- });
+ }, undefined);
this._harRecorders.set(harId, { path: har, resourcesDir: options.resourcesDir });
return harId;
}
@@ -150,7 +150,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
const isZip = harParams.path.endsWith('.zip');
if (isLocal) {
- const { entries } = await this._channel.harExport({ harId, mode: 'entries' });
+ const { entries } = await this._channel.harExport({ harId, mode: 'entries' }, undefined);
if (!isZip) {
// Server wrote HAR and resources to the user's chosen paths.
return;
@@ -162,7 +162,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
return;
}
- const { artifact: artifactChannel } = await this._channel.harExport({ harId, mode: 'archive' });
+ const { artifact: artifactChannel } = await this._channel.harExport({ harId, mode: 'archive' }, undefined);
const artifact = Artifact.from(artifactChannel!);
if (isZip) {
await artifact.saveAs(harParams.path);
@@ -191,7 +191,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
if (!filePath) {
// Not interested in artifacts.
- await this._channel.tracingStopChunk({ mode: 'discard' });
+ await this._channel.tracingStopChunk({ mode: 'discard' }, undefined);
if (this._stacksId)
await this._connection.localUtils()!.traceDiscarded({ stacksId: this._stacksId });
return;
@@ -204,12 +204,12 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap
const isLocal = !this._connection.isRemote();
if (isLocal) {
- const result = await this._channel.tracingStopChunk({ mode: 'entries' });
+ const result = await this._channel.tracingStopChunk({ mode: 'entries' }, undefined);
await localUtils.zip({ zipFile: filePath, entries: result.entries!, mode: 'write', stacksId: this._stacksId, includeSources: this._includeSources, additionalSources });
return;
}
- const result = await this._channel.tracingStopChunk({ mode: 'archive' });
+ const result = await this._channel.tracingStopChunk({ mode: 'archive' }, undefined);
// The artifact may be missing if the browser closed while stopping tracing.
if (!result.artifact) {
diff --git a/packages/playwright-core/src/client/webStorage.ts b/packages/playwright-core/src/client/webStorage.ts
index 2edceaacf0..9a1840276f 100644
--- a/packages/playwright-core/src/client/webStorage.ts
+++ b/packages/playwright-core/src/client/webStorage.ts
@@ -27,24 +27,24 @@ export class WebStorage implements api.WebStorage {
}
async items(): Promise<Array<{ name: string, value: string }>> {
- const { items } = await this._page._channel.webStorageItems({ kind: this._kind });
+ const { items } = await this._page._channel.webStorageItems({ kind: this._kind }, undefined);
return items;
}
async getItem(name: string): Promise<string | null> {
- const { value } = await this._page._channel.webStorageGetItem({ kind: this._kind, name });
+ const { value } = await this._page._channel.webStorageGetItem({ kind: this._kind, name }, undefined);
return value ?? null;
}
async setItem(name: string, value: string): Promise<void> {
- await this._page._channel.webStorageSetItem({ kind: this._kind, name, value });
+ await this._page._channel.webStorageSetItem({ kind: this._kind, name, value }, undefined);
}
async removeItem(name: string): Promise<void> {
- await this._page._channel.webStorageRemoveItem({ kind: this._kind, name });
+ await this._page._channel.webStorageRemoveItem({ kind: this._kind, name }, undefined);
}
async clear(): Promise<void> {
- await this._page._channel.webStorageClear({ kind: this._kind });
+ await this._page._channel.webStorageClear({ kind: this._kind }, undefined);
}
}
diff --git a/packages/playwright-core/src/client/worker.ts b/packages/playwright-core/src/client/worker.ts
index 66b4bcb60e..1279c2256b 100644
--- a/packages/playwright-core/src/client/worker.ts
+++ b/packages/playwright-core/src/client/worker.ts
@@ -76,13 +76,13 @@ export class Worker extends ChannelOwner<channels.WorkerChannel> implements api.
async evaluate<R, Arg>(pageFunction: structs.PageFunction<Arg, R>, arg?: Arg): Promise<R> {
assertMaxArguments(arguments.length, 2);
- const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return parseResult(result.value);
}
async evaluateHandle<R, Arg>(pageFunction: structs.PageFunction<Arg, R>, arg?: Arg): Promise<structs.SmartHandle<R>> {
assertMaxArguments(arguments.length, 2);
- const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) });
+ const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', arg: serializeArgument(arg) }, undefined);
return JSHandle.from(result.handle) as any as structs.SmartHandle<R>;
}
@@ -106,7 +106,7 @@ export class Worker extends ChannelOwner<channels.WorkerChannel> implements api.
async _disconnect(options: { reason?: string } = {}): Promise<void> {
this._closeReason = options.reason;
try {
- await this._channel.disconnect(options);
+ await this._channel.disconnect(options, undefined);
} catch (e) {
if (isTargetClosedError(e))
return;
diff --git a/packages/playwright-core/src/client/writableStream.ts b/packages/playwright-core/src/client/writableStream.ts
index 475fea38f4..5a128eef0c 100644
--- a/packages/playwright-core/src/client/writableStream.ts
+++ b/packages/playwright-core/src/client/writableStream.ts
@@ -43,13 +43,13 @@ class WritableStreamImpl extends Writable {
}
override async _write(chunk: Buffer | string, encoding: BufferEncoding, callback: (error?: Error | null) => void) {
- const error = await this._channel.write({ binary: typeof chunk === 'string' ? Buffer.from(chunk) : chunk }).catch(e => e);
+ const error = await this._channel.write({ binary: typeof chunk === 'string' ? Buffer.from(chunk) : chunk }, undefined).catch(e => e);
callback(error || null);
}
override async _final(callback: (error?: Error | null) => void) {
// Stream might be destroyed after the connection was closed.
- const error = await this._channel.close().catch(e => e);
+ const error = await this._channel.close({}, undefined).catch(e => e);
callback(error || null);
}
}
diff --git a/packages/playwright-core/src/server/dispatchers/dispatcher.ts b/packages/playwright-core/src/server/dispatchers/dispatcher.ts
index 292c5445c1..1b4ffccc6d 100644
--- a/packages/playwright-core/src/server/dispatchers/dispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/dispatcher.ts
@@ -23,7 +23,7 @@ import { assert } from '@isomorphic/assert';
import { monotonicTime } from '@isomorphic/time';
import { rewriteErrorMessage } from '@isomorphic/stackTrace';
import { ValidationError, createMetadataValidator, createWaitInfoValidator, findValidator, maybeFindValidator } from '../../protocol/validator';
-import { TargetClosedError, isTargetClosedError, serializeError } from '../errors';
+import { AbortError, TargetClosedError, isTargetClosedError, serializeError } from '../errors';
import { createRootSdkObject, SdkObject } from '../instrumentation';
import { isProtocolError } from '../protocolError';
import { compressCallLog } from '../callLog';
@@ -55,7 +55,7 @@ export class Dispatcher<Type extends SdkObject, ChannelType, ParentScopeType ext
private _dispatchers = new Map<string, DispatcherScope>();
protected _disposed = false;
protected _eventListeners: RegisteredListener[] = [];
- private _activeProgressControllers = new Set<ProgressController>();
+ readonly _activeProgressControllers = new Map<string, ProgressController>();
readonly _guid: string;
readonly _type: string;
@@ -105,11 +105,11 @@ export class Dispatcher<Type extends SdkObject, ChannelType, ParentScopeType ext
async _runCommand(callMetadata: CallMetadata, method: string, validParams: any) {
const controller = ProgressController.createForSdkObject(this._object, callMetadata);
- this._activeProgressControllers.add(controller);
+ this._activeProgressControllers.set(callMetadata.id, controller);
try {
return await controller.run(progress => (this as any)[method](validParams, progress), validParams?.timeout);
} finally {
- this._activeProgressControllers.delete(controller);
+ this._activeProgressControllers.delete(callMetadata.id);
}
}
@@ -134,7 +134,7 @@ export class Dispatcher<Type extends SdkObject, ChannelType, ParentScopeType ext
async stopPendingOperations(error: Error) {
const controllers: ProgressController[] = [];
const collect = (dispatcher: DispatcherScope) => {
- controllers.push(...dispatcher._activeProgressControllers);
+ controllers.push(...dispatcher._activeProgressControllers.values());
for (const child of [...dispatcher._dispatchers.values()])
collect(child);
};
@@ -300,6 +300,10 @@ export class DispatcherConnection {
await this._dispatchWaitInfo(id, dispatcher, params, metadata);
return;
}
+ if (method === '__abort__') {
+ await dispatcher?._activeProgressControllers.get(`call@${params.id}`)?.abort(new AbortError(undefined, { cause: params.reason }));
+ return;
+ }
if (!dispatcher) {
this.onmessage({ id, error: serializeError(new TargetClosedError(undefined)) });
return;
diff --git a/packages/playwright-core/src/server/errors.ts b/packages/playwright-core/src/server/errors.ts
index 1728d28185..03392de605 100644
--- a/packages/playwright-core/src/server/errors.ts
+++ b/packages/playwright-core/src/server/errors.ts
@@ -20,8 +20,8 @@ import { parseSerializedValue, serializeValue } from '../protocol/serializers';
import type { SerializedError } from './channels';
class CustomError extends Error {
- constructor(message: string) {
- super(message);
+ constructor(message: string, options?: ErrorOptions) {
+ super(message, options);
this.name = this.constructor.name;
}
}
@@ -34,6 +34,14 @@ export class TargetClosedError extends CustomError {
}
}
+// mirrors https://github.com/nodejs/node/blob/4e7c07dfe2b253393702545c0ffe2712b21fd3dd/lib/internal/errors.js#L976-L988
+export class AbortError extends CustomError {
+ constructor(message = 'The operation was aborted', options?: ErrorOptions) {
+ super(message, options);
+ this.name = 'AbortError';
+ }
+}
+
export function isTargetClosedError(error: Error) {
return error instanceof TargetClosedError || error.name === 'TargetClosedError';
}
diff --git a/packages/playwright-core/src/server/socksInterceptor.ts b/packages/playwright-core/src/server/socksInterceptor.ts
index 9d325dfb31..72200bab03 100644
--- a/packages/playwright-core/src/server/socksInterceptor.ts
+++ b/packages/playwright-core/src/server/socksInterceptor.ts
@@ -50,11 +50,11 @@ export class SocksInterceptor {
};
},
}) as channels.SocksSupportChannel & EventEmitter;
- this._handler.on(socks.SocksProxyHandler.Events.SocksConnected, (payload: socks.SocksSocketConnectedPayload) => this._channel.socksConnected(payload));
- this._handler.on(socks.SocksProxyHandler.Events.SocksData, (payload: socks.SocksSocketDataPayload) => this._channel.socksData(payload));
- this._handler.on(socks.SocksProxyHandler.Events.SocksError, (payload: socks.SocksSocketErrorPayload) => this._channel.socksError(payload));
- this._handler.on(socks.SocksProxyHandler.Events.SocksFailed, (payload: socks.SocksSocketFailedPayload) => this._channel.socksFailed(payload));
- this._handler.on(socks.SocksProxyHandler.Events.SocksEnd, (payload: socks.SocksSocketEndPayload) => this._channel.socksEnd(payload));
+ this._handler.on(socks.SocksProxyHandler.Events.SocksConnected, (payload: socks.SocksSocketConnectedPayload) => this._channel.socksConnected(payload, undefined));
+ this._handler.on(socks.SocksProxyHandler.Events.SocksData, (payload: socks.SocksSocketDataPayload) => this._channel.socksData(payload, undefined));
+ this._handler.on(socks.SocksProxyHandler.Events.SocksError, (payload: socks.SocksSocketErrorPayload) => this._channel.socksError(payload, undefined));
+ this._handler.on(socks.SocksProxyHandler.Events.SocksFailed, (payload: socks.SocksSocketFailedPayload) => this._channel.socksFailed(payload, undefined));
+ this._handler.on(socks.SocksProxyHandler.Events.SocksEnd, (payload: socks.SocksSocketEndPayload) => this._channel.socksEnd(payload, undefined));
this._channel.on('socksRequested', payload => this._handler.socketRequested(payload));
this._channel.on('socksClosed', payload => this._handler.socketClosed(payload));
this._channel.on('socksData', payload => this._handler.sendSocketData(payload));
diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 0e37993306..9df5611d2a 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -2070,6 +2070,17 @@ export interface Page {
*/
mode?: "ai"|"default";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -2146,6 +2157,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2261,6 +2283,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2408,6 +2441,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2479,6 +2523,17 @@ export interface Page {
* @param options
*/
dispatchEvent(selector: string, type: string, eventInit?: EvaluationArgument, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2535,6 +2590,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* 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.
@@ -2734,6 +2800,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2762,6 +2839,17 @@ export interface Page {
* @param options
*/
focus(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -2839,6 +2927,17 @@ export interface Page {
* @param options
*/
getAttribute(selector: string, name: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3194,6 +3293,17 @@ export interface Page {
* @param options
*/
goBack(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -3224,6 +3334,17 @@ export interface Page {
* @param options
*/
goForward(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -3281,6 +3402,17 @@ export interface Page {
*/
referer?: string;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -3370,6 +3502,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3403,6 +3546,17 @@ export interface Page {
* @param options
*/
innerHTML(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3428,6 +3582,17 @@ export interface Page {
* @param options
*/
innerText(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3458,6 +3623,17 @@ export interface Page {
* @param options
*/
inputValue(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3483,6 +3659,17 @@ export interface Page {
* @param options
*/
isChecked(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3514,6 +3701,17 @@ export interface Page {
* @param options
*/
isDisabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3540,6 +3738,17 @@ export interface Page {
* @param options
*/
isEditable(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3565,6 +3774,17 @@ export interface Page {
* @param options
*/
isEnabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3959,6 +4179,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -3981,6 +4212,17 @@ export interface Page {
* @param options
*/
reload(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -4287,6 +4529,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4361,6 +4614,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4389,6 +4653,17 @@ export interface Page {
* @param options
*/
setContent(html: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -4512,6 +4787,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4630,6 +4916,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4664,6 +4961,17 @@ export interface Page {
* @param options
*/
textContent(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4714,6 +5022,17 @@ export interface Page {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -4786,6 +5105,17 @@ export interface Page {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -5101,7 +5431,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5146,7 +5478,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5207,7 +5541,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5251,7 +5587,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -5305,7 +5643,9 @@ export interface Page {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -6315,6 +6655,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6419,6 +6770,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6523,6 +6885,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6594,6 +6967,17 @@ export interface Frame {
* @param options
*/
dispatchEvent(selector: string, type: string, eventInit?: EvaluationArgument, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6636,6 +7020,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* 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.
@@ -6716,6 +7111,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6744,6 +7150,17 @@ export interface Frame {
* @param options
*/
focus(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -6809,6 +7226,17 @@ export interface Frame {
* @param options
*/
getAttribute(selector: string, name: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7188,6 +7616,17 @@ export interface Frame {
*/
referer?: string;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -7272,6 +7711,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7305,6 +7755,17 @@ export interface Frame {
* @param options
*/
innerHTML(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7330,6 +7791,17 @@ export interface Frame {
* @param options
*/
innerText(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7360,6 +7832,17 @@ export interface Frame {
* @param options
*/
inputValue(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7385,6 +7868,17 @@ export interface Frame {
* @param options
*/
isChecked(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7416,6 +7910,17 @@ export interface Frame {
* @param options
*/
isDisabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7442,6 +7947,17 @@ export interface Frame {
* @param options
*/
isEditable(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7464,6 +7980,17 @@ export interface Frame {
* @param options
*/
isEnabled(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7645,6 +8172,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7740,6 +8278,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7814,6 +8363,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7842,6 +8402,17 @@ export interface Frame {
* @param options
*/
setContent(html: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `navigationTimeout` option in the config, or by using the
@@ -7918,6 +8489,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -7997,6 +8579,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8031,6 +8624,17 @@ export interface Frame {
* @param options
*/
textContent(selector: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8081,6 +8685,17 @@ export interface Frame {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8153,6 +8768,17 @@ export interface Frame {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
* element, the call throws an exception.
@@ -8209,7 +8835,9 @@ export interface Frame {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -8253,7 +8881,9 @@ export interface Frame {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -8319,7 +8949,9 @@ export interface Frame {
* Allows to cancel the waiting using an
* [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
* waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the
- * default timeout; pass `timeout: 0` to disable the timeout entirely.
+ * default timeout, which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout);
+ * pass `timeout: 0` to disable the timeout entirely.
*/
signal?: AbortSignal;
@@ -11877,6 +12509,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -11969,6 +12612,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -12066,6 +12720,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -12164,6 +12829,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12248,6 +12924,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12402,6 +13089,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12485,6 +13183,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scale?: "css"|"device";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make
* elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces
@@ -12522,6 +13231,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* @param options
*/
scrollIntoViewIfNeeded(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12608,6 +13328,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12636,6 +13367,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
force?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12696,7 +13438,18 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* `"none"`, Playwright does not scroll the element and the action fails if the element is not already in the
* viewport. This is useful to assert that an element is reachable by the user without additional scrolling.
*/
- scroll?: "auto"|"none";
+ scroll?: "auto"|"none";
+
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
@@ -12766,6 +13519,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12834,6 +13598,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12885,6 +13660,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12946,6 +13732,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -12985,6 +13782,17 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
* @param options
*/
waitForElementState(state: "visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable", options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13137,7 +13945,7 @@ export interface Locator {
* [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-wait-for-function-option-expression).
* @param options
*/
- waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number }): Promise<void>;
+ waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise<void>;
/**
* **NOTE** Always prefer using [Locator](https://playwright.dev/docs/api/class-locator)s and web assertions over
* [ElementHandle](https://playwright.dev/docs/api/class-elementhandle)s because latter are inherently racy.
@@ -13298,6 +14106,17 @@ export interface Locator {
*/
mode?: "ai"|"default";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13312,6 +14131,17 @@ export interface Locator {
* @param options
*/
blur(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13348,6 +14178,17 @@ export interface Locator {
* @param options
*/
boundingBox(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13436,6 +14277,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13484,6 +14336,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13589,6 +14452,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -13720,6 +14594,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to 1. Sends `n` interpolated `mousemove` events to represent travel between Playwright's current cursor
* position and the provided destination. When set to 1, emits a single `mousemove` event at the destination location.
@@ -13824,6 +14709,17 @@ export interface Locator {
* @param options
*/
dispatchEvent(type: string, eventInit?: EvaluationArgument, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -13878,6 +14774,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* 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.
@@ -14001,6 +14908,17 @@ export interface Locator {
y: number;
};
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14054,6 +14972,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14133,6 +15062,17 @@ export interface Locator {
* @param options
*/
focus(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14168,6 +15108,17 @@ export interface Locator {
* @param options
*/
getAttribute(name: string, options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14578,6 +15529,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14600,6 +15562,17 @@ export interface Locator {
* @param options
*/
innerHTML(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14621,6 +15594,17 @@ export interface Locator {
* @param options
*/
innerText(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14652,6 +15636,17 @@ export interface Locator {
* @param options
*/
inputValue(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14677,6 +15672,17 @@ export interface Locator {
* @param options
*/
isChecked(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14702,6 +15708,17 @@ export interface Locator {
* @param options
*/
isDisabled(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14729,6 +15746,17 @@ export interface Locator {
* @param options
*/
isEditable(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14754,6 +15782,17 @@ export interface Locator {
* @param options
*/
isEnabled(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -14976,6 +16015,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15026,6 +16076,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15073,6 +16134,17 @@ export interface Locator {
* @param options
*/
scrollIntoViewIfNeeded(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15167,6 +16239,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15191,6 +16274,17 @@ export interface Locator {
*/
force?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15258,6 +16352,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15352,6 +16457,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15422,6 +16538,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15449,6 +16576,17 @@ export interface Locator {
* @param options
*/
textContent(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15485,6 +16623,17 @@ export interface Locator {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15552,6 +16701,17 @@ export interface Locator {
*/
scroll?: "auto"|"none";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -15585,6 +16745,17 @@ export interface Locator {
* @param options
*/
waitFor(options?: {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
@@ -19622,6 +20793,17 @@ export interface FileChooser {
*/
noWaitAfter?: boolean;
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
* option in the config, or by using the
@@ -23845,6 +25027,17 @@ export interface LocatorScreenshotOptions {
*/
scale?: "css"|"device";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make
* elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces
@@ -23867,6 +25060,17 @@ export interface LocatorScreenshotOptions {
}
interface ElementHandleWaitForSelectorOptions {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
@@ -24383,6 +25587,17 @@ export interface Cookie {
}
interface PageWaitForSelectorOptions {
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Defaults to `'visible'`. Can be either:
* - `'attached'` - wait for element to be present in DOM.
@@ -24419,6 +25634,17 @@ interface PageWaitForFunctionOptions {
*/
polling?: number|"raf";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via
* `actionTimeout` option in the config, or by using the
@@ -24518,6 +25744,17 @@ export interface PageScreenshotOptions {
*/
scale?: "css"|"device";
+ /**
+ * Allows to cancel the operation using an
+ * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the
+ * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout,
+ * which can be changed using
+ * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
+ * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass
+ * `timeout: 0` to disable the timeout entirely.
+ */
+ signal?: AbortSignal;
+
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make
* elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces
diff --git a/packages/playwright/src/matchers/matchers.ts b/packages/playwright/src/matchers/matchers.ts
index 8cd4583b7a..afb0dc2406 100644
--- a/packages/playwright/src/matchers/matchers.ts
+++ b/packages/playwright/src/matchers/matchers.ts
@@ -66,11 +66,11 @@ function serializeExpectedTextValues(items: (string | RegExp)[], options: { matc
export interface LocatorEx extends Locator {
_selector: string;
- _expect(expression: string, options: FrameExpectParams): Promise<ExpectResult>;
+ _expect(expression: string, options: FrameExpectParams, signal: AbortSignal | undefined): Promise<ExpectResult>;
}
export interface FrameEx extends Frame {
- _expect(expression: string, options: FrameExpectParams): Promise<ExpectResult>;
+ _expect(expression: string, options: FrameExpectParams, signal: AbortSignal | undefined): Promise<ExpectResult>;
}
interface APIResponseEx extends APIResponse {
@@ -86,7 +86,7 @@ export function toBeAttached(
const expected = attached ? 'attached' : 'detached';
const arg = attached ? '' : '{ attached: false }';
return toBeTruthy.call(this, 'toBeAttached', locator, 'Locator', expected, arg, async (isNot, timeout) => {
- return await locator._expect(attached ? 'to.be.attached' : 'to.be.detached', { isNot, timeout });
+ return await locator._expect(attached ? 'to.be.attached' : 'to.be.detached', { isNot, timeout }, undefined);
}, options);
}
@@ -111,7 +111,7 @@ export function toBeChecked(
arg = options?.checked === false ? `{ checked: false }` : '';
}
return toBeTruthy.call(this, 'toBeChecked', locator, 'Locator', expected, arg, async (isNot, timeout) => {
- return await locator._expect('to.be.checked', { isNot, timeout, expectedValue });
+ return await locator._expect('to.be.checked', { isNot, timeout, expectedValue }, undefined);
}, options);
}
@@ -121,7 +121,7 @@ export function toBeDisabled(
options?: { timeout?: number },
) {
return toBeTruthy.call(this, 'toBeDisabled', locator, 'Locator', 'disabled', '', async (isNot, timeout) => {
- return await locator._expect('to.be.disabled', { isNot, timeout });
+ return await locator._expect('to.be.disabled', { isNot, timeout }, undefined);
}, options);
}
@@ -134,7 +134,7 @@ export function toBeEditable(
const expected = editable ? 'editable' : 'readOnly';
const arg = editable ? '' : '{ editable: false }';
return toBeTruthy.call(this, 'toBeEditable', locator, 'Locator', expected, arg, async (isNot, timeout) => {
- return await locator._expect(editable ? 'to.be.editable' : 'to.be.readonly', { isNot, timeout });
+ return await locator._expect(editable ? 'to.be.editable' : 'to.be.readonly', { isNot, timeout }, undefined);
}, options);
}
@@ -144,7 +144,7 @@ export function toBeEmpty(
options?: { timeout?: number },
) {
return toBeTruthy.call(this, 'toBeEmpty', locator, 'Locator', 'empty', '', async (isNot, timeout) => {
- return await locator._expect('to.be.empty', { isNot, timeout });
+ return await locator._expect('to.be.empty', { isNot, timeout }, undefined);
}, options);
}
@@ -157,7 +157,7 @@ export function toBeEnabled(
const expected = enabled ? 'enabled' : 'disabled';
const arg = enabled ? '' : '{ enabled: false }';
return toBeTruthy.call(this, 'toBeEnabled', locator, 'Locator', expected, arg, async (isNot, timeout) => {
- return await locator._expect(enabled ? 'to.be.enabled' : 'to.be.disabled', { isNot, timeout });
+ return await locator._expect(enabled ? 'to.be.enabled' : 'to.be.disabled', { isNot, timeout }, undefined);
}, options);
}
@@ -167,7 +167,7 @@ export function toBeFocused(
options?: { timeout?: number },
) {
return toBeTruthy.call(this, 'toBeFocused', locator, 'Locator', 'focused', '', async (isNot, timeout) => {
- return await locator._expect('to.be.focused', { isNot, timeout });
+ return await locator._expect('to.be.focused', { isNot, timeout }, undefined);
}, options);
}
@@ -177,7 +177,7 @@ export function toBeHidden(
options?: { timeout?: number },
) {
return toBeTruthy.call(this, 'toBeHidden', locator, 'Locator', 'hidden', '', async (isNot, timeout) => {
- return await locator._expect('to.be.hidden', { isNot, timeout });
+ return await locator._expect('to.be.hidden', { isNot, timeout }, undefined);
}, options);
}
@@ -190,7 +190,7 @@ export function toBeVisible(
const expected = visible ? 'visible' : 'hidden';
const arg = visible ? '' : '{ visible: false }';
return toBeTruthy.call(this, 'toBeVisible', locator, 'Locator', expected, arg, async (isNot, timeout) => {
- return await locator._expect(visible ? 'to.be.visible' : 'to.be.hidden', { isNot, timeout });
+ return await locator._expect(visible ? 'to.be.visible' : 'to.be.hidden', { isNot, timeout }, undefined);
}, options);
}
@@ -200,7 +200,7 @@ export function toBeInViewport(
options?: { timeout?: number, ratio?: number },
) {
return toBeTruthy.call(this, 'toBeInViewport', locator, 'Locator', 'in viewport', '', async (isNot, timeout) => {
- return await locator._expect('to.be.in.viewport', { isNot, expectedNumber: options?.ratio, timeout });
+ return await locator._expect('to.be.in.viewport', { isNot, expectedNumber: options?.ratio, timeout }, undefined);
}, options);
}
@@ -213,12 +213,12 @@ export function toContainText(
if (Array.isArray(expected)) {
return toEqual.call(this, 'toContainText', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues(expected, { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
- return await locator._expect('to.contain.text.array', { expectedText, isNot, useInnerText: options.useInnerText, timeout });
+ return await locator._expect('to.contain.text.array', { expectedText, isNot, useInnerText: options.useInnerText, timeout }, undefined);
}, expected, { ...options, contains: true });
} else {
return toMatchText.call(this, 'toContainText', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { matchSubstring: true, normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
- return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options.useInnerText, timeout });
+ return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options.useInnerText, timeout }, undefined);
}, expected, { ...options, matchSubstring: true });
}
}
@@ -231,7 +231,7 @@ export function toHaveAccessibleDescription(
) {
return toMatchText.call(this, 'toHaveAccessibleDescription', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
- return await locator._expect('to.have.accessible.description', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.accessible.description', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -243,7 +243,7 @@ export function toHaveAccessibleName(
) {
return toMatchText.call(this, 'toHaveAccessibleName', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
- return await locator._expect('to.have.accessible.name', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.accessible.name', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -255,7 +255,7 @@ export function toHaveAccessibleErrorMessage(
) {
return toMatchText.call(this, 'toHaveAccessibleErrorMessage', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase, normalizeWhiteSpace: true });
- return await locator._expect('to.have.accessible.error.message', { expectedText: expectedText, isNot, timeout });
+ return await locator._expect('to.have.accessible.error.message', { expectedText: expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -275,12 +275,12 @@ export function toHaveAttribute(
}
if (expected === undefined) {
return toBeTruthy.call(this, 'toHaveAttribute', locator, 'Locator', 'have attribute', '', async (isNot, timeout) => {
- return await locator._expect('to.have.attribute', { expressionArg: name, isNot, timeout });
+ return await locator._expect('to.have.attribute', { expressionArg: name, isNot, timeout }, undefined);
}, options);
}
return toMatchText.call(this, 'toHaveAttribute', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected as (string | RegExp)], { ignoreCase: options?.ignoreCase });
- return await locator._expect('to.have.attribute.value', { expressionArg: name, expectedText, isNot, timeout });
+ return await locator._expect('to.have.attribute.value', { expressionArg: name, expectedText, isNot, timeout }, undefined);
}, expected as (string | RegExp), options);
}
@@ -293,12 +293,12 @@ export function toHaveClass(
if (Array.isArray(expected)) {
return toEqual.call(this, 'toHaveClass', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues(expected);
- return await locator._expect('to.have.class.array', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.class.array', { expectedText, isNot, timeout }, undefined);
}, expected, options);
} else {
return toMatchText.call(this, 'toHaveClass', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected]);
- return await locator._expect('to.have.class', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.class', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
}
@@ -314,14 +314,14 @@ export function toContainClass(
throw new Error(`"expected" argument in toContainClass cannot contain RegExp values`);
return toEqual.call(this, 'toContainClass', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues(expected);
- return await locator._expect('to.contain.class.array', { expectedText, isNot, timeout });
+ return await locator._expect('to.contain.class.array', { expectedText, isNot, timeout }, undefined);
}, expected, options);
} else {
if (isRegExp(expected))
throw new Error(`"expected" argument in toContainClass cannot be a RegExp value`);
return toMatchText.call(this, 'toContainClass', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected]);
- return await locator._expect('to.contain.class', { expectedText, isNot, timeout });
+ return await locator._expect('to.contain.class', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
}
@@ -333,7 +333,7 @@ export function toHaveCount(
options?: { timeout?: number },
) {
return toEqual.call(this, 'toHaveCount', locator, 'Locator', async (isNot, timeout) => {
- return await locator._expect('to.have.count', { expectedNumber: expected, isNot, timeout });
+ return await locator._expect('to.have.count', { expectedNumber: expected, isNot, timeout }, undefined);
}, expected, options);
}
@@ -347,7 +347,7 @@ export function toHaveCSS(
) {
return toMatchText.call(this, 'toHaveCSS', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected]);
- return await locator._expect('to.have.css', { expressionArg: name, expectedText, isNot, pseudo: options?.pseudo, timeout });
+ return await locator._expect('to.have.css', { expressionArg: name, expectedText, isNot, pseudo: options?.pseudo, timeout }, undefined);
}, expected, options);
}
@@ -359,7 +359,7 @@ export function toHaveId(
) {
return toMatchText.call(this, 'toHaveId', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected]);
- return await locator._expect('to.have.id', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.id', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -371,7 +371,7 @@ export function toHaveJSProperty(
options?: { timeout?: number },
) {
return toEqual.call(this, 'toHaveJSProperty', locator, 'Locator', async (isNot, timeout) => {
- return await locator._expect('to.have.property', { expressionArg: name, expectedValue: expected, isNot, timeout });
+ return await locator._expect('to.have.property', { expressionArg: name, expectedValue: expected, isNot, timeout }, undefined);
}, expected, options);
}
@@ -385,7 +385,7 @@ export function toHaveRole(
throw new Error(`"role" argument in toHaveRole must be a string`);
return toMatchText.call(this, 'toHaveRole', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected]);
- return await locator._expect('to.have.role', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.role', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -398,12 +398,12 @@ export function toHaveText(
if (Array.isArray(expected)) {
return toEqual.call(this, 'toHaveText', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues(expected, { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
- return await locator._expect('to.have.text.array', { expectedText, isNot, useInnerText: options?.useInnerText, timeout });
+ return await locator._expect('to.have.text.array', { expectedText, isNot, useInnerText: options?.useInnerText, timeout }, undefined);
}, expected, options);
} else {
return toMatchText.call(this, 'toHaveText', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true, ignoreCase: options.ignoreCase });
- return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options?.useInnerText, timeout });
+ return await locator._expect('to.have.text', { expectedText, isNot, useInnerText: options?.useInnerText, timeout }, undefined);
}, expected, options);
}
}
@@ -416,7 +416,7 @@ export function toHaveValue(
) {
return toMatchText.call(this, 'toHaveValue', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected]);
- return await locator._expect('to.have.value', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.value', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -428,7 +428,7 @@ export function toHaveValues(
) {
return toEqual.call(this, 'toHaveValues', locator, 'Locator', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues(expected);
- return await locator._expect('to.have.values', { expectedText, isNot, timeout });
+ return await locator._expect('to.have.values', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -440,7 +440,7 @@ export function toHaveTitle(
) {
return toMatchText.call(this, 'toHaveTitle', page, 'Page', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { normalizeWhiteSpace: true });
- return await (page.mainFrame() as FrameEx)._expect('to.have.title', { expectedText, isNot, timeout });
+ return await (page.mainFrame() as FrameEx)._expect('to.have.title', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
@@ -461,7 +461,7 @@ export function toHaveURL(
expected = typeof expected === 'string' ? constructURLBasedOnBaseURL(baseURL, expected) : expected;
return toMatchText.call(this, 'toHaveURL', page, 'Page', async (isNot, timeout) => {
const expectedText = serializeExpectedTextValues([expected], { ignoreCase: options?.ignoreCase });
- return await (page.mainFrame() as FrameEx)._expect('to.have.url', { expectedText, isNot, timeout });
+ return await (page.mainFrame() as FrameEx)._expect('to.have.url', { expectedText, isNot, timeout }, undefined);
}, expected, options);
}
diff --git a/packages/playwright/src/matchers/toMatchAriaSnapshot.ts b/packages/playwright/src/matchers/toMatchAriaSnapshot.ts
index 5fa1965c28..27a5d0e9d8 100644
--- a/packages/playwright/src/matchers/toMatchAriaSnapshot.ts
+++ b/packages/playwright/src/matchers/toMatchAriaSnapshot.ts
@@ -93,8 +93,8 @@ export async function toMatchAriaSnapshot(
const expectParams = { expectedValue: expected, isNot: this.isNot, timeout };
const { matches: pass, received, log, timedOut, errorMessage } = locator ?
- await (locator as LocatorEx)._expect('to.match.aria', expectParams) :
- await ((receiver as Page).mainFrame() as FrameEx)._expect('to.match.aria', expectParams);
+ await (locator as LocatorEx)._expect('to.match.aria', expectParams, undefined) :
+ await ((receiver as Page).mainFrame() as FrameEx)._expect('to.match.aria', expectParams, undefined);
const typedReceived = received?.value as MatcherReceived;
const message = () => {
diff --git a/tests/config/debugControllerBackend.ts b/tests/config/debugControllerBackend.ts
index 1c90a5c468..6246e385e0 100644
--- a/tests/config/debugControllerBackend.ts
+++ b/tests/config/debugControllerBackend.ts
@@ -145,7 +145,7 @@ export class Backend extends EventEmitter {
}
async initialize() {
- await this.channel.initialize({ codegenId: 'playwright-test', sdkLanguage: 'javascript' });
+ await this.channel.initialize({ codegenId: 'playwright-test', sdkLanguage: 'javascript' }, undefined);
}
async close() {
diff --git a/tests/library/debug-controller.spec.ts b/tests/library/debug-controller.spec.ts
index 7d70a22647..3224f81631 100644
--- a/tests/library/debug-controller.spec.ts
+++ b/tests/library/debug-controller.spec.ts
@@ -86,7 +86,7 @@ test('should pick element', async ({ backend, connectedBrowser }) => {
const events = [];
backend.on('inspectRequested', event => events.push(event));
- await backend.setRecorderMode({ mode: 'inspecting' });
+ await backend.setRecorderMode({ mode: 'inspecting' }, undefined);
const context = await connectedBrowser.newContextForReuse();
const [page] = context.pages();
@@ -108,7 +108,7 @@ test('should pick element', async ({ backend, connectedBrowser }) => {
]);
// No events after mode disabled
- await backend.setRecorderMode({ mode: 'none' });
+ await backend.setRecorderMode({ mode: 'none' }, undefined);
await page.locator('body').click();
expect(events).toHaveLength(2);
});
@@ -116,7 +116,7 @@ test('should pick element', async ({ backend, connectedBrowser }) => {
test('should report pages', async ({ backend, connectedBrowser }) => {
const events = [];
backend.on('stateChanged', event => events.push(event));
- await backend.setReportStateChanged({ enabled: true });
+ await backend.setReportStateChanged({ enabled: true }, undefined);
const context = await connectedBrowser.newContextForReuse();
const page1 = await context.newPage();
@@ -124,7 +124,7 @@ test('should report pages', async ({ backend, connectedBrowser }) => {
await page1.close();
await page2.close();
- await backend.setReportStateChanged({ enabled: false });
+ await backend.setReportStateChanged({ enabled: false }, undefined);
const page3 = await context.newPage();
await page3.close();
@@ -165,10 +165,10 @@ test('should highlight all', async ({ backend, connectedBrowser }) => {
const page2 = await context.newPage();
await page1.goto('data:text/html,<button>Submit</button>');
await page2.goto('data:text/html,<button>Submit</button>');
- await backend.highlight({ selector: 'button' });
+ await backend.highlight({ selector: 'button' }, undefined);
await expect(page1.getByText('locator(\'button\')')).toBeVisible();
await expect(page2.getByText('locator(\'button\')')).toBeVisible();
- await backend.hideHighlight();
+ await backend.hideHighlight({}, undefined);
await expect(page1.getByText('locator(\'button\')')).toBeHidden({ timeout: 1000000 });
await expect(page2.getByText('locator(\'button\')')).toBeHidden();
});
@@ -177,7 +177,7 @@ test('should record', async ({ backend, connectedBrowser }) => {
const events = [];
backend.on('sourceChanged', event => events.push(event));
- await backend.setRecorderMode({ mode: 'recording' });
+ await backend.setRecorderMode({ mode: 'recording' }, undefined);
const context = await connectedBrowser.newContextForReuse();
const [page] = context.pages();
@@ -202,7 +202,7 @@ test('test', async ({ page }) => {
});`
});
// No events after mode disabled
- await backend.setRecorderMode({ mode: 'none' });
+ await backend.setRecorderMode({ mode: 'none' }, undefined);
const length = events.length;
await page.getByRole('button').click();
expect(events).toHaveLength(length);
@@ -221,7 +221,7 @@ test('should record custom data-testid', async ({ backend, connectedBrowser }) =
await page.setContent(`<div data-custom-id='one'>One</div>`);
// 2. "Record at cursor".
- await backend.setRecorderMode({ mode: 'recording', testIdAttributeName: 'data-custom-id' });
+ await backend.setRecorderMode({ mode: 'recording', testIdAttributeName: 'data-custom-id' }, undefined);
// 3. Record a click action.
await page.locator('div').click();
@@ -279,16 +279,16 @@ test('should highlight inside iframe', async ({ backend, connectedBrowser }, tes
const highlight = page.frameLocator('iframe').locator('x-pw-highlight');
await expect(highlight).not.toHaveCount(0);
- await backend.hideHighlight();
+ await backend.hideHighlight({}, undefined);
await expect(highlight).toHaveCount(0);
- await backend.highlight({ selector: `frameLocator('iframe').getByText('bar')` });
+ await backend.highlight({ selector: `frameLocator('iframe').getByText('bar')` }, undefined);
await expect(highlight).not.toHaveCount(0);
- await backend.highlight({ selector: `frameLocator('iframe').frameLocator('iframe').getByText('bar')` });
+ await backend.highlight({ selector: `frameLocator('iframe').frameLocator('iframe').getByText('bar')` }, undefined);
await expect(highlight).toHaveCount(0);
- await backend.highlight({ selector: `getByText('bar')` });
+ await backend.highlight({ selector: `getByText('bar')` }, undefined);
await expect(highlight).toHaveCount(1);
await expect(page.locator('x-pw-highlight')).toHaveCount(1);
});
@@ -301,16 +301,16 @@ test('should highlight aria template', async ({ backend, connectedBrowser }, tes
const button = page.getByRole('button');
const highlight = page.locator('x-pw-highlight');
- await backend.highlight({ ariaTemplate: `- button "Submit2"` });
+ await backend.highlight({ ariaTemplate: `- button "Submit2"` }, undefined);
await expect(highlight).toHaveCount(0);
- await backend.highlight({ ariaTemplate: `- button "Submit"` });
+ await backend.highlight({ ariaTemplate: `- button "Submit"` }, undefined);
const box1 = roundBox(await button.boundingBox());
const box2 = roundBox(await highlight.boundingBox());
expect(box1).toEqual(box2);
});
test('should report error in aria template', async ({ backend }) => {
- const error = await backend.highlight({ ariaTemplate: `- button "Submit` }).catch(e => e);
+ const error = await backend.highlight({ ariaTemplate: `- button "Submit` }, undefined).catch(e => e);
expect(error.message).toContain('Unterminated string:');
});
diff --git a/tests/page/locator-wait-for-function.spec.ts b/tests/page/locator-wait-for-function.spec.ts
index adce6bb11a..fd5730ad54 100644
--- a/tests/page/locator-wait-for-function.spec.ts
+++ b/tests/page/locator-wait-for-function.spec.ts
@@ -78,3 +78,24 @@ it('should throw on strict mode violation', async ({ page }) => {
const error = await page.locator('div.x').waitForFunction(() => true).catch(e => e);
expect(error.message).toContain('strict mode violation');
});
+
+it('should abort via signal', async ({ page }) => {
+ await page.setContent('<div id=target>no</div>');
+ const controller = new AbortController();
+ const promise = page.locator('#target').waitForFunction(element => element.textContent === 'yes', undefined, { timeout: 0, signal: controller.signal }).catch(e => e);
+ await page.waitForTimeout(100);
+ const reason = new Error('Aborted by user');
+ controller.abort(reason);
+ const error = await promise;
+ expect(error.name).toBe('AbortError');
+ expect(error.cause).toBe(reason);
+});
+
+it('should abort via already-aborted signal', async ({ page }) => {
+ await page.setContent('<div id=target>no</div>');
+ const controller = new AbortController();
+ controller.abort('already aborted');
+ const error = await page.locator('#target').waitForFunction(() => true, undefined, { signal: controller.signal }).catch(e => e);
+ expect(error.name).toBe('AbortError');
+ expect(error.cause).toBe('already aborted');
+});
diff --git a/tests/page/page-click.spec.ts b/tests/page/page-click.spec.ts
index 55e3cbe72f..fde976f76e 100644
--- a/tests/page/page-click.spec.ts
+++ b/tests/page/page-click.spec.ts
@@ -1349,3 +1349,51 @@ it('should not wait with noAutoWaiting 3', async ({ page }) => {
const error = await page.locator('button').click({ __testHookNoAutoWaiting: true } as any).catch(e => e);
expect(error.message).toContain('locator.click: Element is not enabled');
});
+
+it('should abort via signal', async ({ page }) => {
+ await page.setContent(`<button style="display:none">click me</button>`);
+ const controller = new AbortController();
+ const promise = page.locator('button').click({ signal: controller.signal, timeout: 0 }).catch(e => e);
+ // Give the action time to start and emit call log entries before aborting.
+ await page.waitForTimeout(500);
+
+ const reason = new Error('Aborted by user');
+ controller.abort(reason);
+ const error = await promise;
+ expect(error.message).toContain('The operation was aborted');
+ expect(error.message).toContain(`Call log:`);
+ expect(error.name).toBe('AbortError');
+ expect(error.cause).toBe(reason);
+});
+
+it('should throw an Error when aborted in-flight with a string reason', async ({ page }) => {
+ await page.setContent(`<button style="display:none">click me</button>`);
+ const controller = new AbortController();
+ const promise = page.locator('button').click({ signal: controller.signal, timeout: 0 });
+ controller.abort('aborted by user');
+ const error = await promise.catch(e => e);
+ expect(error).toBeInstanceOf(Error);
+ expect(error.name).toBe('AbortError');
+ expect(error.cause).toBe('aborted by user');
+});
+
+it('should abort via already-aborted signal', async ({ page }) => {
+ await page.setContent(`<button>click me</button>`);
+ const controller = new AbortController();
+ const reason = new Error('Already aborted');
+ controller.abort(reason);
+ const error = await page.locator('button').click({ signal: controller.signal }).catch(e => e);
+ expect(error.message).toContain('The operation was aborted');
+ expect(error.name).toBe('AbortError');
+ expect(error.cause).toBe(reason);
+});
+
+it('should throw an Error when aborted via an already-aborted signal with a string reason', async ({ page }) => {
+ await page.setContent(`<button>click me</button>`);
+ const controller = new AbortController();
+ controller.abort('already aborted');
+ const error = await page.locator('button').click({ signal: controller.signal }).catch(e => e);
+ expect(error).toBeInstanceOf(Error);
+ expect(error.name).toBe('AbortError');
+ expect(error.cause).toBe('already aborted');
+});
diff --git a/utils/generate_channels.js b/utils/generate_channels.js
index 374d334fa8..d18da74789 100755
--- a/utils/generate_channels.js
+++ b/utils/generate_channels.js
@@ -360,8 +360,7 @@ function generateChannels(target) {
for (const derived of derivedClasses.get(channelName) || [])
addScheme(`${derived}${titleCase(methodName)}ErrorDetails`, `tType('${errorDetailsName}')`);
}
- const secondParam = isDispatcher ? `, progress: Progress` : '';
- channels_ts.push(` ${methodName}(params${method.parameters || isDispatcher ? '' : '?'}: ${paramsName}${secondParam}): Promise<${resultName}>;`);
+ channels_ts.push(` ${methodName}(params: ${paramsName}, ${isDispatcher ? `progress: Progress` : `signal: AbortSignal | undefined`}): Promise<${resultName}>;`);
}
channels_ts.push(`}`);
diff --git a/utils/generate_types/overrides.d.ts b/utils/generate_types/overrides.d.ts
index ccfd73db92..54300f3c1e 100644
--- a/utils/generate_types/overrides.d.ts
+++ b/utils/generate_types/overrides.d.ts
@@ -193,7 +193,7 @@ export interface Locator {
evaluate<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, R>, arg?: Arg, options?: { timeout?: number }): Promise<R>;
evaluateHandle<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, R>, arg?: Arg, options?: { timeout?: number }): Promise<SmartHandle<R>>;
evaluateAll<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E[], Arg, R>, arg?: Arg): Promise<R>;
- waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number }): Promise<void>;
+ waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise<void>;
elementHandle(options?: { timeout?: number }): Promise<ElementHandle<SVGElement | HTMLElement>>;
highlight(options?: { style?: string | { [key: string]: string | number } }): Promise<Disposable>;
toString(): string;