From 898825a8022443079e0dd1d669adef16bfe7257a Mon Sep 17 00:00:00 2001 From: bryanlewicki Date: Sun, 19 May 2024 21:18:05 +0200 Subject: [PATCH] fix(test): fixed logging in on the login site --- cypress/e2e/uiTest.cy.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/cypress/e2e/uiTest.cy.js b/cypress/e2e/uiTest.cy.js index 6aa5fc4..8759534 100644 --- a/cypress/e2e/uiTest.cy.js +++ b/cypress/e2e/uiTest.cy.js @@ -1,26 +1,17 @@ const { isConstructorDeclaration } = require("typescript"); function setupTest(){ - if(Cypress.env('TESTENV') === "PROD"){ + if(Cypress.env('TESTENV') === "PROD"){ cy.visit("https://openai.ki.fh-swf.de"); - cy.get("button").contains("Cluster Login").click() - cy.get('input#username').type(Cypress.env("CYPRESS_USER_NAME")); - cy.get('input#password').type(Cypress.env("CYPRESS_USER_PASSWORD")); - cy.get("input").contains("Login Cluster").click(); - // Der Code kann noch nicht einloggen, da hier keine Daten reingeschrieben werden - // Diese werden noch von einem Secret in Github kommen. } - else{ - cy.intercept('GET', "https://www.gravatar.com/8e596ec8846c54f583994b3773e0c4afc16414733b9640b29b546a41b169dcd1"); - cy.intercept('GET', "https://de.gravatar.com/8e596ec8846c54f583994b3773e0c4afc16414733b9640b29b546a41b169dcd1"); - //cy.intercept('GET', 'https://openai.ki.fh-swf.de/api/user', { fixture: 'testUser.json' }).as('getUser'); - cy.intercept('GET', "https://openai.ki.fh-swf.de/api/login") - .then((req) => { - console.log(req); - }); + else{ // if its not prod, then it selects CI cy.visit("http://localhost:5173/"); - //cy.wait('@getUser', { timeout: 15000 }); + //cy.visit("https://openai.ki.fh-swf.de"); } + cy.get("button").contains("Cluster Login").click() + cy.get('input#username').type(Cypress.env("CYPRESS_USER_NAME")); + cy.get('input#password').type(Cypress.env("CYPRESS_USER_PASSWORD")); + cy.get("input").contains("Login Cluster").click(); } describe("User Interface", () => {