diff --git a/cypress/integration/login_test.spec.ts b/cypress/integration/login_test.spec.ts index eef192d9ff..22b7b4d238 100644 --- a/cypress/integration/login_test.spec.ts +++ b/cypress/integration/login_test.spec.ts @@ -22,7 +22,7 @@ describe("Logging In", () => { it("logs in", () => { loginPage.logIn(username, password); - masthead.isAdminConsole(); + masthead.checkIsAdminConsole(); cy.getCookie("KEYCLOAK_SESSION_LEGACY").should("exist"); }); diff --git a/cypress/integration/masthead_test.spec.ts b/cypress/integration/masthead_test.spec.ts index 4393a31eb2..b932b3b500 100644 --- a/cypress/integration/masthead_test.spec.ts +++ b/cypress/integration/masthead_test.spec.ts @@ -19,7 +19,7 @@ const goToAcctMgtTest = () => { masthead.accountManagement(); cy.contains("Welcome to Keycloak Account Management"); cy.get("#landingReferrerLink").click({ force: true }); - masthead.isAdminConsole(); + masthead.checkIsAdminConsole(); }); }; diff --git a/cypress/support/pages/admin_console/Masthead.ts b/cypress/support/pages/admin_console/Masthead.ts index 38b6a5289b..fb306eac22 100644 --- a/cypress/support/pages/admin_console/Masthead.ts +++ b/cypress/support/pages/admin_console/Masthead.ts @@ -5,9 +5,8 @@ export default class Masthead { private userDrpDwn = "#user-dropdown"; private userDrpDwnKebab = "#user-dropdown-kebab"; - private isMobile = false; - isAdminConsole() { + checkIsAdminConsole() { cy.get(this.logoBtn).should("exist"); cy.get(this.userDrpDwn).should("exist"); @@ -15,11 +14,10 @@ export default class Masthead { } get isMobileMode() { - return this.isMobile; + return window.parent[0].innerWidth < 1024; } setMobileMode(isMobileMode: boolean) { - this.isMobile = isMobileMode; if (isMobileMode) { cy.viewport("iphone-6"); } else {