initial commit for notbooks pupeteer tests

This commit is contained in:
Srinath Narayanan
2020-11-11 04:53:04 -08:00
parent e2e58f73b1
commit 9f4fda13e7
12 changed files with 921 additions and 22 deletions

View File

@@ -0,0 +1,18 @@
import { Frame } from "puppeteer";
let testExplorerFrame: Frame;
export async function getTestExplorerFrame(): Promise<Frame> {
if (testExplorerFrame) {
return testExplorerFrame;
}
const prodUrl = "https://localhost:1234/testExplorer.html";
await page.goto(prodUrl);
const buttonHandle = await page.waitForSelector("button");
buttonHandle.click();
const handle = await page.waitForSelector("iframe");
testExplorerFrame = await handle.contentFrame();
await testExplorerFrame.waitForSelector(".galleryHeader");
return testExplorerFrame;
}