From 3509a2976de2459c630d7764aa7c08e18521450c Mon Sep 17 00:00:00 2001 From: SohamRatnaparkhi Date: Sat, 4 Mar 2023 11:58:02 +0530 Subject: [PATCH 1/3] test: added OIDC auth test --- cypress/e2e/spec.cy.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/spec.cy.js b/cypress/e2e/spec.cy.js index 2d03102..bc21ddb 100644 --- a/cypress/e2e/spec.cy.js +++ b/cypress/e2e/spec.cy.js @@ -1,6 +1,13 @@ -describe('auth', () => { - it('user can login', () => { - cy.visit("/") - // cy.findByText(/login/i).click() - }) -}) \ No newline at end of file +describe("auth", () => { + it("user can login", () => { + cy.visit("/"); + cy.contains("Login").click(); + cy.origin("https://ds.aai.lifescience-ri.eu", () => { + cy.contains("Login with LS username").click(); + cy.get("#username").type("test"); // Some test username + cy.get("#password").type("test"); // Some test password + cy.get('button[type="submit"]').click(); + }); + // cy.contains("Run workflows"); + }); +}); From 277359f8a0978e3f300fadf2f75bfd32f63b0466 Mon Sep 17 00:00:00 2001 From: SohamRatnaparkhi Date: Sat, 4 Mar 2023 16:08:14 +0530 Subject: [PATCH 2/3] test: oicd auth tests added --- cypress/e2e/spec.cy.js | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/spec.cy.js b/cypress/e2e/spec.cy.js index bc21ddb..0905af3 100644 --- a/cypress/e2e/spec.cy.js +++ b/cypress/e2e/spec.cy.js @@ -1,13 +1,35 @@ describe("auth", () => { it("user can login", () => { + cy.once("uncaught:exception", () => false); cy.visit("/"); - cy.contains("Login").click(); - cy.origin("https://ds.aai.lifescience-ri.eu", () => { - cy.contains("Login with LS username").click(); - cy.get("#username").type("test"); // Some test username - cy.get("#password").type("test"); // Some test password - cy.get('button[type="submit"]').click(); + cy.wait(3000).then(() => { + cy.get("html").then(($html) => { + if ($html.find("#cm").length > 0) cy.contains("Accept all").click(); + else console.log("No cookie banner or cookie already accepted"); + }); + + cy.contains("Login").click(); + cy.origin("https://elixir-czech.org", () => {}); + cy.origin("https://ds.aai.lifescience-ri.eu", () => { + cy.wait(3000).then(() => { + cy.get("html").then(($html) => { + if ($html.find("LifeScience Hostel").length > 0) { + cy.contains("LifeScience Hostel").click({ force: true }); + } else cy.contains("Login with LS username").click({ force: true }); + }); + cy.get("#username").type("test"); // Some test username + cy.get("#password").type("test"); // Some test password + // cy.get('button[type="submit"]').click(); + }); + }); + cy.once("uncaught:exception", () => false); + cy.origin( + "https://hostel.aai.lifescience-ri.eu/lshostel/module.php/core", + () => { + cy.get('button[type="submit"]').click(); + } + ); + // cy.contains("Run workflows"); }); - // cy.contains("Run workflows"); }); }); From 73e1173a2c84efab587cdcfe81265ffea6946ee8 Mon Sep 17 00:00:00 2001 From: SohamRatnaparkhi Date: Sat, 4 Mar 2023 16:25:19 +0530 Subject: [PATCH 3/3] test: oicd auth tests added and README changes removed --- cypress/e2e/spec.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/spec.cy.js b/cypress/e2e/spec.cy.js index 0905af3..a5c17ba 100644 --- a/cypress/e2e/spec.cy.js +++ b/cypress/e2e/spec.cy.js @@ -8,7 +8,7 @@ describe("auth", () => { else console.log("No cookie banner or cookie already accepted"); }); - cy.contains("Login").click(); + cy.findByText(/login/i).click(); cy.origin("https://elixir-czech.org", () => {}); cy.origin("https://ds.aai.lifescience-ri.eu", () => { cy.wait(3000).then(() => {