2021-01-27 12:56:28 +00:00
|
|
|
import ListingPage from "../support/pages/admin_console/ListingPage";
|
|
|
|
import LoginPage from "../support/pages/LoginPage";
|
|
|
|
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
|
|
|
import Masthead from "../support/pages/admin_console/Masthead";
|
2022-03-09 16:42:51 +00:00
|
|
|
import { keycloakBefore } from "../support/util/keycloak_hooks";
|
2021-01-21 12:09:50 +00:00
|
|
|
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const masthead = new Masthead();
|
2022-02-08 22:10:27 +00:00
|
|
|
const listingPage = new ListingPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
2021-01-21 12:09:50 +00:00
|
|
|
|
|
|
|
const logOutTest = () => {
|
2022-02-16 16:34:54 +00:00
|
|
|
sidebarPage.waitForPageLoad();
|
|
|
|
masthead.signOut();
|
|
|
|
sidebarPage.waitForPageLoad();
|
|
|
|
loginPage.isLogInPage();
|
2021-01-21 12:09:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const goToAcctMgtTest = () => {
|
2022-02-16 16:34:54 +00:00
|
|
|
sidebarPage.waitForPageLoad();
|
|
|
|
masthead.accountManagement();
|
2022-04-22 13:24:08 +00:00
|
|
|
cy.get("h1").contains("Welcome to Keycloak account management");
|
2022-02-16 16:34:54 +00:00
|
|
|
cy.get("#landingReferrerLink").click({ force: true });
|
|
|
|
masthead.checkIsAdminConsole();
|
2021-01-21 12:09:50 +00:00
|
|
|
};
|
|
|
|
|
2022-04-22 13:24:08 +00:00
|
|
|
describe("Masthead tests in desktop mode", () => {
|
2022-02-15 16:02:17 +00:00
|
|
|
beforeEach(() => {
|
2021-03-18 12:48:14 +00:00
|
|
|
keycloakBefore();
|
2021-01-21 12:09:50 +00:00
|
|
|
loginPage.logIn();
|
|
|
|
});
|
|
|
|
|
2022-02-16 16:34:54 +00:00
|
|
|
it("Test dropdown in desktop mode", () => {
|
|
|
|
goToAcctMgtTest();
|
2021-01-21 12:09:50 +00:00
|
|
|
|
|
|
|
sidebarPage.goToClientScopes();
|
|
|
|
listingPage.goToItemDetails("address");
|
|
|
|
|
|
|
|
cy.get("#view-header-subkey").should("exist");
|
2021-12-14 14:56:36 +00:00
|
|
|
cy.findByTestId("help-label-name").should("exist");
|
2021-01-21 12:09:50 +00:00
|
|
|
|
|
|
|
masthead.toggleGlobalHelp();
|
|
|
|
|
|
|
|
cy.get("#view-header-subkey").should("not.exist");
|
2021-12-14 14:56:36 +00:00
|
|
|
cy.findByTestId("help-label-name").should("not.exist");
|
2021-01-21 12:09:50 +00:00
|
|
|
|
2022-02-16 16:34:54 +00:00
|
|
|
logOutTest();
|
|
|
|
});
|
2021-01-21 12:09:50 +00:00
|
|
|
});
|
|
|
|
|
2022-04-22 13:24:08 +00:00
|
|
|
describe("Masthead tests with kebab menu", () => {
|
2022-02-15 16:02:17 +00:00
|
|
|
beforeEach(() => {
|
2021-03-18 12:48:14 +00:00
|
|
|
keycloakBefore();
|
2021-01-21 12:09:50 +00:00
|
|
|
loginPage.logIn();
|
|
|
|
masthead.setMobileMode(true);
|
|
|
|
});
|
|
|
|
|
2022-02-16 16:34:54 +00:00
|
|
|
it("Test dropdown in mobile mode", () => {
|
2021-05-06 09:06:20 +00:00
|
|
|
masthead.checkKebabShown();
|
2022-02-16 16:34:54 +00:00
|
|
|
goToAcctMgtTest();
|
|
|
|
logOutTest();
|
2021-01-21 12:09:50 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// TODO: Add test for help when using kebab menu.
|
|
|
|
// Feature not yet implemented for kebab.
|
|
|
|
});
|