codeceptjs 3.3.5-beta.6 → 3.3.6

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 (160) hide show
  1. package/CHANGELOG.md +69 -2
  2. package/bin/codecept.js +40 -3
  3. package/docs/basics.md +24 -1
  4. package/docs/build/Appium.js +41 -22
  5. package/docs/build/FileSystem.js +1 -1
  6. package/docs/build/Nightmare.js +106 -57
  7. package/docs/build/Playwright.js +187 -111
  8. package/docs/build/Protractor.js +132 -70
  9. package/docs/build/Puppeteer.js +143 -76
  10. package/docs/build/REST.js +2 -2
  11. package/docs/build/TestCafe.js +107 -57
  12. package/docs/build/WebDriver.js +162 -89
  13. package/docs/changelog.md +107 -2
  14. package/docs/commands.md +5 -3
  15. package/docs/community-helpers.md +7 -4
  16. package/docs/configuration.md +5 -5
  17. package/docs/examples.md +39 -48
  18. package/docs/helpers/Appium.md +25 -23
  19. package/docs/helpers/FileSystem.md +1 -1
  20. package/docs/helpers/Nightmare.md +57 -57
  21. package/docs/helpers/Playwright.md +76 -75
  22. package/docs/helpers/Puppeteer.md +76 -85
  23. package/docs/helpers/REST.md +1 -1
  24. package/docs/helpers/TestCafe.md +57 -57
  25. package/docs/helpers/WebDriver.md +84 -97
  26. package/docs/quickstart.md +1 -1
  27. package/docs/reports.md +1 -1
  28. package/docs/secrets.md +1 -1
  29. package/docs/typescript.md +9 -69
  30. package/docs/webapi/appendField.mustache +1 -1
  31. package/docs/webapi/attachFile.mustache +3 -3
  32. package/docs/webapi/checkOption.mustache +1 -1
  33. package/docs/webapi/clearCookie.mustache +1 -1
  34. package/docs/webapi/clearField.mustache +1 -1
  35. package/docs/webapi/click.mustache +1 -1
  36. package/docs/webapi/clickLink.mustache +1 -1
  37. package/docs/webapi/closeCurrentTab.mustache +1 -1
  38. package/docs/webapi/closeOtherTabs.mustache +1 -1
  39. package/docs/webapi/dontSee.mustache +1 -1
  40. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
  41. package/docs/webapi/dontSeeCookie.mustache +1 -1
  42. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
  43. package/docs/webapi/dontSeeElement.mustache +1 -1
  44. package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
  45. package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
  46. package/docs/webapi/dontSeeInField.mustache +1 -1
  47. package/docs/webapi/dontSeeInSource.mustache +1 -1
  48. package/docs/webapi/dontSeeInTitle.mustache +1 -1
  49. package/docs/webapi/doubleClick.mustache +1 -1
  50. package/docs/webapi/downloadFile.mustache +1 -1
  51. package/docs/webapi/dragAndDrop.mustache +1 -1
  52. package/docs/webapi/dragSlider.mustache +1 -1
  53. package/docs/webapi/executeAsyncScript.mustache +1 -1
  54. package/docs/webapi/executeScript.mustache +1 -1
  55. package/docs/webapi/fillField.mustache +1 -1
  56. package/docs/webapi/forceClick.mustache +1 -1
  57. package/docs/webapi/forceRightClick.mustache +1 -1
  58. package/docs/webapi/moveCursorTo.mustache +1 -1
  59. package/docs/webapi/openNewTab.mustache +1 -1
  60. package/docs/webapi/pressKey.mustache +1 -1
  61. package/docs/webapi/pressKeyDown.mustache +1 -1
  62. package/docs/webapi/pressKeyUp.mustache +1 -1
  63. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
  64. package/docs/webapi/refreshPage.mustache +1 -1
  65. package/docs/webapi/resizeWindow.mustache +1 -1
  66. package/docs/webapi/rightClick.mustache +1 -1
  67. package/docs/webapi/saveElementScreenshot.mustache +2 -2
  68. package/docs/webapi/saveScreenshot.mustache +2 -2
  69. package/docs/webapi/say.mustache +1 -1
  70. package/docs/webapi/scrollIntoView.mustache +1 -1
  71. package/docs/webapi/scrollPageToBottom.mustache +1 -1
  72. package/docs/webapi/scrollPageToTop.mustache +1 -1
  73. package/docs/webapi/scrollTo.mustache +1 -1
  74. package/docs/webapi/see.mustache +1 -1
  75. package/docs/webapi/seeAttributesOnElements.mustache +1 -1
  76. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
  77. package/docs/webapi/seeCookie.mustache +1 -1
  78. package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
  79. package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
  80. package/docs/webapi/seeElement.mustache +1 -1
  81. package/docs/webapi/seeElementInDOM.mustache +1 -1
  82. package/docs/webapi/seeInCurrentUrl.mustache +1 -1
  83. package/docs/webapi/seeInField.mustache +1 -1
  84. package/docs/webapi/seeInPopup.mustache +1 -1
  85. package/docs/webapi/seeInSource.mustache +1 -1
  86. package/docs/webapi/seeInTitle.mustache +1 -1
  87. package/docs/webapi/seeNumberOfElements.mustache +1 -1
  88. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
  89. package/docs/webapi/seeTextEquals.mustache +1 -1
  90. package/docs/webapi/seeTitleEquals.mustache +1 -1
  91. package/docs/webapi/selectOption.mustache +1 -1
  92. package/docs/webapi/setCookie.mustache +1 -1
  93. package/docs/webapi/setGeoLocation.mustache +1 -1
  94. package/docs/webapi/switchTo.mustache +1 -1
  95. package/docs/webapi/switchToNextTab.mustache +1 -1
  96. package/docs/webapi/switchToPreviousTab.mustache +1 -1
  97. package/docs/webapi/type.mustache +1 -1
  98. package/docs/webapi/uncheckOption.mustache +1 -1
  99. package/docs/webapi/wait.mustache +1 -1
  100. package/docs/webapi/waitForClickable.mustache +1 -1
  101. package/docs/webapi/waitForDetached.mustache +1 -1
  102. package/docs/webapi/waitForElement.mustache +1 -1
  103. package/docs/webapi/waitForEnabled.mustache +1 -1
  104. package/docs/webapi/waitForFunction.mustache +1 -1
  105. package/docs/webapi/waitForInvisible.mustache +1 -1
  106. package/docs/webapi/waitForText.mustache +1 -1
  107. package/docs/webapi/waitForValue.mustache +1 -1
  108. package/docs/webapi/waitForVisible.mustache +1 -1
  109. package/docs/webapi/waitInUrl.mustache +1 -1
  110. package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
  111. package/docs/webapi/waitToHide.mustache +1 -1
  112. package/docs/webapi/waitUrlEquals.mustache +1 -1
  113. package/lib/command/configMigrate.js +1 -1
  114. package/lib/command/dryRun.js +2 -1
  115. package/lib/command/generate.js +35 -18
  116. package/lib/command/run-rerun.js +38 -0
  117. package/lib/command/utils.js +13 -3
  118. package/lib/config.js +2 -2
  119. package/lib/data/context.js +7 -0
  120. package/lib/helper/Appium.js +6 -4
  121. package/lib/helper/FileSystem.js +1 -1
  122. package/lib/helper/Nightmare.js +1 -1
  123. package/lib/helper/Playwright.js +48 -38
  124. package/lib/helper/Protractor.js +1 -1
  125. package/lib/helper/REST.js +2 -2
  126. package/lib/helper/TestCafe.js +1 -1
  127. package/lib/helper/WebDriver.js +7 -7
  128. package/lib/plugin/wdio.js +11 -2
  129. package/lib/utils.js +3 -0
  130. package/package.json +2 -2
  131. package/typings/index.d.ts +46 -46
  132. package/typings/types.d.ts +497 -443
  133. package/docs/wiki/.git/FETCH_HEAD +0 -1
  134. package/docs/wiki/.git/HEAD +0 -1
  135. package/docs/wiki/.git/ORIG_HEAD +0 -1
  136. package/docs/wiki/.git/config +0 -11
  137. package/docs/wiki/.git/description +0 -1
  138. package/docs/wiki/.git/hooks/applypatch-msg.sample +0 -15
  139. package/docs/wiki/.git/hooks/commit-msg.sample +0 -24
  140. package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +0 -173
  141. package/docs/wiki/.git/hooks/post-update.sample +0 -8
  142. package/docs/wiki/.git/hooks/pre-applypatch.sample +0 -14
  143. package/docs/wiki/.git/hooks/pre-commit.sample +0 -49
  144. package/docs/wiki/.git/hooks/pre-merge-commit.sample +0 -13
  145. package/docs/wiki/.git/hooks/pre-push.sample +0 -53
  146. package/docs/wiki/.git/hooks/pre-rebase.sample +0 -169
  147. package/docs/wiki/.git/hooks/pre-receive.sample +0 -24
  148. package/docs/wiki/.git/hooks/prepare-commit-msg.sample +0 -42
  149. package/docs/wiki/.git/hooks/push-to-checkout.sample +0 -78
  150. package/docs/wiki/.git/hooks/update.sample +0 -128
  151. package/docs/wiki/.git/index +0 -0
  152. package/docs/wiki/.git/info/exclude +0 -6
  153. package/docs/wiki/.git/logs/HEAD +0 -1
  154. package/docs/wiki/.git/logs/refs/heads/master +0 -1
  155. package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +0 -1
  156. package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.idx +0 -0
  157. package/docs/wiki/.git/objects/pack/pack-5938044f9d30daf1c195fda4dec1d54850933935.pack +0 -0
  158. package/docs/wiki/.git/packed-refs +0 -2
  159. package/docs/wiki/.git/refs/heads/master +0 -1
  160. package/docs/wiki/.git/refs/remotes/origin/HEAD +0 -1
