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.
Files changed (139) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/README.md +6 -1
  3. package/docs/api.md +1 -1
  4. package/docs/bdd.md +1 -0
  5. package/docs/best.md +1 -1
  6. package/docs/build/ApiDataFactory.js +4 -3
  7. package/docs/build/Appium.js +21 -16
  8. package/docs/build/GraphQL.js +4 -2
  9. package/docs/build/GraphQLDataFactory.js +3 -3
  10. package/docs/build/JSONResponse.js +1 -1
  11. package/docs/build/Nightmare.js +54 -25
  12. package/docs/build/Playwright.js +105 -52
  13. package/docs/build/Protractor.js +72 -34
  14. package/docs/build/Puppeteer.js +80 -37
  15. package/docs/build/REST.js +5 -2
  16. package/docs/build/TestCafe.js +54 -23
  17. package/docs/build/WebDriver.js +115 -67
  18. package/docs/changelog.md +50 -1
  19. package/docs/custom-helpers.md +1 -1
  20. package/docs/data.md +2 -2
  21. package/docs/helpers/ApiDataFactory.md +7 -3
  22. package/docs/helpers/Appium.md +217 -175
  23. package/docs/helpers/GraphQL.md +6 -0
  24. package/docs/helpers/GraphQLDataFactory.md +3 -3
  25. package/docs/helpers/JSONResponse.md +1 -1
  26. package/docs/helpers/Nightmare.md +98 -45
  27. package/docs/helpers/Playwright.md +151 -59
  28. package/docs/helpers/Puppeteer.md +103 -26
  29. package/docs/helpers/REST.md +1 -1
  30. package/docs/helpers/TestCafe.md +77 -22
  31. package/docs/helpers/WebDriver.md +150 -62
  32. package/docs/index.md +1 -1
  33. package/docs/locators.md +1 -1
  34. package/docs/webapi/amOnPage.mustache +2 -1
  35. package/docs/webapi/appendField.mustache +2 -1
  36. package/docs/webapi/attachFile.mustache +2 -1
  37. package/docs/webapi/checkOption.mustache +2 -1
  38. package/docs/webapi/clearCookie.mustache +2 -1
  39. package/docs/webapi/clearField.mustache +1 -0
  40. package/docs/webapi/click.mustache +2 -1
  41. package/docs/webapi/clickLink.mustache +2 -1
  42. package/docs/webapi/closeCurrentTab.mustache +6 -4
  43. package/docs/webapi/closeOtherTabs.mustache +6 -4
  44. package/docs/webapi/dontSee.mustache +1 -0
  45. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
  46. package/docs/webapi/dontSeeCookie.mustache +2 -1
  47. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
  48. package/docs/webapi/dontSeeElement.mustache +2 -1
  49. package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
  50. package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
  51. package/docs/webapi/dontSeeInField.mustache +2 -1
  52. package/docs/webapi/dontSeeInSource.mustache +1 -0
  53. package/docs/webapi/dontSeeInTitle.mustache +2 -1
  54. package/docs/webapi/doubleClick.mustache +1 -0
  55. package/docs/webapi/downloadFile.mustache +2 -1
  56. package/docs/webapi/dragAndDrop.mustache +1 -0
  57. package/docs/webapi/dragSlider.mustache +2 -1
  58. package/docs/webapi/executeAsyncScript.mustache +1 -1
  59. package/docs/webapi/executeScript.mustache +1 -1
  60. package/docs/webapi/fillField.mustache +1 -0
  61. package/docs/webapi/forceClick.mustache +1 -0
  62. package/docs/webapi/forceRightClick.mustache +1 -0
  63. package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
  64. package/docs/webapi/moveCursorTo.mustache +1 -0
  65. package/docs/webapi/openNewTab.mustache +6 -4
  66. package/docs/webapi/pressKey.mustache +2 -1
  67. package/docs/webapi/pressKeyDown.mustache +1 -0
  68. package/docs/webapi/pressKeyUp.mustache +1 -0
  69. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
  70. package/docs/webapi/refreshPage.mustache +1 -0
  71. package/docs/webapi/resizeWindow.mustache +2 -1
  72. package/docs/webapi/rightClick.mustache +1 -0
  73. package/docs/webapi/saveElementScreenshot.mustache +1 -0
  74. package/docs/webapi/saveScreenshot.mustache +2 -1
  75. package/docs/webapi/say.mustache +2 -1
  76. package/docs/webapi/scrollIntoView.mustache +1 -0
  77. package/docs/webapi/scrollPageToBottom.mustache +1 -0
  78. package/docs/webapi/scrollPageToTop.mustache +1 -0
  79. package/docs/webapi/scrollTo.mustache +2 -1
  80. package/docs/webapi/see.mustache +2 -1
  81. package/docs/webapi/seeAttributesOnElements.mustache +2 -1
  82. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
  83. package/docs/webapi/seeCookie.mustache +1 -0
  84. package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
  85. package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
  86. package/docs/webapi/seeElement.mustache +2 -1
  87. package/docs/webapi/seeElementInDOM.mustache +1 -0
  88. package/docs/webapi/seeInCurrentUrl.mustache +2 -1
  89. package/docs/webapi/seeInField.mustache +1 -0
  90. package/docs/webapi/seeInPopup.mustache +1 -0
  91. package/docs/webapi/seeInSource.mustache +2 -1
  92. package/docs/webapi/seeInTitle.mustache +2 -1
  93. package/docs/webapi/seeNumberOfElements.mustache +1 -0
  94. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
  95. package/docs/webapi/seeTextEquals.mustache +2 -1
  96. package/docs/webapi/seeTitleEquals.mustache +6 -5
  97. package/docs/webapi/selectOption.mustache +1 -0
  98. package/docs/webapi/setCookie.mustache +1 -0
  99. package/docs/webapi/setGeoLocation.mustache +1 -0
  100. package/docs/webapi/switchTo.mustache +2 -1
  101. package/docs/webapi/switchToNextTab.mustache +8 -7
  102. package/docs/webapi/switchToPreviousTab.mustache +8 -7
  103. package/docs/webapi/type.mustache +1 -0
  104. package/docs/webapi/uncheckOption.mustache +2 -1
  105. package/docs/webapi/wait.mustache +2 -1
  106. package/docs/webapi/waitForClickable.mustache +2 -1
  107. package/docs/webapi/waitForDetached.mustache +2 -1
  108. package/docs/webapi/waitForElement.mustache +2 -1
  109. package/docs/webapi/waitForEnabled.mustache +2 -1
  110. package/docs/webapi/waitForFunction.mustache +1 -0
  111. package/docs/webapi/waitForInvisible.mustache +2 -1
  112. package/docs/webapi/waitForText.mustache +2 -1
  113. package/docs/webapi/waitForValue.mustache +1 -0
  114. package/docs/webapi/waitForVisible.mustache +1 -0
  115. package/docs/webapi/waitInUrl.mustache +2 -1
  116. package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
  117. package/docs/webapi/waitToHide.mustache +2 -1
  118. package/docs/webapi/waitUrlEquals.mustache +2 -1
  119. package/lib/cli.js +1 -1
  120. package/lib/command/definitions.js +9 -0
  121. package/lib/command/run-workers.js +1 -1
  122. package/lib/command/run.js +2 -2
  123. package/lib/command/workers/runTests.js +55 -0
  124. package/lib/helper/ApiDataFactory.js +4 -3
  125. package/lib/helper/Appium.js +2 -7
  126. package/lib/helper/GraphQL.js +4 -2
  127. package/lib/helper/GraphQLDataFactory.js +3 -3
  128. package/lib/helper/JSONResponse.js +1 -1
  129. package/lib/helper/Playwright.js +28 -17
  130. package/lib/helper/REST.js +5 -2
  131. package/lib/helper/WebDriver.js +4 -0
  132. package/lib/interfaces/bdd.js +5 -0
  133. package/lib/listener/steps.js +1 -0
  134. package/lib/output.js +4 -0
  135. package/lib/plugin/fakerTransform.js +1 -1
  136. package/lib/plugin/stepByStepReport.js +8 -6
  137. package/lib/workers.js +12 -0
  138. package/package.json +3 -3
  139. 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](/reporters#testomatio)
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`
@@ -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 accross different project and installed as npm packages.
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
- var Factory = require('rosie').Factory;
57
- var faker = require('faker');
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