mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-31 06:41:35 +00:00
initial commit for notbooks pupeteer tests
This commit is contained in:
18
test/notebooks/notebookTestUtils.ts
Normal file
18
test/notebooks/notebookTestUtils.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user