@actionlogementservices/wdio-test-context 1.0.0
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/.editorconfig +20 -0
- package/.jsdoc.json +35 -0
- package/.prettierrc +11 -0
- package/README.md +116 -0
- package/doc/images/badges/modifier-abstract.png +0 -0
- package/doc/images/badges/modifier-abstract.svg +10 -0
- package/doc/images/badges/modifier-default.png +0 -0
- package/doc/images/badges/modifier-default.svg +10 -0
- package/doc/images/badges/modifier-private.png +0 -0
- package/doc/images/badges/modifier-private.svg +10 -0
- package/doc/images/badges/modifier-protected.png +0 -0
- package/doc/images/badges/modifier-protected.svg +10 -0
- package/doc/images/badges/modifier-public.png +0 -0
- package/doc/images/badges/modifier-public.svg +10 -0
- package/doc/images/badges/modifier-readonly.png +0 -0
- package/doc/images/badges/modifier-readonly.svg +10 -0
- package/doc/images/badges/modifier-static.png +0 -0
- package/doc/images/badges/modifier-static.svg +10 -0
- package/doc/src-page-objects_guerrillamail.page.md +69 -0
- package/doc/src-page-objects_maildrop.page.md +57 -0
- package/doc/src-page-objects_page.md +484 -0
- package/doc/src-page-objects_yopmail.page.md +57 -0
- package/doc/src-wdio_ado-reporter.md +93 -0
- package/doc/src-wdio_test-context-worker-service.md +48 -0
- package/doc/src_ado-client.md +55 -0
- package/doc/src_logger.md +183 -0
- package/doc/src_mail-service.md +54 -0
- package/doc/src_pdf-generator.md +35 -0
- package/doc/src_test-context.md +173 -0
- package/doc/toc.md +22 -0
- package/eslint.config.js +100 -0
- package/jsconfig.json +14 -0
- package/package.json +58 -0
- package/src/ado-client.js +96 -0
- package/src/index.js +8 -0
- package/src/logger.js +125 -0
- package/src/mail-service.js +81 -0
- package/src/page-objects/guerrillamail.page.js +144 -0
- package/src/page-objects/index.js +3 -0
- package/src/page-objects/maildrop.page.js +97 -0
- package/src/page-objects/page.js +463 -0
- package/src/page-objects/yopmail.page.js +102 -0
- package/src/pdf-generator.js +61 -0
- package/src/test-context.js +248 -0
- package/src/types.d.ts +60 -0
- package/src/wdio/ado-reporter.js +111 -0
- package/src/wdio/test-context-worker-service.js +88 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Module `ado-client`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Azure DevOps rest client to push test results.
|
|
6
|
+
|
|
7
|
+
[Source file](../src/ado-client.js)
|
|
8
|
+
|
|
9
|
+
## Functions
|
|
10
|
+
|
|
11
|
+
### `isNullOrEmpty()`
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### `getConnectionInfo() ► ConnectionInfo`
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
Retrieves Azure DevOps connection information.
|
|
24
|
+
|
|
25
|
+
Parameters | Type | Description
|
|
26
|
+
--- | --- | ---
|
|
27
|
+
__*return*__ | `ConnectionInfo` | **
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### `getApis(connectionInfo) ► Promise.<Apis>`
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
Gets all necessary REST API clients.
|
|
36
|
+
See https://github.com/Microsoft/azure-devops-node-api and https://docs.microsoft.com/en-us/rest/api/azure/devops/
|
|
37
|
+
|
|
38
|
+
Parameters | Type | Description
|
|
39
|
+
--- | --- | ---
|
|
40
|
+
__connectionInfo__ | `ConnectionInfo` | **
|
|
41
|
+
__*return*__ | `Promise.<Apis>` | **
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### `createAdoTestRun(testRun)`
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+
|
|
49
|
+
Creates the Azure DevOps TestRun.
|
|
50
|
+
|
|
51
|
+
Parameters | Type | Description
|
|
52
|
+
--- | --- | ---
|
|
53
|
+
__testRun__ | `RunModel` | **
|
|
54
|
+
|
|
55
|
+
---
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Module `logger`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Internal logger.
|
|
6
|
+
|
|
7
|
+
[Source file](../src/logger.js)
|
|
8
|
+
|
|
9
|
+
## Functions
|
|
10
|
+
|
|
11
|
+
### `logError()`
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
console implementation @type {(message: string) => void}
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### `logWarn()`
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
console implementation @type {(message: string) => void}
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### `logInfo()`
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
console implementation @type {(message: string) => void}
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
### `logDebug()`
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
console implementation @type {(message: string) => void}
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### `log()`
|
|
44
|
+
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
console implementation @type {(message: string) => void}
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### `bold()`
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Constants
|
|
60
|
+
|
|
61
|
+
### `logger`
|
|
62
|
+
|
|
63
|
+
 
