@bigbinary/neeto-playwright-commons 1.9.26 → 1.9.28
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 +115 -0
- package/index.cjs.js +60 -40
- package/index.cjs.js.map +1 -1
- package/index.d.ts +50 -35
- package/index.js +60 -40
- package/index.js.map +1 -1
- package/package.json +24 -24
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
|
@@ -2660,6 +2660,10 @@ var decode$3 = function (str, decoder, charset) {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
};
|
|
2662
2662
|
|
|
2663
|
+
var limit = 1024;
|
|
2664
|
+
|
|
2665
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
2666
|
+
|
|
2663
2667
|
var encode$3 = function encode(str, defaultEncoder, charset, kind, format) {
|
|
2664
2668
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
2665
2669
|
// It has been adapted here for stricter adherence to RFC 3986
|
|
@@ -2681,45 +2685,54 @@ var encode$3 = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
2681
2685
|
}
|
|
2682
2686
|
|
|
2683
2687
|
var out = '';
|
|
2684
|
-
for (var
|
|
2685
|
-
var
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2688
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
2689
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
2690
|
+
var arr = [];
|
|
2691
|
+
|
|
2692
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
2693
|
+
var c = segment.charCodeAt(i);
|
|
2694
|
+
if (
|
|
2695
|
+
c === 0x2D // -
|
|
2696
|
+
|| c === 0x2E // .
|
|
2697
|
+
|| c === 0x5F // _
|
|
2698
|
+
|| c === 0x7E // ~
|
|
2699
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
2700
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
2701
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
2702
|
+
|| (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
2703
|
+
) {
|
|
2704
|
+
arr[arr.length] = segment.charAt(i);
|
|
2705
|
+
continue;
|
|
2706
|
+
}
|
|
2700
2707
|
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2708
|
+
if (c < 0x80) {
|
|
2709
|
+
arr[arr.length] = hexTable[c];
|
|
2710
|
+
continue;
|
|
2711
|
+
}
|
|
2705
2712
|
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2713
|
+
if (c < 0x800) {
|
|
2714
|
+
arr[arr.length] = hexTable[0xC0 | (c >> 6)]
|
|
2715
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
2716
|
+
continue;
|
|
2717
|
+
}
|
|
2710
2718
|
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2719
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
2720
|
+
arr[arr.length] = hexTable[0xE0 | (c >> 12)]
|
|
2721
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
2722
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
2723
|
+
continue;
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
i += 1;
|
|
2727
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
|
|
2728
|
+
|
|
2729
|
+
arr[arr.length] = hexTable[0xF0 | (c >> 18)]
|
|
2730
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
2731
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
2732
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
2714
2733
|
}
|
|
2715
2734
|
|
|
2716
|
-
|
|
2717
|
-
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
2718
|
-
/* eslint operator-linebreak: [2, "before"] */
|
|
2719
|
-
out += hexTable[0xF0 | (c >> 18)]
|
|
2720
|
-
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
2721
|
-
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
2722
|
-
+ hexTable[0x80 | (c & 0x3F)];
|
|
2735
|
+
out += arr.join('');
|
|
2723
2736
|
}
|
|
2724
2737
|
|
|
2725
2738
|
return out;
|
|
@@ -3153,7 +3166,7 @@ var defaults$1 = {
|
|
|
3153
3166
|
charset: 'utf-8',
|
|
3154
3167
|
charsetSentinel: false,
|
|
3155
3168
|
comma: false,
|
|
3156
|
-
decodeDotInKeys:
|
|
3169
|
+
decodeDotInKeys: false,
|
|
3157
3170
|
decoder: utils$m.decode,
|
|
3158
3171
|
delimiter: '&',
|
|
3159
3172
|
depth: 5,
|
|
@@ -14942,7 +14955,7 @@ class TeamMembers {
|
|
|
14942
14955
|
await this.neetoPlaywrightUtilities.waitForPageLoad();
|
|
14943
14956
|
await this.neetoPlaywrightUtilities.verifySuccessToast();
|
|
14944
14957
|
};
|
|
14945
|
-
this.searchAndVerifyMemberByEmail = async ({ email, interceptOptions, }) => {
|
|
14958
|
+
this.searchAndVerifyMemberByEmail = async ({ email, interceptOptions = {}, }) => {
|
|
14946
14959
|
const searchMembers = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
14947
14960
|
responseUrl: API_ROUTES.teamMembers.index,
|
|
14948
14961
|
...interceptOptions,
|
|
@@ -15270,12 +15283,12 @@ class OrganizationPage {
|
|
|
15270
15283
|
}
|
|
15271
15284
|
}
|
|
15272
15285
|
};
|
|
15273
|
-
this.loginViaSSO = async (email = generateRandomBypassEmail()) => {
|
|
15286
|
+
this.loginViaSSO = async (email = generateRandomBypassEmail(), loginTimeout = 15000) => {
|
|
15274
15287
|
await this.page.getByTestId(LOGIN_SELECTORS.emailTextField).fill(email);
|
|
15275
15288
|
await test$1.expect(async () => {
|
|
15276
15289
|
await this.page.getByTestId(LOGIN_SELECTORS.submitButton).click();
|
|
15277
15290
|
await test$1.expect(this.page.getByTestId(SIGNUP_SELECTORS.unregisterdEmailError)).toBeHidden();
|
|
15278
|
-
}).toPass({ timeout:
|
|
15291
|
+
}).toPass({ timeout: loginTimeout });
|
|
15279
15292
|
await this.page
|
|
15280
15293
|
.getByTestId(SIGNUP_SELECTORS.otpTextBox)
|
|
15281
15294
|
.fill(faker.faker.string.numeric(6));
|
|
@@ -148293,7 +148306,7 @@ class HOTP {
|
|
|
148293
148306
|
// Return early if the token length does not match the digit number.
|
|
148294
148307
|
if (token.length !== digits) return null;
|
|
148295
148308
|
let delta = null;
|
|
148296
|
-
|
|
148309
|
+
const check = ( /** @type {number} */i) => {
|
|
148297
148310
|
const generatedToken = HOTP.generate({
|
|
148298
148311
|
secret,
|
|
148299
148312
|
algorithm,
|
|
@@ -148303,6 +148316,13 @@ class HOTP {
|
|
|
148303
148316
|
if (timingSafeEqual(token, generatedToken)) {
|
|
148304
148317
|
delta = i - counter;
|
|
148305
148318
|
}
|
|
148319
|
+
};
|
|
148320
|
+
check(counter);
|
|
148321
|
+
for (let i = 1; i <= window && delta === null; ++i) {
|
|
148322
|
+
check(counter - i);
|
|
148323
|
+
if (delta !== null) break;
|
|
148324
|
+
check(counter + i);
|
|
148325
|
+
if (delta !== null) break;
|
|
148306
148326
|
}
|
|
148307
148327
|
return delta;
|
|
148308
148328
|
}
|
|
@@ -149190,7 +149210,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
149190
149210
|
baseURL: process.env.BASE_URL,
|
|
149191
149211
|
testIdAttribute: "data-cy",
|
|
149192
149212
|
trace: "on",
|
|
149193
|
-
video: { mode: "on"
|
|
149213
|
+
video: { mode: "on" },
|
|
149194
149214
|
screenshot: "on",
|
|
149195
149215
|
actionTimeout: 10 * 1000,
|
|
149196
149216
|
timezoneId: "Asia/Calcutta",
|