Skip to content

Commit

Permalink
update: adjust steps to use get iframe body
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Apr 10, 2024
1 parent cacd4fa commit 9f96b39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import MaterialDesignerPage from "../widgets/MaterialDesignerPage";

When("I see file {string} opened", (filename: string) => {
const { jupyterLiteSession } = new MaterialDesignerPage().designerWidget;
jupyterLiteSession.waitForVisible("md");
jupyterLiteSession.waitForVisible();
jupyterLiteSession.checkFileOpened(filename);
});
15 changes: 5 additions & 10 deletions tests/cypress/support/widgets/JupyterLiteSession.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Widget from "./Widget";

// TODO: celanup eveyrthing
const selectors = {
wrapper: "iframe#jupyter-lite-iframe",
main: "#main",
Expand All @@ -13,19 +13,14 @@ export default class JupyterLiteSession extends Widget {
this.wrappedSelectors = this.getWrappedSelectors(selectors);
}

waitForVisible(timeout: BrowserTimeout) {
return cy
.get("#jupyter-lite-iframe", { log: true, timeout: 20000 })
.iframe()
.get("body #main")
.should("exist");
waitForVisible() {
return cy.getIframeBody("#jupyter-lite-iframe").find("#main").should("exist");
}

checkFileOpened(fileName: string) {
return cy
.get("#jupyter-lite-iframe", { log: true, timeout: 20000 })
.iframe()
.get("body #main")
.getIframeBody("#jupyter-lite-iframe")
.find("#main")
.find(`li[title="Name: ${fileName}"]`)
.should("exist");
}
Expand Down

0 comments on commit 9f96b39

Please sign in to comment.