|
|
64
|
+
|
|
65
|
+
The common logger instance.
|
|
66
|
+
|
|
67
|
+
#### Value
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
new Logger('error')
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
# Class `Logger`
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Methods
|
|
80
|
+
|
|
81
|
+
### `setLogLevel(logLevel)`
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
Sets the logging level.
|
|
86
|
+
|
|
87
|
+
Parameters | Type | Description
|
|
88
|
+
--- | --- | ---
|
|
89
|
+
__logLevel__ | `import('./types').LogLevel` | *logging level*
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### `info(message)`
|
|
94
|
+
|
|
95
|
+

|
|
96
|
+
|
|
97
|
+
Logs an **informational** message.
|
|
98
|
+
|
|
99
|
+
Parameters | Type | Description
|
|
100
|
+
--- | --- | ---
|
|
101
|
+
__message__ | `string` | *the message to log*
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### `log(message)`
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
Logs a message.
|
|
110
|
+
|
|
111
|
+
Parameters | Type | Description
|
|
112
|
+
--- | --- | ---
|
|
113
|
+
__message__ | `string` | *the message to log*
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### `warn(message)`
|
|
118
|
+
|
|
119
|
+

|
|
120
|
+
|
|
121
|
+
Logs a **warning** message.
|
|
122
|
+
|
|
123
|
+
Parameters | Type | Description
|
|
124
|
+
--- | --- | ---
|
|
125
|
+
__message__ | `string` | *the message to log*
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### `error(message)`
|
|
130
|
+
|
|
131
|
+

|
|
132
|
+
|
|
133
|
+
Logs an **error** message.
|
|
134
|
+
|
|
135
|
+
Parameters | Type | Description
|
|
136
|
+
--- | --- | ---
|
|
137
|
+
__message__ | `string` | *the message to log*
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### `debug(message)`
|
|
142
|
+
|
|
143
|
+

|
|
144
|
+
|
|
145
|
+
Logs a **debug** message
|
|
146
|
+
|
|
147
|
+
Parameters | Type | Description
|
|
148
|
+
--- | --- | ---
|
|
149
|
+
__message__ | `string` | *the message to log*
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### `detailError(detailedError)`
|
|
154
|
+
|
|
155
|
+

|
|
156
|
+
|
|
157
|
+
Logs an **error** message based on the specified error object.
|
|
158
|
+
|
|
159
|
+
Parameters | Type | Description
|
|
160
|
+
--- | --- | ---
|
|
161
|
+
__detailedError__ | `Error` | *the error object to log*
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### `warnError(text, meaningfulErrorInfo)`
|
|
166
|
+
|
|
167
|
+

