codeceptjs 3.5.12-beta.2 → 3.5.12-beta.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 (213) hide show
  1. package/lib/locator.js +7 -12
  2. package/package.json +3 -5
  3. package/docs/advanced.md +0 -351
  4. package/docs/ai.md +0 -248
  5. package/docs/api.md +0 -323
  6. package/docs/basics.md +0 -979
  7. package/docs/bdd.md +0 -539
  8. package/docs/best.md +0 -237
  9. package/docs/books.md +0 -37
  10. package/docs/bootstrap.md +0 -135
  11. package/docs/build/ApiDataFactory.js +0 -410
  12. package/docs/build/Appium.js +0 -2027
  13. package/docs/build/Expect.js +0 -422
  14. package/docs/build/FileSystem.js +0 -228
  15. package/docs/build/GraphQL.js +0 -229
  16. package/docs/build/GraphQLDataFactory.js +0 -309
  17. package/docs/build/JSONResponse.js +0 -338
  18. package/docs/build/Mochawesome.js +0 -71
  19. package/docs/build/Nightmare.js +0 -2152
  20. package/docs/build/OpenAI.js +0 -126
  21. package/docs/build/Playwright.js +0 -5110
  22. package/docs/build/Protractor.js +0 -2706
  23. package/docs/build/Puppeteer.js +0 -3905
  24. package/docs/build/REST.js +0 -344
  25. package/docs/build/TestCafe.js +0 -2125
  26. package/docs/build/WebDriver.js +0 -4240
  27. package/docs/changelog.md +0 -2572
  28. package/docs/commands.md +0 -266
  29. package/docs/community-helpers.md +0 -58
  30. package/docs/configuration.md +0 -157
  31. package/docs/continuous-integration.md +0 -22
  32. package/docs/custom-helpers.md +0 -306
  33. package/docs/data.md +0 -379
  34. package/docs/detox.md +0 -235
  35. package/docs/docker.md +0 -136
  36. package/docs/email.md +0 -183
  37. package/docs/examples.md +0 -149
  38. package/docs/helpers/ApiDataFactory.md +0 -266
  39. package/docs/helpers/Appium.md +0 -1374
  40. package/docs/helpers/Detox.md +0 -586
  41. package/docs/helpers/Expect.md +0 -275
  42. package/docs/helpers/FileSystem.md +0 -152
  43. package/docs/helpers/GraphQL.md +0 -151
  44. package/docs/helpers/GraphQLDataFactory.md +0 -226
  45. package/docs/helpers/JSONResponse.md +0 -254
  46. package/docs/helpers/Mochawesome.md +0 -8
  47. package/docs/helpers/MockRequest.md +0 -377
  48. package/docs/helpers/Nightmare.md +0 -1305
  49. package/docs/helpers/OpenAI.md +0 -70
  50. package/docs/helpers/Playwright.md +0 -2759
  51. package/docs/helpers/Polly.md +0 -44
  52. package/docs/helpers/Protractor.md +0 -1769
  53. package/docs/helpers/Puppeteer-firefox.md +0 -86
  54. package/docs/helpers/Puppeteer.md +0 -2317
  55. package/docs/helpers/REST.md +0 -218
  56. package/docs/helpers/TestCafe.md +0 -1321
  57. package/docs/helpers/WebDriver.md +0 -2547
  58. package/docs/hooks.md +0 -340
  59. package/docs/index.md +0 -111
  60. package/docs/installation.md +0 -75
  61. package/docs/internal-api.md +0 -266
  62. package/docs/locators.md +0 -339
  63. package/docs/mobile-react-native-locators.md +0 -67
  64. package/docs/mobile.md +0 -338
  65. package/docs/pageobjects.md +0 -291
  66. package/docs/parallel.md +0 -400
  67. package/docs/playwright.md +0 -632
  68. package/docs/plugins.md +0 -1259
  69. package/docs/puppeteer.md +0 -316
  70. package/docs/quickstart.md +0 -162
  71. package/docs/react.md +0 -70
  72. package/docs/reports.md +0 -392
  73. package/docs/secrets.md +0 -36
  74. package/docs/shadow.md +0 -68
  75. package/docs/shared/keys.mustache +0 -31
  76. package/docs/shared/react.mustache +0 -1
  77. package/docs/testcafe.md +0 -174
  78. package/docs/translation.md +0 -247
  79. package/docs/tutorial.md +0 -271
  80. package/docs/typescript.md +0 -180
  81. package/docs/ui.md +0 -59
  82. package/docs/videos.md +0 -28
  83. package/docs/visual.md +0 -202
  84. package/docs/vue.md +0 -143
  85. package/docs/webapi/amOnPage.mustache +0 -11
  86. package/docs/webapi/appendField.mustache +0 -11
  87. package/docs/webapi/attachFile.mustache +0 -12
  88. package/docs/webapi/blur.mustache +0 -18
  89. package/docs/webapi/checkOption.mustache +0 -13
  90. package/docs/webapi/clearCookie.mustache +0 -9
  91. package/docs/webapi/clearField.mustache +0 -9
  92. package/docs/webapi/click.mustache +0 -25
  93. package/docs/webapi/clickLink.mustache +0 -8
  94. package/docs/webapi/closeCurrentTab.mustache +0 -7
  95. package/docs/webapi/closeOtherTabs.mustache +0 -8
  96. package/docs/webapi/dontSee.mustache +0 -11
  97. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
  98. package/docs/webapi/dontSeeCookie.mustache +0 -8
  99. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
  100. package/docs/webapi/dontSeeElement.mustache +0 -8
  101. package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
  102. package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
  103. package/docs/webapi/dontSeeInField.mustache +0 -11
  104. package/docs/webapi/dontSeeInSource.mustache +0 -8
  105. package/docs/webapi/dontSeeInTitle.mustache +0 -8
  106. package/docs/webapi/doubleClick.mustache +0 -13
  107. package/docs/webapi/downloadFile.mustache +0 -12
  108. package/docs/webapi/dragAndDrop.mustache +0 -9
  109. package/docs/webapi/dragSlider.mustache +0 -11
  110. package/docs/webapi/executeAsyncScript.mustache +0 -24
  111. package/docs/webapi/executeScript.mustache +0 -26
  112. package/docs/webapi/fillField.mustache +0 -16
  113. package/docs/webapi/focus.mustache +0 -13
  114. package/docs/webapi/forceClick.mustache +0 -28
  115. package/docs/webapi/forceRightClick.mustache +0 -18
  116. package/docs/webapi/grabAllWindowHandles.mustache +0 -7
  117. package/docs/webapi/grabAttributeFrom.mustache +0 -10
  118. package/docs/webapi/grabAttributeFromAll.mustache +0 -9
  119. package/docs/webapi/grabBrowserLogs.mustache +0 -9
  120. package/docs/webapi/grabCookie.mustache +0 -11
  121. package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
  122. package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
  123. package/docs/webapi/grabCurrentUrl.mustache +0 -9
  124. package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
  125. package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
  126. package/docs/webapi/grabElementBoundingRect.mustache +0 -20
  127. package/docs/webapi/grabGeoLocation.mustache +0 -8
  128. package/docs/webapi/grabHTMLFrom.mustache +0 -10
  129. package/docs/webapi/grabHTMLFromAll.mustache +0 -9
  130. package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
  131. package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
  132. package/docs/webapi/grabPageScrollPosition.mustache +0 -8
  133. package/docs/webapi/grabPopupText.mustache +0 -5
  134. package/docs/webapi/grabSource.mustache +0 -8
  135. package/docs/webapi/grabTextFrom.mustache +0 -10
  136. package/docs/webapi/grabTextFromAll.mustache +0 -9
  137. package/docs/webapi/grabTitle.mustache +0 -8
  138. package/docs/webapi/grabValueFrom.mustache +0 -9
  139. package/docs/webapi/grabValueFromAll.mustache +0 -8
  140. package/docs/webapi/grabWebElement.mustache +0 -9
  141. package/docs/webapi/grabWebElements.mustache +0 -9
  142. package/docs/webapi/moveCursorTo.mustache +0 -12
  143. package/docs/webapi/openNewTab.mustache +0 -7
  144. package/docs/webapi/pressKey.mustache +0 -12
  145. package/docs/webapi/pressKeyDown.mustache +0 -12
  146. package/docs/webapi/pressKeyUp.mustache +0 -12
  147. package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
  148. package/docs/webapi/refreshPage.mustache +0 -6
  149. package/docs/webapi/resizeWindow.mustache +0 -6
  150. package/docs/webapi/rightClick.mustache +0 -14
  151. package/docs/webapi/saveElementScreenshot.mustache +0 -10
  152. package/docs/webapi/saveScreenshot.mustache +0 -12
  153. package/docs/webapi/say.mustache +0 -10
  154. package/docs/webapi/scrollIntoView.mustache +0 -11
  155. package/docs/webapi/scrollPageToBottom.mustache +0 -6
  156. package/docs/webapi/scrollPageToTop.mustache +0 -6
  157. package/docs/webapi/scrollTo.mustache +0 -12
  158. package/docs/webapi/see.mustache +0 -11
  159. package/docs/webapi/seeAttributesOnElements.mustache +0 -9
  160. package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
  161. package/docs/webapi/seeCookie.mustache +0 -8
  162. package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
  163. package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
  164. package/docs/webapi/seeElement.mustache +0 -8
  165. package/docs/webapi/seeElementInDOM.mustache +0 -8
  166. package/docs/webapi/seeInCurrentUrl.mustache +0 -8
  167. package/docs/webapi/seeInField.mustache +0 -12
  168. package/docs/webapi/seeInPopup.mustache +0 -8
  169. package/docs/webapi/seeInSource.mustache +0 -7
  170. package/docs/webapi/seeInTitle.mustache +0 -8
  171. package/docs/webapi/seeNumberOfElements.mustache +0 -11
  172. package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
  173. package/docs/webapi/seeTextEquals.mustache +0 -9
  174. package/docs/webapi/seeTitleEquals.mustache +0 -8
  175. package/docs/webapi/selectOption.mustache +0 -21
  176. package/docs/webapi/setCookie.mustache +0 -16
  177. package/docs/webapi/setGeoLocation.mustache +0 -12
  178. package/docs/webapi/switchTo.mustache +0 -9
  179. package/docs/webapi/switchToNextTab.mustache +0 -10
  180. package/docs/webapi/switchToPreviousTab.mustache +0 -10
  181. package/docs/webapi/type.mustache +0 -21
  182. package/docs/webapi/uncheckOption.mustache +0 -13
  183. package/docs/webapi/wait.mustache +0 -8
  184. package/docs/webapi/waitForClickable.mustache +0 -11
  185. package/docs/webapi/waitForDetached.mustache +0 -10
  186. package/docs/webapi/waitForElement.mustache +0 -11
  187. package/docs/webapi/waitForEnabled.mustache +0 -6
  188. package/docs/webapi/waitForFunction.mustache +0 -17
  189. package/docs/webapi/waitForInvisible.mustache +0 -10
  190. package/docs/webapi/waitForNumberOfTabs.mustache +0 -9
  191. package/docs/webapi/waitForText.mustache +0 -13
  192. package/docs/webapi/waitForValue.mustache +0 -10
  193. package/docs/webapi/waitForVisible.mustache +0 -10
  194. package/docs/webapi/waitInUrl.mustache +0 -9
  195. package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
  196. package/docs/webapi/waitToHide.mustache +0 -10
  197. package/docs/webapi/waitUrlEquals.mustache +0 -10
  198. package/docs/webdriver.md +0 -701
  199. package/docs/wiki/Books-&-Posts.md +0 -27
  200. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -53
  201. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -61
  202. package/docs/wiki/Examples.md +0 -145
  203. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  204. package/docs/wiki/Home.md +0 -16
  205. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +0 -83
  206. package/docs/wiki/Release-Process.md +0 -24
  207. package/docs/wiki/Roadmap.md +0 -23
  208. package/docs/wiki/Tests.md +0 -1393
  209. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  210. package/docs/wiki/Videos.md +0 -19
  211. package/lib/css2xpath/js/css_to_xpath.js +0 -20
  212. package/lib/css2xpath/js/expression.js +0 -23
  213. package/lib/css2xpath/js/renderer.js +0 -239
