2022-04-19 12:25:57 +00:00
|
|
|
import CommonElements from "../CommonElements";
|
|
|
|
|
|
|
|
export default class SidebarPage extends CommonElements {
|
2022-02-16 16:34:54 +00:00
|
|
|
private realmsDrpDwn = "#realm-select button.pf-c-dropdown__toggle";
|
|
|
|
private realmsList = '#realm-select ul[role="menu"]';
|
2021-05-03 16:44:47 +00:00
|
|
|
private createRealmBtn = "add-realm";
|
|
|
|
|
|
|
|
private clientsBtn = "#nav-item-clients";
|
|
|
|
private clientScopesBtn = "#nav-item-client-scopes";
|
|
|
|
private realmRolesBtn = "#nav-item-roles";
|
|
|
|
private usersBtn = "#nav-item-users";
|
|
|
|
private groupsBtn = "#nav-item-groups";
|
|
|
|
private sessionsBtn = "#nav-item-sessions";
|
|
|
|
private eventsBtn = "#nav-item-events";
|
|
|
|
|
|
|
|
private realmSettingsBtn = "#nav-item-realm-settings";
|
|
|
|
private authenticationBtn = "#nav-item-authentication";
|
|
|
|
private identityProvidersBtn = "#nav-item-identity-providers";
|
|
|
|
private userFederationBtn = "#nav-item-user-federation";
|
2021-01-27 12:56:28 +00:00
|
|
|
|
2022-04-06 09:21:04 +00:00
|
|
|
showCurrentRealms(length: number) {
|
|
|
|
cy.get(this.realmsDrpDwn).scrollIntoView().click({ force: true });
|
|
|
|
cy.get(this.realmsList)
|
|
|
|
.children("li")
|
|
|
|
.should("have.length", length + 1); // account for button
|
|
|
|
cy.get(this.realmsDrpDwn).click({ force: true });
|
|
|
|
}
|
|
|
|
|
2021-01-27 12:56:28 +00:00
|
|
|
getCurrentRealm() {
|
2022-02-16 16:34:54 +00:00
|
|
|
return cy.get(this.realmsDrpDwn).scrollIntoView().invoke("text");
|
2021-01-27 12:56:28 +00:00
|
|
|
}
|
|
|
|
|
2021-01-28 09:07:12 +00:00
|
|
|
goToRealm(realmName: string) {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
|
|
|
cy.get(this.realmsDrpDwn).scrollIntoView().click({ force: true });
|
|
|
|
cy.get(this.realmsList).contains(realmName).click({ force: true });
|
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToCreateRealm() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
|
|
|
cy.get(this.realmsDrpDwn).scrollIntoView().click({ force: true });
|
|
|
|
cy.findByTestId(this.createRealmBtn).click({ force: true });
|
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToClients() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2022-02-15 16:02:17 +00:00
|
|
|
cy.get(this.clientsBtn).scrollIntoView().click({ force: true });
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToClientScopes() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-05-03 16:44:47 +00:00
|
|
|
cy.get(this.clientScopesBtn).scrollIntoView().click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToRealmRoles() {
|
|
|
|
cy.get(this.realmRolesBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToUsers() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.get(this.usersBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToGroups() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.get(this.groupsBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToSessions() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.get(this.sessionsBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToEvents() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.get(this.eventsBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToRealmSettings() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2022-02-15 16:02:17 +00:00
|
|
|
cy.get(this.realmSettingsBtn).click({ force: true });
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToAuthentication() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.get(this.authenticationBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToIdentityProviders() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-05-07 18:42:59 +00:00
|
|
|
cy.get(this.identityProvidersBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToUserFederation() {
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
cy.get(this.userFederationBtn).click();
|
2022-02-16 16:34:54 +00:00
|
|
|
this.waitForPageLoad();
|
2021-01-27 12:56:28 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
2021-09-15 09:45:56 +00:00
|
|
|
|
|
|
|
waitForPageLoad() {
|
2022-02-16 16:34:54 +00:00
|
|
|
cy.get('[role="progressbar"]').should("not.exist");
|
2021-09-15 09:45:56 +00:00
|
|
|
return this;
|
|
|
|
}
|
2021-01-27 12:56:28 +00:00
|
|
|
}
|