|
|
168
|
+
|
|
169
|
+
Logs an **warning** message based on the specified error object.
|
|
170
|
+
|
|
171
|
+
Parameters | Type | Description
|
|
172
|
+
--- | --- | ---
|
|
173
|
+
__text__ | `string` | *the text message to log*
|
|
174
|
+
__meaningfulErrorInfo__ | `Object` | *the meaningfull error info to log*
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Members
|
|
179
|
+
|
|
180
|
+
Name | Type | Description
|
|
181
|
+
--- | --- | ---
|
|
182
|
+
___logMethodFactory__ | `Map<'error' \| 'warn' \| 'info' \| 'debug' \| 'log', (message: string) => void>` | **
|
|
183
|
+
___level__ | `Number` | **
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Module `mail-service`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**Mail service** to send and retrieve mail from various provider.
|
|
6
|
+
Accessible through the **mailService property** of the TestContext instance.
|
|
7
|
+
|
|
8
|
+
[Source file](../src/mail-service.js)
|
|
9
|
+
|
|
10
|
+
# Class `MailService`
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Methods
|
|
15
|
+
|
|
16
|
+
### `sendMessage(from, to, subject, html) ► Promise.<void>`
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
Sends a mail.
|
|
21
|
+
|
|
22
|
+
Parameters | Type | Description
|
|
23
|
+
--- | --- | ---
|
|
24
|
+
__from__ | `string` | *sender*
|
|
25
|
+
__to__ | `string` | *recipient*
|
|
26
|
+
__subject__ | `string` | *subject of the mail*
|
|
27
|
+
__html__ | `string` | *html body string of the mail*
|
|
28
|
+
__*return*__ | `Promise.<void>` | **
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### `waitForMessage(email, from, subject) ► Promise.<string>`
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
Waits for an email from the specified sender and containing the specified subject
|
|
37
|
+
and gets its content.
|
|
38
|
+
|
|
39
|
+
Parameters | Type | Description
|
|
40
|
+
--- | --- | ---
|
|
41
|
+
__email__ | `string` | *recipient email*
|
|
42
|
+
__from__ | `string` | *sender*
|
|
43
|
+
__subject__ | `string` | *subject of email*
|
|
44
|
+
__*return*__ | `Promise.<string>` | *content of email*
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Members
|
|
49
|
+
|
|
50
|
+
Name | Type | Description
|
|
51
|
+
--- | --- | ---
|
|
52
|
+
__provider__ | `MailProvider` | *disposable email provider @type {MailProvider}*
|
|
53
|
+
__name__ | `string` | *Provider name*
|
|
54
|
+
__domains__ | `Array.<string>` | *Emails domains exposed by the provider.*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Module `pdf-generator`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**Pdf file generator**.
|
|
6
|
+
|
|
7
|
+
[Source file](../src/pdf-generator.js)
|
|
8
|
+
|
|
9
|
+
## Functions
|
|
10
|
+
|
|
11
|
+
### `generatePdf(filename, context) ► Promise.<string>`
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
Generates a pdf file with specified name and context data.
|
|
16
|
+
|
|
17
|
+
Parameters | Type | Description
|
|
18
|
+
--- | --- | ---
|
|
19
|
+
__filename__ | `string` | *file name*
|
|
20
|
+
__context__ | `import('./test-context.js').TestContext` | *test context*
|
|
21
|
+
__*return*__ | `Promise.<string>` | *the file path*
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
### `deletePdf(filepath)`
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
Deletes the specified file.
|
|
30
|
+
|
|
31
|
+
Parameters | Type | Description
|
|
32
|
+
--- | --- | ---
|
|
33
|
+
__filepath__ | `string` | *pdf file path*
|
|
34
|
+
|
|
35
|
+
---
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Module `test-context`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
**Test Context** to be populated and passed to WDIO specs.
|
|
6
|
+
|
|
7
|
+
[Source file](../src/test-context.js)
|
|
8
|
+
|
|
9
|
+
## Constants
|
|
10
|
+
|
|
11
|
+
### `defaultMailProviderName`
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#### Value
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
'maildrop'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Class `TestContext`
|
|
26
|
+
|
|
27
|
+
Implements **Test Context** with data to pass to WDIO specs.
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
### `setEnvironment(name, parameters, environmentOptions) ► TestContext`
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
Implements a test context with environments and dataset in webdriverio.
|
|
36
|
+
|
|
37
|
+
Parameters | Type | Description
|
|
38
|
+
--- | --- | ---
|
|
39
|
+
__name__ | `string` | *name of the environment (defined by TARGET_ENV environment variable)*
|
|
40
|
+
__parameters__ | `Record.<string, any>` | *custom parameters (like 'url')*
|
|
41
|
+
__environmentOptions__ | `import('./types.js').EnvironmentOptions` | *custom options*
|
|
42
|
+
__*return*__ | [TestContext](src_test-context.md) | **
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### `setDataGenerator(dataGenerator) ► TestContext`
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
Defines a custom function that adds data to the current dataset
|
|
51
|
+
|
|
52
|
+
Parameters | Type | Description
|
|
53
|
+
--- | --- | ---
|
|
54
|
+
__dataGenerator__ | `DataGenerator` | **
|
|
55
|
+
__*return*__ | [TestContext](src_test-context.md) | **
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### `setDefaultDataset(name) ► TestContext`
|
|
60
|
+
|
|
61
|
+

