From 1900fa94183e0a8654633a91f82b372ad068da71 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Fri, 2 Feb 2024 13:17:24 +0100 Subject: [PATCH] refactor!: remove waitForTimeout (#11780) --- docs/api/puppeteer.frame.md | 1 - docs/api/puppeteer.frame.waitfortimeout.md | 41 ---------------------- docs/api/puppeteer.page.md | 1 - docs/api/puppeteer.page.waitfortimeout.md | 41 ---------------------- packages/puppeteer-core/src/api/Frame.ts | 26 -------------- packages/puppeteer-core/src/api/Page.ts | 25 ------------- test/src/waittask.spec.ts | 33 ----------------- 7 files changed, 168 deletions(-) delete mode 100644 docs/api/puppeteer.frame.waitfortimeout.md delete mode 100644 docs/api/puppeteer.page.waitfortimeout.md diff --git a/docs/api/puppeteer.frame.md b/docs/api/puppeteer.frame.md index 92d480e371d..f2bed31d82c 100644 --- a/docs/api/puppeteer.frame.md +++ b/docs/api/puppeteer.frame.md @@ -103,5 +103,4 @@ console.log(text); | [waitForFunction(pageFunction, options, args)](./puppeteer.frame.waitforfunction.md) | | | | [waitForNavigation(options)](./puppeteer.frame.waitfornavigation.md) | |
Waits for the frame to navigate. It is useful for when you run code which will indirectly cause the frame to navigate.
Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered a navigation.
| | [waitForSelector(selector, options)](./puppeteer.frame.waitforselector.md) | |Waits for an element matching the given selector to appear in the frame.
This method works across navigations.
| -| [waitForTimeout(milliseconds)](./puppeteer.frame.waitfortimeout.md) | | | | [waitForXPath(xpath, options)](./puppeteer.frame.waitforxpath.md) | | | diff --git a/docs/api/puppeteer.frame.waitfortimeout.md b/docs/api/puppeteer.frame.waitfortimeout.md deleted file mode 100644 index fd3a2339086..00000000000 --- a/docs/api/puppeteer.frame.waitfortimeout.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -sidebar_label: Frame.waitForTimeout ---- - -# Frame.waitForTimeout() method - -> Warning: This API is now obsolete. -> -> Replace with `new Promise(r => setTimeout(r, milliseconds));`. -> -> Causes your script to wait for the given number of milliseconds. - -#### Signature: - -```typescript -class Frame { - waitForTimeout(milliseconds: number): Promiseselector
to appear in page. If at the moment of calling the method the selector
already exists, the method will return immediately. If the selector
doesn't appear after the timeout
milliseconds of waiting, the function will throw. |
-| [waitForTimeout(milliseconds)](./puppeteer.page.waitfortimeout.md) | | |
| [waitForXPath(xpath, options)](./puppeteer.page.waitforxpath.md) | | Wait for the xpath
to appear in page. If at the moment of calling the method the xpath
already exists, the method will return immediately. If the xpath
doesn't appear after the timeout
milliseconds of waiting, the function will throw. |
| [workers()](./puppeteer.page.workers.md) | | All of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page. |
diff --git a/docs/api/puppeteer.page.waitfortimeout.md b/docs/api/puppeteer.page.waitfortimeout.md
deleted file mode 100644
index 681bf8a7249..00000000000
--- a/docs/api/puppeteer.page.waitfortimeout.md
+++ /dev/null
@@ -1,41 +0,0 @@
----
-sidebar_label: Page.waitForTimeout
----
-
-# Page.waitForTimeout() method
-
-> Warning: This API is now obsolete.
->
-> Replace with `new Promise(r => setTimeout(r, milliseconds));`.
->
-> Causes your script to wait for the given number of milliseconds.
-
-#### Signature:
-
-```typescript
-class Page {
- waitForTimeout(milliseconds: number): Promise