codeceptjs 3.3.5-beta.3 → 3.3.5-beta.4
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/docs/configuration.md +15 -16
- package/lib/config.js +0 -1
- package/package.json +3 -1
- package/typings/index.d.ts +109 -20
package/docs/configuration.md
CHANGED
|
@@ -11,25 +11,24 @@ After running `codeceptjs init` it should be saved in test root.
|
|
|
11
11
|
|
|
12
12
|
| Name | Type | Description |
|
|
13
13
|
| :------ | :------ | :------ |
|
|
14
|
-
| `bootstrap
|
|
15
|
-
| `bootstrapAll
|
|
16
|
-
| `gherkin?` | { `features`: `string` \| `string`[] ; `steps`: `string`[] } | Enable BDD features
|
|
14
|
+
| `bootstrap?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute code before](https://codecept.io/bootstrap/) tests are run. Can be either JS module file or async function: ```bootstrap: async () => server.launch(), ``` or ```bootstrap: 'bootstrap.js', ``` |
|
|
15
|
+
| `bootstrapAll?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
|
|
16
|
+
| `gherkin?` | { `features`: `string` \| `string`[] ; `steps`: `string`[] } | Enable [BDD features](https://codecept.io/bdd/#configuration). Sample configuration: ```gherkin: { features: "./features/*.feature", steps: ["./step_definitions/steps.js"] } ``` |
|
|
17
17
|
| `gherkin.features` | `string` \| `string`[] | load feature files by pattern. Multiple patterns can be specified as array |
|
|
18
18
|
| `gherkin.steps` | `string`[] | load step definitions from JS files |
|
|
19
|
-
| `grep
|
|
20
|
-
| `helpers?` | {
|
|
21
|
-
| `include?` | `any` | Include page objects to access them via dependency injection ```
|
|
22
|
-
| `mocha?` | `any` | [Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here. Example: ```
|
|
19
|
+
| `grep?` | `string` | Pattern to filter tests by name. This option is useful if you plan to use multiple configs for different environments. To execute only tests with @firefox tag use ```grep: '@firefox' ``` |
|
|
20
|
+
| `helpers?` | {} | Enable and configure helpers: ```helpers: { Playwright: { url: 'https://mysite.com', browser: 'firefox' } } ``` |
|
|
21
|
+
| `include?` | `any` | Include page objects to access them via dependency injection ```I: "./custom_steps.js", loginPage: "./pages/Login.js", User: "./pages/User.js", ``` Configured modules can be injected by name in a Scenario: ```Scenario('test', { I, loginPage, User }) ``` |
|
|
22
|
+
| `mocha?` | `any` | [Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here. Example: ```mocha: { "mocha-junit-reporter": { stdout: "./output/console.log", options: { mochaFile: "./output/result.xml", attachments: true //add screenshot for a failed test } } } ``` |
|
|
23
23
|
| `noGlobals?` | `boolean` | Disable registering global functions (Before, Scenario, etc). Not recommended |
|
|
24
|
-
| `output` | `string` | Where to store failure screenshots, artifacts, etc |
|
|
25
|
-
| `plugins?` | `any` |
|
|
26
|
-
| `require?` | `string`[] | Require additional JS modules
|
|
27
|
-
| `teardown
|
|
28
|
-
| `teardownAll
|
|
29
|
-
| `tests` | `string` | Pattern to locate CodeceptJS tests.
|
|
30
|
-
| `timeout?` | `number` | Set default tests timeout in seconds.
|
|
31
|
-
| `translation?` | `string` | Enable localized test commands
|
|
32
|
-
|
|
24
|
+
| `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output' ``` |
|
|
25
|
+
| `plugins?` | `any` | Enable CodeceptJS plugins. Example: ```plugins: { autoDelay: { enabled: true } } ``` |
|
|
26
|
+
| `require?` | `string`[] | [Require additional JS modules](https://codecept.io/configuration/#require) Example: ``` require: ["should"] ``` |
|
|
27
|
+
| `teardown?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute code after tests](https://codecept.io/bootstrap/) finished. Can be either JS module file or async function: ```teardown: async () => server.stop(), ``` or ```teardown: 'teardown.js', ``` |
|
|
28
|
+
| `teardownAll?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
|
|
29
|
+
| `tests` | `string` | Pattern to locate CodeceptJS tests. Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names. For tests in JavaScript: ```tests: 'tests/**.test.js' ``` For tests in TypeScript: ```tests: 'tests/**.test.ts' ``` |
|
|
30
|
+
| `timeout?` | `number` | Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```timeout: 20, ``` |
|
|
31
|
+
| `translation?` | `string` | Enable [localized test commands](https://codecept.io/translation/) |
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
## Require
|
package/lib/config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeceptjs",
|
|
3
|
-
"version": "3.3.5-beta.
|
|
3
|
+
"version": "3.3.5-beta.4",
|
|
4
4
|
"description": "Supercharged End 2 End Testing Framework for NodeJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acceptance",
|
|
@@ -133,6 +133,8 @@
|
|
|
133
133
|
"testcafe": "^1.18.3",
|
|
134
134
|
"ts-morph": "^3.1.3",
|
|
135
135
|
"tsd-jsdoc": "https://github.com/englercj/tsd-jsdoc.git",
|
|
136
|
+
"typedoc": "^0.23.10",
|
|
137
|
+
"typedoc-plugin-markdown": "^3.13.4",
|
|
136
138
|
"typescript": "^4.4.3",
|
|
137
139
|
"wdio-docker-service": "^1.5.0",
|
|
138
140
|
"webdriverio": "^7.16.14",
|
package/typings/index.d.ts
CHANGED
|
@@ -32,12 +32,27 @@ declare namespace CodeceptJS {
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
tests: string;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Where to store failure screenshots, artifacts, etc
|
|
37
|
+
*
|
|
38
|
+
* ```js
|
|
39
|
+
* output: './output'
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
36
42
|
output: string;
|
|
37
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Pattern to filter tests by name.
|
|
45
|
+
* This option is useful if you plan to use multiple configs for different environments.
|
|
46
|
+
*
|
|
47
|
+
* To execute only tests with @firefox tag
|
|
48
|
+
*
|
|
49
|
+
* ```js
|
|
50
|
+
* grep: '@firefox'
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
38
53
|
grep?: string;
|
|
39
54
|
/**
|
|
40
|
-
*
|
|
55
|
+
* Enable and configure helpers:
|
|
41
56
|
*
|
|
42
57
|
* ```js
|
|
43
58
|
* helpers: {
|
|
@@ -49,17 +64,90 @@ declare namespace CodeceptJS {
|
|
|
49
64
|
* ```
|
|
50
65
|
*/
|
|
51
66
|
helpers?: {
|
|
52
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Run web tests controlling browsers via Playwright engine.
|
|
69
|
+
*
|
|
70
|
+
* https://codecept.io/helpers/playwright
|
|
71
|
+
*
|
|
72
|
+
* Available commands:
|
|
73
|
+
* ```js
|
|
74
|
+
* I.amOnPage('/');
|
|
75
|
+
* I.click('Open');
|
|
76
|
+
* I.see('Welcome');
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
53
79
|
Playwright?: PlaywrightConfig;
|
|
54
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Run web tests controlling browsers via Puppeteer engine.
|
|
82
|
+
*
|
|
83
|
+
* https://codecept.io/helpers/puppeteer
|
|
84
|
+
*
|
|
85
|
+
* Available commands:
|
|
86
|
+
* ```js
|
|
87
|
+
* I.amOnPage('/');
|
|
88
|
+
* I.click('Open');
|
|
89
|
+
* I.see('Welcome');
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
55
92
|
Puppeteer?: PuppeteerConfig;
|
|
56
|
-
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Run web tests controlling browsers via WebDriver engine.
|
|
96
|
+
*
|
|
97
|
+
* Available commands:
|
|
98
|
+
* ```js
|
|
99
|
+
* I.amOnPage('/');
|
|
100
|
+
* I.click('Open');
|
|
101
|
+
* I.see('Welcome');
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* https://codecept.io/helpers/webdriver
|
|
105
|
+
*/
|
|
57
106
|
WebDriver?: WebDriverConfig;
|
|
58
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Execute REST API requests for API testing or to assist web testing.
|
|
109
|
+
*
|
|
110
|
+
* https://codecept.io/helpers/REST
|
|
111
|
+
*
|
|
112
|
+
* Available commands:
|
|
113
|
+
* ```js
|
|
114
|
+
* I.sendGetRequest('/');
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
59
117
|
REST?: RESTConfig;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Use JSON assertions for API testing.
|
|
121
|
+
* Can be paired with REST or GraphQL helpers.
|
|
122
|
+
*
|
|
123
|
+
* https://codecept.io/helpers/JSONResponse
|
|
124
|
+
*
|
|
125
|
+
* Available commands:
|
|
126
|
+
* ```js
|
|
127
|
+
* I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } });
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
JSONResponse?: any;
|
|
131
|
+
|
|
60
132
|
[key: string]: any;
|
|
61
133
|
},
|
|
62
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Enable CodeceptJS plugins.
|
|
136
|
+
*
|
|
137
|
+
* https://codecept.io/plugins/
|
|
138
|
+
*
|
|
139
|
+
* Plugins listen to test events and extend functionality of CodeceptJS.
|
|
140
|
+
*
|
|
141
|
+
* Example:
|
|
142
|
+
*
|
|
143
|
+
* ```js
|
|
144
|
+
* plugins: {
|
|
145
|
+
* autoDelay: {
|
|
146
|
+
* enabled: true
|
|
147
|
+
* }
|
|
148
|
+
}
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
63
151
|
plugins?: any;
|
|
64
152
|
/**
|
|
65
153
|
* Include page objects to access them via dependency injection
|
|
@@ -106,7 +194,8 @@ declare namespace CodeceptJS {
|
|
|
106
194
|
*/
|
|
107
195
|
mocha?: any;
|
|
108
196
|
/**
|
|
109
|
-
* Execute
|
|
197
|
+
* [Execute code before](https://codecept.io/bootstrap/) tests are run.
|
|
198
|
+
*
|
|
110
199
|
* Can be either JS module file or async function:
|
|
111
200
|
*
|
|
112
201
|
* ```js
|
|
@@ -119,7 +208,8 @@ declare namespace CodeceptJS {
|
|
|
119
208
|
*/
|
|
120
209
|
bootstrap?: () => Promise<void> | boolean | string;
|
|
121
210
|
/**
|
|
122
|
-
* Execute
|
|
211
|
+
* [Execute code after tests](https://codecept.io/bootstrap/) finished.
|
|
212
|
+
*
|
|
123
213
|
* Can be either JS module file or async function:
|
|
124
214
|
*
|
|
125
215
|
* ```js
|
|
@@ -132,30 +222,29 @@ declare namespace CodeceptJS {
|
|
|
132
222
|
*/
|
|
133
223
|
teardown?: () => Promise<void> | boolean | string;
|
|
134
224
|
/**
|
|
135
|
-
* Execute
|
|
136
|
-
*
|
|
137
|
-
|
|
225
|
+
* [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
|
|
226
|
+
*
|
|
227
|
+
*/
|
|
138
228
|
bootstrapAll?: () => Promise<void> | boolean | string;
|
|
139
229
|
/**
|
|
140
|
-
* Execute JS code after finishing tests in parallel mode.
|
|
141
|
-
* https://codecept.io/bootstrap/#bootstrapall-teardownall
|
|
230
|
+
* [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
|
|
142
231
|
*/
|
|
143
232
|
teardownAll?: () => Promise<void> | boolean | string;
|
|
144
|
-
/** Enable localized test commands
|
|
233
|
+
/** Enable [localized test commands](https://codecept.io/translation/) */
|
|
145
234
|
translation?: string;
|
|
146
235
|
/**
|
|
147
|
-
* Require additional JS modules
|
|
236
|
+
* [Require additional JS modules](https://codecept.io/configuration/#require)
|
|
148
237
|
*
|
|
149
238
|
* Example:
|
|
150
239
|
* ```
|
|
151
|
-
* require: ["
|
|
240
|
+
* require: ["should"]
|
|
152
241
|
* ```
|
|
153
242
|
*/
|
|
154
243
|
require?: Array<string>;
|
|
155
244
|
|
|
156
245
|
/**
|
|
157
|
-
* Enable BDD features
|
|
158
|
-
*
|
|
246
|
+
* Enable [BDD features](https://codecept.io/bdd/#configuration).
|
|
247
|
+
*
|
|
159
248
|
* Sample configuration:
|
|
160
249
|
* ```js
|
|
161
250
|
* gherkin: {
|