package/docs/changelog.md CHANGED
@@ -7,6 +7,111 @@ layout: Section
7
7
 
8
8
  # Releases
9
9
 
10
+ ## 3.3.6
11
+
12
+ * [`run-rerun`](https://codecept.io/commands/#run-rerun) command was re-introduced by **[dwentland24](https://github.com/dwentland24)** in [#3436](https://github.com/codeceptjs/CodeceptJS/issues/3436). Use it to perform run multiple times and detect flaky tests
13
+ * Enabled `retryFailedStep` by default in `@codeceptjs/configure` v 0.10. See https://github.com/codeceptjs/configure/pull/26
14
+ * **[Playwright]** Fixed properties types "waitForNavigation" and "firefox" by **[mirao](https://github.com/mirao)** in [#3401](https://github.com/codeceptjs/CodeceptJS/issues/3401)
15
+ * **[REST]** Changed "endpoint" to optional by **[mirao](https://github.com/mirao)** in [#3404](https://github.com/codeceptjs/CodeceptJS/issues/3404)
16
+ * **[REST]** Use [`secret`]() for form encoded string by **[PeterNgTr](https://github.com/PeterNgTr)**:
17
+
18
+ ```js
19
+ const secretData = secret('name=john&password=123456');
20
+ const response = await I.sendPostRequest('/user', secretData);
21
+ ```
22
+
23
+ * [Playwright]Fixed docs related to fixed properties types "waitForNavigation" and "firefox" by **[mirao](https://github.com/mirao)** in [#3407](https://github.com/codeceptjs/CodeceptJS/issues/3407)
24
+ * [Playwright]Fixed parameters of startActivity() by **[mirao](https://github.com/mirao)** in [#3408](https://github.com/codeceptjs/CodeceptJS/issues/3408)
25
+ * Move semver to prod dependencies by **[timja](https://github.com/timja)** in [#3413](https://github.com/codeceptjs/CodeceptJS/issues/3413)
26
+ * check if browser is W3C instead of Android by **[mikk150](https://github.com/mikk150)** in [#3414](https://github.com/codeceptjs/CodeceptJS/issues/3414)
27
+ * Pass service configs with options and caps as array for browsers… by **[07souravkunda](https://github.com/07souravkunda)** in [#3418](https://github.com/codeceptjs/CodeceptJS/issues/3418)
28
+ * fix for type of "webdriver.port" by **[ngraf](https://github.com/ngraf)** in [#3421](https://github.com/codeceptjs/CodeceptJS/issues/3421)
29
+ * fix for type of "webdriver.smartWait" by **[pmajewski24](https://github.com/pmajewski24)** in [#3426](https://github.com/codeceptjs/CodeceptJS/issues/3426)
30
+ * fix(datatable): mask secret text by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3432](https://github.com/codeceptjs/CodeceptJS/issues/3432)
31
+ * fix(playwright) - video name and missing type by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3430](https://github.com/codeceptjs/CodeceptJS/issues/3430)
32
+ * fix for expected type of "bootstrap", "teardown", "bootstrapAll" and "teardownAll" by **[ngraf](https://github.com/ngraf)** in [#3424](https://github.com/codeceptjs/CodeceptJS/issues/3424)
33
+ * Improve generate pageobject `gpo` command to work with TypeScript by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3411](https://github.com/codeceptjs/CodeceptJS/issues/3411)
34
+ * Fixed dry-run to always return 0 code and exit
35
+ * Added minimal version notice for NodeJS >= 12
36
+ * fix(utils): remove . of test title to avoid confusion by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3431](https://github.com/codeceptjs/CodeceptJS/issues/3431)
37
+
38
+ ## 3.3.5
39
+
40
+ 🛩️ Features
41
+
42
+ * Added **TypeScript types for CodeceptJS config**.
43
+
44
+ Update `codecept.conf.js` to get intellisense when writing config file:
45
+
46
+ ```js
47
+ /**@type {CodeceptJS.MainConfig}**/
48
+ exports.config = {
49
+ //...
50
+ }
51
+ ```
52
+ * Added TS types for helpers config:
53
+ * Playwright
54
+ * Puppeteer
55
+ * WebDriver
56
+ * REST
57
+ * Added **[TypeScript option](/typescript)** for installation via `codeceptjs init` to initialize new projects in TS (by **[PeterNgTr](https://github.com/PeterNgTr)** and **[davertmik](https://github.com/davertmik)**)
58
+ * Includes `node-ts` automatically when using TypeScript setup.
59
+
60
+
61
+ 🐛 Bugfixes
62
+
63
+ * **[Puppeteer]** Fixed support for Puppeteer > 14.4 by **[PeterNgTr](https://github.com/PeterNgTr)**
64
+ * Don't report files as existing when non-directory is in path by **[jonathanperret](https://github.com/jonathanperret)**. See [#3374](https://github.com/codeceptjs/CodeceptJS/issues/3374)
65
+ * Fixed TS type for `secret` function by **[PeterNgTr](https://github.com/PeterNgTr)**
66
+ * Fixed wrong order for async MetaSteps by **[dwentland24](https://github.com/dwentland24)**. See [#3393](https://github.com/codeceptjs/CodeceptJS/issues/3393)
67
+ * Fixed same param substitution in BDD step. See [#3385](https://github.com/codeceptjs/CodeceptJS/issues/3385) by **[snehabhandge](https://github.com/snehabhandge)**
68
+
69
+ 📖 Documentation
70
+
71
+ * Updated [configuration options](https://codecept.io/configuration/) to match TypeScript types
72
+ * Updated [TypeScript documentation](https://codecept.io/typescript/) on simplifying TS installation
73
+ * Added codecept-tesults plugin documentation by **[ajeetd](https://github.com/ajeetd)**
74
+
75
+
76
+
77
+ ## 3.3.4
78
+
79
+ * Added support for masking fields in objects via `secret` function:
80
+
81
+ ```js
82
+ I.sendPostRequest('/auth', secret({ name: 'jon', password: '123456' }, 'password'));
83
+ ```
84
+ * Added [a guide about using of `secret`](/secrets) function
85
+ * **[Appium]** Use `touchClick` when interacting with elements in iOS. See [#3317](https://github.com/codeceptjs/CodeceptJS/issues/3317) by **[mikk150](https://github.com/mikk150)**
86
+ * **[Playwright]** Added `cdpConnection` option to connect over CDP. See [#3309](https://github.com/codeceptjs/CodeceptJS/issues/3309) by **[Hmihaly](https://github.com/Hmihaly)**
87
+ * [customLocator plugin] Allowed to specify multiple attributes for custom locator. Thanks to **[aruiz-caritsqa](https://github.com/aruiz-caritsqa)**
88
+
89
+ ```js
90
+ plugins: {
91
+ customLocator: {
92
+ enabled: true,
93
+ prefix: '$',
94
+ attribute: ['data-qa', 'data-test'],
95
+ }
96
+ }
97
+ ```
98
+ * [retryTo plugin] Fixed [#3147](https://github.com/codeceptjs/CodeceptJS/issues/3147) using `pollInterval` option. See [#3351](https://github.com/codeceptjs/CodeceptJS/issues/3351) by **[cyonkee](https://github.com/cyonkee)**
99
+ * **[Playwright]** Fixed grabbing of browser console messages and window resize in new tab. Thanks to **[mirao](https://github.com/mirao)**
100
+ * **[REST]** Added `prettyPrintJson` option to print JSON in nice way by **[PeterNgTr](https://github.com/PeterNgTr)**
101
+ * **[JSONResponse]** Updated response validation to iterate over array items if response is array. Thanks to **[PeterNgTr](https://github.com/PeterNgTr)**
102
+
103
+ ```js
104
+ // response.data == [
105
+ // { user: { name: 'jon', email: 'jon@doe.com' } },
106
+ // { user: { name: 'matt', email: 'matt@doe.com' } },
107
+ //]
108
+
109
+ I.seeResponseContainsKeys(['user']);
110
+ I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } });
111
+ I.seeResponseContainsJson({ user: { email: 'matt@doe.com' } });
112
+ I.dontSeeResponseContainsJson({ user: 2 });
113
+ ```
114
+
10
115
  ## 3.3.3
11
116
 
12
117
  * Fixed `DataCloneError: () => could not be cloned` when running data tests in run-workers
@@ -505,7 +610,7 @@ MyPage.hasFiles('first arg', 'second arg');
505
610
 
506
611
  // OUTPUT:
507
612
  MyPage: hasFile "First arg", "Second arg"
508
- I see file "codecept.json"
613
+ I see file "codecept.js"
509
614
  I see file "codecept.po.json"
510
615
  ```
511
616
  * Introduced official [TypeScript boilerplate](https://github.com/codeceptjs/typescript-boilerplate). Started by **[Vorobeyko](https://github.com/Vorobeyko)**.
@@ -2101,7 +2206,7 @@ module.exports = function(done) {
2101
2206
  ```js
2102
2207
  // inside codecept.conf.js
2103
2208
  exports.config = {
2104
- // contents of codecept.json
2209
+ // contents of codecept.js
2105
2210
  }
2106
2211
  ```
2107
2212
  * Added `--profile` option to pass its value to `codecept.conf.js` as `process.profile` for [dynamic configuration](http://codecept.io/configuration#dynamic-configuration).
package/docs/commands.md CHANGED
@@ -57,7 +57,7 @@ Select config file manually (`-c` or `--config` option)
57
57
 
58
58
  ```sh
59
59
  npx codeceptjs run -c my.codecept.conf.js
60
- npx codeceptjs run --config path/to/codecept.json
60
+ npx codeceptjs run --config path/to/codecept.conf.js
61
61
  ```
62
62
 
63
63
  Override config on the fly. Provide valid JSON which will be merged into current config:
@@ -102,7 +102,7 @@ Run tests in parallel threads.
102
102
  npx codeceptjs run-workers 3
103
103
  ```
104
104
 
105
- ## Run Rerun <Badge text="Since 2.4" type="warning"/>
105
+ ## Run Rerun <Badge text="Since 3.3.6" type="warning"/>
106
106
 
107
107
  Run tests multiple times to detect and fix flaky tests.
108
108
 
@@ -160,6 +160,8 @@ npx codeceptjs dry-run --steps --bootstrap
160
160
 
161
161
  ## Run Multiple
162
162
 
163
+ > ⚠️ prefer using run-workers instead
164
+
163
165
  Run multiple suites. Unlike `run-workers` spawns processes to execute tests.
164
166
  [Requires additional configuration](/advanced#multiple-browsers-execution) and can be used to execute tests in multiple browsers.
165
167
 
@@ -223,7 +225,7 @@ TypeScript Definitions allows IDEs to provide autocompletion when writing tests.
223
225
 
224
226
  ```sh
225
227
  npx codeceptjs def
226
- npx codeceptjs def --config path/to/codecept.json
228
+ npx codeceptjs def --config path/to/codecept.conf.js
227
229
  ```
228
230
 
229
231
  After doing that IDE should provide autocompletion for `I` object inside `Scenario` and `within` blocks.
@@ -9,11 +9,16 @@ editLink: false
9
9
 
10
10
  Here is the list of helpers created by our community.
11
11
  Please **add your own** by editing this page.
12
+ ## Webhooks
13
+
14
+ * [codeceptjs-webhook-helper](https://github.com/onemolegames/codeceptjs-webhook-helper) - to check webhook calls during the tests.
12
15
 
13
16
  ## Email Checking
14
17
 
15
18
  * [MailCatcher](https://gist.github.com/schmkr/026732dfa1627b927ff3a08dc31ee884) - to check emails via Mailcatcher locally.
16
19
  * [codeceptjs-mailhog-helper](https://github.com/tsuemura/codeceptjs-mailhog-helper) - to check emails via Mailhog locally.
20
+ * [codeceptjs-testmailapp-helper](https://github.com/pavkam/codeceptjs-testmailapp-helper) - to check emails via Testmail.app service.
21
+ * [codeceptjs-mailosaurhelper](https://github.com/yurkovychv/codeceptjs-mailosaur) - to check emails via [Mailosaur](https://mailosaur.com/) service.
17
22
 
18
23
  ## Data Sources
19
24
 
@@ -32,15 +37,13 @@ Please **add your own** by editing this page.
32
37
  ## Visual-Testing
33
38
  * [codeceptjs-resemblehelper](https://github.com/puneet0191/codeceptjs-resemblehelper) - a helper which helps with visual testing using resemble.js.
34
39
  * [codeceptjs-applitoolshelper](https://www.npmjs.com/package/codeceptjs-applitoolshelper) - a helper which helps interaction with [Applitools](https://applitools.com)
40
+ * [codeceptjs-pixelmatchhelper](https://github.com/stracker-phil/codeceptjs-pixelmatchhelper) - a helper that integrates pixelmatch for visual testing.
35
41
 
36
42
  ## Reporters
37
43
  * [codeceptjs-rphelper](https://github.com/reportportal/agent-js-codecept) is a CodeceptJS helper which can publish tests results on ReportPortal after execution.
38
44
  * [codeceptjs-xray-helper](https://www.npmjs.com/package/codeceptjs-xray-helper) is a CodeceptJS helper which can publish tests results on [XRAY](https://confluence.xpand-it.com/display/XRAYCLOUD/Import+Execution+Results+-+REST).
39
45
  * [codeceptjs-slack-reporter](https://www.npmjs.com/package/codeceptjs-slack-reporter) Get a Slack notification when one or more scenarios fail.
40
- * [codeceptjs-tesults](https://www.npmjs.com/package/codeceptjs-tesults) Report test results data from CodeceptJS to Tesults with this plugin.
41
-
42
- ## Page Object Code Generator
43
- * [codeceptjs-CodeGenerator](https://github.com/senthillkumar/CodeCeptJS-PageObject) is a CodeceptJS custom wrapper which can create page class with action methods from the page object file(JSON) and project setup(Folder Structure).
46
+ * [codeceptjs-browserlogs-plugin](https://github.com/pavkam/codeceptjs-browserlogs-plugin) Record the browser logs for failed tests.
44
47
 
45
48
  ## Browser request control
46
49
  * [codeceptjs-resources-check](https://github.com/luarmr/codeceptjs-resources-check) Load a URL with Puppeteer and listen to the requests while the page is loading. Enabling count the number or check the sizes of the requests.
@@ -11,8 +11,8 @@ After running `codeceptjs init` it should be saved in test root.
11
11
 
12
12
  | Name | Type | Description |
13
13
  | :------ | :------ | :------ |
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) |
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
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 |
@@ -24,8 +24,8 @@ After running `codeceptjs init` it should be saved in test root.
24
24
  | `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output' ``` |
25
25
  | `plugins?` | `any` | Enable CodeceptJS plugins. Example: ```plugins: { autoDelay: { enabled: true } } ``` |
26
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) |
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
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
30
  | `timeout?` | `number` | Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```timeout: 20, ``` |
31
31
  | `translation?` | `string` | Enable [localized test commands](https://codecept.io/translation/) |
@@ -99,7 +99,7 @@ exports.config = {
99
99
  dashboardPage: new DashboardPage()
100
100
  }
101
101
 
102
- // here goes config as it was in codecept.json
102
+ // here goes config as it was in codecept.conf.ts
103
103
  // ....
104
104
  };
105
105
  ```
package/docs/examples.md CHANGED
@@ -29,11 +29,35 @@ CodeceptJS repo contains basic tests (both failing and passing) just to show how
29
29
  Our team uses it to test new features and run simple scenarios.
30
30
 
31
31
 
32
- ## [Testing Single Page Application](https://github.com/bugiratracker/codeceptjs-demo)
32
+ ## [CodeceptJS Cucumber E2E Framework](https://github.com/gkushang/codeceptjs-e2e)
33
33
 
34
- ![](https://user-images.githubusercontent.com/220264/56353972-56975080-61db-11e9-8b23-06e8b4620995.png)
34
+ This repository contains complete E2E framework for CodeceptJS with Cucumber and SauceLabs Integration
35
35
 
36
- End 2 end tests for [Bugira Bugtracker](https://bugira.com) app built with Rails & EmberJS. Bugira is a SaaS application that helps collecting users' feedbacks and transforming them into professional bug reports.
36
+ * CodecepJS-Cucumber E2E Framework
37
+ * Saucelabs Integration
38
+ * Run Cross Browser tests in Parallel on SauceLabs with a simple command
39
+ * Run tests on `chrome:headless`
40
+ * Page Objects
41
+ * `Should.js` Assertion Library
42
+ * Uses `wdio` service (selenium-standalone, sauce)
43
+ * Allure HTML Reports
44
+ * Uses shared Master configuration
45
+ * Sample example and feature files of GitHub Features
46
+
47
+ ## [Enterprise Grade Tests](https://github.com/uc-cdis/gen3-qa)
48
+
49
+ Complex testing solution by [Gen3](https://github.com/uc-cdis/gen3-qa)
50
+
51
+ Includes
52
+
53
+ * classical CodeceptJS tests
54
+ * BDD tests
55
+ * Jenkins integration
56
+ * Complex Before/BeforeSuite scripts and more
57
+
58
+ ## [Testing Single Page Application](https://github.com/bugiratracker/codeceptjs-demo)
59
+
60
+ End 2 end tests for Task management app (currently offline).
37
61
 
38
62
  Tests repository demonstrate usage of
39
63
 
@@ -52,21 +76,6 @@ This repository demonstrates usage of:
52
76
  * testing WYSIWYG editor
53
77
  * GitLab CI
54
78
 
55
- ## [CodeceptJS Cucumber E2E Framework](https://github.com/gkushang/codeceptjs-e2e)
56
-
57
- This repository contains complete E2E framework for CodeceptJS with Cucumber and SauceLabs Integration
58
-
59
- * CodecepJS-Cucumber E2E Framework
60
- * Saucelabs Integration
61
- * Run Cross Browser tests in Parallel on SauceLabs with a simple command
62
- * Run tests on `chrome:headless`
63
- * Page Objects
64
- * `Should.js` Assertion Library
65
- * Uses `wdio` service (selenium-standalone, sauce)
66
- * Allure HTML Reports
67
- * Uses shared Master configuration
68
- * Sample example and feature files of GitHub Features
69
-
70
79
  ## [Amazon Tests v2](https://gitlab.com/thanhnguyendh/codeceptjs-wdio-services)
71
80
 
72
81
  Testing Amazon website using Selenium WebDriver.
@@ -79,17 +88,6 @@ This repository demonstrates usage of:
79
88
  * Parallel execution
80
89
  * GitLab CI setup
81
90
 
82
- ## [Amazon Tests v1](https://github.com/PeterNgTr/amazon-ui-tests)
83
-
84
- Previous version of Amazon Tests, still valid but quite different.
85
-
86
- This repository demonstrates usage of:
87
-
88
- * WebDriver helper
89
- * Page Objects
90
- * Bootstrap and teardown
91
- * Parallel execution
92
-
93
91
  ## [Tests with Docker Compose](https://github.com/mathesouza/codeceptjs-docker-compose)
94
92
 
95
93
  Running CodeceptJS tests with Docker Compose
@@ -101,17 +99,6 @@ This repository demonstrates usage of:
101
99
  * Allure plugin
102
100
 
103
101
 
104
- ## [ModusCreate Tests](https://github.com/ModusCreateOrg/codeceptjs-nightmare-harness)
105
-
106
- Test automation by ModusCreate agency with NightmareJS.
107
-
108
- This repository demonstrates usage of:
109
-
110
- * Nightmare helper
111
- * Reports with Mochawesome
112
- * Docker
113
- * Page objects and page fragments
114
-
115
102
  ## [AngularJS Example Tests](https://github.com/armno/angular-e2e-codeceptjs-example)
116
103
 
117
104
  Based on [Setting up End-to-End Testing in Angular Project with CodeceptJS](https://medium.com/@armno/setting-up-end-to-end-testing-in-angular-project-with-codeceptjs-ac1784de3420) post by Armno Prommarak.
@@ -147,12 +134,16 @@ This is a ready to use example that shows how to integrate CodeceptJS with Puppe
147
134
  * examples for sequential and parallel execution
148
135
  * generation of allure test results
149
136
 
150
- ## [Framework with UI and API test support : CodeceptJS , Puppeteer , REST , ESLint](https://github.com/avighub/CodeceptJS-puppeteer)
151
- This is a basic framework with Puppeteer , REST helpers which can support both UI and API actions within same test.
152
- More improvements and features will be added and will be updated.
153
- Suggestions and improvements are welcome , please raise a ticket in Issue tab.
137
+ ## [Example for Advanced REST API testing: TypeScript, Axios, CodeceptJS, Jest Expect, Docker, Allure, Mock-Server, Prettier + Eslint, pre-commit, Jest Unit Tests ](https://github.com/EgorBodnar/rest-axios-codeceptjs-allure-docker-test-example)
138
+ One button example with built-in mocked backend.
139
+
140
+ If you already have a UI testing solution based on the CodeceptJS and you need to implement advanced REST API testing you can just extend your existing framework. Use this implementation as an example.
141
+ This is necessary if all integrations with TMS and CI/CD are already configured, and you do not want to reconnect and configure the plugins and libraries used for the new test runner. Use CodeceptJS!
154
142
 
155
- * Step by step setup in README
156
- * Two helpers are added. UI - Puppeteer , API - REST and chai-codeceptJS for assetion
157
- * ESLint for code check
158
- * Upcoming : API generic functions , Adaptor design pattern , More utilities
143
+ * Easy run
144
+ * Detailed README
145
+ * Well documented mocked backend's REST API endpoints
146
+ * HTTP request client with session support and unit tests
147
+ * Exemplary code control
148
+ * Ready to launch in a CI/CD system as is
149
+ * OOP, Test data models and builders, endpoint decorators
@@ -23,7 +23,7 @@ Launch the daemon: `appium`
23
23
 
24
24
  ## Helper configuration
25
25
 
26
- This helper should be configured in codecept.json or codecept.conf.js
26
+ This helper should be configured in codecept.conf.ts or codecept.conf.js
27
27
 
28
28
  - `app`: Application path. Local path or remote URL to an .ipa or .apk file, or a .zip containing one of these. Alias to desiredCapabilities.appPackage
29
29
  - `host`: (default: 'localhost') Appium host
@@ -433,12 +433,14 @@ Start an arbitrary Android activity during a session.
433
433
  I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
434
434
  ```
435
435
 
436
+ Appium: support only Android
437
+
436
438
  #### Parameters
437
439
 
438
- - `appPackage`
439
- - `appActivity`
440
+ - `appPackage` **[string][4]**
441
+ - `appActivity` **[string][4]**
440
442
 
441
- Returns **[Promise][5]&lt;void>** Appium: support only Android
443
+ Returns **[Promise][5]&lt;void>**
442
444
 
443
445
  ### setNetworkConnection
444
446
 
@@ -822,7 +824,7 @@ I.appendField('#myTextField', 'appended');
822
824
 
823
825
  - `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator
824
826
  - `value` **[string][4]** text value to append.
825
- [!] returns a _promise_ which is synchronized internally by recorder
827
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
826
828
 
827
829
  ### checkOption
828
830
 
@@ -841,7 +843,7 @@ I.checkOption('agree', '//form');
841
843
 
842
844
  - `field` **([string][4] \| [object][8])** checkbox located by label | name | CSS | XPath | strict locator.
843
845
  - `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS | XPath | strict locator.
844
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
846
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
845
847
 
846
848
  ### click
847
849
 
@@ -871,7 +873,7 @@ I.click({css: 'nav a.login'});
871
873
 
872
874
  - `locator` **([string][4] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
873
875
  - `context` **([string][4]? | [object][8] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
874
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
876
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
875
877
 
876
878
  ### dontSeeCheckboxIsChecked
877
879
 
@@ -886,7 +888,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
886
888
  #### Parameters
887
889
 
888
890
  - `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
889
- [!] returns a _promise_ which is synchronized internally by recorder
891
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
890
892
 
891
893
  ### dontSeeElement
892
894
 
@@ -899,7 +901,7 @@ I.dontSeeElement('.modal'); // modal is not shown
899
901
  #### Parameters
900
902
 
901
903
  - `locator` **([string][4] \| [object][8])** located by CSS|XPath|Strict locator.
902
- [!] returns a _promise_ which is synchronized internally by recorder
904
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
903
905
 
904
906
  ### dontSeeInField
905
907
 
@@ -915,7 +917,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
915
917
 
916
918
  - `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
917
919
  - `value` **[string][4]** value to check.
918
- [!] returns a _promise_ which is synchronized internally by recorder
920
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
919
921
 
920
922
  ### dontSee
921
923
 
@@ -931,7 +933,7 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
931
933
 
932
934
  - `text` **[string][4]** which is not present.
933
935
  - `context` **([string][4] \| [object][8])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
934
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
936
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
935
937
 
936
938
  ### fillField
937
939
 
@@ -953,7 +955,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
953
955
 
954
956
  - `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
955
957
  - `value` **([string][4] \| [object][8])** text value to fill.
956
- [!] returns a _promise_ which is synchronized internally by recorder
958
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
957
959
 
958
960
  ### grabTextFromAll
959
961
 
@@ -1071,7 +1073,7 @@ Returns **[Promise][5]&lt;[string][4]>** attribute value
1071
1073
 
1072
1074
  ### saveScreenshot
1073
1075
 
1074
- Saves a screenshot to ouput folder (set in codecept.json or codecept.conf.js).
1076
+ Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
1075
1077
  Filename is relative to output folder.
1076
1078
 
1077
1079
  ```js
@@ -1098,7 +1100,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
1098
1100
 
1099
1101
  - `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
1100
1102
  - `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][15].
1101
- [!] returns a _promise_ which is synchronized internally by recorderSupported only for web testing
1103
+ ⚠️ returns a _promise_ which is synchronized internally by recorderSupported only for web testing
1102
1104
 
1103
1105
  ### seeCheckboxIsChecked
1104
1106
 
@@ -1113,7 +1115,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
1113
1115
  #### Parameters
1114
1116
 
1115
1117
  - `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
1116
- [!] returns a _promise_ which is synchronized internally by recorder
1118
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
1117
1119
 
1118
1120
  ### seeElement
1119
1121
 
@@ -1127,7 +1129,7 @@ I.seeElement('#modal');
1127
1129
  #### Parameters
1128
1130
 
1129
1131
  - `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
1130
- [!] returns a _promise_ which is synchronized internally by recorder
1132
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
1131
1133
 
1132
1134
  ### seeInField
1133
1135
 
@@ -1145,7 +1147,7 @@ I.seeInField('#searchform input','Search');
1145
1147
 
1146
1148
  - `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
1147
1149
  - `value` **[string][4]** value to check.
1148
- [!] returns a _promise_ which is synchronized internally by recorder
1150
+ ⚠️ returns a _promise_ which is synchronized internally by recorder
1149
1151
 
1150
1152
  ### see
1151
1153
 
@@ -1162,7 +1164,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator
1162
1164
 
1163
1165
  - `text` **[string][4]** expected on page.
1164
1166
  - `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
1165
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
1167
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
1166
1168
 
1167
1169
  ### selectOption
1168
1170
 
@@ -1189,7 +1191,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
1189
1191
 
1190
1192
  - `select` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
1191
1193
  - `option` **([string][4] \| [Array][6]&lt;any>)** visible text or value of option.
1192
- [!] returns a _promise_ which is synchronized internally by recorderSupported only for web testing
1194
+ ⚠️ returns a _promise_ which is synchronized internally by recorderSupported only for web testing
1193
1195
 
1194
1196
  ### waitForElement
1195
1197
 
@@ -1205,7 +1207,7 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
1205
1207
 
1206
1208
  - `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
1207
1209
  - `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
1208
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
1210
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
1209
1211
 
1210
1212
  ### waitForVisible
1211
1213
 
@@ -1220,7 +1222,7 @@ I.waitForVisible('#popup');
1220
1222
 
1221
1223
  - `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
1222
1224
  - `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
1223
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
1225
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
1224
1226
 
1225
1227
  ### waitForInvisible
1226
1228
 
@@ -1235,7 +1237,7 @@ I.waitForInvisible('#popup');
1235
1237
 
1236
1238
  - `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
1237
1239
  - `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
1238
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
1240
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
1239
1241
 
1240
1242
  ### waitForText
1241
1243
 
@@ -1253,7 +1255,7 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
1253
1255
  - `text` **[string][4]** to wait for.
1254
1256
  - `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
1255
1257
  - `context` **([string][4] \| [object][8])?** (optional) element located by CSS|XPath|strict locator.
1256
- [!] returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
1258
+ ⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
1257
1259
 
1258
1260
  [1]: http://codecept.io/helpers/WebDriver/
1259
1261
 
@@ -16,7 +16,7 @@ Can be easily used to check file structures:
16
16
 
17
17
  ```js
18
18
  I.amInPath('test');
19
- I.seeFile('codecept.json');
19
+ I.seeFile('codecept.js');
20
20
  I.seeInThisFile('FileSystem');
21
21
  I.dontSeeInThisFile("WebDriver");
22
22
  ```