Group permission tests (#3246)
This commit is contained in:
parent
9c22d91d12
commit
a8ab21096b
3 changed files with 31 additions and 1 deletions
|
@ -473,4 +473,15 @@ describe("Group test", () => {
|
|||
groupPage.assertGroupItemExist(predefinedGroups[0], true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Permissions", () => {
|
||||
beforeEach(() => {
|
||||
groupPage.goToGroupChildGroupsTab(predefinedGroups[0]);
|
||||
groupDetailPage.goToPermissionsTab();
|
||||
});
|
||||
|
||||
it("enable/disable permissions", () => {
|
||||
groupDetailPage.enablePermissionSwitch();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,6 +9,7 @@ export default class GroupDetailPage extends GroupPage {
|
|||
private childGroupsTab = "groups";
|
||||
private attributesTab = "attributes";
|
||||
private roleMappingTab = "role-mapping-tab";
|
||||
private permissionsTab = "permissionsTab";
|
||||
private memberNameColumn =
|
||||
'[data-testid="members-table"] > tbody > tr > [data-label="Name"]';
|
||||
private addMembers = "addMember";
|
||||
|
@ -18,7 +19,7 @@ export default class GroupDetailPage extends GroupPage {
|
|||
private headerGroupName = ".pf-l-level.pf-m-gutter";
|
||||
private renameGroupModalGroupNameInput = "groupNameInput";
|
||||
private renameGroupModalRenameBtn = "renameGroup";
|
||||
|
||||
private permissionSwitch = "permissionSwitch";
|
||||
public goToChildGroupsTab() {
|
||||
cy.findByTestId(this.childGroupsTab).click();
|
||||
return this;
|
||||
|
@ -39,6 +40,11 @@ export default class GroupDetailPage extends GroupPage {
|
|||
return this;
|
||||
}
|
||||
|
||||
public goToPermissionsTab() {
|
||||
cy.findByTestId(this.permissionsTab).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
public headerActionRenameGroup() {
|
||||
super.openDropdownMenu("", cy.findByTestId(this.actionDrpDwnButton));
|
||||
super.clickDropdownMenuItem(
|
||||
|
@ -128,4 +134,16 @@ export default class GroupDetailPage extends GroupPage {
|
|||
cy.findByTestId(this.addMembers).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
enablePermissionSwitch() {
|
||||
cy.findByTestId(this.permissionSwitch).parent().click();
|
||||
this.assertSwitchStateOn(cy.findByTestId(this.permissionSwitch));
|
||||
cy.findByTestId(this.permissionSwitch).parent().click();
|
||||
modalUtils
|
||||
.checkModalTitle("Disable permissions?")
|
||||
.checkConfirmButtonText("Confirm")
|
||||
.confirmModal();
|
||||
this.assertSwitchStateOff(cy.findByTestId(this.permissionSwitch));
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,7 @@ export const PermissionsTab = ({ id, type }: PermissionsTabProps) => {
|
|||
>
|
||||
<Switch
|
||||
id="permissionsEnabled"
|
||||
data-testid="permissionSwitch"
|
||||
label={t("common:on")}
|
||||
labelOff={t("common:off")}
|
||||
isChecked={permission.enabled}
|
||||
|
|
Loading…
Reference in a new issue