Skip to content

Commit

Permalink
update: adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Apr 11, 2024
1 parent 0b6a873 commit c992298
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/cypress/support/step_definitions/I Run All Cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ When("I Run All Cells", () => {
jupyterLiteSession.clickMenuTab("Run");
jupyterLiteSession.clickMenuTab("Run All Cells");
// We have to wait for python script to run, which actually takes quite a bit of time
// jupyterLiteSession.waitForKernelIdle(360000);
jupyterLiteSession.waitForKernelIdle(360000);
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import MaterialDesignerPage from "../widgets/MaterialDesignerPage";

When("I submit materials", () => {
const { jupyterLiteTransformationDialog } = new MaterialDesignerPage().designerWidget;
jupyterLiteTransformationDialog.selectMaterialsOut(0);
jupyterLiteTransformationDialog.selectMaterialsOut(1);
jupyterLiteTransformationDialog.submit();
});
11 changes: 5 additions & 6 deletions tests/cypress/support/widgets/JupyterLiteSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const selectors = {
main: "#main",
notebook: ".jp-Notebook",
cellIn: `.jp-Cell-inputWrapper .jp-InputArea-editor`,
menuItem: 'li[role="menuitem"]',
runTab: 'li[role="menuitem"] > div:contains("Run")',
runAllCells: 'li[role="menuitem"] > div:contains("Run All Cells")',
};
Expand Down Expand Up @@ -69,14 +70,12 @@ export default class JupyterLiteSession extends Widget {

clickMenuTab(tabName: string) {
return cy
.getIframeBody(selectors.wrapper) // Assuming this is the correct selector for the iframe
.contains('li[role="menuitem"]', tabName) // Find the li with the specific text
.click() // Click the li element to open the dropdown if necessary
.getIframeBody(selectors.wrapper)
.contains(selectors.menuItem, tabName)
.click()
.then(($li) => {
if ($li.find(".lm-Menu").length > 0) {
// Check if there is a dropdown menu
// If the clicked tab has a dropdown menu, wait until the menu is visible
cy.contains('li[role="menuitem"]', tabName).should("be.visible").click(); // Click the actual menu item now that the dropdown is visible
cy.contains(selectors.menuItem, tabName).should("be.visible").click();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class JupyterLiteTransformationDialog extends Widget {

selectMaterialsOut(index: number) {
this.browser.click(this.wrappedSelectors.materialsOutSelector);
this.browser.waitForVisible(selectors.materialsOutSelectorItem(index), "lg");
this.browser.waitForVisible(selectors.materialsOutSelectorItem(index), "xl");
this.browser.click(selectors.materialsOutSelectorItem(index));
}

Expand Down

0 comments on commit c992298

Please sign in to comment.