@bigbinary/neeto-playwright-commons 1.9.27 → 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.d.ts +46 -33
- package/package.json +1 -1
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.d.ts
CHANGED
|
@@ -362,9 +362,9 @@ declare class MailosaurUtils {
|
|
|
362
362
|
* email: `someone@${process.env.MAILOSAUR_SERVER_ID}.mailosaur.net`,
|
|
363
363
|
* subjectSubstring: "is your OTP",
|
|
364
364
|
* timeout: 60 * 1000,
|
|
365
|
-
* receivedAfter: new Date()
|
|
366
|
-
* })
|
|
367
|
-
* })
|
|
365
|
+
* receivedAfter: new Date(),
|
|
366
|
+
* });
|
|
367
|
+
* });
|
|
368
368
|
* @endexample
|
|
369
369
|
*/
|
|
370
370
|
getEmailContent: ({
|
|
@@ -400,9 +400,9 @@ declare class MailosaurUtils {
|
|
|
400
400
|
* email: `someone@${process.env.MAILOSAUR_SERVER_ID}.mailosaur.net`,
|
|
401
401
|
* subjectSubstring: "is your OTP",
|
|
402
402
|
* timeout: 60 * 1000,
|
|
403
|
-
* receivedAfter: new Date()
|
|
404
|
-
* })
|
|
405
|
-
* })
|
|
403
|
+
* receivedAfter: new Date(),
|
|
404
|
+
* });
|
|
405
|
+
* });
|
|
406
406
|
* @endexample
|
|
407
407
|
*/
|
|
408
408
|
fetchOtpFromEmail: FetchOtpFromEmail;
|
|
@@ -414,7 +414,7 @@ declare class MailosaurUtils {
|
|
|
414
414
|
*
|
|
415
415
|
* test("sample test", async ({ mailosaurUtils }) => {
|
|
416
416
|
* const email = mailosaurUtils.generateRandomMailosaurEmail();
|
|
417
|
-
* })
|
|
417
|
+
* });
|
|
418
418
|
* @endexample
|
|
419
419
|
*/
|
|
420
420
|
generateRandomMailosaurEmail: () => string;
|
|
@@ -947,7 +947,7 @@ declare class SlackPage extends IntegrationBase {
|
|
|
947
947
|
*
|
|
948
948
|
* @example
|
|
949
949
|
*
|
|
950
|
-
*
|
|
950
|
+
* await slackPage.setupCloseHandlers(slackWebappPageInstance);
|
|
951
951
|
* @endexample
|
|
952
952
|
*/
|
|
953
953
|
setupCloseHandlers: (slackWebappPage?: Page) => Promise<void>;
|
|
@@ -963,7 +963,11 @@ declare class SlackPage extends IntegrationBase {
|
|
|
963
963
|
*
|
|
964
964
|
* @example
|
|
965
965
|
*
|
|
966
|
-
*
|
|
966
|
+
* await slackPage.connectAndVerifyIntegration(
|
|
967
|
+
* /example\.com/,
|
|
968
|
+
* customSteps,
|
|
969
|
+
* "general"
|
|
970
|
+
* );
|
|
967
971
|
* @endexample
|
|
968
972
|
*/
|
|
969
973
|
connectAndVerifyIntegration: (redirectUrl: RedirectUrl, customSteps?: AsyncNoArgsFunction, channelToConfigure?: string) => Promise<void>;
|
|
@@ -973,7 +977,7 @@ declare class SlackPage extends IntegrationBase {
|
|
|
973
977
|
*
|
|
974
978
|
* @example
|
|
975
979
|
*
|
|
976
|
-
*
|
|
980
|
+
* await slackPage.disconnectAndVerifyIntegration();
|
|
977
981
|
* @endexample
|
|
978
982
|
*/
|
|
979
983
|
disconnectAndVerifyIntegration: () => Promise<void>;
|
|
@@ -1041,6 +1045,12 @@ declare class SlackPage extends IntegrationBase {
|
|
|
1041
1045
|
*/
|
|
1042
1046
|
clickOnChannelListRefreshButton: (refreshInterceptMultipleResponsesParams?: PartialInterceptMultipleResponsesParams) => Promise<void>;
|
|
1043
1047
|
/**
|
|
1048
|
+
*
|
|
1049
|
+
* Note: Either ENV variables SLACK_WORKSPACE, SLACK_LOGIN_PASSWORD and
|
|
1050
|
+
*
|
|
1051
|
+
* SLACK_LOGIN_EMAIL is required for this method to work or custom credentials
|
|
1052
|
+
*
|
|
1053
|
+
* workspace, loginPassword and loginEmail must be passed.
|
|
1044
1054
|
*
|
|
1045
1055
|
* Logs into slack web app. It takes the following parameters:
|
|
1046
1056
|
*
|
|
@@ -1050,13 +1060,13 @@ declare class SlackPage extends IntegrationBase {
|
|
|
1050
1060
|
*
|
|
1051
1061
|
* @example
|
|
1052
1062
|
*
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
*
|
|
1056
|
-
*
|
|
1057
|
-
*
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1063
|
+
* await slackPage.loginToSlackWebapp(slackWebappPageInstance);
|
|
1064
|
+
* // OR
|
|
1065
|
+
* await slackPage.loginToSlackWebapp(slackWebappPageInstance, {
|
|
1066
|
+
* loginEmail: "johndoe@gmail.com",
|
|
1067
|
+
* loginPassword: "123456789",
|
|
1068
|
+
* workspace: "your-workspace-name",
|
|
1069
|
+
* });
|
|
1060
1070
|
* @endexample
|
|
1061
1071
|
*/
|
|
1062
1072
|
loginToSlackWebapp: (slackWebappPage: Page, customCredentials?: Record<"workspace" | "loginPassword" | "loginEmail", string | undefined>) => Promise<void>;
|
|
@@ -1066,7 +1076,7 @@ declare class SlackPage extends IntegrationBase {
|
|
|
1066
1076
|
*
|
|
1067
1077
|
* @example
|
|
1068
1078
|
*
|
|
1069
|
-
*
|
|
1079
|
+
* await slackPage.logoutFromSlackWebApp();
|
|
1070
1080
|
* @endexample
|
|
1071
1081
|
*/
|
|
1072
1082
|
logoutFromSlackWebApp: () => Promise<void>;
|
|
@@ -1078,7 +1088,7 @@ declare class SlackPage extends IntegrationBase {
|
|
|
1078
1088
|
*
|
|
1079
1089
|
* @example
|
|
1080
1090
|
*
|
|
1081
|
-
*
|
|
1091
|
+
* await slackPage.goToSlackChannel("general");
|
|
1082
1092
|
* @endexample
|
|
1083
1093
|
*/
|
|
1084
1094
|
goToSlackChannel: (slackChannel: string) => Promise<void>;
|
|
@@ -1092,7 +1102,10 @@ declare class SlackPage extends IntegrationBase {
|
|
|
1092
1102
|
*
|
|
1093
1103
|
* @example
|
|
1094
1104
|
*
|
|
1095
|
-
*
|
|
1105
|
+
* await slackPage.createNewSlackChannel({
|
|
1106
|
+
* channelName: "new-channel",
|
|
1107
|
+
* kind: "public",
|
|
1108
|
+
* });
|
|
1096
1109
|
* @endexample
|
|
1097
1110
|
*/
|
|
1098
1111
|
createNewSlackChannel: ({
|
|
@@ -1110,7 +1123,7 @@ declare class SlackPage extends IntegrationBase {
|
|
|
1110
1123
|
*
|
|
1111
1124
|
* @example
|
|
1112
1125
|
*
|
|
1113
|
-
*
|
|
1126
|
+
* await slackPage.deleteSlackChannel("old-channel");
|
|
1114
1127
|
* @endexample
|
|
1115
1128
|
*/
|
|
1116
1129
|
deleteSlackChannel: (channel: string) => Promise<void>;
|
|
@@ -1263,7 +1276,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1263
1276
|
*
|
|
1264
1277
|
* @example
|
|
1265
1278
|
*
|
|
1266
|
-
*
|
|
1279
|
+
* await zapierPage.loginToZapier(zapierWebPageInstance);
|
|
1267
1280
|
* @endexample
|
|
1268
1281
|
*/
|
|
1269
1282
|
loginToZapier: (zapierWebPage: Page) => Promise<void>;
|
|
@@ -1273,7 +1286,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1273
1286
|
*
|
|
1274
1287
|
* @example
|
|
1275
1288
|
*
|
|
1276
|
-
*
|
|
1289
|
+
* await zapierPage.logoutFromZapier();
|
|
1277
1290
|
* @endexample
|
|
1278
1291
|
*/
|
|
1279
1292
|
logoutFromZapier: () => Promise<void>;
|
|
@@ -1285,7 +1298,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1285
1298
|
*
|
|
1286
1299
|
* @example
|
|
1287
1300
|
*
|
|
1288
|
-
*
|
|
1301
|
+
* await zapierPage.reconnectAccountAndPublish("your-zapier-api-key");
|
|
1289
1302
|
* @endexample
|
|
1290
1303
|
*/
|
|
1291
1304
|
reconnectAccountAndPublish: (zapierApiKey: string) => Promise<void>;
|
|
@@ -1297,7 +1310,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1297
1310
|
*
|
|
1298
1311
|
* @example
|
|
1299
1312
|
*
|
|
1300
|
-
*
|
|
1313
|
+
* await zapierPage.deleteAllConnections("https://zapier.com/app/dashboard");
|
|
1301
1314
|
* @endexample
|
|
1302
1315
|
*/
|
|
1303
1316
|
deleteAllConnections: (zapierAppLink: string) => Promise<void>;
|
|
@@ -1313,11 +1326,11 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1313
1326
|
*
|
|
1314
1327
|
* @example
|
|
1315
1328
|
*
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
*
|
|
1319
|
-
*
|
|
1320
|
-
*
|
|
1329
|
+
* await zapierPage.verifyZapIsTriggered({
|
|
1330
|
+
* submittedEmail: "example@example.com",
|
|
1331
|
+
* zapTriggeredAfter: new Date(),
|
|
1332
|
+
* productName: "neetoChat",
|
|
1333
|
+
* });
|
|
1321
1334
|
* @endexample
|
|
1322
1335
|
*/
|
|
1323
1336
|
verifyZapIsTriggered: ({
|
|
@@ -1335,7 +1348,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1335
1348
|
*
|
|
1336
1349
|
* @example
|
|
1337
1350
|
*
|
|
1338
|
-
*
|
|
1351
|
+
* await zapierPage.skipIfTaskLimitIsExhausted();
|
|
1339
1352
|
* @endexample
|
|
1340
1353
|
*/
|
|
1341
1354
|
skipIfTaskLimitIsExhausted: () => Promise<void>;
|
|
@@ -1349,7 +1362,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1349
1362
|
*
|
|
1350
1363
|
* @example
|
|
1351
1364
|
*
|
|
1352
|
-
*
|
|
1365
|
+
* const apiKey = await zapierPage.connectAndVerify({ apiKeyLabel: "Your API Key" });
|
|
1353
1366
|
* @endexample
|
|
1354
1367
|
*/
|
|
1355
1368
|
connectAndVerify: ({
|
|
@@ -1363,7 +1376,7 @@ declare class ZapierPage extends IntegrationBase {
|
|
|
1363
1376
|
*
|
|
1364
1377
|
* @example
|
|
1365
1378
|
*
|
|
1366
|
-
*
|
|
1379
|
+
* await zapierPage.disconnectAndVerify();
|
|
1367
1380
|
* @endexample
|
|
1368
1381
|
*/
|
|
1369
1382
|
disconnectAndVerify: () => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-playwright-commons",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.28",
|
|
4
4
|
"description": "A package encapsulating common playwright code across neeto projects.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
|
|
6
6
|
"license": "apache-2.0",
|