codeceptjs 3.0.4 → 3.0.5
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 +34 -0
- package/docs/build/Appium.js +1 -1
- package/docs/build/Nightmare.js +4 -5
- package/docs/build/Playwright.js +41 -15
- package/docs/build/Protractor.js +1 -1
- package/docs/build/Puppeteer.js +1 -1
- package/docs/build/REST.js +20 -1
- package/docs/build/TestCafe.js +1 -1
- package/docs/build/WebDriver.js +3 -3
- package/docs/changelog.md +34 -0
- package/docs/data.md +5 -5
- package/docs/detox.md +2 -2
- package/docs/docker.md +11 -11
- package/docs/helpers/Appium.md +1 -1
- package/docs/helpers/Nightmare.md +4 -5
- package/docs/helpers/Playwright.md +81 -61
- package/docs/helpers/Protractor.md +1 -1
- package/docs/helpers/Puppeteer.md +1 -1
- package/docs/helpers/REST.md +9 -0
- package/docs/helpers/TestCafe.md +1 -1
- package/docs/helpers/WebDriver.md +1 -1
- package/docs/locators.md +2 -2
- package/docs/mobile-react-native-locators.md +2 -2
- package/docs/mobile.md +3 -3
- package/docs/pageobjects.md +3 -1
- package/docs/reports.md +3 -3
- package/docs/typescript.md +47 -5
- package/docs/webapi/fillField.mustache +1 -1
- package/lib/cli.js +16 -10
- package/lib/command/interactive.js +6 -7
- package/lib/config.js +6 -1
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/Playwright.js +8 -16
- package/lib/helper/REST.js +20 -1
- package/lib/helper/WebDriver.js +2 -2
- package/lib/interfaces/gherkin.js +9 -3
- package/lib/output.js +2 -2
- package/lib/plugin/allure.js +3 -7
- package/lib/plugin/screenshotOnFail.js +1 -2
- package/lib/step.js +2 -1
- package/lib/within.js +1 -1
- package/lib/workers.js +13 -1
- package/package.json +5 -5
- package/typings/index.d.ts +7 -2
- package/typings/types.d.ts +55 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
## 3.0.5
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Features:
|
|
5
|
+
|
|
6
|
+
* **[Official Docker image for CodeceptJS v3](https://hub.docker.com/r/codeceptjs/codeceptjs)**. New Docker image is based on official Playwright image and supports Playwright, Puppeteer, WebDriver engines. Thanks @VikentyShevyrin
|
|
7
|
+
* Better support for Typescript `codecept.conf.ts` configuration files. See #2750 by @elaichenkov
|
|
8
|
+
* Propagate more events for custom parallel script. See #2796 by @jccguimaraes
|
|
9
|
+
* [mocha-junit-reporter] Now supports attachments, see documentation for details. See #2675 by @Shard
|
|
10
|
+
* CustomLocators interface for TypeScript to extend from LocatorOrString. See #2798 by @danielrentz
|
|
11
|
+
* [REST] Mask sensitive data from log messages.
|
|
12
|
+
```js
|
|
13
|
+
I.sendPatchRequest('/api/users.json', secret({ "email": "user@user.com" }));
|
|
14
|
+
```
|
|
15
|
+
See #2786 by @PeterNgTr
|
|
16
|
+
|
|
17
|
+
Bug fixes:
|
|
18
|
+
* Fixed reporting of nested steps with PageObjects and BDD scenarios. See #2800 by @davertmik. Fixes #2720 #2682
|
|
19
|
+
* Fixed issue with `codeceptjs shell` which was broken since 3.0.0. See #2743 by @stedman
|
|
20
|
+
* [Gherkin] Fixed issue suppressed or hidden errors in tests. See #2745 by @ktryniszewski-mdsol
|
|
21
|
+
* [Playwright] fix grabCssPropertyFromAll serialization by using property names. See #2757 by @elaichenkov
|
|
22
|
+
* [Allure] fix report for multi sessions. See #2771 by @cbayer97
|
|
23
|
+
* [WebDriver] Fix locator object debug log messages in smart wait. See 2748 by @elaichenkov
|
|
24
|
+
|
|
25
|
+
Documentation fixes:
|
|
26
|
+
* Fixed some broken examples. See #2756 by @danielrentz
|
|
27
|
+
* Fixed Typescript typings. See #2747, #2758 and #2769 by @elaichenkov
|
|
28
|
+
* Added missing type for xFeature. See #2754 by @PeterNgTr
|
|
29
|
+
* Fixed code example in Page Object documentation. See #2793 by @mkrtchian
|
|
30
|
+
|
|
31
|
+
Library updates:
|
|
32
|
+
* Updated Axios to 0.21.1. See by @sseide
|
|
33
|
+
* Updated @pollyjs/core @pollyjs/adapter-puppeteer. See #2760 by @Anikethana
|
|
34
|
+
|
|
1
35
|
## 3.0.4
|
|
2
36
|
|
|
3
37
|
* **Hotfix** Fixed `init` script by adding `cross-spawn` package. By @vipulgupta2048
|
package/docs/build/Appium.js
CHANGED
|
@@ -1414,7 +1414,7 @@ class Appium extends Webdriver {
|
|
|
1414
1414
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1415
1415
|
* ```
|
|
1416
1416
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1417
|
-
* @param {
|
|
1417
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1418
1418
|
*
|
|
1419
1419
|
*
|
|
1420
1420
|
*/
|
package/docs/build/Nightmare.js
CHANGED
|
@@ -966,7 +966,7 @@ class Nightmare extends Helper {
|
|
|
966
966
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
967
967
|
* ```
|
|
968
968
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
969
|
-
* @param {
|
|
969
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
970
970
|
*
|
|
971
971
|
*/
|
|
972
972
|
async fillField(field, value) {
|
|
@@ -1180,15 +1180,14 @@ class Nightmare extends Helper {
|
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
1182
|
/**
|
|
1183
|
-
* Retrieves
|
|
1183
|
+
* Retrieves an array of value from a form located by CSS or XPath and returns it to test.
|
|
1184
1184
|
* Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
1185
|
-
* If more than one element is found - value of first element is returned.
|
|
1186
1185
|
*
|
|
1187
1186
|
* ```js
|
|
1188
|
-
* let
|
|
1187
|
+
* let inputs = await I.grabValueFromAll('//form/input');
|
|
1189
1188
|
* ```
|
|
1190
1189
|
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1191
|
-
* @returns {Promise<string>} attribute value
|
|
1190
|
+
* @returns {Promise<string[]>} attribute value
|
|
1192
1191
|
*
|
|
1193
1192
|
*/
|
|
1194
1193
|
async grabValueFromAll(locator) {
|
package/docs/build/Playwright.js
CHANGED
|
@@ -878,11 +878,14 @@ class Playwright extends Helper {
|
|
|
878
878
|
}
|
|
879
879
|
|
|
880
880
|
/**
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
885
|
-
*
|
|
881
|
+
* Checks that title is equal to provided one.
|
|
882
|
+
*
|
|
883
|
+
* ```js
|
|
884
|
+
* I.seeTitleEquals('Test title.');
|
|
885
|
+
* ```
|
|
886
|
+
*
|
|
887
|
+
* @param {string} text value to check.
|
|
888
|
+
*
|
|
886
889
|
*/
|
|
887
890
|
async seeTitleEquals(text) {
|
|
888
891
|
const title = await this.page.title();
|
|
@@ -1217,14 +1220,34 @@ class Playwright extends Helper {
|
|
|
1217
1220
|
}
|
|
1218
1221
|
|
|
1219
1222
|
/**
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
+
* Perform an emulated click on a link or a button, given by a locator.
|
|
1224
|
+
* Unlike normal click instead of sending native event, emulates a click with JavaScript.
|
|
1225
|
+
* This works on hidden, animated or inactive elements as well.
|
|
1226
|
+
*
|
|
1227
|
+
* If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
|
|
1228
|
+
* For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
|
|
1229
|
+
* For images, the "alt" attribute and inner text of any parent links are searched.
|
|
1230
|
+
*
|
|
1231
|
+
* The second parameter is a context (CSS or XPath locator) to narrow the search.
|
|
1232
|
+
*
|
|
1223
1233
|
* ```js
|
|
1224
|
-
*
|
|
1225
|
-
* I.forceClick('
|
|
1234
|
+
* // simple link
|
|
1235
|
+
* I.forceClick('Logout');
|
|
1236
|
+
* // button of form
|
|
1237
|
+
* I.forceClick('Submit');
|
|
1238
|
+
* // CSS button
|
|
1239
|
+
* I.forceClick('#form input[type=submit]');
|
|
1240
|
+
* // XPath
|
|
1241
|
+
* I.forceClick('//form/*[@type=submit]');
|
|
1242
|
+
* // link in context
|
|
1243
|
+
* I.forceClick('Logout', '#nav');
|
|
1244
|
+
* // using strict locator
|
|
1245
|
+
* I.forceClick({css: 'nav a.login'});
|
|
1226
1246
|
* ```
|
|
1227
|
-
*
|
|
1247
|
+
*
|
|
1248
|
+
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1249
|
+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1250
|
+
*
|
|
1228
1251
|
*/
|
|
1229
1252
|
async forceClick(locator, context = null) {
|
|
1230
1253
|
return proceedClick.call(this, locator, context, { force: true });
|
|
@@ -1530,7 +1553,7 @@ class Playwright extends Helper {
|
|
|
1530
1553
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1531
1554
|
* ```
|
|
1532
1555
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1533
|
-
* @param {
|
|
1556
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1534
1557
|
*
|
|
1535
1558
|
*
|
|
1536
1559
|
*/
|
|
@@ -2043,6 +2066,10 @@ class Playwright extends Helper {
|
|
|
2043
2066
|
* I.executeScript(([x, y]) => x + y, [x, y]);
|
|
2044
2067
|
* ```
|
|
2045
2068
|
* If a function returns a Promise it will wait for its resolution.
|
|
2069
|
+
*
|
|
2070
|
+
* @param {string|function} fn function to be executed in browser context.
|
|
2071
|
+
* @param {any} [arg] optional argument to pass to the function
|
|
2072
|
+
* @return {Promise<any>}
|
|
2046
2073
|
*/
|
|
2047
2074
|
async executeScript(fn, arg) {
|
|
2048
2075
|
let context = this.page;
|
|
@@ -2209,8 +2236,7 @@ class Playwright extends Helper {
|
|
|
2209
2236
|
async grabCssPropertyFromAll(locator, cssProperty) {
|
|
2210
2237
|
const els = await this._locate(locator);
|
|
2211
2238
|
this.debug(`Matched ${els.length} elements`);
|
|
2212
|
-
const
|
|
2213
|
-
const cssValues = res.map(props => props[toCamelCase(cssProperty)]);
|
|
2239
|
+
const cssValues = await Promise.all(els.map(el => el.$eval('xpath=.', (el, cssProperty) => getComputedStyle(el).getPropertyValue(cssProperty), cssProperty)));
|
|
2214
2240
|
|
|
2215
2241
|
return cssValues;
|
|
2216
2242
|
}
|
|
@@ -2882,7 +2908,7 @@ class Playwright extends Helper {
|
|
|
2882
2908
|
/**
|
|
2883
2909
|
* Waits for navigation to finish. By default takes configured `waitForNavigation` option.
|
|
2884
2910
|
*
|
|
2885
|
-
* See [
|
|
2911
|
+
* See [Playwright's reference](https://playwright.dev/docs/api/class-page?_highlight=waitfornavi#pagewaitfornavigationoptions)
|
|
2886
2912
|
*
|
|
2887
2913
|
* @param {*} opts
|
|
2888
2914
|
*/
|
package/docs/build/Protractor.js
CHANGED
|
@@ -723,7 +723,7 @@ class Protractor extends Helper {
|
|
|
723
723
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
724
724
|
* ```
|
|
725
725
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
726
|
-
* @param {
|
|
726
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
727
727
|
*
|
|
728
728
|
*/
|
|
729
729
|
async fillField(field, value) {
|
package/docs/build/Puppeteer.js
CHANGED
|
@@ -1593,7 +1593,7 @@ class Puppeteer extends Helper {
|
|
|
1593
1593
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1594
1594
|
* ```
|
|
1595
1595
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1596
|
-
* @param {
|
|
1596
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1597
1597
|
*
|
|
1598
1598
|
* {{ react }}
|
|
1599
1599
|
*/
|
package/docs/build/REST.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const axios = require('axios').default;
|
|
2
|
+
const Secret = require('../secret');
|
|
2
3
|
|
|
3
4
|
const Helper = require('../helper');
|
|
4
5
|
|
|
@@ -75,12 +76,18 @@ class REST extends Helper {
|
|
|
75
76
|
* @param {*} request
|
|
76
77
|
*/
|
|
77
78
|
async _executeRequest(request) {
|
|
79
|
+
const _debugRequest = { ...request };
|
|
78
80
|
axios.defaults.timeout = request.timeout || this.options.timeout;
|
|
79
81
|
|
|
80
82
|
if (this.headers && this.headers.auth) {
|
|
81
83
|
request.auth = this.headers.auth;
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
if (request.data instanceof Secret) {
|
|
87
|
+
_debugRequest.data = '*****';
|
|
88
|
+
request.data = typeof request.data === 'object' ? { ...request.data.toString() } : request.data.toString();
|
|
89
|
+
}
|
|
90
|
+
|
|
84
91
|
if ((typeof request.data) === 'string') {
|
|
85
92
|
if (!request.headers || !request.headers['Content-Type']) {
|
|
86
93
|
request.headers = { ...request.headers, ...{ 'Content-Type': 'application/x-www-form-urlencoded' } };
|
|
@@ -91,7 +98,7 @@ class REST extends Helper {
|
|
|
91
98
|
await this.config.onRequest(request);
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
this.debugSection('Request', JSON.stringify(
|
|
101
|
+
this.debugSection('Request', JSON.stringify(_debugRequest));
|
|
95
102
|
|
|
96
103
|
let response;
|
|
97
104
|
try {
|
|
@@ -149,6 +156,10 @@ class REST extends Helper {
|
|
|
149
156
|
*
|
|
150
157
|
* ```js
|
|
151
158
|
* I.sendPostRequest('/api/users.json', { "email": "user@user.com" });
|
|
159
|
+
*
|
|
160
|
+
* // To mask the payload in logs
|
|
161
|
+
* I.sendPostRequest('/api/users.json', secret({ "email": "user@user.com" }));
|
|
162
|
+
*
|
|
152
163
|
* ```
|
|
153
164
|
*
|
|
154
165
|
* @param {*} url
|
|
@@ -176,6 +187,10 @@ class REST extends Helper {
|
|
|
176
187
|
*
|
|
177
188
|
* ```js
|
|
178
189
|
* I.sendPatchRequest('/api/users.json', { "email": "user@user.com" });
|
|
190
|
+
*
|
|
191
|
+
* // To mask the payload in logs
|
|
192
|
+
* I.sendPatchRequest('/api/users.json', secret({ "email": "user@user.com" }));
|
|
193
|
+
*
|
|
179
194
|
* ```
|
|
180
195
|
*
|
|
181
196
|
* @param {string} url
|
|
@@ -203,6 +218,10 @@ class REST extends Helper {
|
|
|
203
218
|
*
|
|
204
219
|
* ```js
|
|
205
220
|
* I.sendPutRequest('/api/users.json', { "email": "user@user.com" });
|
|
221
|
+
*
|
|
222
|
+
* // To mask the payload in logs
|
|
223
|
+
* I.sendPutRequest('/api/users.json', secret({ "email": "user@user.com" }));
|
|
224
|
+
*
|
|
206
225
|
* ```
|
|
207
226
|
*
|
|
208
227
|
* @param {string} url
|
package/docs/build/TestCafe.js
CHANGED
|
@@ -440,7 +440,7 @@ class TestCafe extends Helper {
|
|
|
440
440
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
441
441
|
* ```
|
|
442
442
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
443
|
-
* @param {
|
|
443
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
444
444
|
*
|
|
445
445
|
*/
|
|
446
446
|
async fillField(field, value) {
|
package/docs/build/WebDriver.js
CHANGED
|
@@ -718,7 +718,7 @@ class WebDriver extends Helper {
|
|
|
718
718
|
* @param {object} locator
|
|
719
719
|
*/
|
|
720
720
|
async _smartWait(locator) {
|
|
721
|
-
this.debugSection(`SmartWait (${this.options.smartWait}ms)`, `Locating ${locator} in ${this.options.smartWait}`);
|
|
721
|
+
this.debugSection(`SmartWait (${this.options.smartWait}ms)`, `Locating ${JSON.stringify(locator)} in ${this.options.smartWait}`);
|
|
722
722
|
await this.defineTimeout({ implicit: this.options.smartWait });
|
|
723
723
|
}
|
|
724
724
|
|
|
@@ -1076,7 +1076,7 @@ class WebDriver extends Helper {
|
|
|
1076
1076
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1077
1077
|
* ```
|
|
1078
1078
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1079
|
-
* @param {
|
|
1079
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1080
1080
|
*
|
|
1081
1081
|
* {{ react }}
|
|
1082
1082
|
*
|
|
@@ -1785,7 +1785,7 @@ class WebDriver extends Helper {
|
|
|
1785
1785
|
*/
|
|
1786
1786
|
async grabBrowserLogs() {
|
|
1787
1787
|
if (this.browser.isW3C) {
|
|
1788
|
-
this.debug('Logs not
|
|
1788
|
+
this.debug('Logs not available in W3C specification');
|
|
1789
1789
|
return;
|
|
1790
1790
|
}
|
|
1791
1791
|
return this.browser.getLogs('browser');
|
package/docs/changelog.md
CHANGED
|
@@ -7,6 +7,40 @@ layout: Section
|
|
|
7
7
|
|
|
8
8
|
# Releases
|
|
9
9
|
|
|
10
|
+
## 3.0.5
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Features:
|
|
14
|
+
|
|
15
|
+
* **[Official Docker image for CodeceptJS v3](https://hub.docker.com/r/codeceptjs/codeceptjs)**. New Docker image is based on official Playwright image and supports Playwright, Puppeteer, WebDriver engines. Thanks **[VikentyShevyrin](https://github.com/VikentyShevyrin)**
|
|
16
|
+
* Better support for Typescript `codecept.conf.ts` configuration files. See [#2750](https://github.com/codeceptjs/CodeceptJS/issues/2750) by **[elaichenkov](https://github.com/elaichenkov)**
|
|
17
|
+
* Propagate more events for custom parallel script. See [#2796](https://github.com/codeceptjs/CodeceptJS/issues/2796) by **[jccguimaraes](https://github.com/jccguimaraes)**
|
|
18
|
+
* [mocha-junit-reporter] Now supports attachments, see documentation for details. See [#2675](https://github.com/codeceptjs/CodeceptJS/issues/2675) by **[Shard](https://github.com/Shard)**
|
|
19
|
+
* CustomLocators interface for TypeScript to extend from LocatorOrString. See [#2798](https://github.com/codeceptjs/CodeceptJS/issues/2798) by **[danielrentz](https://github.com/danielrentz)**
|
|
20
|
+
* **[REST]** Mask sensitive data from log messages.
|
|
21
|
+
```js
|
|
22
|
+
I.sendPatchRequest('/api/users.json', secret({ "email": "user@user.com" }));
|
|
23
|
+
```
|
|
24
|
+
See [#2786](https://github.com/codeceptjs/CodeceptJS/issues/2786) by **[PeterNgTr](https://github.com/PeterNgTr)**
|
|
25
|
+
|
|
26
|
+
Bug fixes:
|
|
27
|
+
* Fixed reporting of nested steps with PageObjects and BDD scenarios. See [#2800](https://github.com/codeceptjs/CodeceptJS/issues/2800) by **[davertmik](https://github.com/davertmik)**. Fixes [#2720](https://github.com/codeceptjs/CodeceptJS/issues/2720) [#2682](https://github.com/codeceptjs/CodeceptJS/issues/2682)
|
|
28
|
+
* Fixed issue with `codeceptjs shell` which was broken since 3.0.0. See [#2743](https://github.com/codeceptjs/CodeceptJS/issues/2743) by **[stedman](https://github.com/stedman)**
|
|
29
|
+
* **[Gherkin]** Fixed issue suppressed or hidden errors in tests. See [#2745](https://github.com/codeceptjs/CodeceptJS/issues/2745) by **[ktryniszewski-mdsol](https://github.com/ktryniszewski-mdsol)**
|
|
30
|
+
* **[Playwright]** fix grabCssPropertyFromAll serialization by using property names. See [#2757](https://github.com/codeceptjs/CodeceptJS/issues/2757) by **[elaichenkov](https://github.com/elaichenkov)**
|
|
31
|
+
* **[Allure]** fix report for multi sessions. See [#2771](https://github.com/codeceptjs/CodeceptJS/issues/2771) by **[cbayer97](https://github.com/cbayer97)**
|
|
32
|
+
* **[WebDriver]** Fix locator object debug log messages in smart wait. See 2748 by **[elaichenkov](https://github.com/elaichenkov)**
|
|
33
|
+
|
|
34
|
+
Documentation fixes:
|
|
35
|
+
* Fixed some broken examples. See [#2756](https://github.com/codeceptjs/CodeceptJS/issues/2756) by **[danielrentz](https://github.com/danielrentz)**
|
|
36
|
+
* Fixed Typescript typings. See [#2747](https://github.com/codeceptjs/CodeceptJS/issues/2747), [#2758](https://github.com/codeceptjs/CodeceptJS/issues/2758) and [#2769](https://github.com/codeceptjs/CodeceptJS/issues/2769) by **[elaichenkov](https://github.com/elaichenkov)**
|
|
37
|
+
* Added missing type for xFeature. See [#2754](https://github.com/codeceptjs/CodeceptJS/issues/2754) by **[PeterNgTr](https://github.com/PeterNgTr)**
|
|
38
|
+
* Fixed code example in Page Object documentation. See [#2793](https://github.com/codeceptjs/CodeceptJS/issues/2793) by **[mkrtchian](https://github.com/mkrtchian)**
|
|
39
|
+
|
|
40
|
+
Library updates:
|
|
41
|
+
* Updated Axios to 0.21.1. See by **[sseide](https://github.com/sseide)**
|
|
42
|
+
* Updated **[pollyjs](https://github.com/pollyjs)**/core **[pollyjs](https://github.com/pollyjs)**/adapter-puppeteer. See [#2760](https://github.com/codeceptjs/CodeceptJS/issues/2760) by **[Anikethana](https://github.com/Anikethana)**
|
|
43
|
+
|
|
10
44
|
## 3.0.4
|
|
11
45
|
|
|
12
46
|
* **Hotfix** Fixed `init` script by adding `cross-spawn` package. By **[vipulgupta2048](https://github.com/vipulgupta2048)**
|
package/docs/data.md
CHANGED
|
@@ -154,8 +154,8 @@ Scenario('check post page', async ({ I }) => {
|
|
|
154
154
|
// cleanup created data
|
|
155
155
|
After(({ I }) => {
|
|
156
156
|
I.sendMutation(
|
|
157
|
-
'mutation deletePost($
|
|
158
|
-
{
|
|
157
|
+
'mutation deletePost($id: ID!) { deletePost(id: $id) }',
|
|
158
|
+
{ id: postData.id},
|
|
159
159
|
);
|
|
160
160
|
});
|
|
161
161
|
```
|
|
@@ -196,7 +196,7 @@ The way for setting data for a test is as simple as writing:
|
|
|
196
196
|
```js
|
|
197
197
|
// inside async function
|
|
198
198
|
let post = await I.have('post');
|
|
199
|
-
I.haveMultiple('comment', 5, {
|
|
199
|
+
I.haveMultiple('comment', 5, { postId: post.id});
|
|
200
200
|
```
|
|
201
201
|
|
|
202
202
|
After completing the preparations under 'Data Generation with Factories', create a factory module which will export a factory.
|
|
@@ -248,7 +248,7 @@ This way for setting data for a test is as simple as writing:
|
|
|
248
248
|
```js
|
|
249
249
|
// inside async function
|
|
250
250
|
let post = await I.mutateData('createPost');
|
|
251
|
-
I.mutateMultiple('createComment', 5, {
|
|
251
|
+
I.mutateMultiple('createComment', 5, { postId: post.id});
|
|
252
252
|
```
|
|
253
253
|
|
|
254
254
|
|
|
@@ -288,7 +288,7 @@ GraphQLDataFactory: {
|
|
|
288
288
|
query: 'mutation createUser($input: UserInput!) { createUser(input: $input) { id name }}',
|
|
289
289
|
factory: './factories/users',
|
|
290
290
|
revert: (data) => ({
|
|
291
|
-
query: 'mutation deleteUser($
|
|
291
|
+
query: 'mutation deleteUser($id: ID!) { deleteUser(id: $id) }',
|
|
292
292
|
variables: { id : data.id},
|
|
293
293
|
}),
|
|
294
294
|
},
|
package/docs/detox.md
CHANGED
|
@@ -179,7 +179,7 @@ If element differs on on iOS and Android you can use **cross platform locators**
|
|
|
179
179
|
```js
|
|
180
180
|
// locate element by text on Android
|
|
181
181
|
// locate element by accessibility id on iOS
|
|
182
|
-
I.click({ android:
|
|
182
|
+
I.click({ android: 'Start', ios: '~start' });
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
When application behavior differs on Android and iOS use platform-specific actions:
|
|
@@ -207,7 +207,7 @@ Scenario('save in application', ({ I }) => {
|
|
|
207
207
|
I.fillField('#text', 'a new text');
|
|
208
208
|
I.see('a new text', '#textValue');
|
|
209
209
|
I.dontSeeElement('#createdAndVisibleText');
|
|
210
|
-
I.click({ ios: '#GoButton', android:
|
|
210
|
+
I.click({ ios: '#GoButton', android: 'Button' });
|
|
211
211
|
I.waitForElement('#createdAndVisibleText', 20);
|
|
212
212
|
I.seeElement('#createdAndVisibleText');
|
|
213
213
|
I.runOnAndroid(() => {
|
package/docs/docker.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Codeceptjs Docker
|
|
2
2
|
|
|
3
|
-
CodeceptJS
|
|
3
|
+
CodeceptJS has an [official docker image](https://hub.docker.com/r/codeceptjs/codeceptjs) based on Playwright image. Image supports Playwright, Puppeteer, and WebDriver engines.
|
|
4
4
|
|
|
5
5
|
## How to Use
|
|
6
6
|
|
|
@@ -16,17 +16,17 @@ CodeceptJS runner is available inside container as `codeceptjs`.
|
|
|
16
16
|
You can execute CodeceptJS with Puppeteer or Nightmare locally with no extra configuration.
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
docker run --net=host -v $PWD:/tests
|
|
19
|
+
docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
To customize execution call `codeceptjs` command:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
25
|
# run tests with steps
|
|
26
|
-
docker run --net=host -v $PWD:/tests
|
|
26
|
+
docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs codeceptjs run --steps
|
|
27
27
|
|
|
28
28
|
# run tests with @user in a name
|
|
29
|
-
docker run --net=host -v $PWD:/tests
|
|
29
|
+
docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs codeceptjs run --grep "@user"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ docker run --net=host -v $PWD:/tests codeception/codeceptjs codeceptjs run --gre
|
|
|
36
36
|
version: '2'
|
|
37
37
|
services:
|
|
38
38
|
codeceptjs:
|
|
39
|
-
image:
|
|
39
|
+
image: codeceptjs/codeceptjs
|
|
40
40
|
depends_on:
|
|
41
41
|
- firefox
|
|
42
42
|
- web
|
|
@@ -75,7 +75,7 @@ $ docker run -d -P --name selenium-chrome selenium/standalone-chrome
|
|
|
75
75
|
|
|
76
76
|
# Alternatively, selenium/standalone-firefox can be used
|
|
77
77
|
|
|
78
|
-
$ docker run -it --rm -v /<path_to_codeceptjs_test_dir>/:/tests/ --link selenium-chrome:selenium
|
|
78
|
+
$ docker run -it --rm -v /<path_to_codeceptjs_test_dir>/:/tests/ --link selenium-chrome:selenium codeceptjs/codeceptjs
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
You may run use `-v $(pwd)/:tests/` if running this from the root of your CodeceptJS tests directory.
|
|
@@ -87,7 +87,7 @@ _Note: If running with the Nightmare driver, it is not necessary to run a seleni
|
|
|
87
87
|
To build this image:
|
|
88
88
|
|
|
89
89
|
```sh
|
|
90
|
-
docker build -t
|
|
90
|
+
docker build -t codeceptjs/codeceptjs .
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
* this directory will be added as `/codecept` insde container
|
|
@@ -97,7 +97,7 @@ docker build -t codeception/codeceptjs .
|
|
|
97
97
|
To build this image with your desired Node version:
|
|
98
98
|
|
|
99
99
|
```sh
|
|
100
|
-
docker build -t
|
|
100
|
+
docker build -t codeceptjs/codeceptjs . --build-arg NODE_VERSION=12.10.0
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
### Passing Options
|
|
@@ -105,7 +105,7 @@ docker build -t codeception/codeceptjs . --build-arg NODE_VERSION=12.10.0
|
|
|
105
105
|
Options can be passed by calling `codeceptjs`:
|
|
106
106
|
|
|
107
107
|
```
|
|
108
|
-
docker run -v $PWD:/tests
|
|
108
|
+
docker run -v $PWD:/tests codeceptjs/codeceptjs codeceptjs run --debug
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
Alternatively arguments to `codecept run` command can be passed via `CODECEPT_ARGS` environment variable. For example to run your tests with debug
|
|
@@ -115,7 +115,7 @@ output:
|
|
|
115
115
|
version: '2'
|
|
116
116
|
services:
|
|
117
117
|
codeceptjs:
|
|
118
|
-
image:
|
|
118
|
+
image: codeceptjs/codeceptjs
|
|
119
119
|
environment:
|
|
120
120
|
- CODECEPT_ARGS=--debug
|
|
121
121
|
volumes:
|
|
@@ -128,7 +128,7 @@ You can also use `run-workers`to run tests by passing `NO_OF_WORKERS`, additiona
|
|
|
128
128
|
version: '2'
|
|
129
129
|
services:
|
|
130
130
|
codeceptjs:
|
|
131
|
-
image:
|
|
131
|
+
image: codeceptjs/codeceptjs
|
|
132
132
|
environment:
|
|
133
133
|
- NO_OF_WORKERS=3
|
|
134
134
|
- CODECEPT_ARGS=--debug
|
package/docs/helpers/Appium.md
CHANGED
|
@@ -911,7 +911,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
911
911
|
#### Parameters
|
|
912
912
|
|
|
913
913
|
- `field` **([string][4] \| [object][6])** located by label|name|CSS|XPath|strict locator.
|
|
914
|
-
- `value` **[string][4]** text value to fill.
|
|
914
|
+
- `value` **([string][4] \| [object][6])** text value to fill.
|
|
915
915
|
|
|
916
916
|
### grabTextFromAll
|
|
917
917
|
|
|
@@ -415,7 +415,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
415
415
|
#### Parameters
|
|
416
416
|
|
|
417
417
|
- `field` **([string][3] | [object][4])** located by label|name|CSS|XPath|strict locator.
|
|
418
|
-
- `value` **[string][3]** text value to fill.
|
|
418
|
+
- `value` **([string][3] | [object][4])** text value to fill.
|
|
419
419
|
|
|
420
420
|
### grabAttributeFrom
|
|
421
421
|
|
|
@@ -653,19 +653,18 @@ Returns **[Promise][8]<[string][3]>** attribute value
|
|
|
653
653
|
|
|
654
654
|
### grabValueFromAll
|
|
655
655
|
|
|
656
|
-
Retrieves
|
|
656
|
+
Retrieves an array of value from a form located by CSS or XPath and returns it to test.
|
|
657
657
|
Resumes test execution, so **should be used inside async function with `await`** operator.
|
|
658
|
-
If more than one element is found - value of first element is returned.
|
|
659
658
|
|
|
660
659
|
```js
|
|
661
|
-
let
|
|
660
|
+
let inputs = await I.grabValueFromAll('//form/input');
|
|
662
661
|
```
|
|
663
662
|
|
|
664
663
|
#### Parameters
|
|
665
664
|
|
|
666
665
|
- `locator` **([string][3] | [object][4])** field located by label|name|CSS|XPath|strict locator.
|
|
667
666
|
|
|
668
|
-
Returns **[Promise][8]<[string][3]
|
|
667
|
+
Returns **[Promise][8]<[Array][10]<[string][3]>>** attribute value
|
|
669
668
|
|
|
670
669
|
### haveHeader
|
|
671
670
|
|