🤖 Merge PR #47822 [puppeteer] Add page.waitForTimeout by @okko

This commit is contained in:
Oskari Okko Ojala 2020-09-21 15:30:14 +03:00 committed by GitHub
parent 00954267f7
commit b7dafdedb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -1275,6 +1275,12 @@ export interface FrameBase extends Evalable, JSEvalable {
xpath: string,
options?: WaitForSelectorOptions,
): Promise<ElementHandle>;
/**
* Waits for a certain amount of time before resolving.
* @param duration The time to wait for.
*/
waitForTimeout(duration: number): Promise<void>;
}
export interface Frame extends FrameBase {

View File

@ -512,6 +512,13 @@ puppeteer.launch().then(async browser => {
}, 'asd');
})();
// Test waitForTimeout
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.waitForTimeout(1000); // $ExpectType void
})();
// Permission tests
(async () => {
const browser = await puppeteer.launch();