@bigbinary/neeto-playwright-commons 1.9.27 → 1.9.29

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/README.md CHANGED
@@ -11,6 +11,121 @@ Install from npm:
11
11
  yarn add "@bigbinary/neeto-playwright-commons@latest"
12
12
  ```
13
13
 
14
+ ## Dependencies
15
+
16
+ **neetoPlaywrightCommons** has some peer dependencies which can be installed
17
+ using the commands listed below:
18
+
19
+ ### `neeto-cist`
20
+
21
+ A collection of common utility functions used across all our
22
+ [neeto](https://www.neeto.com/) products. Try out the utility functions live at
23
+ [neetoCommons REPL](https://neeto-cist.neeto.com/).
24
+
25
+ ```
26
+ yarn add @bigbinary/neeto-cist
27
+ ```
28
+
29
+ ### `faker`
30
+
31
+ Faker is used to generate fake data.
32
+
33
+ ```
34
+ yarn add @faker-js/faker
35
+ ```
36
+
37
+ ### `playwright/test`
38
+
39
+ ```
40
+ yarn add @playwright/test
41
+ ```
42
+
43
+ ### `lint-staged`
44
+
45
+ Run linters against staged git files.
46
+
47
+ ```
48
+ yarn add lint-staged
49
+ ```
50
+
51
+ ### `dotenv-webpack`
52
+
53
+ `dotenv-webpack` is a secure webpack plugin that supports
54
+ [dotenv](https://www.npmjs.com/package/dotenv) and other environment variables.
55
+
56
+ ```
57
+ yarn add dotenv-webpack
58
+ ```
59
+
60
+ ### `mailosaur`
61
+
62
+ Using `Mailosaur` you can automate email and SMS tests.
63
+
64
+ ```
65
+ yarn add mailosaur
66
+ ```
67
+
68
+ ### `dayjs`
69
+
70
+ Dayjs is a JavaScript library that parses, validates, manipulates, and displays
71
+ dates and times.
72
+
73
+ ```
74
+ yarn add dayjs
75
+ ```
76
+
77
+ ### `ramda`
78
+
79
+ Ramda is a JavaScript library that facilitates functional programming in
80
+ JavaScript. It provides a collection of utility functions that operate on data.
81
+
82
+ ```
83
+ yarn add ramda
84
+ ```
85
+
86
+ ### `playwright-i18next-fixture`
87
+
88
+ Use your `i18next` translations in Playwright to create multi-language
89
+ selectors.
90
+
91
+ ```
92
+ yarn add playwright-i18next-fixture
93
+ ```
94
+
95
+ We can install all the above peer dependencies by running a single command.
96
+
97
+ ```
98
+ yarn add @bigbinary/neeto-cist @faker-js/faker @playwright/test lint-staged dotenv-webpack mailosaur dayjs ramda playwright-i18next-fixture
99
+ ```
100
+
101
+ ## External dependencies
102
+
103
+ ### Methods
104
+
105
+ ## mailosaurUtils
106
+
107
+ Note: ENV variables `MAILOUSAUR_KEY` and `MAILOSAUR_SERVER_ID` are required for
108
+ this methods to work.
109
+
110
+ We can find `MAILOUSAUR_KEY` by visiting https://mailosaur.com/app/account/keys
111
+ and `MAILOSAUR_SERVER_ID` by visiting https://mailosaur.com/app/servers
112
+
113
+ ## Slack integration methods
114
+
115
+ Note: Either ENV variables `SLACK_WORKSPACE`, `SLACK_LOGIN_PASSWORD` and
116
+ `SLACK_LOGIN_EMAIL` is required for this method to work or custom credentials
117
+ `workspace`, `loginPassword` and `loginEmail` must be passed.
118
+
119
+ ## Zapier integration methods
120
+
121
+ Note: ENV variables `INTEGRATION_MAILOSAUR_API_KEY`,
122
+ `INTEGRATION_MAILOSAUR_SERVER_ID`, `ZAPIER_LOGIN_PASSWORD`,
123
+ `ZAPIER_LOGIN_EMAIL`, and `ZAP_ID` are required for this methods to work.
124
+
125
+ We can find `INTEGRATION_MAILOSAUR_SERVER_ID` by visiting
126
+ https://mailosaur.com/app/servers and `INTEGRATION_MAILOSAUR_API_KEY` by
127
+ visiting https://mailosaur.com/app/servers/ymn2s6kt/keys
128
+
14
129
  ## Usage
15
130
 
16
131
  You can import the utility functions and constants from the
package/index.cjs.js CHANGED
@@ -284,6 +284,10 @@ const getByDataQA = ramda.curry((page, dataQa) => {
284
284
  .locator(`[data-qa='${dataQa[0]}']`)
285
285
  .locator(`[data-qa='${dataQa[1]}']`);
286
286
  });
287
+ const getListCount = async ({ page, countSelector, }) => {
288
+ const countText = await page.getByTestId(countSelector).textContent();
289
+ return Number(countText === null || countText === void 0 ? void 0 : countText.trim().split(" ")[0]);
290
+ };
287
291
 
288
292
  const COMMON_SELECTORS = {
289
293
  emailInputError: "email-input-error",
@@ -360,6 +364,7 @@ const COMMON_SELECTORS = {
360
364
  takeActionDropdown: "take-action-dropdown-icon",
361
365
  columnsSearchInput: "neeto-ui-columns-search",
362
366
  errorToastIcon: "error-toast-icon",
367
+ nuiRadioLabel: "nui-radio-label",
363
368
  };
364
369
 
365
370
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -13882,10 +13887,10 @@ class IntegrationBase {
13882
13887
  })).toBeVisible();
13883
13888
  await this.page.getByTestId(INTEGRATION_SELECTORS.connectButton).click();
13884
13889
  };
13885
- this.verifyIntegrationStatus = async (status = "connected") => {
13890
+ this.verifyIntegrationStatus = async (status = "connected", visibilityTimeout = 15000) => {
13886
13891
  await this.gotoIntegrationIndex();
13887
13892
  if (status === "connected") {
13888
- await test$1.expect(this.integrationCard.getByTestId(INTEGRATION_SELECTORS.integrationStatusTag)).toBeVisible({ timeout: 10000 });
13893
+ await test$1.expect(this.integrationCard.getByTestId(INTEGRATION_SELECTORS.integrationStatusTag)).toBeVisible({ timeout: visibilityTimeout });
13889
13894
  }
13890
13895
  await this.clickOnIntegrationCard();
13891
13896
  const header = status === "connected" ? this.connectedHeader : this.connectHeader;
@@ -13972,7 +13977,11 @@ class SlackPage extends IntegrationBase {
13972
13977
  const slackWebappPageDataQa = getByDataQA(slackWebappPage);
13973
13978
  await slackWebappPage.addLocatorHandler(slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.coachMarkCloseButton), () => slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.coachMarkCloseButton).click());
13974
13979
  await slackWebappPage.addLocatorHandler(slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.messagePaneBannerCloseIcon), () => slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.messagePaneBannerCloseIcon).click());
13975
- await slackWebappPage.addLocatorHandler(slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.permissionBannerCloseIcon), () => slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.permissionBannerCloseIcon).click());
13980
+ const permissionBannerCloseIcon = slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.permissionBannerCloseIcon);
13981
+ await slackWebappPage.addLocatorHandler(permissionBannerCloseIcon, async () => {
13982
+ await permissionBannerCloseIcon.click();
13983
+ await permissionBannerCloseIcon.click();
13984
+ });
13976
13985
  };
13977
13986
  this.connectAndVerifyIntegration = async (redirectUrl, customSteps, channelToConfigure = SLACK_DEFAULT_CHANNEL) => {
13978
13987
  await this.connect();
@@ -14952,8 +14961,9 @@ class TeamMembers {
14952
14961
  await this.page.getByTestId(MEMBER_SELECTORS.continueButton).click();
14953
14962
  }
14954
14963
  await this.page.getByTestId(MEMBER_SELECTORS.submitButton).click();
14964
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeHidden();
14955
14965
  await this.neetoPlaywrightUtilities.waitForPageLoad();
14956
- await this.neetoPlaywrightUtilities.verifySuccessToast();
14966
+ await this.neetoPlaywrightUtilities.verifyToast();
14957
14967
  };
14958
14968
  this.searchAndVerifyMemberByEmail = async ({ email, interceptOptions = {}, }) => {
14959
14969
  const searchMembers = this.neetoPlaywrightUtilities.interceptMultipleResponses({
@@ -149320,6 +149330,7 @@ exports.generateStagingData = generateStagingData;
149320
149330
  exports.getByDataQA = getByDataQA;
149321
149331
  exports.getGlobalUserState = getGlobalUserState;
149322
149332
  exports.getImagePathAndName = getImagePathAndName;
149333
+ exports.getListCount = getListCount;
149323
149334
  exports.headerUtils = headerUtils;
149324
149335
  exports.hexToRGB = hexToRGB;
149325
149336
  exports.hyphenize = hyphenize;