|
|
62
|
+
|
|
63
|
+
Defines the **default dataset** when no DATASET environment variable is specified.
|
|
64
|
+
|
|
65
|
+
Parameters | Type | Description
|
|
66
|
+
--- | --- | ---
|
|
67
|
+
__name__ | `string` | *name ot the default dataset*
|
|
68
|
+
__*return*__ | [TestContext](src_test-context.md) | **
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### `setMailProvider(name) ► TestContext`
|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+
Defines the **disposable email provider**. Overriden by MAILPROVIDER environment variable. **maildrop** is default value.
|
|
77
|
+
|
|
78
|
+
Parameters | Type | Description
|
|
79
|
+
--- | --- | ---
|
|
80
|
+
__name__ | `MailProviderName` | *name of the disposable mail service provider*
|
|
81
|
+
__*return*__ | [TestContext](src_test-context.md) | **
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### `setLogLevel(level)`
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
Sets the logging level.
|
|
90
|
+
|
|
91
|
+
Parameters | Type | Description
|
|
92
|
+
--- | --- | ---
|
|
93
|
+
__level__ | `LogLevel` | *logging level*
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### `initialize() ► TestContext`
|
|
98
|
+
|
|
99
|
+

|
|
100
|
+
|
|
101
|
+
Initializes the data of the test context.
|
|
102
|
+
|
|
103
|
+
Parameters | Type | Description
|
|
104
|
+
--- | --- | ---
|
|
105
|
+
__*return*__ | [TestContext](src_test-context.md) | **
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### `getParameter(name, mandatory) ► any`
|
|
110
|
+
|
|
111
|
+

|
|
112
|
+
|
|
113
|
+
Retrieves the specified parameter of the current environment.
|
|
114
|
+
|
|
115
|
+
Parameters | Type | Description
|
|
116
|
+
--- | --- | ---
|
|
117
|
+
__name__ | `string` | **
|
|
118
|
+
__mandatory__ | `boolean` | **
|
|
119
|
+
__*return*__ | `any` | **
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### `recordTestUser()`
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
Records the current created user.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### `_generateRandomUser(mailService) ► TestUser`
|
|
132
|
+
|
|
133
|
+

|
|
134
|
+
|
|
135
|
+
Generates a random user.
|
|
136
|
+
|
|
137
|
+
Parameters | Type | Description
|
|
138
|
+
--- | --- | ---
|
|
139
|
+
__mailService__ | [MailService](src_mail-service.md) | **
|
|
140
|
+
__*return*__ | `TestUser` | **
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### `_getPreviouslyRecordedUser(email) ► TestUser`
|
|
145
|
+
|
|
146
|
+

