2021-01-21 12:09:50 +00:00
|
|
|
export default class Masthead {
|
2021-01-27 12:56:28 +00:00
|
|
|
menuBtn: string;
|
|
|
|
logoBtn: string;
|
|
|
|
helpBtn: string;
|
|
|
|
userDrpDwn: string;
|
|
|
|
userDrpDwnKebab: string;
|
2021-01-28 09:07:12 +00:00
|
|
|
isMobile: boolean;
|
2021-01-21 12:09:50 +00:00
|
|
|
constructor() {
|
|
|
|
this.menuBtn = "#nav-toggle";
|
|
|
|
this.logoBtn = "#masthead-logo";
|
|
|
|
this.helpBtn = "#help";
|
|
|
|
|
|
|
|
this.userDrpDwn = "#user-dropdown";
|
|
|
|
this.userDrpDwnKebab = "#user-dropdown-kebab";
|
2021-01-28 09:07:12 +00:00
|
|
|
this.isMobile = false;
|
2021-01-21 12:09:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
isAdminConsole() {
|
|
|
|
cy.get(this.logoBtn).should("exist");
|
|
|
|
cy.get(this.userDrpDwn).should("exist");
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-01-28 09:07:12 +00:00
|
|
|
get isMobileMode() {
|
|
|
|
return this.isMobile;
|
2021-01-21 12:09:50 +00:00
|
|
|
}
|
|
|
|
|
2021-01-28 09:07:12 +00:00
|
|
|
setMobileMode(isMobileMode: boolean) {
|
|
|
|
this.isMobile = isMobileMode;
|
2021-01-21 12:09:50 +00:00
|
|
|
if (isMobileMode) {
|
|
|
|
cy.viewport("iphone-6");
|
|
|
|
} else {
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.viewport(1024, 768);
|
2021-01-21 12:09:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
toggleGlobalHelp() {
|
|
|
|
cy.get(this.helpBtn).click();
|
|
|
|
cy.get("#enableHelp").click({ force: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
userDropdown() {
|
2021-01-28 09:07:12 +00:00
|
|
|
if (this.isMobileMode) {
|
2021-01-21 12:09:50 +00:00
|
|
|
return cy.get(this.userDrpDwnKebab);
|
|
|
|
} else {
|
|
|
|
return cy.get(this.userDrpDwn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
signOut() {
|
|
|
|
this.userDropdown().click();
|
|
|
|
cy.get("#sign-out").click();
|
|
|
|
}
|
|
|
|
|
|
|
|
accountManagement() {
|
|
|
|
this.userDropdown().click();
|
|
|
|
cy.get("#manage-account").click();
|
|
|
|
}
|
|
|
|
|
2021-01-28 09:07:12 +00:00
|
|
|
checkNotificationMessage(message: string) {
|
2021-01-21 12:09:50 +00:00
|
|
|
cy.contains(message).should("exist");
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|