codeceptjs 3.3.2 → 3.3.5-beta.1
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/CHANGELOG.md +44 -2
- package/docs/api.md +4 -0
- package/docs/basics.md +2 -0
- package/docs/bdd.md +12 -0
- package/docs/build/JSONResponse.js +44 -3
- package/docs/build/Playwright.js +63 -40
- package/docs/build/Puppeteer.js +54 -43
- package/docs/build/REST.js +23 -9
- package/docs/build/WebDriver.js +39 -30
- package/docs/changelog.md +6 -2
- package/docs/community-helpers.md +1 -0
- package/docs/configuration.md +21 -18
- package/docs/helpers/Appium.md +0 -723
- package/docs/helpers/JSONResponse.md +24 -0
- package/docs/helpers/Playwright.md +276 -264
- package/docs/helpers/Puppeteer.md +230 -222
- package/docs/helpers/REST.md +21 -6
- package/docs/helpers/WebDriver.md +265 -259
- package/docs/plugins.md +41 -1
- package/docs/reports.md +11 -0
- package/docs/secrets.md +30 -0
- package/docs/wiki/.git/FETCH_HEAD +1 -0
- package/docs/wiki/.git/HEAD +1 -0
- package/docs/wiki/.git/ORIG_HEAD +1 -0
- package/docs/wiki/.git/config +11 -0
- package/docs/wiki/.git/description +1 -0
- package/docs/wiki/.git/hooks/applypatch-msg.sample +15 -0
- package/docs/wiki/.git/hooks/commit-msg.sample +24 -0
- package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +173 -0
- package/docs/wiki/.git/hooks/post-update.sample +8 -0
- package/docs/wiki/.git/hooks/pre-applypatch.sample +14 -0
- package/docs/wiki/.git/hooks/pre-commit.sample +49 -0
- package/docs/wiki/.git/hooks/pre-merge-commit.sample +13 -0
- package/docs/wiki/.git/hooks/pre-push.sample +53 -0
- package/docs/wiki/.git/hooks/pre-rebase.sample +169 -0
- package/docs/wiki/.git/hooks/pre-receive.sample +24 -0
- package/docs/wiki/.git/hooks/prepare-commit-msg.sample +42 -0
- package/docs/wiki/.git/hooks/push-to-checkout.sample +78 -0
- package/docs/wiki/.git/hooks/update.sample +128 -0
- package/docs/wiki/.git/index +0 -0
- package/docs/wiki/.git/info/exclude +6 -0
- package/docs/wiki/.git/logs/HEAD +1 -0
- package/docs/wiki/.git/logs/refs/heads/master +1 -0
- package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.idx +0 -0
- package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.pack +0 -0
- package/docs/wiki/.git/packed-refs +2 -0
- package/docs/wiki/.git/refs/heads/master +1 -0
- package/docs/wiki/.git/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/Community-Helpers-&-Plugins.md +7 -3
- package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +29 -0
- package/docs/wiki/Examples.md +39 -48
- package/docs/wiki/Release-Process.md +8 -8
- package/docs/wiki/Tests.md +62 -60
- package/docs/wiki/Upgrading-to-CodeceptJS-3.md +2 -2
- package/lib/cli.js +1 -1
- package/lib/command/generate.js +3 -0
- package/lib/command/init.js +83 -24
- package/lib/command/interactive.js +1 -1
- package/lib/command/run-workers.js +1 -1
- package/lib/command/workers/runTests.js +15 -0
- package/lib/helper/JSONResponse.js +44 -3
- package/lib/helper/Playwright.js +63 -40
- package/lib/helper/Puppeteer.js +54 -43
- package/lib/helper/REST.js +23 -9
- package/lib/helper/WebDriver.js +39 -30
- package/lib/interfaces/gherkin.js +1 -1
- package/lib/output.js +4 -0
- package/lib/plugin/customLocator.js +50 -3
- package/lib/plugin/retryFailedStep.js +1 -1
- package/lib/plugin/retryTo.js +1 -8
- package/lib/secret.js +31 -1
- package/lib/step.js +22 -10
- package/lib/utils.js +1 -6
- package/package.json +4 -4
- package/typings/index.d.ts +158 -0
- package/typings/types.d.ts +367 -96
package/typings/index.d.ts
CHANGED
|
@@ -16,6 +16,164 @@ declare namespace CodeceptJS {
|
|
|
16
16
|
path?: string,
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
type MainConfig = {
|
|
20
|
+
/** Pattern to locate CodeceptJS tests.
|
|
21
|
+
* Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names.
|
|
22
|
+
*
|
|
23
|
+
* For tests in JavaScript:
|
|
24
|
+
*
|
|
25
|
+
* ```js
|
|
26
|
+
* tests: 'tests/**.test.js'
|
|
27
|
+
* ```
|
|
28
|
+
* For tests in TypeScript:
|
|
29
|
+
*
|
|
30
|
+
* ```js
|
|
31
|
+
* tests: 'tests/**.test.ts'
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
tests: string;
|
|
35
|
+
/** Where to store failure screenshots, artifacts, etc */
|
|
36
|
+
output: string;
|
|
37
|
+
/** Pattern to filter tests by name */
|
|
38
|
+
grep: string;
|
|
39
|
+
/**
|
|
40
|
+
* Enabled and configured helpers
|
|
41
|
+
*
|
|
42
|
+
* ```js
|
|
43
|
+
* helpers: {
|
|
44
|
+
* Playwright: {
|
|
45
|
+
* url: 'https://mysite.com',
|
|
46
|
+
* browser: 'firefox'
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
helpers?: {
|
|
52
|
+
/** Run web tests controlling browsers via Playwright engine. https://codecept.io/playwright */
|
|
53
|
+
Playwright?: PlaywrightConfig;
|
|
54
|
+
/** Run web tests controlling browsers via Puppeteer engine. https://codecept.io/puppeteer */
|
|
55
|
+
Puppeteer?: PuppeteerConfig;
|
|
56
|
+
/** Run web tests controlling browsers via WebDriver engine. https://codecept.io/webdriver */
|
|
57
|
+
WebDriver?: WebDriverConfig;
|
|
58
|
+
/** Execute REST API requests for API testing or to assist web testing. https://codecept.io/api/ */
|
|
59
|
+
REST?: RESTConfig;
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
},
|
|
62
|
+
/** [Enabled plugins](https://codecept.io/plugins/) */
|
|
63
|
+
plugins?: any;
|
|
64
|
+
/**
|
|
65
|
+
* Include page objects to access them via dependency injection
|
|
66
|
+
*
|
|
67
|
+
* ```js
|
|
68
|
+
* I: "./custom_steps.js",
|
|
69
|
+
* loginPage: "./pages/Login.js",
|
|
70
|
+
* User: "./pages/User.js",
|
|
71
|
+
* ```
|
|
72
|
+
* Configured modules can be injected by name in a Scenario:
|
|
73
|
+
*
|
|
74
|
+
* ```js
|
|
75
|
+
* Scenario('test', { I, loginPage, User })
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
include?: any;
|
|
79
|
+
/**
|
|
80
|
+
* Set default tests timeout in seconds.
|
|
81
|
+
* Tests will be killed on no response after timeout.
|
|
82
|
+
*
|
|
83
|
+
* ```js
|
|
84
|
+
* timeout: 20,
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
timeout?: number;
|
|
88
|
+
/** Disable registering global functions (Before, Scenario, etc). Not recommended */
|
|
89
|
+
noGlobals?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* [Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here.
|
|
92
|
+
*
|
|
93
|
+
* Example:
|
|
94
|
+
*
|
|
95
|
+
* ```js
|
|
96
|
+
* mocha: {
|
|
97
|
+
* "mocha-junit-reporter": {
|
|
98
|
+
* stdout: "./output/console.log",
|
|
99
|
+
* options: {
|
|
100
|
+
* mochaFile: "./output/result.xml",
|
|
101
|
+
* attachments: true //add screenshot for a failed test
|
|
102
|
+
* }
|
|
103
|
+
* }
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
mocha?: any;
|
|
108
|
+
/**
|
|
109
|
+
* Execute JS code before tests are run. https://codecept.io/bootstrap/
|
|
110
|
+
* Can be either JS module file or async function:
|
|
111
|
+
*
|
|
112
|
+
* ```js
|
|
113
|
+
* bootstrap: async () => server.launch(),
|
|
114
|
+
* ```
|
|
115
|
+
* or
|
|
116
|
+
* ```js
|
|
117
|
+
* bootstrap: 'bootstrap.js',
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
bootstrap: () => Promise<void> | boolean | string;
|
|
121
|
+
/**
|
|
122
|
+
* Execute JS code after tests are run. https://codecept.io/bootstrap/
|
|
123
|
+
* Can be either JS module file or async function:
|
|
124
|
+
*
|
|
125
|
+
* ```js
|
|
126
|
+
* teardown: async () => server.stop(),
|
|
127
|
+
* ```
|
|
128
|
+
* or
|
|
129
|
+
* ```js
|
|
130
|
+
* teardown: 'teardown.js',
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
teardown: () => Promise<void> | boolean | string;
|
|
134
|
+
/**
|
|
135
|
+
* Execute JS code before launching tests in parallel mode.
|
|
136
|
+
* https://codecept.io/bootstrap/#bootstrapall-teardownall
|
|
137
|
+
*/
|
|
138
|
+
bootstrapAll: () => Promise<void> | boolean | string;
|
|
139
|
+
/**
|
|
140
|
+
* Execute JS code after finishing tests in parallel mode.
|
|
141
|
+
* https://codecept.io/bootstrap/#bootstrapall-teardownall
|
|
142
|
+
*/
|
|
143
|
+
teardownAll: () => Promise<void> | boolean | string;
|
|
144
|
+
/** Enable localized test commands https://codecept.io/translation/ */
|
|
145
|
+
translation?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Require additional JS modules. https://codecept.io/configuration/#require
|
|
148
|
+
*
|
|
149
|
+
* Example:
|
|
150
|
+
* ```
|
|
151
|
+
* require: ["ts-node/register", "should"]
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
require?: Array<string>;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Enable BDD features. https://codecept.io/bdd/#configuration
|
|
158
|
+
*
|
|
159
|
+
* Sample configuration:
|
|
160
|
+
* ```js
|
|
161
|
+
* gherkin: {
|
|
162
|
+
* features: "./features/*.feature",
|
|
163
|
+
* steps: ["./step_definitions/steps.js"]
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
gherkin?: {
|
|
168
|
+
/** load feature files by pattern. Multiple patterns can be specified as array */
|
|
169
|
+
features: string | Array<string>,
|
|
170
|
+
/** load step definitions from JS files */
|
|
171
|
+
steps: Array<string>
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
[key: string]: any;
|
|
175
|
+
};
|
|
176
|
+
|
|
19
177
|
interface PageScrollPosition {
|
|
20
178
|
x: number;
|
|
21
179
|
y: number;
|