f2e26b0049
* Cypress tests for masthead. * Update snapshot * Update Keycloak version. * Fix download address * Update start.js Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com> * Follow redirect when downloading keycloak. * Refactor HeaderPage into Masthead and ModalUtils * Minor change to kick off build. * logOutTest no longer needs a param * goToAcctMgtTest no longer needs a param * Update tests/cypress/support/pages/admin_console/Masthead.js Co-authored-by: Aboullos <61687012+Aboullos@users.noreply.github.com> * Update tests/cypress/support/pages/admin_console/Masthead.js Co-authored-by: Aboullos <61687012+Aboullos@users.noreply.github.com> * Fix userDropdown() method * Minor refactor Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com> Co-authored-by: Aboullos <61687012+Aboullos@users.noreply.github.com>
31 lines
820 B
JavaScript
31 lines
820 B
JavaScript
import LoginPage from "./../support/pages/LoginPage.js";
|
|
import Masthead from "./../support/pages/admin_console/Masthead.js";
|
|
|
|
describe("Logging In", function () {
|
|
const username = "admin";
|
|
const password = "admin";
|
|
|
|
const loginPage = new LoginPage();
|
|
const masthead = new Masthead();
|
|
|
|
describe("Login form submission", function () {
|
|
beforeEach(function () {
|
|
cy.visit("");
|
|
});
|
|
|
|
it("displays errors on login", function () {
|
|
loginPage
|
|
.logIn("wrong", "user{enter}")
|
|
.checkErrorMessage("Invalid username or password.")
|
|
.isLogInPage();
|
|
});
|
|
|
|
it("redirects to admin console on success", function () {
|
|
loginPage.logIn(username, password);
|
|
|
|
masthead.isAdminConsole();
|
|
|
|
cy.getCookie("KEYCLOAK_SESSION_LEGACY").should("exist");
|
|
});
|
|
});
|
|
});
|