mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[puppeteer] adding missing waitForXPath method (#25609)
* adding missing waitForXPath method * remove trailing whitespce * add waitForXPath method usage
This commit is contained in:
Vendored
+5
@@ -900,6 +900,11 @@ export interface FrameBase {
|
||||
selector: string,
|
||||
options?: { visible?: boolean; hidden?: boolean; timeout?: number }
|
||||
): Promise<ElementHandle>;
|
||||
|
||||
waitForXPath(
|
||||
xpath: string,
|
||||
options?: { visible?: boolean; hidden?: boolean; timeout?: number }
|
||||
): Promise<ElementHandle>;
|
||||
}
|
||||
|
||||
export interface Frame extends FrameBase {
|
||||
|
||||
@@ -117,9 +117,15 @@ puppeteer.launch().then(async browser => {
|
||||
await watchDog;
|
||||
|
||||
let currentURL: string;
|
||||
|
||||
page
|
||||
.waitForSelector("img", { visible: true })
|
||||
.then(() => console.log("First URL with image: " + currentURL));
|
||||
.then(() => console.log("First URL with image by selector: " + currentURL));
|
||||
|
||||
page
|
||||
.waitForXPath("//img", { visible: true })
|
||||
.then(() => console.log("First URL with image by xpath: " + currentURL));
|
||||
|
||||
for (currentURL of [
|
||||
"https://example.com",
|
||||
"https://google.com",
|
||||
|
||||
Reference in New Issue
Block a user