Remove Cypress test to check login (#4019)

This commit is contained in:
Jon Koops 2022-12-13 17:25:08 +01:00 committed by GitHub
parent ea80b0f872
commit 2e36e4c3fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 43 deletions

View file

@ -1,29 +0,0 @@
import LoginPage from "../support/pages/LoginPage";
import Masthead from "../support/pages/admin-ui/Masthead";
import { keycloakBefore } from "../support/util/keycloak_hooks";
const username = "admin";
const password = "admin";
const loginPage = new LoginPage();
const masthead = new Masthead();
describe("Logging In", () => {
beforeEach(() => {
keycloakBefore();
});
it("displays errors on wrong credentials", () => {
loginPage.logIn("wrong", "user{enter}");
loginPage.checkErrorMessage("Invalid username or password.").isLogInPage();
});
it("logs in", () => {
loginPage.logIn(username, password);
masthead.checkIsAdminUI();
cy.getCookie("KEYCLOAK_SESSION_LEGACY").should("exist");
});
});

View file

@ -2,9 +2,7 @@ export default class LoginPage {
private userNameInput = "#username";
private passwordInput = "#password";
private submitBtn = "#kc-login";
private userDrpDwn = "#user-dropdown";
private errorText = ".kc-feedback-text";
private oldLoadContainer = "#loading";
private loadContainer = "div.keycloak__loading-container";
@ -32,16 +30,4 @@ export default class LoginPage {
});
cy.get('[role="progressbar"]').should("not.exist");
}
checkErrorIsDisplayed() {
cy.get(this.userDrpDwn).should("exist");
return this;
}
checkErrorMessage(message: string) {
cy.get(this.errorText).invoke("text").should("contain", message);
return this;
}
}