2022-04-19 12:25:57 +00:00
|
|
|
import CommonPage from "../../../CommonPage";
|
|
|
|
|
|
|
|
enum ClientRolesTabItems {
|
|
|
|
Details = "Details",
|
|
|
|
Attributes = "Attributes",
|
|
|
|
UsersInRole = "Users in role",
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class ClientRolesTab extends CommonPage {
|
2022-03-09 16:41:45 +00:00
|
|
|
private createRoleBtn = "create-role";
|
|
|
|
private createRoleEmptyStateBtn = "no-roles-for-this-client-empty-action";
|
|
|
|
private hideInheritedRolesChkBox = "#kc-hide-inherited-roles-checkbox";
|
|
|
|
private rolesTab = "rolesTab";
|
|
|
|
private associatedRolesTab = ".kc-associated-roles-tab > button";
|
2022-04-19 12:25:57 +00:00
|
|
|
|
|
|
|
goToDetailsTab() {
|
|
|
|
this.tabUtils().clickTab(ClientRolesTabItems.Details);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToAttributesTab() {
|
|
|
|
this.tabUtils().clickTab(ClientRolesTabItems.Attributes);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToUsersInRoleTab() {
|
|
|
|
this.tabUtils().clickTab(ClientRolesTabItems.UsersInRole);
|
|
|
|
return this;
|
|
|
|
}
|
2022-03-09 16:41:45 +00:00
|
|
|
|
|
|
|
goToRolesTab() {
|
|
|
|
cy.findByTestId(this.rolesTab).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToAssociatedRolesTab() {
|
|
|
|
cy.get(this.associatedRolesTab).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToCreateRoleFromToolbar() {
|
|
|
|
cy.findByTestId(this.createRoleBtn).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
goToCreateRoleFromEmptyState() {
|
|
|
|
cy.findByTestId(this.createRoleEmptyStateBtn).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
fillClientRoleData() {
|
|
|
|
cy.findByTestId(this.createRoleBtn).click();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
hideInheritedRoles() {
|
|
|
|
cy.get(this.hideInheritedRolesChkBox).check();
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|