From 3a643d87b3727d4742031ce853328aa956c7e115 Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Tue, 6 Sep 2022 11:36:37 +0200 Subject: [PATCH] ci(e2e): firefox (#4310) fix: remove unnecessary cypress get Co-authored-by: Elio Bischof --- .../e2e/applications/applications.cy.ts | 84 ++++++++++--------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/e2e/cypress/e2e/applications/applications.cy.ts b/e2e/cypress/e2e/applications/applications.cy.ts index 27127575c3..200de99f5a 100644 --- a/e2e/cypress/e2e/applications/applications.cy.ts +++ b/e2e/cypress/e2e/applications/applications.cy.ts @@ -1,42 +1,50 @@ -import { Apps, ensureProjectExists, ensureProjectResourceDoesntExist } from "../../support/api/projects"; +import { + Apps, + ensureProjectExists, + ensureProjectResourceDoesntExist, +} from "../../support/api/projects"; import { apiAuth } from "../../support/api/apiauth"; -describe('applications', () => { +describe("applications", () => { + const testProjectName = "e2eprojectapplication"; + const testAppName = "e2eappundertest"; - const testProjectName = 'e2eprojectapplication' - const testAppName = 'e2eappundertest' + beforeEach(`ensure it doesn't exist already`, () => { + apiAuth().then((api) => { + ensureProjectExists(api, testProjectName).then((projectID) => { + ensureProjectResourceDoesntExist( + api, + projectID, + Apps, + testAppName + ).then(() => { + cy.visit(`/projects/${projectID}`); + }); + }); + }); + }); - beforeEach(`ensure it doesn't exist already`, () => { - apiAuth().then(api => { - ensureProjectExists(api, testProjectName).then(projectID => { - ensureProjectResourceDoesntExist(api, projectID, Apps, testAppName).then(() => { - cy.visit(`/projects/${projectID}`) - }) - }) - }) - }) - - it('add app', () => { - cy.get('mat-spinner') - cy.get('mat-spinner').should('not.exist') - cy.get('[data-e2e="app-card-add"]').should('be.visible').click() - // select webapp - cy.get('[formcontrolname="name"]').type(testAppName) - cy.get('[for="WEB"]').click() - cy.get('[data-e2e="continue-button-nameandtype"]').click() - //select authentication - cy.get('[for="PKCE"]').click() - cy.get('[data-e2e="continue-button-authmethod"]').click() - //enter URL - cy.get('cnsl-redirect-uris').eq(0).type("https://testurl.org") - cy.get('cnsl-redirect-uris').eq(1).type("https://testlogouturl.org") - cy.get('[data-e2e="continue-button-redirecturis"]').click() - cy.get('[data-e2e="create-button"]').click().then(() => { - cy.get('[id*=overlay]').should('exist') - }) - cy.get('.data-e2e-success') - cy.wait(200) - cy.get('.data-e2e-failure', { timeout: 0 }).should('not.exist') - //TODO: check client ID/Secret - }) -}) \ No newline at end of file + it("add app", () => { + cy.get('[data-e2e="app-card-add"]').should("be.visible").click(); + // select webapp + cy.get('[formcontrolname="name"]').type(testAppName); + cy.get('[for="WEB"]').click(); + cy.get('[data-e2e="continue-button-nameandtype"]').click(); + //select authentication + cy.get('[for="PKCE"]').click(); + cy.get('[data-e2e="continue-button-authmethod"]').click(); + //enter URL + cy.get("cnsl-redirect-uris").eq(0).type("https://testurl.org"); + cy.get("cnsl-redirect-uris").eq(1).type("https://testlogouturl.org"); + cy.get('[data-e2e="continue-button-redirecturis"]').click(); + cy.get('[data-e2e="create-button"]') + .click() + .then(() => { + cy.get("[id*=overlay]").should("exist"); + }); + cy.get(".data-e2e-success"); + cy.wait(200); + cy.get(".data-e2e-failure", { timeout: 0 }).should("not.exist"); + //TODO: check client ID/Secret + }); +});