codeceptjs 3.3.0 β 3.3.3
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 +50 -1
- package/README.md +6 -1
- package/docs/api.md +1 -1
- package/docs/bdd.md +1 -0
- package/docs/best.md +1 -1
- package/docs/build/ApiDataFactory.js +4 -3
- package/docs/build/Appium.js +21 -16
- package/docs/build/GraphQL.js +4 -2
- package/docs/build/GraphQLDataFactory.js +3 -3
- package/docs/build/JSONResponse.js +1 -1
- package/docs/build/Nightmare.js +54 -25
- package/docs/build/Playwright.js +105 -52
- package/docs/build/Protractor.js +72 -34
- package/docs/build/Puppeteer.js +80 -37
- package/docs/build/REST.js +5 -2
- package/docs/build/TestCafe.js +54 -23
- package/docs/build/WebDriver.js +115 -67
- package/docs/changelog.md +50 -1
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +2 -2
- package/docs/helpers/ApiDataFactory.md +7 -3
- package/docs/helpers/Appium.md +217 -175
- package/docs/helpers/GraphQL.md +6 -0
- package/docs/helpers/GraphQLDataFactory.md +3 -3
- package/docs/helpers/JSONResponse.md +1 -1
- package/docs/helpers/Nightmare.md +98 -45
- package/docs/helpers/Playwright.md +151 -59
- package/docs/helpers/Puppeteer.md +103 -26
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +77 -22
- package/docs/helpers/WebDriver.md +150 -62
- package/docs/index.md +1 -1
- package/docs/locators.md +1 -1
- package/docs/webapi/amOnPage.mustache +2 -1
- package/docs/webapi/appendField.mustache +2 -1
- package/docs/webapi/attachFile.mustache +2 -1
- package/docs/webapi/checkOption.mustache +2 -1
- package/docs/webapi/clearCookie.mustache +2 -1
- package/docs/webapi/clearField.mustache +1 -0
- package/docs/webapi/click.mustache +2 -1
- package/docs/webapi/clickLink.mustache +2 -1
- package/docs/webapi/closeCurrentTab.mustache +6 -4
- package/docs/webapi/closeOtherTabs.mustache +6 -4
- package/docs/webapi/dontSee.mustache +1 -0
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/dontSeeCookie.mustache +2 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/dontSeeElement.mustache +2 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
- package/docs/webapi/dontSeeInField.mustache +2 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -0
- package/docs/webapi/dontSeeInTitle.mustache +2 -1
- package/docs/webapi/doubleClick.mustache +1 -0
- package/docs/webapi/downloadFile.mustache +2 -1
- package/docs/webapi/dragAndDrop.mustache +1 -0
- package/docs/webapi/dragSlider.mustache +2 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -0
- package/docs/webapi/forceRightClick.mustache +1 -0
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +1 -0
- package/docs/webapi/openNewTab.mustache +6 -4
- package/docs/webapi/pressKey.mustache +2 -1
- package/docs/webapi/pressKeyDown.mustache +1 -0
- package/docs/webapi/pressKeyUp.mustache +1 -0
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
- package/docs/webapi/refreshPage.mustache +1 -0
- package/docs/webapi/resizeWindow.mustache +2 -1
- package/docs/webapi/rightClick.mustache +1 -0
- package/docs/webapi/saveElementScreenshot.mustache +1 -0
- package/docs/webapi/saveScreenshot.mustache +2 -1
- package/docs/webapi/say.mustache +2 -1
- package/docs/webapi/scrollIntoView.mustache +1 -0
- package/docs/webapi/scrollPageToBottom.mustache +1 -0
- package/docs/webapi/scrollPageToTop.mustache +1 -0
- package/docs/webapi/scrollTo.mustache +2 -1
- package/docs/webapi/see.mustache +2 -1
- package/docs/webapi/seeAttributesOnElements.mustache +2 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/seeCookie.mustache +1 -0
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/seeElement.mustache +2 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -0
- package/docs/webapi/seeInCurrentUrl.mustache +2 -1
- package/docs/webapi/seeInField.mustache +1 -0
- package/docs/webapi/seeInPopup.mustache +1 -0
- package/docs/webapi/seeInSource.mustache +2 -1
- package/docs/webapi/seeInTitle.mustache +2 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
- package/docs/webapi/seeTextEquals.mustache +2 -1
- package/docs/webapi/seeTitleEquals.mustache +6 -5
- package/docs/webapi/selectOption.mustache +1 -0
- package/docs/webapi/setCookie.mustache +1 -0
- package/docs/webapi/setGeoLocation.mustache +1 -0
- package/docs/webapi/switchTo.mustache +2 -1
- package/docs/webapi/switchToNextTab.mustache +8 -7
- package/docs/webapi/switchToPreviousTab.mustache +8 -7
- package/docs/webapi/type.mustache +1 -0
- package/docs/webapi/uncheckOption.mustache +2 -1
- package/docs/webapi/wait.mustache +2 -1
- package/docs/webapi/waitForClickable.mustache +2 -1
- package/docs/webapi/waitForDetached.mustache +2 -1
- package/docs/webapi/waitForElement.mustache +2 -1
- package/docs/webapi/waitForEnabled.mustache +2 -1
- package/docs/webapi/waitForFunction.mustache +1 -0
- package/docs/webapi/waitForInvisible.mustache +2 -1
- package/docs/webapi/waitForText.mustache +2 -1
- package/docs/webapi/waitForValue.mustache +1 -0
- package/docs/webapi/waitForVisible.mustache +1 -0
- package/docs/webapi/waitInUrl.mustache +2 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
- package/docs/webapi/waitToHide.mustache +2 -1
- package/docs/webapi/waitUrlEquals.mustache +2 -1
- package/lib/cli.js +1 -1
- package/lib/command/definitions.js +9 -0
- package/lib/command/run-workers.js +1 -1
- package/lib/command/run.js +2 -2
- package/lib/command/workers/runTests.js +55 -0
- package/lib/helper/ApiDataFactory.js +4 -3
- package/lib/helper/Appium.js +2 -7
- package/lib/helper/GraphQL.js +4 -2
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +1 -1
- package/lib/helper/Playwright.js +28 -17
- package/lib/helper/REST.js +5 -2
- package/lib/helper/WebDriver.js +4 -0
- package/lib/interfaces/bdd.js +5 -0
- package/lib/listener/steps.js +1 -0
- package/lib/output.js +4 -0
- package/lib/plugin/fakerTransform.js +1 -1
- package/lib/plugin/stepByStepReport.js +8 -6
- package/lib/workers.js +12 -0
- package/package.json +3 -3
- package/typings/types.d.ts +534 -112
package/docs/changelog.md
CHANGED
|
@@ -7,6 +7,55 @@ layout: Section
|
|
|
7
7
|
|
|
8
8
|
# Releases
|
|
9
9
|
|
|
10
|
+
## 3.3.3
|
|
11
|
+
|
|
12
|
+
* Fixed `DataCloneError: () => could not be cloned` when running data tests in run-workers
|
|
13
|
+
* πΊπ¦ Added #StandWithUkraine notice to CLI
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 3.3.2
|
|
17
|
+
|
|
18
|
+
* **[REST]** Fixed override of headers/token in `haveRequestHeaders()` and `amBearerAuthenticated()`. See [#3304](https://github.com/codeceptjs/CodeceptJS/issues/3304) by **[mirao](https://github.com/mirao)**
|
|
19
|
+
* Reverted typings change introduced in [#3245](https://github.com/codeceptjs/CodeceptJS/issues/3245). [More details on this](https://twitter.com/CodeceptJS/status/1519725963856207873)
|
|
20
|
+
|
|
21
|
+
## 3.3.1
|
|
22
|
+
|
|
23
|
+
π©οΈ Features:
|
|
24
|
+
|
|
25
|
+
* Add option to avoid duplicate gherkin step definitions ([#3257](https://github.com/codeceptjs/CodeceptJS/issues/3257)) - **[raywiis](https://github.com/raywiis)**
|
|
26
|
+
* Added `step.*` for run-workers [#3272](https://github.com/codeceptjs/CodeceptJS/issues/3272). Thanks to **[abhimanyupandian](https://github.com/abhimanyupandian)**
|
|
27
|
+
* Fixed loading tests for `codecept run` using glob patterns. By **[jayudey-wf](https://github.com/jayudey-wf)**
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
npx codeceptjs run test-dir/*"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
* **[Playwright]** **Possible breaking change.** By default `timeout` is changed to 5000ms. The value set in 3.3.0 was too low. Please set `timeout` explicitly to not depend on release values.
|
|
34
|
+
* **[Playwright]** Added for color scheme option by **[PeterNgTr](https://github.com/PeterNgTr)**
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
helpers: {
|
|
38
|
+
Playwright : {
|
|
39
|
+
url: "http://localhost",
|
|
40
|
+
colorScheme: "dark",
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
π Bugfixes:
|
|
47
|
+
|
|
48
|
+
* **[Playwright]** Fixed `Cannot read property 'video' of undefined`
|
|
49
|
+
* Fixed haveRequestHeaders() and amBearerAuthenticated() of REST helper ([#3260](https://github.com/codeceptjs/CodeceptJS/issues/3260)) - **[mirao](https://github.com/mirao)**
|
|
50
|
+
* Fixed: allure attachment fails if screenshot failed [#3298](https://github.com/codeceptjs/CodeceptJS/issues/3298) by **[ruudvanderweijde](https://github.com/ruudvanderweijde)**
|
|
51
|
+
* Fixed [#3105](https://github.com/codeceptjs/CodeceptJS/issues/3105) using autoLogin() plugin with TypeScript. Fix [#3290](https://github.com/codeceptjs/CodeceptJS/issues/3290) by **[PeterNgTr](https://github.com/PeterNgTr)**
|
|
52
|
+
* **[Playwright]** Added extra params for click and dragAndDrop to type definitions by **[mirao](https://github.com/mirao)**
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
π Documentation
|
|
56
|
+
* Improving the typings in many places
|
|
57
|
+
* Improving the return type of helpers for TS users ([#3245](https://github.com/codeceptjs/CodeceptJS/issues/3245)) - **[nlespiaucq](https://github.com/nlespiaucq)**
|
|
58
|
+
|
|
10
59
|
## 3.3.0
|
|
11
60
|
|
|
12
61
|
π©οΈ Features:
|
|
@@ -55,7 +104,7 @@ await eachElement('click all links in .list', '.list a', (el) => {
|
|
|
55
104
|
|
|
56
105
|
π Documentation
|
|
57
106
|
|
|
58
|
-
* Added [Testomat.io reporter](/
|
|
107
|
+
* Added [Testomat.io reporter](/reports#testomatio)
|
|
59
108
|
* Added [api testing](/api) guides
|
|
60
109
|
* Added [internal api](/internal-api) guides
|
|
61
110
|
* **[Appium]** Fixed documentation for `performSwipe`
|
package/docs/custom-helpers.md
CHANGED
|
@@ -7,7 +7,7 @@ title: Custom Helpers
|
|
|
7
7
|
|
|
8
8
|
Helper is the core concept of CodeceptJS. Helper is a wrapper on top of various libraries providing unified interface around them. When `I` object is used in tests it delegates execution of its functions to currently enabled helper classes.
|
|
9
9
|
|
|
10
|
-
Use Helpers to introduce low-level API to your tests without polluting test scenarios. Helpers can also be used to share functionality
|
|
10
|
+
Use Helpers to introduce low-level API to your tests without polluting test scenarios. Helpers can also be used to share functionality across different project and installed as npm packages.
|
|
11
11
|
|
|
12
12
|
## Development
|
|
13
13
|
|
package/docs/data.md
CHANGED
|
@@ -206,7 +206,7 @@ See the example providing a factory for User generation:
|
|
|
206
206
|
```js
|
|
207
207
|
// factories/post.js
|
|
208
208
|
var Factory = require('rosie').Factory;
|
|
209
|
-
var faker = require('faker');
|
|
209
|
+
var faker = require('@faker-js/faker');
|
|
210
210
|
|
|
211
211
|
module.exports = new Factory()
|
|
212
212
|
.attr('name', () => faker.name.findName())
|
|
@@ -262,7 +262,7 @@ See the example providing a factory for User generation:
|
|
|
262
262
|
```js
|
|
263
263
|
// factories/post.js
|
|
264
264
|
var Factory = require('rosie').Factory;
|
|
265
|
-
var faker = require('faker');
|
|
265
|
+
var faker = require('@faker-js/faker');
|
|
266
266
|
|
|
267
267
|
module.exports = new Factory((buildObj) => {
|
|
268
268
|
return {
|
|
@@ -43,7 +43,7 @@ To make this work you need
|
|
|
43
43
|
Install [Rosie][1] and [Faker][2] libraries.
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
npm i rosie faker --save-dev
|
|
46
|
+
npm i rosie @faker-js/faker --save-dev
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
Create a factory file for a resource.
|
|
@@ -53,8 +53,8 @@ See the example for Posts factories:
|
|
|
53
53
|
```js
|
|
54
54
|
// tests/factories/posts.js
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const Factory = require('rosie').Factory;
|
|
57
|
+
const faker = require('@faker-js/faker');
|
|
58
58
|
|
|
59
59
|
module.exports = new Factory()
|
|
60
60
|
// no need to set id, it will be set by REST API
|
|
@@ -231,6 +231,8 @@ I.have('user', { }, { age: 33, height: 55 })
|
|
|
231
231
|
- `params` **any** predefined parameters
|
|
232
232
|
- `options` **any** options for programmatically generate the attributes
|
|
233
233
|
|
|
234
|
+
Returns **[Promise][5]<any>**
|
|
235
|
+
|
|
234
236
|
### haveMultiple
|
|
235
237
|
|
|
236
238
|
Generates bunch of records and saves multiple API requests to store them.
|
|
@@ -260,3 +262,5 @@ I.haveMultiple('post', 3, { author: 'davert' }, { publish_date: '01.01.1997' });
|
|
|
260
262
|
[3]: http://codecept.io/helpers/REST/
|
|
261
263
|
|
|
262
264
|
[4]: https://github.com/axios/axios#request-config
|
|
265
|
+
|
|
266
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|