|
|
147
|
+
|
|
148
|
+
Retrieves the previously recorded user.
|
|
149
|
+
|
|
150
|
+
Parameters | Type | Description
|
|
151
|
+
--- | --- | ---
|
|
152
|
+
__email__ | `string` | **
|
|
153
|
+
__*return*__ | `TestUser` | **
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Members
|
|
158
|
+
|
|
159
|
+
Name | Type | Description
|
|
160
|
+
--- | --- | ---
|
|
161
|
+
__user__ | `TestUser` | *Test user @type {TestUser}*
|
|
162
|
+
__mailService__ | [MailService](src_mail-service.md) | *Mail service @type {MailService}*
|
|
163
|
+
__environmentName__ | `undefined` | *Retrieves the name of the current environment.*
|
|
164
|
+
__environment__ | `undefined` | *Retrieves the configuration of the current environment.*
|
|
165
|
+
__dataset__ | `undefined` | *The current dataset.*
|
|
166
|
+
__isDefaultDataset__ | `undefined` | *Is the current dataset the default one.*
|
|
167
|
+
___environments__ | `Map<string, TestEnvironmentConfiguration>` | *Test environments @private @type {Map<string, TestEnvironmentConfiguration>}*
|
|
168
|
+
___mailProviderName__ | `MailProviderName` | *Mail provider name @private @type {MailProviderName}*
|
|
169
|
+
___dataFolder__ | `string` | *data folder @private @type {string}*
|
|
170
|
+
___logFolder__ | `string` | *log folder @private @type {string}*
|
|
171
|
+
___recordedUsersFilepath__ | `string` | *data folder @private @type {string}*
|
|
172
|
+
___dataGenerator__ | `DataGenerator` | *custom data generator @private @type {DataGenerator}*
|
|
173
|
+
___defaultDatasetName__ | `string` | *default dataset name @private @type {string}*
|
package/doc/toc.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Code documentation
|
|
2
|
+
|
|
3
|
+
## Table of contents
|
|
4
|
+
|
|
5
|
+
* 
|
|
6
|
+
* [mail-service](src_mail-service.md) - _**Mail service** to send and retrieve mail from various provider.
|
|
7
|
+
Accessible through the **mailService property** of the TestContext instance._
|
|
8
|
+
* [page-objects/page](src-page-objects_page.md) - _Base page object for WDIO page objects._
|
|
9
|
+
* [pdf-generator](src_pdf-generator.md) - _**Pdf file generator**._
|
|
10
|
+
* [test-context](src_test-context.md) - _**Test Context** to be populated and passed to WDIO specs._
|
|
11
|
+
* [wdio/ado-reporter](src-wdio_ado-reporter.md) - _**WDIO Reporter** to handle Azure DevOps Test Run generation._
|
|
12
|
+
|
|
13
|
+
* 
|
|
14
|
+
* [ado-client](src_ado-client.md) - _Azure DevOps rest client to push test results._
|
|
15
|
+
* [logger](src_logger.md) - _Internal logger._
|
|
16
|
+
* [page-objects/guerrillamail.page](src-page-objects_guerrillamail.page.md) - _Page-object on top of Guerilla Mail._
|
|
17
|
+
* [page-objects/maildrop.page](src-page-objects_maildrop.page.md) - _Page-object on top of maildrop._
|
|
18
|
+
* [page-objects/yopmail.page](src-page-objects_yopmail.page.md) - _Page-object on top of YOPmail._
|
|
19
|
+
|
|
20
|
+
* 
|
|
21
|
+
* [wdio/test-context-worker-service](src-wdio_test-context-worker-service.md) - _Module wdio/test-context-worker-service_
|
|
22
|
+
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import arrayFunc from 'eslint-plugin-array-func';
|
|
2
|
+
import promise from 'eslint-plugin-promise';
|
|
3
|
+
import unicorn from 'eslint-plugin-unicorn';
|
|
4
|
+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
import eslint from '@eslint/js';
|
|
7
|
+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
|
8
|
+
|
|
9
|
+
export default [
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
arrayFunc.configs.recommended,
|
|
12
|
+
promise.configs['flat/recommended'],
|
|
13
|
+
unicorn.configs.recommended,
|
|
14
|
+
prettierRecommended,
|
|
15
|
+
eslintConfigPrettier,
|
|
16
|
+
{
|
|
17
|
+
languageOptions: {
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.builtin,
|
|
20
|
+
...globals.nodeBuiltin,
|
|
21
|
+
...globals.node
|
|
22
|
+
},
|
|
23
|
+
ecmaVersion: 'latest',
|
|
24
|
+
sourceType: 'module'
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
rules: {
|
|
28
|
+
'no-var': 2,
|
|
29
|
+
'prefer-const': 1,
|
|
30
|
+
'no-shadow': 2,
|
|
31
|
+
'no-unused-vars': [
|
|
32
|
+
2,
|
|
33
|
+
{
|
|
34
|
+
vars: 'local',
|
|
35
|
+
args: 'none'
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
'no-use-before-define': 0,
|
|
39
|
+
'no-console': 1,
|
|
40
|
+
'no-alert': 1,
|
|
41
|
+
'consistent-return': 0,
|
|
42
|
+
'default-case': 2,
|
|
43
|
+
'dot-notation': 2,
|
|
44
|
+
eqeqeq: 2,
|
|
45
|
+
'guard-for-in': 1,
|
|
46
|
+
'no-caller': 2,
|
|
47
|
+
'no-else-return': 2,
|
|
48
|
+
'no-eq-null': 2,
|
|
49
|
+
'no-eval': 2,
|
|
50
|
+
'no-extend-native': 2,
|
|
51
|
+
'no-extra-bind': 2,
|
|
52
|
+
'no-implied-eval': 2,
|
|
53
|
+
'no-lone-blocks': 2,
|
|
54
|
+
'no-loop-func': 2,
|
|
55
|
+
'no-multi-str': 2,
|
|
56
|
+
'no-native-reassign': 2,
|
|
57
|
+
'no-new': 2,
|
|
58
|
+
'no-new-func': 2,
|
|
59
|
+
'no-new-wrappers': 2,
|
|
60
|
+
'no-octal-escape': 2,
|
|
61
|
+
'no-param-reassign': 0,
|
|
62
|
+
'no-proto': 2,
|
|
63
|
+
'no-script-url': 2,
|
|
64
|
+
'no-self-compare': 2,
|
|
65
|
+
'no-sequences': 2,
|
|
66
|
+
'no-throw-literal': 2,
|
|
67
|
+
'no-useless-concat': 1,
|
|
68
|
+
radix: 0,
|
|
69
|
+
'vars-on-top': 2,
|
|
70
|
+
yoda: 2,
|
|
71
|
+
camelcase: [
|
|
72
|
+
2,
|
|
73
|
+
{
|
|
74
|
+
properties: 'never'
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
'func-names': 0,
|
|
78
|
+
'new-cap': ['error', { newIsCapExceptions: ['jsPDF'] }],
|
|
79
|
+
'no-nested-ternary': 2,
|
|
80
|
+
'no-new-object': 2,
|
|
81
|
+
'no-underscore-dangle': 0,
|
|
82
|
+
'one-var': [2, 'never'],
|
|
83
|
+
'spaced-comment': [
|
|
84
|
+
1,
|
|
85
|
+
'always',
|
|
86
|
+
{
|
|
87
|
+
exceptions: ['*']
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
'no-return-assign': ['error', 'except-parens'],
|
|
91
|
+
|
|
92
|
+
'array-func/prefer-array-from': 0,
|
|
93
|
+
'promise/no-promise-in-callback': 0,
|
|
94
|
+
|
|
95
|
+
'unicorn/prefer-spread': 0,
|
|
96
|
+
'unicorn/prefer-number-properties': 0,
|
|
97
|
+
'unicorn/prefer-node-protocol': 0
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
];
|
package/jsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "Node",
|
|
6
|
+
"resolveJsonModule": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"checkJs": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"types": ["node", "@wdio/globals/types"]
|
|
12
|
+
},
|
|
13
|
+
"exclude": ["node_modules"]
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@actionlogementservices/wdio-test-context",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A framework to add test context to webdriverio end to end tests.",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"types": "src/types.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.js",
|
|
10
|
+
"./types": "./src/types.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"prettier": "prettier \"./src/**/*.js\" --write",
|
|
14
|
+
"eslint": "eslint \"./src/**/*.js\"",
|
|
15
|
+
"doc": "jsdoc -c ./.jsdoc.json"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/actionlogementservices/wdio-test-context.git"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"wdio"
|
|
23
|
+
],
|
|
24
|
+
"author": "Action Logement Services",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/actionlogementservices/wdio-test-context/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/actionlogementservices/wdio-test-context#readme",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@eslint/js": "^9.23.0",
|
|
32
|
+
"@wdio/spec-reporter": "^9.11.0",
|
|
33
|
+
"eslint": "^9.23.0",
|
|
34
|
+
"eslint-config-prettier": "^10.1.1",
|
|
35
|
+
"eslint-plugin-array-func": "^5.0.2",
|
|
36
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
37
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
38
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
39
|
+
"globals": "^16.0.0",
|
|
40
|
+
"jsdoc": "^4.0.4",
|
|
41
|
+
"jsdoc-escape-at": "^1.0.1",
|
|
42
|
+
"kis-jsdoc-plugin": "^2.2.1",
|
|
43
|
+
"prettier": "^3.5.3"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@faker-js/faker": "^9.6.0",
|
|
47
|
+
"azure-devops-node-api": "^14.1.0",
|
|
48
|
+
"chalk": "^5.4.1",
|
|
49
|
+
"glob": "^11.0.1",
|
|
50
|
+
"jspdf": "^3.0.1",
|
|
51
|
+
"lodash.merge": "^4.6.2",
|
|
52
|
+
"moment": "^2.30.1",
|
|
53
|
+
"nodemailer": "^6.10.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@wdio/globals": "^9.12.1"
|
|
57
|
+
}
|
|
58
|
+
}
|