Skip to content

Commit

Permalink
test the test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rokroskar authored Aug 23, 2024
1 parent d324182 commit 1117afe
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions tests/cypress/e2e/jupyterlab.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ const url_or_path = Cypress.env("URL");
const url =
url_or_path.slice(-1) === "/" ? url_or_path.slice(0, -1) : url_or_path;

const makeFileWithTerminal_ = (fname: string) => () => {
cy.get(".xterm-helper-textarea").click().type(`touch ${fname}{enter}`);
cy.get("#filebrowser > .jp-Toolbar")
.find('[title="Refresh the file browser."]')
.click();
cy.get("#filebrowser .jp-DirListing-content")
.should("be.visible")
.should("contain.text", "new-file.txt");
};

const removeFileWithTerminal_ = (fname: string) => () => {
cy.get(".xterm-helper-textarea").click().type(`rm ${fname}{enter}`);
cy.get("#filebrowser > .jp-Toolbar")
.find('[title="Refresh the file browser."]')
.click();
cy.get("#filebrowser .jp-DirListing-content")
.should("be.visible")
.should("not.contain.text", "new-file.txt");
};

describe("Test jupyter notebook", () => {
before(() => {
registerCustomCommands();
Expand All @@ -32,11 +52,11 @@ describe("Test jupyter notebook", () => {
it("Can launch a terminal", jupyterlabTestFuncs.launchTerminal);
it(
"Can run terminal command to create a file",
jupyterlabTestFuncs.makeFileWithTerminal("new-file.txt")
makeFileWithTerminal_("new-file.txt")
);
it(
"Can remove the file",
jupyterlabTestFuncs.removeFileWithTerminal("new-file.txt")
removeFileWithTerminal_("new-file.txt")
);
it("Can close the terminal", jupyterlabTestFuncs.closeTerminal);
it(
Expand Down

0 comments on commit 1117afe

Please sign in to comment.