@bigbinary/neeto-playwright-commons 1.26.2 → 1.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -5217,6 +5217,7 @@ const ROLES_SELECTORS = {
5217
5217
  roleCell: (roleName) => `${neetoCist.hyphenate(roleName)}-role-cell`,
5218
5218
  tablePermissionCheckbox: "ntm-roles-table-permission-checkbox",
5219
5219
  descriptionInputError: "description-input-error",
5220
+ permissionSubCategoryCard: (index) => `ntm-roles-permission-sub-category-card-${index}`,
5220
5221
  };
5221
5222
 
5222
5223
  const SIGNUP_SELECTORS = {
@@ -117946,7 +117947,8 @@ class TeamMembers {
117946
117947
  await test.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
117947
117948
  };
117948
117949
  this.filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
117949
- await this.page.getByTestId(NEETO_FILTERS_SELECTORS.filterButton).click();
117950
+ await filterUtils.clearFiltersFromActionBlock(this.page);
117951
+ await filterUtils.openFilterPane(this.page);
117950
117952
  if (neetoCist.isPresent(email.id)) {
117951
117953
  await this.page
117952
117954
  .getByTestId(NEETO_FILTERS_SELECTORS.emailSelectContainer)
@@ -118688,12 +118690,12 @@ class RolesPage {
118688
118690
  const [{ roleId }, { roleId: secondaryRoleId }] = await Promise.all([roleName, secondaryRoleName].map(this.getRoleIdAndOrganizationId));
118689
118691
  return this.roleApis.deleteRole(roleId, secondaryRoleId);
118690
118692
  };
118691
- this.addRoleViaUI = async ({ roleName, permissions }) => {
118693
+ this.addRoleViaUI = async ({ roleName, permissions, parentPermission = "", hierarchyLevelOfPermissions = 2, }) => {
118692
118694
  await this.page.getByTestId(ROLES_SELECTORS.newButton).click();
118693
118695
  await this.page.getByTestId(ROLES_SELECTORS.nameTextField).fill(roleName);
118694
- await this.selectAndSubmitPermissions(permissions);
118696
+ await this.selectAndSubmitPermissions(permissions, parentPermission, hierarchyLevelOfPermissions);
118695
118697
  };
118696
- this.editRoleViaUI = async ({ roleName, permissions }) => {
118698
+ this.editRoleViaUI = async ({ roleName, permissions, parentPermission = "", hierarchyLevelOfPermissions = 2, }) => {
118697
118699
  await this.page
118698
118700
  .getByTestId(ROLES_SELECTORS.tableHeaderRoleName)
118699
118701
  .filter({ hasText: roleName })
@@ -118701,11 +118703,20 @@ class RolesPage {
118701
118703
  .click();
118702
118704
  await this.page.getByTestId(ROLES_SELECTORS.editRoleButton).click();
118703
118705
  await test.expect(this.page.getByTestId(ROLES_SELECTORS.updateRolePaneHeading)).toBeVisible();
118704
- await this.selectAndSubmitPermissions(permissions);
118706
+ await this.selectAndSubmitPermissions(permissions, parentPermission, hierarchyLevelOfPermissions);
118705
118707
  };
118706
- this.selectAndSubmitPermissions = async (permissions) => {
118708
+ this.selectAndSubmitPermissions = async (permissions, parentPermission = "", hierarchyLevelOfPermissions = 2) => {
118709
+ const parentPermissionSelector = parentPermission
118710
+ ? this.page
118711
+ .getByTestId(ROLES_SELECTORS.permissionSubCategoryCard(hierarchyLevelOfPermissions - 1))
118712
+ .filter({ hasText: parentPermission })
118713
+ : this.page;
118714
+ parentPermission &&
118715
+ (await parentPermissionSelector
118716
+ .getByTestId(COMMON_SELECTORS.customCheckboxLabel(parentPermission))
118717
+ .click({ force: true }));
118707
118718
  for (const permission of permissions) {
118708
- await this.page
118719
+ await parentPermissionSelector
118709
118720
  .getByTestId(COMMON_SELECTORS.customCheckboxLabel(permission))
118710
118721
  .click({ force: true }); // Used force: true because disabling the parent permission disables the child permissions means the checkboxes label become disable
118711
118722
  }