Skip to content

Commit

Permalink
Update the e2e tests for local auth (PR #5755)
Browse files Browse the repository at this point in the history
# Description

Forgot to update the local-auth tests based on the compliance updates.

<img width="470" alt="image" src="https://github.com/inmanta/web-console/assets/44098050/b747e782-41be-4c3b-b048-1ee45ee609b0">
  • Loading branch information
LukasStordeur authored and inmantaci committed May 23, 2024
1 parent ad4fb5c commit 2068598
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelogs/unreleased/local-auth-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: "Update the e2e tests for local auth"
change-type: patch
destination-branches: [master, iso7]

17 changes: 12 additions & 5 deletions cypress/e2e/scenario-7.3-user-management.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (Cypress.env("local-auth")) {

cy.get("h1").contains("User Management").should("be.visible");

cy.get('[role="user-row"]').should("have.length", 1);
cy.get('[data-testid="user-row"]').should("have.length", 1);

cy.get("button").contains("Add User").click();

Expand All @@ -34,7 +34,7 @@ if (Cypress.env("local-auth")) {

cy.get("button").contains("Add").click();

cy.get('[role="user-row"]').should("have.length", 2);
cy.get('[data-testid="user-row"]').should("have.length", 2);
});

it("should be able to remove user", () => {
Expand All @@ -52,12 +52,19 @@ if (Cypress.env("local-auth")) {

cy.get("h1").contains("User Management").should("be.visible");

cy.get('[role="user-row"]').should("have.length", 2);
cy.get('[data-testid="user-row"]').should("have.length", 2);

cy.get('[role="user-row"]').eq(1).find("button").contains("Delete").click();
cy.get('[data-testid="user-row"]')
.eq(1)
.find("button")
.contains("Delete")
.click();

cy.get("button").contains("Yes").click();

cy.get('[role="user-row"]', { timeout: 20000 }).should("have.length", 1);
cy.get('[data-testid="user-row"]', { timeout: 20000 }).should(
"have.length",
1,
);
});
}

0 comments on commit 2068598

Please sign in to comment.