package/docs/commands.md DELETED
@@ -1,266 +0,0 @@
1
- ---
2
- permalink: /commands
3
- title: Commands
4
- ---
5
-
6
- # Commands
7
-
8
- ## Run
9
-
10
- Executes tests. Requires `codecept.conf.js` config to be present in provided path.
11
-
12
- ---
13
-
14
- Run all tests from current dir
15
-
16
- ```sh
17
- npx codeceptjs run
18
- ```
19
-
20
- Load config and run tests from `test` dir
21
-
22
- ```sh
23
- npx codeceptjs run -c test
24
- ```
25
-
26
- Run only tests with "signin" word in name
27
-
28
- ```sh
29
- npx codeceptjs run --grep "signin"
30
- ```
31
-
32
- Run all tests without "@IEOnly" word in name
33
-
34
- ```sh
35
- npx codeceptjs run --grep "@IEOnly" --invert
36
- ```
37
-
38
- Run single test [path to codecept.js] [test filename]
39
-
40
- ```sh
41
- npx codeceptjs run github_test.js
42
- ```
43
-
44
- Run single test with steps printed
45
-
46
- ```sh
47
- npx codeceptjs run github_test.js --steps
48
- ```
49
-
50
- Run single test in debug mode (see more in [debugging](#Debugging) section)
51
-
52
- ```sh
53
- npx codeceptjs run github_test.js --debug
54
- ```
55
-
56
- Select config file manually (`-c` or `--config` option)
57
-
58
- ```sh
59
- npx codeceptjs run -c my.codecept.conf.js
60
- npx codeceptjs run --config path/to/codecept.conf.js
61
- ```
62
-
63
- Override config on the fly. Provide valid JSON which will be merged into current config:
64
-
65
- ```sh
66
- npx codeceptjs run --override '{ "helpers": {"WebDriver": {"browser": "chrome"}}}'
67
- ```
68
-
69
- Run tests and produce xunit report:
70
-
71
- ```sh
72
- npx codeceptjs run --reporter xunit
73
- ```
74
-
75
- Use any of [Mocha reporters](https://github.com/mochajs/mocha/tree/master/lib/reporters) used.
76
-
77
- #### Debugging
78
-
79
- Run single test in debug mode
80
-
81
- ```sh
82
- npx codeceptjs run --debug
83
- ```
84
-
85
- Run test with internal logs printed.
86
-
87
- ```sh
88
- npx codeceptjs run --verbose
89
- ```
90
-
91
- Display complete debug output including scheduled promises
92
-
93
- ```
94
- DEBUG=codeceptjs:* npx codeceptjs run
95
- ```
96
-
97
- ## Run Workers
98
-
99
- Run tests in parallel threads.
100
-
101
- ```
102
- npx codeceptjs run-workers 3
103
- ```
104
-
105
- ## Run Rerun <Badge text="Since 3.3.6" type="warning"/>
106
-
107
- Run tests multiple times to detect and fix flaky tests.
108
-
109
- ```
110
- npx codeceptjs run-rerun
111
- ```
112
-
113
- For this command configuration is required:
114
-
115
- ```js
116
- {
117
- // inside codecept.conf.js
118
- rerun: {
119
- // how many times all tests should pass
120
- minSuccess: 2,
121
-
122
- // how many times to try to rerun all tests
123
- maxReruns: 4,
124
- }
125
- }
126
- ```
127
-
128
- Use Cases:
129
-
130
- * `minSuccess: 1, maxReruns: 5` - run all tests no more than 5 times, until first successful run.
131
- * `minSuccess: 3, maxReruns: 5` - run all tests no more than 5 times, until reaching 3 successfull runs.
132
- * `minSuccess: 10, maxReruns: 10` - run all tests exactly 10 times, to check their stability.
133
-
134
-
135
- ## Dry Run
136
-
137
- Prints test scenarios without executing them
138
-
139
- ```
140
- npx codeceptjs dry-run
141
- ```
142
-
143
- When passed `--steps` or `--debug` option runs tests, disabling all plugins and helpers, so you can get step-by-step report with no tests actually executed.
144
-
145
- ```
146
- npx codeceptjs dry-run --steps
147
- ```
148
-
149
- If a plugin needs to be enabled in `dry-run` mode, pass its name in `-p` option:
150
-
151
- ```
152
- npx codeceptjs dry-run --steps -p allure
153
- ```
154
-
155
- If some plugins need to be enabled in `dry-run` mode, pass its name in `-p` option:
156
-
157
- ```
158
- npx codeceptjs dry-run --steps -p allure,customLocator
159
- ```
160
-
161
- If all plugins need to be enabled in `dry-run` mode, pass its name in `-p` option:
162
-
163
- ```
164
- npx codeceptjs dry-run --steps -p all
165
- ```
166
-
167
- To enable bootstrap script in dry-run mode, pass in `--bootstrap` option when running with `--steps` or `--debug`
168
-
169
- ```
170
- npx codeceptjs dry-run --steps --bootstrap
171
- ```
172
-
173
- ## Run Multiple
174
-
175
- > ⚠️ prefer using run-workers instead
176
-
177
- Run multiple suites. Unlike `run-workers` spawns processes to execute tests.
178
- [Requires additional configuration](/advanced#multiple-browsers-execution) and can be used to execute tests in multiple browsers.
179
-
180
- ```sh
181
- npx codeceptjs run-multiple smoke:chrome regression:firefox
182
- ```
183
-
184
- ## Init
185
-
186
- Creates `codecept.conf.js` file in current directory:
187
-
188
- ```sh
189
- npx codeceptjs init
190
- ```
191
-
192
- Or in provided path
193
-
194
- ```sh
195
- npx codecept init test
196
- ```
197
-
198
- ## Migrate
199
-
200
- Migrate your current `codecept.json` to `codecept.conf.js`
201
-
202
- ```sh
203
- npx codeceptjs migrate
204
- ```
205
-
206
- ## Shell
207
-
208
- Interactive shell. Allows to try `I.` commands in runtime
209
-
210
- ```sh
211
- npx codeceptjs shell
212
- ```
213
-
214
- ## Generators
215
-
216
- Create new test
217
-
218
- ```sh
219
- npx codeceptjs generate:test
220
- ```
221
-
222
- Create new pageobject
223
-
224
- ```sh
225
- npx codeceptjs generate:pageobject
226
- ```
227
-
228
- Create new helper
229
-
230
- ```sh
231
- npx codeceptjs generate:helper
232
- ```
233
-
234
- ## TypeScript Definitions
235
-
236
- TypeScript Definitions allows IDEs to provide autocompletion when writing tests.
237
-
238
- ```sh
239
- npx codeceptjs def
240
- npx codeceptjs def --config path/to/codecept.conf.js
241
- ```
242
-
243
- After doing that IDE should provide autocompletion for `I` object inside `Scenario` and `within` blocks.
244
-
245
- Add optional parameter `output` (or shortcut `-o`), if you want to place your definition file in specific folder:
246
-
247
- ```sh
248
- npx codeceptjs def --output ./tests/typings
249
- npx codeceptjs def -o ./tests/typings
250
- ```
251
-
252
- ## List Commands
253
-
254
- Prints all available methods of `I` to console
255
-
256
- ```sh
257
- npx codeceptjs list
258
- ```
259
-
260
- ## Local Environment Information
261
-
262
- Prints debugging information concerning the local environment
263
-
264
- ```sh
265
- npx codeceptjs info
266
- ```
@@ -1,58 +0,0 @@
1
- ---
2
- permalink: /community-helpers
3
- title: Community Helpers
4
- editLink: false
5
- ---
6
-
7
- # Community Helpers
8
- > Share your helpers at our [Wiki Page](https://github.com/codeceptjs/CodeceptJS/wiki/Community-Helpers)
9
-
10
- Here is the list of helpers created by our community.
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.
15
-
16
- ## Email Checking
17
-
18
- * [MailCatcher](https://gist.github.com/schmkr/026732dfa1627b927ff3a08dc31ee884) - to check emails via Mailcatcher locally.
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.
22
-
23
- ## Data Sources
24
-
25
- * [codeceptjs-httpmock](https://github.com/testphony/codeceptjs-httpMock) - a helper which wraps mockttp library to manage http mock in tests.
26
- * [codeceptjs-http](https://github.com/testphony/codeceptjs-http) - a helper which wraps then-request library to process HTTP requests. It's alternative helper that provides more flexible request management.
27
- * [codeceptjs-dbhelper](https://github.com/thiagodp/codeceptjs-dbhelper) - allows you to execute queries or commands to databases using database-js.
28
-
29
- ## Cloud Providers
30
- * [codeceptjs-saucehelper](https://github.com/puneet0191/codeceptjs-saucehelper/) - a helper which updates `Test Names` & `Test Results` on Saucelabs
31
- * [codeceptjs-bshelper](https://github.com/PeterNgTr/codeceptjs-bshelper) - a helper which updates `Test Names` & `Test Results` on Browserstack
32
- * [codeceptjs-tbhelper](https://github.com/testingbot/codeceptjs-tbhelper) - a helper which updates `Test Names` & `Test Results` on TestingBot
33
-
34
- ## Integrations
35
- * [codeceptjs-testrail](https://github.com/PeterNgTr/codeceptjs-testrail) - a plugin to integrate with [Testrail](https://www.gurock.com/testrail)
36
-
37
- ## Visual-Testing
38
- * [codeceptjs-resemblehelper](https://github.com/puneet0191/codeceptjs-resemblehelper) - a helper which helps with visual testing using resemble.js.
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.
41
-
42
- ## Reporters
43
- * [codeceptjs-rphelper](https://github.com/reportportal/agent-js-codecept) is a CodeceptJS helper which can publish tests results on ReportPortal after execution.
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).
45
- * [codeceptjs-slack-reporter](https://www.npmjs.com/package/codeceptjs-slack-reporter) Get a Slack notification when one or more scenarios fail.
46
- * [codeceptjs-browserlogs-plugin](https://github.com/pavkam/codeceptjs-browserlogs-plugin) Record the browser logs for failed tests.
47
-
48
- ## Browser request control
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.
50
-
51
- ## Assertion & Validations
52
- * [codeceptjs-chai](https://www.npmjs.com/package/codeceptjs-chai) is a CodeceptJS helper which wraps
53
- [chai](https://www.chaijs.com/) library to complete chai assertion steps with CodeceptJS logging.
54
-
55
- ## Other
56
-
57
- * [codeceptjs-cmdhelper](https://github.com/thiagodp/codeceptjs-cmdhelper) allows you to run commands in the terminal/console
58
- * [eslint-plugin-codeceptjs](https://www.npmjs.com/package/eslint-plugin-codeceptjs) Eslint rules for CodeceptJS.
@@ -1,157 +0,0 @@
1
- ---
2
- permalink: /configuration
3
- title: Configuration
4
- ---
5
-
6
- # Configuration
7
-
8
- CodeceptJS configuration is set in `codecept.conf.js` file.
9
-
10
- After running `codeceptjs init` it should be saved in test root.
11
-
12
- | Name | Type | Description |
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) |
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
- | `gherkin.features` | `string` \| `string`[] | load feature files by pattern. Multiple patterns can be specified as array |
18
- | `gherkin.steps` | `string`[] | load step definitions from JS files |
19
- | `grep?` | `string` | Pattern to filter tests by name. This option is useful if you plan to use multiple configs for different environments. To execute only tests with @firefox tag use ```grep: '@firefox' ``` |
20
- | `helpers?` | {} | Enable and configure helpers: ```helpers: { Playwright: { url: 'https://mysite.com', browser: 'firefox' } } ``` |
21
- | `include?` | `any` | Include page objects to access them via dependency injection ```I: "./custom_steps.js", loginPage: "./pages/Login.js", User: "./pages/User.js", ``` Configured modules can be injected by name in a Scenario: ```Scenario('test', { I, loginPage, User }) ``` |
22
- | `mocha?` | `any` | [Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here. Example: ```mocha: { "mocha-junit-reporter": { stdout: "./output/console.log", options: { mochaFile: "./output/result.xml", attachments: true //add screenshot for a failed test } } } ``` |
23
- | `noGlobals?` | `boolean` | Disable registering global functions (Before, Scenario, etc). Not recommended |
24
- | `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output' ``` |
25
- | `plugins?` | `any` | Enable CodeceptJS plugins. Example: ```plugins: { autoDelay: { enabled: true } } ``` |
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) |
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
- | `timeout?` | `number` | Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```timeout: 20, ``` |
31
- | `translation?` | `string` | Enable [localized test commands](https://codecept.io/translation/) |
32
-
33
-
34
- ## Require
35
-
36
- Requires described module before run. This option is useful for assertion libraries, so you may `--require should` instead of manually invoking `require('should')` within each test file. It can be used with relative paths, e.g. `"require": ["/lib/somemodule"]`, and installed packages.
37
-
38
- You can register ts-node, so you can use Typescript in tests with ts-node package
39
- ```js
40
- exports.config = {
41
- tests: './*_test.js',
42
- timeout: 10000,
43
- output: '',
44
- helpers: {},
45
- include: {},
46
- bootstrap: false,
47
- mocha: {},
48
- // require modules
49
- require: ["ts-node/register", "should"]
50
- }
51
- ```
52
- For array of test pattern
53
- ```js
54
- exports.config = {
55
- tests: ['./*_test.js','./sampleTest.js'],
56
- timeout: 10000,
57
- output: '',
58
- helpers: {},
59
- include: {},
60
- bootstrap: false,
61
- mocha: {},
62
- // require modules
63
- require: ["ts-node/register", "should"]
64
- }
65
- ```
66
- ## Dynamic Configuration
67
-
68
- By default `codecept.json` is used for configuration. You can override its values in runtime by using `--override` or `-o` option in command line, passing valid JSON as a value:
69
-
70
- ```sh
71
- codeceptjs run -o '{ "helpers": {"WebDriver": {"browser": "firefox"}}}'
72
- ```
73
-
74
- You can also switch to JS configuration format for more dynamic options.
75
- Create `codecept.conf.js` file and make it export `config` property.
76
-
77
- See the config example:
78
-
79
- ```js
80
- exports.config = {
81
- helpers: {
82
- WebDriver: {
83
- // load variables from the environment and provide defaults
84
- url: process.env.CODECEPT_URL || 'http://localhost:3000',
85
-
86
- user: process.env.CLOUDSERVICE_USER,
87
- key: process.env.CLOUDSERVICE_KEY,
88
-
89
- coloredLogs: true,
90
- waitForTimeout: 10000
91
- }
92
- },
93
-
94
- // don't build monolithic configs
95
- mocha: require('./mocha.conf.js') || {},
96
- include: {
97
- I: './src/steps_file.js',
98
- loginPage: './src/pages/login_page',
99
- dashboardPage: new DashboardPage()
100
- }
101
-
102
- // here goes config as it was in codecept.conf.ts
103
- // ....
104
- };
105
- ```
106
-
107
- (Don't copy-paste this config, it's just demo)
108
-
109
- If you prefer to store your configuration files in a different location, or with a different name, you can do that with `--config` or `-c:
110
-
111
- ```sh
112
- codeceptjs run --config=./path/to/my/config.js
113
- ```
114
-
115
- ## Common Configuration Patterns
116
-
117
- > 📺 [Watch this material](https://www.youtube.com/watch?v=onBnfo_rJa4&t=4s) on YouTube
118
-
119
- [`@codeceptjs/configure` package](https://github.com/codeceptjs/configure) contains shared recipes for common configuration patterns. This allows to set meta-configuration, independent from a current helper enabled.
120
-
121
- Install it and enable to easily switch to headless/window mode, change window size, etc.
122
-
123
- ```js
124
- const { setHeadlessWhen, setWindowSize } = require('@codeceptjs/configure');
125
-
126
- setHeadlessWhen(process.env.CI);
127
- setWindowSize(1600, 1200);
128
-
129
- exports.config = {
130
- // ...
131
- }
132
- ```
133
-
134
- ## Profile
135
-
136
- Using `process.env.profile` you can change the config dynamically.
137
- It provides value of `--profile` option passed to runner.
138
- Use its value to change config value on the fly.
139
-
140
- For instance, with the config above we can change browser value using `profile` option
141
-
142
- ```sh
143
- codeceptjs run --profile firefox
144
- ```
145
-
146
- ```js
147
- exports.config = {
148
- helpers: {
149
- WebDriver: {
150
- url: 'http://localhost:3000',
151
- // load value from `profile`
152
- browser: process.env.profile || 'firefox'
153
-
154
- }
155
- }
156
- };
157
- ```
@@ -1,22 +0,0 @@
1
- ---
2
- permalink: /continuous-integration
3
- title: Continuous Integration
4
- ---
5
-
6
- <!-- this file is auto generated from CI category https://codecept.discourse.group/c/CodeceptJS-issues-in-general/ci/9 -->
7
-
8
- # Continuous Integration
9
-
10
- > Help us improve this article. [Write how did you set up CodeceptJS for CI](https://codecept.discourse.group/c/CodeceptJS-issues-in-general/ci/9) and see your post listed here!
11
-
12
- Continuous Integration services allows you to delegate the control of running tests to external system.
13
- CodeceptJS plays well with all types of CI even when there is no documentation on this topic, it is still easy to set up with any kind of hosted or cloud CI.
14
- Our community prepared some valuable recipes for setting up CI systems with CodeceptJS.
15
-
16
- ## Recipes
17
-
18
- * ### [CodeceptJS - Codefresh Integration](https://codecept.discourse.group/t/codeceptjs-codefresh-integration/)
19
- * ### [CodeceptJS GitLab Integration](https://codecept.discourse.group/t/codeceptjs-gitlab-integration/)
20
- * ### [CodeceptJS - Jenkins Integration](https://codecept.discourse.group/t/codeceptjs-jenkins-integration/)
21
- * ### [CodeceptJS Integration with TeamCity](https://codecept.discourse.group/t/codeceptjs-integration-with-teamcity/)
22
-