Update Masthead tests (#1820)

This commit is contained in:
Aboullos 2022-01-05 10:56:38 +01:00 committed by GitHub
parent e6d8ffb202
commit 23b11eb879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View file

@ -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");
});

View file

@ -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();
});
};

View file

@ -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 {