Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@renku/notebooks-cypress-tests

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@renku/notebooks-cypress-tests - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

63

dist/cjs/cypress/support/commands/jupyterlab.js

@@ -5,28 +5,57 @@ "use strict";

var findExpectedElements = function () {
cy.get('.jp-Launcher-body').should("be.visible").should('include.text', 'Notebook').and('include.text', 'Console').and('include.text', 'Other');
cy.get('div#jp-menu-panel').should("be.visible").should('include.text', 'File').and('include.text', 'Edit').and('include.text', 'View');
cy.get('.jp-DirListing-content').should("be.visible");
cy.get(".jp-Launcher-body")
.should("be.visible")
.should("include.text", "Notebook")
.and("include.text", "Console")
.and("include.text", "Other");
cy.get("div#jp-menu-panel")
.should("be.visible")
.should("include.text", "File")
.and("include.text", "Edit")
.and("include.text", "View");
cy.get(".jp-DirListing-content").should("be.visible");
};
var launchTerminal = function () {
cy.get('div.jp-LauncherCard[title="Start a new terminal session"]').should("be.visible").click();
cy.get('.jp-Terminal-body').should("be.visible").should('have.attr', 'class').and('contain', 'focus');
cy.get('.xterm-helper-textarea').should('have.focus');
cy.get('#tab-key-1').should("be.visible").should("contain.text", "Terminal");
// The terminal is in a html canvas element so I cannot check its contents/state easily
// the wait makes sure the canvas has fully rendered
cy.get('div.jp-LauncherCard[title="Start a new terminal session"]')
.should("be.visible")
.click();
cy.get(".jp-Terminal-body")
.should("be.visible")
.should("have.attr", "class")
.and("contain", "focus");
cy.get(".xterm-helper-textarea").should("have.focus");
cy.get('[role="tablist"]')
.contains('[role="tab"]', "Terminal")
.should("be.visible")
.and("have.attr", "aria-selected", "true");
cy.wait(5000);
};
var makeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("touch ".concat(fname, "{enter}"));
cy.get('#filebrowser > .jp-Toolbar > :nth-child(4)').click();
cy.get('.jp-DirListing-content').should("be.visible").should("contain.text", "new-file.txt");
cy.get(".xterm-helper-textarea").click().type("touch ".concat(fname, "{enter}"));
cy.get("#filebrowser > .jp-Toolbar")
.find('button[title="Refresh the file browser."]')
.click();
cy.get("#filebrowser .jp-DirListing-content")
.should("be.visible")
.should("contain.text", "new-file.txt");
}; };
var removeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("rm ".concat(fname, "{enter}"));
cy.get('#filebrowser > .jp-Toolbar > :nth-child(4)').click();
cy.get('.jp-DirListing-content').should("be.visible").should("not.contain.text", "new-file.txt");
cy.get(".xterm-helper-textarea").click().type("rm ".concat(fname, "{enter}"));
cy.get("#filebrowser > .jp-Toolbar")
.find('button[title="Refresh the file browser."]')
.click();
cy.get("#filebrowser .jp-DirListing-content")
.should("be.visible")
.should("not.contain.text", "new-file.txt");
}; };
var closeTerminal = function () {
cy.get("body").find('#jp-main-dock-panel >* .lm-TabBar-tabCloseIcon').each(function ($el, _, __) {
cy.wrap($el).click();
cy.wait(5000);
cy.get('[role="tablist"]')
.contains('[role="tab"]', "Terminal")
.should("be.visible");
cy.get("body")
.find('[role="tablist"] .lm-TabBar-tabCloseIcon')
.each(function ($el) {
cy.wrap($el).click({ force: true });
cy.wait(1000);
});

@@ -33,0 +62,0 @@ };

declare const _default: (username: string, password: string) => void;
export default _default;
export declare function validateLogin(username: string, password: string): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateLogin = void 0;
exports.default = (function (username, password) {

@@ -12,1 +13,11 @@ cy.url().then(function (url) {

});
function validateLogin(username, password) {
cy.url().then(function (url) {
if (url.includes("realms/Renku/protocol/openid-connect") &&
username.length > 0 &&
password.length > 0) {
return false;
}
});
}
exports.validateLogin = validateLogin;

@@ -5,37 +5,68 @@ "use strict";

var findExpectedElements = function () {
cy.get('#rstudio_workbench_tab_console').should('include.text', 'Console');
cy.get('#rstudio_workbench_tab_terminal').should('include.text', 'Terminal');
cy.get("#rstudio_workbench_tab_jobs").should('include.text', 'Jobs');
cy.get('.GEL-OVUBKQ').should('include.text', 'File').and('include.text', 'Edit').and('include.text', 'View');
cy.get('#rstudio_workbench_panel_files').should("contain.html", "table");
cy.get('#rstudio_workbench_panel_files').find("tbody")
.first().should("be.visible").should("not.be.empty").find("td")
.first().should("be.visible").should("not.be.empty")
.next().should("be.visible").should("not.be.empty");
cy.get(':nth-child(3) > .rstudio-HyperlinkLabel').should("be.visible").should("not.be.empty");
cy.get("#rstudio_workbench_tab_console").should("include.text", "Console");
cy.get("#rstudio_workbench_tab_terminal").should("include.text", "Terminal");
cy.get("#rstudio_workbench_tab_background_jobs").should("include.text", "Background Jobs");
cy.get('[aria-label="Main menu and toolbar"]')
.should("include.text", "File")
.and("include.text", "Edit")
.and("include.text", "View");
cy.get("#rstudio_workbench_panel_files").should("contain.html", "table");
cy.get("#rstudio_workbench_panel_files")
.find("tbody")
.first()
.should("be.visible")
.should("not.be.empty")
.find("td")
.first()
.should("be.visible")
.should("not.be.empty")
.next()
.should("be.visible")
.should("not.be.empty");
cy.contains(".rstudio-HyperlinkLabel", "Home")
.should("be.visible")
.should("not.be.empty");
};
var launchTerminal = function () {
cy.get('#rstudio_workbench_tab_terminal').click();
cy.get('#rstudio_terminal_dropdown_menubutton').should("include.text", "Terminal");
cy.get(':nth-child(6) > .GEL-OVUBNT').should("be.visible").should("not.be.empty");
cy.get('.xterm-helper-textarea').should("have.focus");
// The terminal is in a html canvas element so I cannot check its contents/state easily
// the wait makes sure the canvas has fully rendered
cy.wait(5000);
cy.get("#rstudio_workbench_tab_terminal").click();
cy.get("#rstudio_terminal_dropdown_menubutton").should("include.text", "Terminal");
cy.get("#rstudio_workbench_panel_terminal")
.should("be.visible")
.should("not.be.empty");
cy.get(".xterm-helper-textarea").should("have.focus");
};
var makeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("touch ".concat(fname, "{enter}"));
cy.get('#rstudio_tb_refreshfiles').click();
cy.get('div.GEL-OVUBEDC >* div.GEL-OVUBMH').should("contain.text", fname);
cy.get("#rstudio_workbench_tab_terminal").click();
cy.get("#rstudio_workbench_panel_terminal").should("be.visible");
cy.get(".xterm-helper-textarea")
.click({ force: true })
.type("touch ".concat(fname, "{enter}"), { force: true });
cy.get("#rstudio_tb_refreshfiles").click();
cy.get('[aria-label="Files"]')
.find("table tr")
.contains(fname)
.should("be.visible");
}; };
var removeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("rm ".concat(fname, "{enter}"));
cy.get('#rstudio_tb_refreshfiles').click();
cy.get('div.GEL-OVUBEDC >* div.GEL-OVUBMH').should("not.contain.text", fname);
cy.get("#rstudio_workbench_tab_terminal").click();
cy.get("#rstudio_workbench_panel_terminal").should("be.visible");
cy.get(".xterm-helper-textarea")
.click({ force: true })
.type("rm ".concat(fname, "{enter}"), { force: true });
cy.get("#rstudio_tb_refreshfiles").click();
cy.get('[aria-label="Files"]')
.find("table tr")
.contains(fname)
.should("not.exist");
}; };
var closeTerminal = function () {
cy.get("body").find('#rstudio_tb_closeterminal').each(function ($el, _, __) {
cy.wrap($el).click();
cy.get("body")
.find("#rstudio_tb_closeterminal")
.each(function ($el) {
cy.wrap($el).click({ force: true });
});
cy.get('#rstudio_workbench_tab_console').click().should('have.attr', 'class').and('contain', 'selected');
cy.get("#rstudio_workbench_tab_console")
.click()
.should("have.attr", "class")
.and("contain", "selected");
};

@@ -42,0 +73,0 @@ exports.testSnippets = {

export { testSnippets as rstudioTestFuncs } from "./cypress/support/commands/rstudio";
export { testSnippets as jupyterlabTestFuncs } from "./cypress/support/commands/jupyterlab";
export { registerCustomCommands } from "./cypress/support/commands";
export { validateLogin } from "./cypress/support/commands/login";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerCustomCommands = exports.jupyterlabTestFuncs = exports.rstudioTestFuncs = void 0;
exports.validateLogin = exports.registerCustomCommands = exports.jupyterlabTestFuncs = exports.rstudioTestFuncs = void 0;
var rstudio_1 = require("./cypress/support/commands/rstudio");

@@ -10,1 +10,3 @@ Object.defineProperty(exports, "rstudioTestFuncs", { enumerable: true, get: function () { return rstudio_1.testSnippets; } });

Object.defineProperty(exports, "registerCustomCommands", { enumerable: true, get: function () { return commands_1.registerCustomCommands; } });
var login_1 = require("./cypress/support/commands/login");
Object.defineProperty(exports, "validateLogin", { enumerable: true, get: function () { return login_1.validateLogin; } });

@@ -5,28 +5,57 @@ "use strict";

var findExpectedElements = function () {
cy.get('.jp-Launcher-body').should("be.visible").should('include.text', 'Notebook').and('include.text', 'Console').and('include.text', 'Other');
cy.get('div#jp-menu-panel').should("be.visible").should('include.text', 'File').and('include.text', 'Edit').and('include.text', 'View');
cy.get('.jp-DirListing-content').should("be.visible");
cy.get(".jp-Launcher-body")
.should("be.visible")
.should("include.text", "Notebook")
.and("include.text", "Console")
.and("include.text", "Other");
cy.get("div#jp-menu-panel")
.should("be.visible")
.should("include.text", "File")
.and("include.text", "Edit")
.and("include.text", "View");
cy.get(".jp-DirListing-content").should("be.visible");
};
var launchTerminal = function () {
cy.get('div.jp-LauncherCard[title="Start a new terminal session"]').should("be.visible").click();
cy.get('.jp-Terminal-body').should("be.visible").should('have.attr', 'class').and('contain', 'focus');
cy.get('.xterm-helper-textarea').should('have.focus');
cy.get('#tab-key-1').should("be.visible").should("contain.text", "Terminal");
// The terminal is in a html canvas element so I cannot check its contents/state easily
// the wait makes sure the canvas has fully rendered
cy.get('div.jp-LauncherCard[title="Start a new terminal session"]')
.should("be.visible")
.click();
cy.get(".jp-Terminal-body")
.should("be.visible")
.should("have.attr", "class")
.and("contain", "focus");
cy.get(".xterm-helper-textarea").should("have.focus");
cy.get('[role="tablist"]')
.contains('[role="tab"]', "Terminal")
.should("be.visible")
.and("have.attr", "aria-selected", "true");
cy.wait(5000);
};
var makeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("touch ".concat(fname, "{enter}"));
cy.get('#filebrowser > .jp-Toolbar > :nth-child(4)').click();
cy.get('.jp-DirListing-content').should("be.visible").should("contain.text", "new-file.txt");
cy.get(".xterm-helper-textarea").click().type("touch ".concat(fname, "{enter}"));
cy.get("#filebrowser > .jp-Toolbar")
.find('button[title="Refresh the file browser."]')
.click();
cy.get("#filebrowser .jp-DirListing-content")
.should("be.visible")
.should("contain.text", "new-file.txt");
}; };
var removeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("rm ".concat(fname, "{enter}"));
cy.get('#filebrowser > .jp-Toolbar > :nth-child(4)').click();
cy.get('.jp-DirListing-content').should("be.visible").should("not.contain.text", "new-file.txt");
cy.get(".xterm-helper-textarea").click().type("rm ".concat(fname, "{enter}"));
cy.get("#filebrowser > .jp-Toolbar")
.find('button[title="Refresh the file browser."]')
.click();
cy.get("#filebrowser .jp-DirListing-content")
.should("be.visible")
.should("not.contain.text", "new-file.txt");
}; };
var closeTerminal = function () {
cy.get("body").find('#jp-main-dock-panel >* .lm-TabBar-tabCloseIcon').each(function ($el, _, __) {
cy.wrap($el).click();
cy.wait(5000);
cy.get('[role="tablist"]')
.contains('[role="tab"]', "Terminal")
.should("be.visible");
cy.get("body")
.find('[role="tablist"] .lm-TabBar-tabCloseIcon')
.each(function ($el) {
cy.wrap($el).click({ force: true });
cy.wait(1000);
});

@@ -33,0 +62,0 @@ };

declare const _default: (username: string, password: string) => void;
export default _default;
export declare function validateLogin(username: string, password: string): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateLogin = void 0;
exports.default = (function (username, password) {

@@ -12,1 +13,11 @@ cy.url().then(function (url) {

});
function validateLogin(username, password) {
cy.url().then(function (url) {
if (url.includes("realms/Renku/protocol/openid-connect") &&
username.length > 0 &&
password.length > 0) {
return false;
}
});
}
exports.validateLogin = validateLogin;

@@ -5,37 +5,68 @@ "use strict";

var findExpectedElements = function () {
cy.get('#rstudio_workbench_tab_console').should('include.text', 'Console');
cy.get('#rstudio_workbench_tab_terminal').should('include.text', 'Terminal');
cy.get("#rstudio_workbench_tab_jobs").should('include.text', 'Jobs');
cy.get('.GEL-OVUBKQ').should('include.text', 'File').and('include.text', 'Edit').and('include.text', 'View');
cy.get('#rstudio_workbench_panel_files').should("contain.html", "table");
cy.get('#rstudio_workbench_panel_files').find("tbody")
.first().should("be.visible").should("not.be.empty").find("td")
.first().should("be.visible").should("not.be.empty")
.next().should("be.visible").should("not.be.empty");
cy.get(':nth-child(3) > .rstudio-HyperlinkLabel').should("be.visible").should("not.be.empty");
cy.get("#rstudio_workbench_tab_console").should("include.text", "Console");
cy.get("#rstudio_workbench_tab_terminal").should("include.text", "Terminal");
cy.get("#rstudio_workbench_tab_background_jobs").should("include.text", "Background Jobs");
cy.get('[aria-label="Main menu and toolbar"]')
.should("include.text", "File")
.and("include.text", "Edit")
.and("include.text", "View");
cy.get("#rstudio_workbench_panel_files").should("contain.html", "table");
cy.get("#rstudio_workbench_panel_files")
.find("tbody")
.first()
.should("be.visible")
.should("not.be.empty")
.find("td")
.first()
.should("be.visible")
.should("not.be.empty")
.next()
.should("be.visible")
.should("not.be.empty");
cy.contains(".rstudio-HyperlinkLabel", "Home")
.should("be.visible")
.should("not.be.empty");
};
var launchTerminal = function () {
cy.get('#rstudio_workbench_tab_terminal').click();
cy.get('#rstudio_terminal_dropdown_menubutton').should("include.text", "Terminal");
cy.get(':nth-child(6) > .GEL-OVUBNT').should("be.visible").should("not.be.empty");
cy.get('.xterm-helper-textarea').should("have.focus");
// The terminal is in a html canvas element so I cannot check its contents/state easily
// the wait makes sure the canvas has fully rendered
cy.wait(5000);
cy.get("#rstudio_workbench_tab_terminal").click();
cy.get("#rstudio_terminal_dropdown_menubutton").should("include.text", "Terminal");
cy.get("#rstudio_workbench_panel_terminal")
.should("be.visible")
.should("not.be.empty");
cy.get(".xterm-helper-textarea").should("have.focus");
};
var makeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("touch ".concat(fname, "{enter}"));
cy.get('#rstudio_tb_refreshfiles').click();
cy.get('div.GEL-OVUBEDC >* div.GEL-OVUBMH').should("contain.text", fname);
cy.get("#rstudio_workbench_tab_terminal").click();
cy.get("#rstudio_workbench_panel_terminal").should("be.visible");
cy.get(".xterm-helper-textarea")
.click({ force: true })
.type("touch ".concat(fname, "{enter}"), { force: true });
cy.get("#rstudio_tb_refreshfiles").click();
cy.get('[aria-label="Files"]')
.find("table tr")
.contains(fname)
.should("be.visible");
}; };
var removeFileWithTerminal = function (fname) { return function () {
cy.get('.xterm-helper-textarea').click().type("rm ".concat(fname, "{enter}"));
cy.get('#rstudio_tb_refreshfiles').click();
cy.get('div.GEL-OVUBEDC >* div.GEL-OVUBMH').should("not.contain.text", fname);
cy.get("#rstudio_workbench_tab_terminal").click();
cy.get("#rstudio_workbench_panel_terminal").should("be.visible");
cy.get(".xterm-helper-textarea")
.click({ force: true })
.type("rm ".concat(fname, "{enter}"), { force: true });
cy.get("#rstudio_tb_refreshfiles").click();
cy.get('[aria-label="Files"]')
.find("table tr")
.contains(fname)
.should("not.exist");
}; };
var closeTerminal = function () {
cy.get("body").find('#rstudio_tb_closeterminal').each(function ($el, _, __) {
cy.wrap($el).click();
cy.get("body")
.find("#rstudio_tb_closeterminal")
.each(function ($el) {
cy.wrap($el).click({ force: true });
});
cy.get('#rstudio_workbench_tab_console').click().should('have.attr', 'class').and('contain', 'selected');
cy.get("#rstudio_workbench_tab_console")
.click()
.should("have.attr", "class")
.and("contain", "selected");
};

@@ -42,0 +73,0 @@ exports.testSnippets = {

export { testSnippets as rstudioTestFuncs } from "./cypress/support/commands/rstudio";
export { testSnippets as jupyterlabTestFuncs } from "./cypress/support/commands/jupyterlab";
export { registerCustomCommands } from "./cypress/support/commands";
export { validateLogin } from "./cypress/support/commands/login";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerCustomCommands = exports.jupyterlabTestFuncs = exports.rstudioTestFuncs = void 0;
exports.validateLogin = exports.registerCustomCommands = exports.jupyterlabTestFuncs = exports.rstudioTestFuncs = void 0;
var rstudio_1 = require("./cypress/support/commands/rstudio");

@@ -10,1 +10,3 @@ Object.defineProperty(exports, "rstudioTestFuncs", { enumerable: true, get: function () { return rstudio_1.testSnippets; } });

Object.defineProperty(exports, "registerCustomCommands", { enumerable: true, get: function () { return commands_1.registerCustomCommands; } });
var login_1 = require("./cypress/support/commands/login");
Object.defineProperty(exports, "validateLogin", { enumerable: true, get: function () { return login_1.validateLogin; } });
{
"name": "@renku/notebooks-cypress-tests",
"version": "0.0.10",
"version": "0.0.11",
"description": "Set of cypress tests used for renku notebooks sessions",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc