@bigbinary/neeto-playwright-commons 1.20.3 → 1.20.5

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
@@ -60,11 +60,13 @@ let MemberApis$1 = class MemberApis {
60
60
  this.jobStatus = (jobId) => this.neetoPlaywrightUtilities.apiRequest({
61
61
  url: `${this.teamsBaseUrl}/creation_status/${jobId}`,
62
62
  });
63
- this.fetch = (params) => this.neetoPlaywrightUtilities.apiRequest({
64
- method: "get",
63
+ this.fetch = (params = {}) => this.neetoPlaywrightUtilities.apiRequest({
65
64
  url: this.teamsBaseUrl,
66
65
  params,
67
66
  });
67
+ this.fetchPermissions = () => this.neetoPlaywrightUtilities.apiRequest({
68
+ url: `${this.teamMembersBaseUrl}/permissions`,
69
+ });
68
70
  this.update = (memberId, body) => this.neetoPlaywrightUtilities.apiRequest({
69
71
  method: "put",
70
72
  url: `${this.teamsBaseUrl}/${memberId}`,
@@ -75,7 +77,8 @@ let MemberApis$1 = class MemberApis {
75
77
  url: `${this.teamsBaseUrl}/bulk_update`,
76
78
  body: { users: body },
77
79
  });
78
- this.teamsBaseUrl = "/team_members/teams";
80
+ this.teamMembersBaseUrl = "/team_members";
81
+ this.teamsBaseUrl = `${this.teamMembersBaseUrl}/teams`;
79
82
  }
80
83
  };
81
84
 
@@ -188919,8 +188922,8 @@ const STATUS_TEXTS = {
188919
188922
  };
188920
188923
  const AUDIT_LOGS_TEXTS = { organizationRole: "Organization Role" };
188921
188924
  const COMMON_TEXTS = {
188922
- skipCleanup: "SKIP_CLEANUP",
188923
- skipSetup: "SKIP_SETUP",
188925
+ skipCleanup: "@SKIP_CLEANUP",
188926
+ skipSetup: "@SKIP_SETUP",
188924
188927
  };
188925
188928
  const ORGANIZATION_TEXTS = {
188926
188929
  subdomainAvailable: "Subdomain is available",
@@ -188955,7 +188958,7 @@ class HelpAndProfilePage {
188955
188958
  this.openAndVerifyChatWidgetV2 = async () => {
188956
188959
  await this.page.reload();
188957
188960
  await this.neetoPlaywrightUtilities.waitForPageLoad();
188958
- await test$1.test.step("Step 1: Open live chat and verify iframe", this.openLiveChatAndVerify);
188961
+ await test$1.test.step("Step 1: Open live chat and verify iframe", () => this.openLiveChatAndVerify());
188959
188962
  await test$1.test.step("Step 2: Close and reopen live chat frame", async () => {
188960
188963
  await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
188961
188964
  await test$1.expect(this.neetoChatWidget).toBeHidden({ timeout: 35000 });
@@ -191284,7 +191287,7 @@ class SlackPage extends IntegrationBase {
191284
191287
  .pressSequentially(slackLoginPassword, { delay: 10 });
191285
191288
  await slackWebappPage.locator(SLACK_SELECTORS.signInButton).click();
191286
191289
  const redirectOpenInBrowser = slackWebappPage.locator(SLACK_SELECTORS.redirectOpenInBrowser);
191287
- await test$1.expect(redirectOpenInBrowser).toBeVisible({ timeout: 10000 });
191290
+ await test$1.expect(redirectOpenInBrowser).toBeVisible({ timeout: 25000 });
191288
191291
  await redirectOpenInBrowser.click();
191289
191292
  await this.setupCloseHandlers(slackWebappPage);
191290
191293
  return;
@@ -191705,11 +191708,13 @@ class MemberApis {
191705
191708
  this.jobStatus = (jobId) => this.neetoPlaywrightUtilities.apiRequest({
191706
191709
  url: `${this.teamsBaseUrl}/creation_status/${jobId}`,
191707
191710
  });
191708
- this.fetch = (params) => this.neetoPlaywrightUtilities.apiRequest({
191709
- method: "get",
191711
+ this.fetch = (params = {}) => this.neetoPlaywrightUtilities.apiRequest({
191710
191712
  url: this.teamsBaseUrl,
191711
191713
  params,
191712
191714
  });
191715
+ this.fetchPermissions = () => this.neetoPlaywrightUtilities.apiRequest({
191716
+ url: `${this.teamMembersBaseUrl}/permissions`,
191717
+ });
191713
191718
  this.update = (memberId, body) => this.neetoPlaywrightUtilities.apiRequest({
191714
191719
  method: "put",
191715
191720
  url: `${this.teamsBaseUrl}/${memberId}`,
@@ -191720,7 +191725,8 @@ class MemberApis {
191720
191725
  url: `${this.teamsBaseUrl}/bulk_update`,
191721
191726
  body: { users: body },
191722
191727
  });
191723
- this.teamsBaseUrl = "/team_members/teams";
191728
+ this.teamMembersBaseUrl = "/team_members";
191729
+ this.teamsBaseUrl = `${this.teamMembersBaseUrl}/teams`;
191724
191730
  }
191725
191731
  }
191726
191732
 
@@ -193013,9 +193019,9 @@ class RolesPage {
193013
193019
  permission_ids: permissionIds,
193014
193020
  });
193015
193021
  };
193016
- this.deleteRoleViaRequest = async (roleName) => {
193017
- const [{ roleId }, { roleId: editorRoleId }] = await Promise.all([roleName, "Editor"].map(this.getRoleIdAndOrganizationId));
193018
- return this.roleApis.deleteRole(roleId, editorRoleId);
193022
+ this.deleteRoleViaRequest = async (roleName, secondaryRoleName = "Editor") => {
193023
+ const [{ roleId }, { roleId: secondaryRoleId }] = await Promise.all([roleName, secondaryRoleName].map(this.getRoleIdAndOrganizationId));
193024
+ return this.roleApis.deleteRole(roleId, secondaryRoleId);
193019
193025
  };
193020
193026
  this.addRoleViaUI = async ({ roleName, permissions }) => {
193021
193027
  await this.page.getByTestId(ROLES_SELECTORS.newButton).click();
@@ -193029,16 +193035,19 @@ class RolesPage {
193029
193035
  .getByTestId(ROLES_SELECTORS.dropDownIcon)
193030
193036
  .click();
193031
193037
  await this.page.getByTestId(ROLES_SELECTORS.editRoleButton).click();
193038
+ await test$1.expect(this.page.getByTestId(ROLES_SELECTORS.updateRolePaneHeading)).toBeVisible();
193032
193039
  await this.selectAndSubmitPermissions(permissions);
193033
193040
  };
193034
193041
  this.selectAndSubmitPermissions = async (permissions) => {
193035
193042
  for (const permission of permissions) {
193036
193043
  await this.page
193037
- .getByTestId(MEMBER_SELECTORS.checkboxLabel(permission))
193038
- .check();
193044
+ .getByTestId(COMMON_SELECTORS.customCheckboxLabel(permission))
193045
+ .click({ force: true }); // Used force: true because disabling the parent permission disables the child permissions means the checkboxes label become disable
193039
193046
  }
193040
- await this.page.getByTestId(ROLES_SELECTORS.proceedButton).click();
193041
- await this.neetoPlaywrightUtilities.verifyToast();
193047
+ await Promise.all([
193048
+ this.page.getByTestId(ROLES_SELECTORS.proceedButton).click(),
193049
+ this.neetoPlaywrightUtilities.verifyToast(),
193050
+ ]);
193042
193051
  };
193043
193052
  this.verifyAdminPanelCard = ({ cardLocator, title, description, }) => Promise.all([
193044
193053
  test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemHeading)).toHaveText(title),
@@ -193046,16 +193055,25 @@ class RolesPage {
193046
193055
  test$1.expect(this.page.getByTestId(COMMON_SELECTORS.sidebarSubLink(title))).toHaveCSS("background-color", COLOR.transparent),
193047
193056
  ]);
193048
193057
  this.deleteRoleViaUI = async (roleName) => {
193049
- await this.page
193050
- .getByTestId(ROLES_SELECTORS.tableHeaderRoleName)
193058
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
193059
+ await this.page.getByTestId(ROLES_SELECTORS.searchTextField).fill(roleName);
193060
+ const tableHeaderRoles = this.page.getByTestId(ROLES_SELECTORS.tableHeaderRoleName);
193061
+ await test$1.expect(tableHeaderRoles).toHaveCount(1);
193062
+ await tableHeaderRoles
193051
193063
  .filter({ hasText: roleName })
193052
193064
  .getByTestId(ROLES_SELECTORS.dropDownIcon)
193053
193065
  .click();
193054
193066
  await this.page.getByTestId(ROLES_SELECTORS.deleteRoleButton).click();
193055
- await this.page
193056
- .getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
193057
- .click();
193058
- await this.neetoPlaywrightUtilities.verifyToast();
193067
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.alertTitle)).toHaveText(this.t("neetoTeamMembers.labels.deleteRole"));
193068
+ await Promise.all([
193069
+ this.page.getByTestId(COMMON_SELECTORS.alertModalSubmitButton).click(),
193070
+ this.neetoPlaywrightUtilities.verifyToast(),
193071
+ ]);
193072
+ await test$1.expect(this.page
193073
+ .getByTestId(ROLES_SELECTORS.tableHeaderRoleTitle)
193074
+ .filter({ hasText: roleName })).toBeHidden();
193075
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toHaveText(this.t("neetoTeamMembers.labels.roleNotFound", PLURAL));
193076
+ await test$1.expect(this.page.getByTestId(ROLES_SELECTORS.newButton)).toHaveCount(2);
193059
193077
  };
193060
193078
  this.verifyPermissions = ({ allPermissions, rolePermissions, }) => Promise.all(Object.values(allPermissions).map(async (permission) => rolePermissions.includes(permission)
193061
193079
  ? await test$1.expect(this.page.getByTestId(permission)).toBeVisible()