Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
Revert "feat: add `AbortSignal` support to client-side Waiter methods" (#41197)
Simon Knottdff0517d6acc
diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.mdindex 518b2f6059..c5e504b484 100644--- a/docs/src/api/class-browsercontext.md+++ b/docs/src/api/class-browsercontext.md@@ -1713,7 +1713,6 @@ Receives the [ConsoleMessage] object and resolves to truthy value when the waiti### option: BrowserContext.waitForConsoleMessage.timeout = %%-wait-for-event-timeout-%%* since: v1.34-### option: BrowserContext.waitForConsoleMessage.signal = %%-wait-for-event-signal-%%### param: BrowserContext.waitForConsoleMessage.callback = %%-java-wait-for-event-callback-%%* since: v1.34@@ -1783,7 +1782,6 @@ Either a predicate that receives an event or an options object. Optional.### option: BrowserContext.waitForEvent.timeout = %%-wait-for-event-timeout-%%* since: v1.8-### option: BrowserContext.waitForEvent.signal = %%-wait-for-event-signal-%%## async method: BrowserContext.waitForPage* since: v1.9@@ -1813,7 +1811,6 @@ Receives the [Page] object and resolves to truthy value when the waiting should### option: BrowserContext.waitForPage.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: BrowserContext.waitForPage.signal = %%-wait-for-event-signal-%%### param: BrowserContext.waitForPage.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -1840,4 +1837,3 @@ Will throw an error if the browser context is closed before the `event` is fired### option: BrowserContext.waitForEvent2.timeout = %%-wait-for-event-timeout-%%* since: v1.8-### option: BrowserContext.waitForEvent2.signal = %%-wait-for-event-signal-%%diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.mdindex 153a09ddaa..c73aa88e7b 100644--- a/docs/src/api/class-frame.md+++ b/docs/src/api/class-frame.md@@ -2010,7 +2010,6 @@ await frame.WaitForLoadStateAsync(); // Defaults to LoadState.Load### option: Frame.waitForLoadState.timeout = %%-navigation-timeout-js-%%* since: v1.8-### option: Frame.waitForLoadState.signal = %%-wait-for-event-signal-%%## async method: Frame.waitForNavigation* since: v1.8@@ -2094,7 +2093,6 @@ a navigation.### option: Frame.waitForNavigation.timeout = %%-navigation-timeout-js-%%* since: v1.8-### option: Frame.waitForNavigation.signal = %%-wait-for-event-signal-%%### param: Frame.waitForNavigation.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -2291,7 +2289,6 @@ await frame.WaitForURLAsync("**/target.html");### option: Frame.waitForURL.timeout = %%-navigation-timeout-js-%%* since: v1.11-### option: Frame.waitForURL.signal = %%-wait-for-event-signal-%%### option: Frame.waitForURL.waitUntil = %%-navigation-wait-until-%%* since: v1.11diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.mdindex 098d83af72..606bab5d35 100644--- a/docs/src/api/class-page.md+++ b/docs/src/api/class-page.md@@ -4507,7 +4507,6 @@ Performs action and waits for the Page to close.### option: Page.waitForClose.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForClose.signal = %%-wait-for-event-signal-%%### param: Page.waitForClose.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -4539,7 +4538,6 @@ Receives the [ConsoleMessage] object and resolves to truthy value when the waiti### option: Page.waitForConsoleMessage.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForConsoleMessage.signal = %%-wait-for-event-signal-%%### param: Page.waitForConsoleMessage.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -4571,7 +4569,6 @@ Receives the [Download] object and resolves to truthy value when the waiting sho### option: Page.waitForDownload.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForDownload.signal = %%-wait-for-event-signal-%%### param: Page.waitForDownload.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -4628,7 +4625,6 @@ Either a predicate that receives an event or an options object. Optional.### option: Page.waitForEvent.timeout = %%-wait-for-event-timeout-%%* since: v1.8-### option: Page.waitForEvent.signal = %%-wait-for-event-signal-%%## async method: Page.waitForFileChooser* since: v1.9@@ -4657,7 +4653,6 @@ Receives the [FileChooser] object and resolves to truthy value when the waiting### option: Page.waitForFileChooser.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForFileChooser.signal = %%-wait-for-event-signal-%%### param: Page.waitForFileChooser.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -4895,7 +4890,6 @@ Console.WriteLine(await popup.TitleAsync()); // popup is ready to use.### option: Page.waitForLoadState.timeout = %%-navigation-timeout-js-%%* since: v1.8-### option: Page.waitForLoadState.signal = %%-wait-for-event-signal-%%## async method: Page.waitForNavigation* since: v1.8@@ -4982,7 +4976,6 @@ a navigation.### option: Page.waitForNavigation.timeout = %%-navigation-timeout-js-%%* since: v1.8-### option: Page.waitForNavigation.signal = %%-wait-for-event-signal-%%### param: Page.waitForNavigation.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -5014,7 +5007,6 @@ Receives the [Page] object and resolves to truthy value when the waiting should### option: Page.waitForPopup.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForPopup.signal = %%-wait-for-event-signal-%%### param: Page.waitForPopup.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -5124,8 +5116,6 @@ Request URL string, regex or predicate receiving [Request] object.Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can bechanged by using the [`method: Page.setDefaultTimeout`] method.-### option: Page.waitForRequest.signal = %%-wait-for-event-signal-%%-### param: Page.waitForRequest.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -5156,7 +5146,6 @@ Receives the [Request] object and resolves to truthy value when the waiting shou### option: Page.waitForRequestFinished.timeout = %%-wait-for-event-timeout-%%* since: v1.12-### option: Page.waitForRequestFinished.signal = %%-wait-for-event-signal-%%### param: Page.waitForRequestFinished.callback = %%-java-wait-for-event-callback-%%* since: v1.12@@ -5273,8 +5262,6 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/WeMaximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can bechanged by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.-### option: Page.waitForResponse.signal = %%-wait-for-event-signal-%%-### param: Page.waitForResponse.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -5526,7 +5513,6 @@ await page.WaitForURLAsync("**/target.html");### option: Page.waitForURL.timeout = %%-navigation-timeout-js-%%* since: v1.11-### option: Page.waitForURL.signal = %%-wait-for-event-signal-%%### option: Page.waitForURL.waitUntil = %%-navigation-wait-until-%%* since: v1.11@@ -5558,7 +5544,6 @@ Receives the [WebSocket] object and resolves to truthy value when the waiting sh### option: Page.waitForWebSocket.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForWebSocket.signal = %%-wait-for-event-signal-%%### param: Page.waitForWebSocket.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -5590,7 +5575,6 @@ Receives the [Worker] object and resolves to truthy value when the waiting shoul### option: Page.waitForWorker.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Page.waitForWorker.signal = %%-wait-for-event-signal-%%### param: Page.waitForWorker.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -5628,4 +5612,3 @@ Will throw an error if the page is closed before the `event` is fired.### option: Page.waitForEvent2.timeout = %%-wait-for-event-timeout-%%* since: v1.8-### option: Page.waitForEvent2.signal = %%-wait-for-event-signal-%%diff --git a/docs/src/api/class-websocket.md b/docs/src/api/class-websocket.mdindex 354de8f874..e33740eaca 100644--- a/docs/src/api/class-websocket.md+++ b/docs/src/api/class-websocket.md@@ -97,7 +97,6 @@ Either a predicate that receives an event or an options object. Optional.### option: WebSocket.waitForEvent.timeout = %%-wait-for-event-timeout-%%* since: v1.8-### option: WebSocket.waitForEvent.signal = %%-wait-for-event-signal-%%## async method: WebSocket.waitForFrameReceived* since: v1.10@@ -116,7 +115,6 @@ Receives the [WebSocketFrame] object and resolves to truthy value when the waiti### option: WebSocket.waitForFrameReceived.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: WebSocket.waitForFrameReceived.signal = %%-wait-for-event-signal-%%### param: WebSocket.waitForFrameReceived.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -138,7 +136,6 @@ Receives the [WebSocketFrame] object and resolves to truthy value when the waiti### option: WebSocket.waitForFrameSent.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: WebSocket.waitForFrameSent.signal = %%-wait-for-event-signal-%%### param: WebSocket.waitForFrameSent.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -165,4 +162,3 @@ Will throw an error if the socket is closed before the `event` is fired.### option: WebSocket.waitForEvent2.timeout = %%-wait-for-event-timeout-%%* since: v1.8-### option: WebSocket.waitForEvent2.signal = %%-wait-for-event-signal-%%diff --git a/docs/src/api/class-worker.md b/docs/src/api/class-worker.mdindex 9c7160335a..5fc5992aff 100644--- a/docs/src/api/class-worker.md+++ b/docs/src/api/class-worker.md@@ -126,7 +126,6 @@ Performs action and waits for the Worker to close.### option: Worker.waitForClose.timeout = %%-wait-for-event-timeout-%%* since: v1.9-### option: Worker.waitForClose.signal = %%-wait-for-event-signal-%%### param: Worker.waitForClose.callback = %%-java-wait-for-event-callback-%%* since: v1.9@@ -146,7 +145,6 @@ Receives the [ConsoleMessage] object and resolves to true when the waiting shoul### option: Worker.waitForConsoleMessage.timeout = %%-wait-for-event-timeout-%%* since: v1.57-### option: Worker.waitForConsoleMessage.signal = %%-wait-for-event-signal-%%### param: Worker.waitForConsoleMessage.callback = %%-java-wait-for-event-callback-%%* since: v1.57@@ -205,4 +203,3 @@ Either a predicate that receives an event or an options object. Optional.### option: Worker.waitForEvent.timeout = %%-wait-for-event-timeout-%%* since: v1.57-### option: Worker.waitForEvent.signal = %%-wait-for-event-signal-%%diff --git a/docs/src/api/params.md b/docs/src/api/params.mdindex 0e885a7aa3..118b38b282 100644--- a/docs/src/api/params.md+++ b/docs/src/api/params.md@@ -991,14 +991,6 @@ Receives the event data and resolves to truthy value when the waiting should resMaximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].-## wait-for-event-signal-* langs: js-* since: v1.61-- `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.-## android-timeout* langs: js- `timeout` <[float]>diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.tsindex 26912a6ead..f03a833351 100644--- a/packages/playwright-client/types/types.d.ts+++ b/packages/playwright-client/types/types.d.ts@@ -4787,7 +4787,7 @@ export interface Page {/*** Emitted when the page closes.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.@@ -4808,7 +4808,7 @@ export interface Page {* ```**/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;/*** Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page@@ -4828,7 +4828,7 @@ export interface Page {* ```**/- waitForEvent(event: 'crash', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'crash', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**@@ -4848,19 +4848,19 @@ export interface Page {* listeners are present, all dialogs are automatically dismissed.**/- waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;+ waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;/*** Emitted when the JavaScript* [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.*/- waitForEvent(event: 'domcontentloaded', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'domcontentloaded', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when attachment download started. User can access basic file operations on downloaded content via the* passed [Download](https://playwright.dev/docs/api/class-download) instance.*/- waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;+ waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;/*** Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can@@ -4875,27 +4875,27 @@ export interface Page {* ```**/- waitForEvent(event: 'filechooser', optionsOrPredicate?: { predicate?: (fileChooser: FileChooser) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((fileChooser: FileChooser) => boolean | Promise<boolean>)): Promise<FileChooser>;+ waitForEvent(event: 'filechooser', optionsOrPredicate?: { predicate?: (fileChooser: FileChooser) => boolean | Promise<boolean>, timeout?: number } | ((fileChooser: FileChooser) => boolean | Promise<boolean>)): Promise<FileChooser>;/*** Emitted when a frame is attached.*/- waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is detached.*/- waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is navigated to a new url.*/- waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when the JavaScript [`load`](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched.*/- waitForEvent(event: 'load', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'load', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when an uncaught exception happens within the page.@@ -4911,7 +4911,7 @@ export interface Page {* ```**/- waitForEvent(event: 'pageerror', optionsOrPredicate?: { predicate?: (error: Error) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((error: Error) => boolean | Promise<boolean>)): Promise<Error>;+ waitForEvent(event: 'pageerror', optionsOrPredicate?: { predicate?: (error: Error) => boolean | Promise<boolean>, timeout?: number } | ((error: Error) => boolean | Promise<boolean>)): Promise<Error>;/*** Emitted when the page opens a new tab or window. This event is emitted in addition to the@@ -4940,14 +4940,14 @@ export interface Page {* wait until the page gets to a particular state (you should not need it in most cases).**/- waitForEvent(event: 'popup', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'popup', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,* see [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).*/- waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request fails, for example by timing out.@@ -4966,30 +4966,30 @@ export interface Page {* error net::ERR_FAILED.**/- waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request finishes successfully after downloading the response body. For a successful response, the* sequence of events is `request`, `response` and `requestfinished`.*/- waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when [response] status and headers are received for a request. For a successful response, the sequence of* events is `request`, `response` and `requestfinished`.*/- waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;+ waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;/*** Emitted when [WebSocket](https://playwright.dev/docs/api/class-websocket) request is sent.*/- waitForEvent(event: 'websocket', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;+ waitForEvent(event: 'websocket', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;/*** Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned* by the page.*/- waitForEvent(event: 'worker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;+ waitForEvent(event: 'worker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;/**@@ -5026,14 +5026,6 @@ export interface Page {* @param options*/waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {- /**- * 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.- */- 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@@ -5071,14 +5063,6 @@ export interface Page {* @param options*/waitForNavigation(options?: {- /**- * 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.- */- 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@@ -5132,14 +5116,6 @@ export interface Page {* @param options*/waitForRequest(urlOrPredicate: string|RegExp|((request: Request) => boolean|Promise<boolean>), options?: {- /**- * 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.- */- signal?: AbortSignal;-/*** Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can* be changed by using the@@ -5176,14 +5152,6 @@ export interface Page {* @param options*/waitForResponse(urlOrPredicate: string|RegExp|((response: Response) => boolean|Promise<boolean>), options?: {- /**- * 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.- */- signal?: AbortSignal;-/*** Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can* be changed by using the@@ -5230,14 +5198,6 @@ export interface Page {* @param options*/waitForURL(url: string|RegExp|URLPattern|((url: URL) => boolean), options?: {- /**- * 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.- */- 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@@ -8063,14 +8023,6 @@ export interface Frame {* @param options*/waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {- /**- * 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.- */- 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@@ -8107,14 +8059,6 @@ export interface Frame {* @param options*/waitForNavigation(options?: {- /**- * 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.- */- 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@@ -8173,14 +8117,6 @@ export interface Frame {* @param options*/waitForURL(url: string|RegExp|URLPattern|((url: URL) => boolean), options?: {- /**- * 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.- */- 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@@ -9787,7 +9723,7 @@ export interface BrowserContext {/*** This event is not emitted.*/- waitForEvent(event: 'backgroundpage', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'backgroundpage', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when Browser context gets closed. This might happen because of one of the following:@@ -9795,7 +9731,7 @@ export interface BrowserContext {* - Browser application is closed or crashed.* - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (browserContext: BrowserContext) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((browserContext: BrowserContext) => boolean | Promise<boolean>)): Promise<BrowserContext>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (browserContext: BrowserContext) => boolean | Promise<boolean>, timeout?: number } | ((browserContext: BrowserContext) => boolean | Promise<boolean>)): Promise<BrowserContext>;/*** Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.@@ -9816,7 +9752,7 @@ export interface BrowserContext {* ```**/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;/*** Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**@@ -9838,7 +9774,7 @@ export interface BrowserContext {* listeners are present, all dialogs are automatically dismissed.**/- waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;+ waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;/*** Emitted when attachment download started in any page belonging to this context. User can access basic file@@ -9846,28 +9782,28 @@ export interface BrowserContext {* instance. See also [page.on('download')](https://playwright.dev/docs/api/class-page#page-event-download) to receive* events about a specific page.*/- waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;+ waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;/*** Emitted when a frame is attached in any page belonging to this context. See also* [page.on('frameattached')](https://playwright.dev/docs/api/class-page#page-event-frame-attached) to receive events* about a specific page.*/- waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is detached in any page belonging to this context. See also* [page.on('framedetached')](https://playwright.dev/docs/api/class-page#page-event-frame-detached) to receive events* about a specific page.*/- waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is navigated to a new url in any page belonging to this context. See also* [page.on('framenavigated')](https://playwright.dev/docs/api/class-page#page-event-frame-navigated) to receive* events about navigations in a specific page.*/- waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event@@ -9896,14 +9832,14 @@ export interface BrowserContext {* wait until the page gets to a particular state (you should not need it in most cases).**/- waitForEvent(event: 'page', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'page', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a page in this context is closed. See also* [page.on('close')](https://playwright.dev/docs/api/class-page#page-event-close) to receive events about a specific* page.*/- waitForEvent(event: 'pageclose', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'pageclose', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when the JavaScript [`load`](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched@@ -9911,7 +9847,7 @@ export interface BrowserContext {* [page.on('load')](https://playwright.dev/docs/api/class-page#page-event-load) to receive events about a specific* page.*/- waitForEvent(event: 'pageload', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'pageload', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To@@ -9922,7 +9858,7 @@ export interface BrowserContext {* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route)* or [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route).*/- waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,@@ -9935,7 +9871,7 @@ export interface BrowserContext {* [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed).**/- waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request finishes successfully after downloading the response body. For a successful response, the@@ -9943,27 +9879,27 @@ export interface BrowserContext {* particular page, use* [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).*/- waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when [response] status and headers are received for a request. For a successful response, the sequence of* events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use* [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response).*/- waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;+ waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;/*** **NOTE** Service workers are only supported on Chromium-based browsers.** Emitted when new service worker is created in the context.*/- waitForEvent(event: 'serviceworker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;+ waitForEvent(event: 'serviceworker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;/*** Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular* page, use [page.on('pageerror')](https://playwright.dev/docs/api/class-page#page-event-page-error) instead.*/- waitForEvent(event: 'weberror', optionsOrPredicate?: { predicate?: (webError: WebError) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((webError: WebError) => boolean | Promise<boolean>)): Promise<WebError>;+ waitForEvent(event: 'weberror', optionsOrPredicate?: { predicate?: (webError: WebError) => boolean | Promise<boolean>, timeout?: number } | ((webError: WebError) => boolean | Promise<boolean>)): Promise<WebError>;/**@@ -10930,12 +10866,12 @@ export interface Worker {* Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is* terminated.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;/*** Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.*/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;}@@ -17178,7 +17114,7 @@ export interface ElectronApplication {/*** This event is issued when the application process has been terminated.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | (() => boolean | Promise<boolean>)): Promise<void>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number } | (() => boolean | Promise<boolean>)): Promise<void>;/*** Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or@@ -17200,13 +17136,13 @@ export interface ElectronApplication {* ```**/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;/*** This event is issued for every window that is created **and loaded** in Electron. It contains a* [Page](https://playwright.dev/docs/api/class-page) that can be used for Playwright automation.*/- waitForEvent(event: 'window', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'window', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/**@@ -21708,7 +21644,7 @@ export interface WebSocket {/*** Fired when the websocket closes.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;/*** Fired when the websocket receives a frame.@@ -21718,7 +21654,7 @@ export interface WebSocket {* frame payload*/payload: string|Buffer;- }) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((data: {+ }) => boolean | Promise<boolean>, timeout?: number } | ((data: {/*** frame payload*/@@ -21738,7 +21674,7 @@ export interface WebSocket {* frame payload*/payload: string|Buffer;- }) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((data: {+ }) => boolean | Promise<boolean>, timeout?: number } | ((data: {/*** frame payload*/@@ -21753,7 +21689,7 @@ export interface WebSocket {/*** Fired when the websocket has an error.*/- waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((string: string) => boolean | Promise<boolean>)): Promise<string>;+ waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise<boolean>, timeout?: number } | ((string: string) => boolean | Promise<boolean>)): Promise<string>;}@@ -23100,12 +23036,12 @@ export interface AndroidDevice {/*** Emitted when the device connection gets closed.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (androidDevice: AndroidDevice) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((androidDevice: AndroidDevice) => boolean | Promise<boolean>)): Promise<AndroidDevice>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (androidDevice: AndroidDevice) => boolean | Promise<boolean>, timeout?: number } | ((androidDevice: AndroidDevice) => boolean | Promise<boolean>)): Promise<AndroidDevice>;/*** Emitted when a new WebView instance is detected.*/- waitForEvent(event: 'webview', optionsOrPredicate?: { predicate?: (androidWebView: AndroidWebView) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((androidWebView: AndroidWebView) => boolean | Promise<boolean>)): Promise<AndroidWebView>;+ waitForEvent(event: 'webview', optionsOrPredicate?: { predicate?: (androidWebView: AndroidWebView) => boolean | Promise<boolean>, timeout?: number } | ((androidWebView: AndroidWebView) => boolean | Promise<boolean>)): Promise<AndroidWebView>;/**diff --git a/packages/playwright-core/src/client/android.ts b/packages/playwright-core/src/client/android.tsindex 3f6ad60f04..9a63c601ef 100644--- a/packages/playwright-core/src/client/android.ts+++ b/packages/playwright-core/src/client/android.ts@@ -273,10 +273,8 @@ export class AndroidDevice extends ChannelOwner<channels.AndroidDeviceChannel> ireturn await this._wrapApiCall(async () => {const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === 'function' ? {} : optionsOrPredicate);const predicate = typeof optionsOrPredicate === 'function' ? optionsOrPredicate : optionsOrPredicate.predicate;- const signal = typeof optionsOrPredicate === 'function' ? undefined : (optionsOrPredicate as types.TimeoutOptions).signal;const waiter = Waiter.createForEvent(this, event);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);- waiter.rejectOnSignal(signal);if (event !== Events.AndroidDevice.Close)waiter.rejectOnEvent(this, Events.AndroidDevice.Close, () => new TargetClosedError());const result = await waiter.waitForEvent(this, event, predicate as any);diff --git a/packages/playwright-core/src/client/browserContext.ts b/packages/playwright-core/src/client/browserContext.tsindex ff4b4241de..31accbf0cb 100644--- a/packages/playwright-core/src/client/browserContext.ts+++ b/packages/playwright-core/src/client/browserContext.ts@@ -43,7 +43,7 @@ import { Worker } from './worker';import { TimeoutSettings } from './timeoutSettings';import { mkdirIfNeeded } from './fileUtils';-import type { BrowserContextOptions, Headers, SetStorageState, StorageState, TimeoutOptions, WaitForEventOptions } from './types';+import type { BrowserContextOptions, Headers, SetStorageState, StorageState, WaitForEventOptions } from './types';import type * as structs from '../../types/structs';import type * as api from '../../types/types';import type { URLMatch } from '@isomorphic/urlMatch';@@ -447,10 +447,8 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>return await this._wrapApiCall(async () => {const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === 'function' ? {} : optionsOrPredicate);const predicate = typeof optionsOrPredicate === 'function' ? optionsOrPredicate : optionsOrPredicate.predicate;- const signal = typeof optionsOrPredicate === 'function' ? undefined : (optionsOrPredicate as TimeoutOptions).signal;const waiter = Waiter.createForEvent(this, event);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);- waiter.rejectOnSignal(signal);if (event !== Events.BrowserContext.Close)waiter.rejectOnEvent(this, Events.BrowserContext.Close, () => new TargetClosedError(this._effectiveCloseReason()));const result = await waiter.waitForEvent(this, event, predicate as any);diff --git a/packages/playwright-core/src/client/electron.ts b/packages/playwright-core/src/client/electron.tsindex f83be02946..2399aa61ff 100644--- a/packages/playwright-core/src/client/electron.ts+++ b/packages/playwright-core/src/client/electron.ts@@ -25,7 +25,7 @@ import { Waiter } from './waiter';import { TimeoutSettings } from './timeoutSettings';import type { Page } from './page';-import type { BrowserContextOptions, Headers, TimeoutOptions, WaitForEventOptions } from './types';+import type { BrowserContextOptions, Headers, WaitForEventOptions } from './types';import type * as structs from '../../types/structs';import type * as api from '../../types/types';import type * as channels from '@protocol/channels';@@ -114,7 +114,7 @@ export class ElectronApplication extends ChannelOwner<channels.ElectronApplicatireturn [...this._windows];}- async firstWindow(options?: TimeoutOptions): Promise<Page> {+ async firstWindow(options?: { timeout?: number }): Promise<Page> {if (this._windows.size)return this._windows.values().next().value!;return await this.waitForEvent('window', options);@@ -142,10 +142,8 @@ export class ElectronApplication extends ChannelOwner<channels.ElectronApplicatireturn await this._wrapApiCall(async () => {const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === 'function' ? {} : optionsOrPredicate);const predicate = typeof optionsOrPredicate === 'function' ? optionsOrPredicate : optionsOrPredicate.predicate;- const signal = typeof optionsOrPredicate === 'function' ? undefined : (optionsOrPredicate as TimeoutOptions).signal;const waiter = Waiter.createForEvent(this, event);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);- waiter.rejectOnSignal(signal);if (event !== Events.ElectronApplication.Close)waiter.rejectOnEvent(this, Events.ElectronApplication.Close, () => new TargetClosedError());const result = await waiter.waitForEvent(this, event, predicate as any);diff --git a/packages/playwright-core/src/client/frame.ts b/packages/playwright-core/src/client/frame.tsindex bb28e67377..bb116238ea 100644--- a/packages/playwright-core/src/client/frame.ts+++ b/packages/playwright-core/src/client/frame.ts@@ -44,7 +44,6 @@ export type WaitForNavigationOptions = {timeout?: number,waitUntil?: LifecycleEvent,url?: URLMatch,- signal?: AbortSignal,};export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Frame {@@ -119,7 +118,7 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Frreturn network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);}- private _setupNavigationWaiter(options: TimeoutOptions): Waiter {+ private _setupNavigationWaiter(options: { timeout?: number }): Waiter {const waiter = new Waiter(this._page!, '');if (this._page!.isClosed())waiter.rejectImmediately(this._page!._closeErrorWithReason());@@ -128,7 +127,6 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Frwaiter.rejectOnEvent<Frame>(this._page!, Events.Page.FrameDetached, new Error('Navigating frame was detached!'), frame => frame === this);const timeout = this._page!._timeoutSettings.navigationTimeout(options);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded.`);- waiter.rejectOnSignal(options.signal);return waiter;}@@ -167,10 +165,10 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr}, { title: 'Wait for navigation' });}- async waitForLoadState(state: LifecycleEvent = 'load', options?: TimeoutOptions): Promise<void> {+ async waitForLoadState(state: LifecycleEvent = 'load', options: { timeout?: number } = {}): Promise<void> {state = verifyLoadState('state', state);return await this._page!._wrapApiCall(async () => {- const waiter = this._setupNavigationWaiter(options ?? {});+ const waiter = this._setupNavigationWaiter(options);if (this._loadStates.has(state)) {waiter.log(` not waiting, "${state}" event already fired`);} else {@@ -183,12 +181,11 @@ export class Frame extends ChannelOwner<channels.FrameChannel> implements api.Fr}, { title: `Wait for load state "${state}"` });}- async waitForURL(url: URLMatch, options?: { waitUntil?: LifecycleEvent } & TimeoutOptions): Promise<void> {- const waitOptions = options ?? {};+ async waitForURL(url: URLMatch, options: { waitUntil?: LifecycleEvent, timeout?: number } = {}): Promise<void> {if (urlMatches(this._page?.context()._options.baseURL, this.url(), url))- return await this.waitForLoadState(waitOptions.waitUntil, waitOptions);+ return await this.waitForLoadState(options.waitUntil, options);- await this.waitForNavigation({ url, ...waitOptions });+ await this.waitForNavigation({ url, ...options });}async frameElement(): Promise<ElementHandle> {diff --git a/packages/playwright-core/src/client/network.ts b/packages/playwright-core/src/client/network.tsindex 49ab620c19..08ce06bf09 100644--- a/packages/playwright-core/src/client/network.ts+++ b/packages/playwright-core/src/client/network.ts@@ -32,7 +32,7 @@ import { ChannelOwner } from './channelOwner';import type { BrowserContext } from './browserContext';import type { Page } from './page';-import type { Headers, RemoteAddr, SecurityDetails, TimeoutOptions, WaitForEventOptions } from './types';+import type { Headers, RemoteAddr, SecurityDetails, WaitForEventOptions } from './types';import type { Serializable } from '../../types/structs';import type * as api from '../../types/types';import type { HeadersArray } from '@isomorphic/types';@@ -802,10 +802,8 @@ export class WebSocket extends ChannelOwner<channels.WebSocketChannel> implementreturn await this._wrapApiCall(async () => {const timeout = this._page._timeoutSettings.timeout(typeof optionsOrPredicate === 'function' ? {} : optionsOrPredicate);const predicate = typeof optionsOrPredicate === 'function' ? optionsOrPredicate : optionsOrPredicate.predicate;- const signal = typeof optionsOrPredicate === 'function' ? undefined : (optionsOrPredicate as TimeoutOptions).signal;const waiter = Waiter.createForEvent(this, event);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);- waiter.rejectOnSignal(signal);if (event !== Events.WebSocket.Error)waiter.rejectOnEvent(this, Events.WebSocket.Error, new Error('Socket error'));if (event !== Events.WebSocket.Close)diff --git a/packages/playwright-core/src/client/page.ts b/packages/playwright-core/src/client/page.tsindex b45b623083..6da37f9f5b 100644--- a/packages/playwright-core/src/client/page.ts+++ b/packages/playwright-core/src/client/page.ts@@ -449,7 +449,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page};const trimmedUrl = trimUrl(urlOrPredicate);const logLine = trimmedUrl ? `waiting for request ${trimmedUrl}` : undefined;- return await this._waitForEvent(Events.Page.Request, { predicate, timeout: options.timeout, signal: options.signal }, logLine);+ return await this._waitForEvent(Events.Page.Request, { predicate, timeout: options.timeout }, logLine);}async waitForResponse(urlOrPredicate: string | RegExp | ((r: Response) => boolean | Promise<boolean>), options: TimeoutOptions = {}): Promise<Response> {@@ -460,7 +460,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page};const trimmedUrl = trimUrl(urlOrPredicate);const logLine = trimmedUrl ? `waiting for response ${trimmedUrl}` : undefined;- return await this._waitForEvent(Events.Page.Response, { predicate, timeout: options.timeout, signal: options.signal }, logLine);+ return await this._waitForEvent(Events.Page.Response, { predicate, timeout: options.timeout }, logLine);}async waitForEvent(event: string, optionsOrPredicate: WaitForEventOptions = {}): Promise<any> {@@ -475,12 +475,10 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Pagereturn await this._wrapApiCall(async () => {const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === 'function' ? {} : optionsOrPredicate);const predicate = typeof optionsOrPredicate === 'function' ? optionsOrPredicate : optionsOrPredicate.predicate;- const signal = typeof optionsOrPredicate === 'function' ? undefined : (optionsOrPredicate as TimeoutOptions).signal;const waiter = Waiter.createForEvent(this, event);if (logLine)waiter.log(logLine);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);- waiter.rejectOnSignal(signal);if (event !== Events.Page.Crash)waiter.rejectOnEvent(this, Events.Page.Crash, new Error('Page crashed'));if (event !== Events.Page.Close)diff --git a/packages/playwright-core/src/client/types.ts b/packages/playwright-core/src/client/types.tsindex cf7bedd7af..cb90ec932f 100644--- a/packages/playwright-core/src/client/types.ts+++ b/packages/playwright-core/src/client/types.ts@@ -25,7 +25,7 @@ export interface Logger {log(name: string, severity: LoggerSeverity, message: string | Error, args: any[], hints: { color?: string }): void;}-export type TimeoutOptions = { timeout?: number, signal?: AbortSignal };+export type TimeoutOptions = { timeout?: number };export type StrictOptions = { strict?: boolean };export type Headers = { [key: string]: string };diff --git a/packages/playwright-core/src/client/waiter.ts b/packages/playwright-core/src/client/waiter.tsindex e53aeae27d..e2b63c8900 100644--- a/packages/playwright-core/src/client/waiter.ts+++ b/packages/playwright-core/src/client/waiter.ts@@ -85,20 +85,6 @@ export class Waiter {this._rejectOn(promise.then(() => { throw new TimeoutError(message); }), dispose);}- rejectOnSignal(signal: AbortSignal | undefined) {- if (!signal)- return;- if (signal.aborted) {- this.rejectImmediately(signalToError(signal));- return;- }- let rejectPromise: (e: any) => void;- const promise = new Promise<void>((_, reject) => { rejectPromise = reject; });- const listener = () => rejectPromise!(signalToError(signal));- signal.addEventListener('abort', listener, { once: true });- this._rejectOn(promise, () => signal.removeEventListener('abort', listener));- }-rejectImmediately(error: Error) {this._immediateError = error;}@@ -160,14 +146,6 @@ function waitForEvent<T = void>(emitter: EventEmitter, event: string, savedZone:return { promise, dispose };}-function signalToError(signal: AbortSignal): Error {- const reason = signal.reason;- if (reason instanceof Error)- return reason;- const message = typeof reason?.message === 'string' ? reason.message : reason;- return new Error(String(message ?? 'The operation was aborted'));-}-function waitForTimeout(timeout: number): { promise: Promise<void>, dispose: () => void } {let timeoutId: any;const promise = new Promise<void>(resolve => timeoutId = setTimeout(resolve, timeout));diff --git a/packages/playwright-core/src/client/worker.ts b/packages/playwright-core/src/client/worker.tsindex 1d11e65b21..ee98e35779 100644--- a/packages/playwright-core/src/client/worker.ts+++ b/packages/playwright-core/src/client/worker.ts@@ -28,7 +28,7 @@ import type { Page } from './page';import type * as structs from '../../types/structs';import type * as api from '../../types/types';import type * as channels from '@protocol/channels';-import type { TimeoutOptions, WaitForEventOptions } from './types';+import type { WaitForEventOptions } from './types';export class Worker extends ChannelOwner<channels.WorkerChannel> implements api.Worker {@@ -91,10 +91,8 @@ export class Worker extends ChannelOwner<channels.WorkerChannel> implements api.const timeoutSettings = this._page?._timeoutSettings ?? this._context?._timeoutSettings ?? new TimeoutSettings(this._platform);const timeout = timeoutSettings.timeout(typeof optionsOrPredicate === 'function' ? {} : optionsOrPredicate);const predicate = typeof optionsOrPredicate === 'function' ? optionsOrPredicate : optionsOrPredicate.predicate;- const signal = typeof optionsOrPredicate === 'function' ? undefined : (optionsOrPredicate as TimeoutOptions).signal;const waiter = Waiter.createForEvent(this, event);waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);- waiter.rejectOnSignal(signal);if (event !== Events.Worker.Close)waiter.rejectOnEvent(this, Events.Worker.Close, () => this._closeErrorWithReason());const result = await waiter.waitForEvent(this, event, predicate as any);diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.tsindex 26912a6ead..f03a833351 100644--- a/packages/playwright-core/types/types.d.ts+++ b/packages/playwright-core/types/types.d.ts@@ -4787,7 +4787,7 @@ export interface Page {/*** Emitted when the page closes.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.@@ -4808,7 +4808,7 @@ export interface Page {* ```**/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;/*** Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page@@ -4828,7 +4828,7 @@ export interface Page {* ```**/- waitForEvent(event: 'crash', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'crash', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**@@ -4848,19 +4848,19 @@ export interface Page {* listeners are present, all dialogs are automatically dismissed.**/- waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;+ waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;/*** Emitted when the JavaScript* [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.*/- waitForEvent(event: 'domcontentloaded', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'domcontentloaded', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when attachment download started. User can access basic file operations on downloaded content via the* passed [Download](https://playwright.dev/docs/api/class-download) instance.*/- waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;+ waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;/*** Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can@@ -4875,27 +4875,27 @@ export interface Page {* ```**/- waitForEvent(event: 'filechooser', optionsOrPredicate?: { predicate?: (fileChooser: FileChooser) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((fileChooser: FileChooser) => boolean | Promise<boolean>)): Promise<FileChooser>;+ waitForEvent(event: 'filechooser', optionsOrPredicate?: { predicate?: (fileChooser: FileChooser) => boolean | Promise<boolean>, timeout?: number } | ((fileChooser: FileChooser) => boolean | Promise<boolean>)): Promise<FileChooser>;/*** Emitted when a frame is attached.*/- waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is detached.*/- waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is navigated to a new url.*/- waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when the JavaScript [`load`](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched.*/- waitForEvent(event: 'load', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'load', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when an uncaught exception happens within the page.@@ -4911,7 +4911,7 @@ export interface Page {* ```**/- waitForEvent(event: 'pageerror', optionsOrPredicate?: { predicate?: (error: Error) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((error: Error) => boolean | Promise<boolean>)): Promise<Error>;+ waitForEvent(event: 'pageerror', optionsOrPredicate?: { predicate?: (error: Error) => boolean | Promise<boolean>, timeout?: number } | ((error: Error) => boolean | Promise<boolean>)): Promise<Error>;/*** Emitted when the page opens a new tab or window. This event is emitted in addition to the@@ -4940,14 +4940,14 @@ export interface Page {* wait until the page gets to a particular state (you should not need it in most cases).**/- waitForEvent(event: 'popup', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'popup', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,* see [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route) or* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route).*/- waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request fails, for example by timing out.@@ -4966,30 +4966,30 @@ export interface Page {* error net::ERR_FAILED.**/- waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request finishes successfully after downloading the response body. For a successful response, the* sequence of events is `request`, `response` and `requestfinished`.*/- waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when [response] status and headers are received for a request. For a successful response, the sequence of* events is `request`, `response` and `requestfinished`.*/- waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;+ waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;/*** Emitted when [WebSocket](https://playwright.dev/docs/api/class-websocket) request is sent.*/- waitForEvent(event: 'websocket', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;+ waitForEvent(event: 'websocket', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;/*** Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned* by the page.*/- waitForEvent(event: 'worker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;+ waitForEvent(event: 'worker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;/**@@ -5026,14 +5026,6 @@ export interface Page {* @param options*/waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {- /**- * 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.- */- 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@@ -5071,14 +5063,6 @@ export interface Page {* @param options*/waitForNavigation(options?: {- /**- * 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.- */- 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@@ -5132,14 +5116,6 @@ export interface Page {* @param options*/waitForRequest(urlOrPredicate: string|RegExp|((request: Request) => boolean|Promise<boolean>), options?: {- /**- * 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.- */- signal?: AbortSignal;-/*** Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can* be changed by using the@@ -5176,14 +5152,6 @@ export interface Page {* @param options*/waitForResponse(urlOrPredicate: string|RegExp|((response: Response) => boolean|Promise<boolean>), options?: {- /**- * 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.- */- signal?: AbortSignal;-/*** Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can* be changed by using the@@ -5230,14 +5198,6 @@ export interface Page {* @param options*/waitForURL(url: string|RegExp|URLPattern|((url: URL) => boolean), options?: {- /**- * 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.- */- 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@@ -8063,14 +8023,6 @@ export interface Frame {* @param options*/waitForLoadState(state?: "load"|"domcontentloaded"|"networkidle", options?: {- /**- * 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.- */- 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@@ -8107,14 +8059,6 @@ export interface Frame {* @param options*/waitForNavigation(options?: {- /**- * 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.- */- 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@@ -8173,14 +8117,6 @@ export interface Frame {* @param options*/waitForURL(url: string|RegExp|URLPattern|((url: URL) => boolean), options?: {- /**- * 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.- */- 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@@ -9787,7 +9723,7 @@ export interface BrowserContext {/*** This event is not emitted.*/- waitForEvent(event: 'backgroundpage', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'backgroundpage', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when Browser context gets closed. This might happen because of one of the following:@@ -9795,7 +9731,7 @@ export interface BrowserContext {* - Browser application is closed or crashed.* - The [browser.close([options])](https://playwright.dev/docs/api/class-browser#browser-close) method was called.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (browserContext: BrowserContext) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((browserContext: BrowserContext) => boolean | Promise<boolean>)): Promise<BrowserContext>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (browserContext: BrowserContext) => boolean | Promise<boolean>, timeout?: number } | ((browserContext: BrowserContext) => boolean | Promise<boolean>)): Promise<BrowserContext>;/*** Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.@@ -9816,7 +9752,7 @@ export interface BrowserContext {* ```**/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;/*** Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**@@ -9838,7 +9774,7 @@ export interface BrowserContext {* listeners are present, all dialogs are automatically dismissed.**/- waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;+ waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise<boolean>, timeout?: number } | ((dialog: Dialog) => boolean | Promise<boolean>)): Promise<Dialog>;/*** Emitted when attachment download started in any page belonging to this context. User can access basic file@@ -9846,28 +9782,28 @@ export interface BrowserContext {* instance. See also [page.on('download')](https://playwright.dev/docs/api/class-page#page-event-download) to receive* events about a specific page.*/- waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;+ waitForEvent(event: 'download', optionsOrPredicate?: { predicate?: (download: Download) => boolean | Promise<boolean>, timeout?: number } | ((download: Download) => boolean | Promise<boolean>)): Promise<Download>;/*** Emitted when a frame is attached in any page belonging to this context. See also* [page.on('frameattached')](https://playwright.dev/docs/api/class-page#page-event-frame-attached) to receive events* about a specific page.*/- waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'frameattached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is detached in any page belonging to this context. See also* [page.on('framedetached')](https://playwright.dev/docs/api/class-page#page-event-frame-detached) to receive events* about a specific page.*/- waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framedetached', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** Emitted when a frame is navigated to a new url in any page belonging to this context. See also* [page.on('framenavigated')](https://playwright.dev/docs/api/class-page#page-event-frame-navigated) to receive* events about navigations in a specific page.*/- waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;+ waitForEvent(event: 'framenavigated', optionsOrPredicate?: { predicate?: (frame: Frame) => boolean | Promise<boolean>, timeout?: number } | ((frame: Frame) => boolean | Promise<boolean>)): Promise<Frame>;/*** The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event@@ -9896,14 +9832,14 @@ export interface BrowserContext {* wait until the page gets to a particular state (you should not need it in most cases).**/- waitForEvent(event: 'page', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'page', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a page in this context is closed. See also* [page.on('close')](https://playwright.dev/docs/api/class-page#page-event-close) to receive events about a specific* page.*/- waitForEvent(event: 'pageclose', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'pageclose', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when the JavaScript [`load`](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched@@ -9911,7 +9847,7 @@ export interface BrowserContext {* [page.on('load')](https://playwright.dev/docs/api/class-page#page-event-load) to receive events about a specific* page.*/- waitForEvent(event: 'pageload', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'pageload', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/*** Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To@@ -9922,7 +9858,7 @@ export interface BrowserContext {* [browserContext.route(url, handler[, options])](https://playwright.dev/docs/api/class-browsercontext#browser-context-route)* or [page.route(url, handler[, options])](https://playwright.dev/docs/api/class-page#page-route).*/- waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'request', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,@@ -9935,7 +9871,7 @@ export interface BrowserContext {* [browserContext.on('requestfailed')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-request-failed).**/- waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfailed', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when a request finishes successfully after downloading the response body. For a successful response, the@@ -9943,27 +9879,27 @@ export interface BrowserContext {* particular page, use* [page.on('requestfinished')](https://playwright.dev/docs/api/class-page#page-event-request-finished).*/- waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;+ waitForEvent(event: 'requestfinished', optionsOrPredicate?: { predicate?: (request: Request) => boolean | Promise<boolean>, timeout?: number } | ((request: Request) => boolean | Promise<boolean>)): Promise<Request>;/*** Emitted when [response] status and headers are received for a request. For a successful response, the sequence of* events is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use* [page.on('response')](https://playwright.dev/docs/api/class-page#page-event-response).*/- waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;+ waitForEvent(event: 'response', optionsOrPredicate?: { predicate?: (response: Response) => boolean | Promise<boolean>, timeout?: number } | ((response: Response) => boolean | Promise<boolean>)): Promise<Response>;/*** **NOTE** Service workers are only supported on Chromium-based browsers.** Emitted when new service worker is created in the context.*/- waitForEvent(event: 'serviceworker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;+ waitForEvent(event: 'serviceworker', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;/*** Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular* page, use [page.on('pageerror')](https://playwright.dev/docs/api/class-page#page-event-page-error) instead.*/- waitForEvent(event: 'weberror', optionsOrPredicate?: { predicate?: (webError: WebError) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((webError: WebError) => boolean | Promise<boolean>)): Promise<WebError>;+ waitForEvent(event: 'weberror', optionsOrPredicate?: { predicate?: (webError: WebError) => boolean | Promise<boolean>, timeout?: number } | ((webError: WebError) => boolean | Promise<boolean>)): Promise<WebError>;/**@@ -10930,12 +10866,12 @@ export interface Worker {* Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is* terminated.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (worker: Worker) => boolean | Promise<boolean>, timeout?: number } | ((worker: Worker) => boolean | Promise<boolean>)): Promise<Worker>;/*** Emitted when JavaScript within the worker calls one of console API methods, e.g. `console.log` or `console.dir`.*/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;}@@ -17178,7 +17114,7 @@ export interface ElectronApplication {/*** This event is issued when the application process has been terminated.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | (() => boolean | Promise<boolean>)): Promise<void>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: () => boolean | Promise<boolean>, timeout?: number } | (() => boolean | Promise<boolean>)): Promise<void>;/*** Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or@@ -17200,13 +17136,13 @@ export interface ElectronApplication {* ```**/- waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;+ waitForEvent(event: 'console', optionsOrPredicate?: { predicate?: (consoleMessage: ConsoleMessage) => boolean | Promise<boolean>, timeout?: number } | ((consoleMessage: ConsoleMessage) => boolean | Promise<boolean>)): Promise<ConsoleMessage>;/*** This event is issued for every window that is created **and loaded** in Electron. It contains a* [Page](https://playwright.dev/docs/api/class-page) that can be used for Playwright automation.*/- waitForEvent(event: 'window', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;+ waitForEvent(event: 'window', optionsOrPredicate?: { predicate?: (page: Page) => boolean | Promise<boolean>, timeout?: number } | ((page: Page) => boolean | Promise<boolean>)): Promise<Page>;/**@@ -21708,7 +21644,7 @@ export interface WebSocket {/*** Fired when the websocket closes.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (webSocket: WebSocket) => boolean | Promise<boolean>, timeout?: number } | ((webSocket: WebSocket) => boolean | Promise<boolean>)): Promise<WebSocket>;/*** Fired when the websocket receives a frame.@@ -21718,7 +21654,7 @@ export interface WebSocket {* frame payload*/payload: string|Buffer;- }) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((data: {+ }) => boolean | Promise<boolean>, timeout?: number } | ((data: {/*** frame payload*/@@ -21738,7 +21674,7 @@ export interface WebSocket {* frame payload*/payload: string|Buffer;- }) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((data: {+ }) => boolean | Promise<boolean>, timeout?: number } | ((data: {/*** frame payload*/@@ -21753,7 +21689,7 @@ export interface WebSocket {/*** Fired when the websocket has an error.*/- waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((string: string) => boolean | Promise<boolean>)): Promise<string>;+ waitForEvent(event: 'socketerror', optionsOrPredicate?: { predicate?: (string: string) => boolean | Promise<boolean>, timeout?: number } | ((string: string) => boolean | Promise<boolean>)): Promise<string>;}@@ -23100,12 +23036,12 @@ export interface AndroidDevice {/*** Emitted when the device connection gets closed.*/- waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (androidDevice: AndroidDevice) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((androidDevice: AndroidDevice) => boolean | Promise<boolean>)): Promise<AndroidDevice>;+ waitForEvent(event: 'close', optionsOrPredicate?: { predicate?: (androidDevice: AndroidDevice) => boolean | Promise<boolean>, timeout?: number } | ((androidDevice: AndroidDevice) => boolean | Promise<boolean>)): Promise<AndroidDevice>;/*** Emitted when a new WebView instance is detected.*/- waitForEvent(event: 'webview', optionsOrPredicate?: { predicate?: (androidWebView: AndroidWebView) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((androidWebView: AndroidWebView) => boolean | Promise<boolean>)): Promise<AndroidWebView>;+ waitForEvent(event: 'webview', optionsOrPredicate?: { predicate?: (androidWebView: AndroidWebView) => boolean | Promise<boolean>, timeout?: number } | ((androidWebView: AndroidWebView) => boolean | Promise<boolean>)): Promise<AndroidWebView>;/**diff --git a/tests/page/page-filechooser.spec.ts b/tests/page/page-filechooser.spec.tsindex 9fef3a6925..6c4262e41d 100644--- a/tests/page/page-filechooser.spec.ts+++ b/tests/page/page-filechooser.spec.ts@@ -218,13 +218,6 @@ test('should work with no timeout', async ({ page, server }) => {expect(chooser).toBeTruthy();});-test('should abort with signal', async ({ page }) => {- const controller = new AbortController();- const promise = page.waitForEvent('filechooser', { signal: controller.signal });- controller.abort('Aborted by user');- await expect(promise).rejects.toThrow('Aborted by user');-});-test('should return the same file chooser when there are many watchdogs simultaneously', async ({ page, server }) => {await page.setContent(`<input type=file>`);const [fileChooser1, fileChooser2] = await Promise.all([diff --git a/utils/generate_types/index.js b/utils/generate_types/index.jsindex c0cf8c46b9..dc811837eb 100644--- a/utils/generate_types/index.js+++ b/utils/generate_types/index.js@@ -288,7 +288,7 @@ class TypesGenerator {for (const { eventName, params, comment, type } of eventDescriptions) {if (comment)parts.push(this.writeComment(comment, indent));- parts.push(` ${member.alias}(event: '${eventName}', optionsOrPredicate?: { predicate?: (${params}) => boolean | Promise<boolean>, timeout?: number, signal?: AbortSignal } | ((${params}) => boolean | Promise<boolean>)): Promise<${type}>;\n`);+ parts.push(` ${member.alias}(event: '${eventName}', optionsOrPredicate?: { predicate?: (${params}) => boolean | Promise<boolean>, timeout?: number } | ((${params}) => boolean | Promise<boolean>)): Promise<${type}>;\n`);}return parts.join('\n');