mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-24 04:57:50 +00:00
Added tests Moved onSubmt and initialize inside base class Moved testExplorer to separate folder made fields of SelfServe Class non static
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import { uploadNotebookIfNotExist } from "./notebookTestUtils";
|
|
import { ElementHandle, Frame } from "puppeteer";
|
|
import { getTestExplorerFrame } from "../testExplorer/TestExplorerUtils";
|
|
|
|
jest.setTimeout(300000);
|
|
|
|
const notebookName = "GettingStarted.ipynb";
|
|
let frame: Frame;
|
|
let uploadedNotebookNode: ElementHandle<Element>;
|
|
|
|
describe("Notebook UI tests", () => {
|
|
it("Upload, Open and Delete Notebook", async () => {
|
|
try {
|
|
frame = await getTestExplorerFrame();
|
|
await frame.waitForSelector(".galleryHeader");
|
|
uploadedNotebookNode = await uploadNotebookIfNotExist(frame, notebookName);
|
|
await uploadedNotebookNode.click();
|
|
await frame.waitForSelector(".tabNavText");
|
|
const tabTitle = await frame.$eval(".tabNavText", element => element.textContent);
|
|
expect(tabTitle).toEqual(notebookName);
|
|
const closeIcon = await frame.waitForSelector(".close-Icon");
|
|
await closeIcon.click();
|
|
} catch (error) {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const testName = (expect as any).getState().currentTestName;
|
|
await page.screenshot({ path: `Test Failed ${testName}.jpg` });
|
|
throw error;
|
|
}
|
|
});
|
|
});
|