2021-07-14 10:14:03 +00:00
|
|
|
export default class SessionsPage {
|
2021-08-16 19:25:36 +00:00
|
|
|
sessionTypeDrpDwn = ".pf-c-select__toggle";
|
|
|
|
sessionTypeList = ".pf-c-select__toggle + ul";
|
|
|
|
allSessionTypesOption = "all-sessions-option";
|
|
|
|
regularSSOOption = "regular-sso-option";
|
|
|
|
offlineOption = "offline-option";
|
|
|
|
directGrantOption = "direct-grant-option";
|
|
|
|
serviceAccountOption = "service-account-option";
|
|
|
|
selectedType = ".pf-c-select__toggle-text";
|
|
|
|
revocationActionItem = "revocation";
|
|
|
|
setToNowButton = "set-to-now-button";
|
|
|
|
actionDropdown = "action-dropdown";
|
|
|
|
clearNotBeforeButton = "clear-not-before-button";
|
|
|
|
notBeforeInput = "not-before-input";
|
|
|
|
logoutAll = "logout-all";
|
|
|
|
logoutAllConfirm = "logout-all-confirm-button";
|
2021-07-14 10:14:03 +00:00
|
|
|
|
|
|
|
shouldDisplay() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).should("exist");
|
|
|
|
}
|
|
|
|
|
|
|
|
shouldNotBeEmpty() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).click();
|
|
|
|
cy.get(this.sessionTypeList).should("exist");
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
selectAllSessionsType() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).click();
|
2021-07-14 10:41:04 +00:00
|
|
|
cy.getId(this.allSessionTypesOption).click();
|
2021-08-16 19:25:36 +00:00
|
|
|
cy.get(this.selectedType).should("have.text", "All session types");
|
2021-07-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
selectRegularSSO() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).click();
|
2021-07-14 10:41:04 +00:00
|
|
|
cy.getId(this.regularSSOOption).click();
|
2021-08-16 19:25:36 +00:00
|
|
|
cy.get(this.selectedType).should("have.text", "Regular SSO");
|
2021-07-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
selectOffline() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).click();
|
2021-07-14 10:41:04 +00:00
|
|
|
cy.getId(this.offlineOption).click();
|
2021-08-16 19:25:36 +00:00
|
|
|
cy.get(this.selectedType).should("have.text", "Offline");
|
2021-07-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
selectDirectGrant() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).click();
|
2021-07-14 10:41:04 +00:00
|
|
|
cy.getId(this.directGrantOption).click();
|
2021-08-16 19:25:36 +00:00
|
|
|
cy.get(this.selectedType).should("have.text", "Direct grant");
|
2021-07-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
selectServiceAccount() {
|
|
|
|
cy.get(this.sessionTypeDrpDwn).click();
|
2021-07-14 10:41:04 +00:00
|
|
|
cy.getId(this.serviceAccountOption).click();
|
2021-08-16 19:25:36 +00:00
|
|
|
cy.get(this.selectedType).should("have.text", "Service account");
|
|
|
|
}
|
|
|
|
|
|
|
|
setToNow() {
|
|
|
|
cy.getId(this.actionDropdown).click();
|
|
|
|
cy.getId(this.revocationActionItem).click();
|
|
|
|
cy.getId(this.setToNowButton).click();
|
|
|
|
}
|
|
|
|
|
|
|
|
checkNotBeforeValueExists() {
|
|
|
|
cy.getId(this.actionDropdown).click();
|
|
|
|
cy.getId(this.revocationActionItem).click();
|
|
|
|
cy.getId(this.notBeforeInput).should("not.have.value", "None");
|
|
|
|
}
|
|
|
|
|
|
|
|
clearNotBefore() {
|
|
|
|
cy.getId(this.actionDropdown).click();
|
|
|
|
cy.getId(this.revocationActionItem).click();
|
|
|
|
cy.getId(this.clearNotBeforeButton).click();
|
|
|
|
}
|
|
|
|
|
|
|
|
checkNotBeforeCleared() {
|
|
|
|
cy.getId(this.actionDropdown).click();
|
|
|
|
cy.getId(this.revocationActionItem).click();
|
|
|
|
cy.getId(this.notBeforeInput).should("have.value", "None");
|
|
|
|
}
|
|
|
|
|
|
|
|
logoutAllSessions() {
|
|
|
|
cy.getId(this.actionDropdown).click();
|
|
|
|
cy.getId(this.logoutAll).click();
|
|
|
|
cy.getId(this.logoutAllConfirm).click();
|
2021-07-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
}
|