codeceptjs 3.5.0 → 3.5.1-2.beta.7

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 (273) hide show
  1. package/README.md +24 -25
  2. package/lib/actor.js +6 -3
  3. package/lib/ai.js +12 -3
  4. package/lib/cli.js +12 -2
  5. package/lib/codecept.js +4 -0
  6. package/lib/colorUtils.js +10 -0
  7. package/lib/command/definitions.js +2 -7
  8. package/lib/command/dryRun.js +2 -1
  9. package/lib/command/info.js +24 -0
  10. package/lib/command/init.js +51 -5
  11. package/lib/command/run-multiple/collection.js +17 -5
  12. package/lib/command/run-multiple.js +4 -2
  13. package/lib/command/run-workers.js +66 -4
  14. package/lib/command/run.js +7 -0
  15. package/lib/command/workers/runTests.js +39 -0
  16. package/lib/data/context.js +14 -6
  17. package/lib/event.js +4 -0
  18. package/lib/helper/ApiDataFactory.js +2 -1
  19. package/lib/helper/Appium.js +73 -24
  20. package/lib/helper/Expect.js +422 -0
  21. package/lib/helper/FileSystem.js +1 -1
  22. package/lib/helper/GraphQL.js +25 -0
  23. package/lib/helper/Nightmare.js +9 -4
  24. package/lib/helper/OpenAI.js +14 -10
  25. package/lib/helper/Playwright.js +1205 -288
  26. package/lib/helper/Protractor.js +11 -6
  27. package/lib/helper/Puppeteer.js +173 -61
  28. package/lib/helper/TestCafe.js +44 -9
  29. package/lib/helper/WebDriver.js +231 -82
  30. package/lib/helper/errors/ElementNotFound.js +2 -1
  31. package/lib/helper/extras/PlaywrightReactVueLocator.js +38 -0
  32. package/lib/helper/scripts/blurElement.js +17 -0
  33. package/lib/helper/scripts/focusElement.js +17 -0
  34. package/lib/helper/scripts/highlightElement.js +2 -2
  35. package/lib/html.js +3 -3
  36. package/lib/interfaces/bdd.js +1 -1
  37. package/lib/interfaces/gherkin.js +37 -3
  38. package/lib/interfaces/scenarioConfig.js +1 -0
  39. package/lib/locator.js +17 -4
  40. package/lib/mochaFactory.js +2 -1
  41. package/lib/output.js +1 -1
  42. package/lib/pause.js +12 -9
  43. package/lib/plugin/autoLogin.js +45 -10
  44. package/lib/plugin/heal.js +47 -17
  45. package/lib/plugin/retryFailedStep.js +10 -1
  46. package/lib/plugin/retryTo.js +2 -4
  47. package/lib/plugin/selenoid.js +6 -1
  48. package/lib/plugin/standardActingHelpers.js +0 -2
  49. package/lib/plugin/stepByStepReport.js +2 -2
  50. package/lib/plugin/tryTo.js +5 -7
  51. package/lib/plugin/wdio.js +0 -1
  52. package/lib/recorder.js +20 -9
  53. package/lib/session.js +1 -1
  54. package/lib/step.js +30 -11
  55. package/lib/ui.js +1 -0
  56. package/lib/utils.js +18 -1
  57. package/lib/workers.js +28 -3
  58. package/package.json +108 -98
  59. package/translations/de-DE.js +5 -0
  60. package/translations/fr-FR.js +14 -1
  61. package/translations/it-IT.js +1 -0
  62. package/translations/ja-JP.js +5 -0
  63. package/translations/pl-PL.js +5 -0
  64. package/translations/pt-BR.js +1 -0
  65. package/translations/ru-RU.js +1 -0
  66. package/translations/zh-CN.js +5 -0
  67. package/translations/zh-TW.js +5 -0
  68. package/typings/index.d.ts +8 -6
  69. package/typings/promiseBasedTypes.d.ts +784 -822
  70. package/typings/types.d.ts +1214 -727
  71. package/CHANGELOG.md +0 -2492
  72. package/docs/advanced.md +0 -351
  73. package/docs/ai.md +0 -246
  74. package/docs/api.md +0 -323
  75. package/docs/basics.md +0 -980
  76. package/docs/bdd.md +0 -535
  77. package/docs/best.md +0 -237
  78. package/docs/books.md +0 -37
  79. package/docs/bootstrap.md +0 -135
  80. package/docs/build/ApiDataFactory.js +0 -409
  81. package/docs/build/Appium.js +0 -1978
  82. package/docs/build/FileSystem.js +0 -228
  83. package/docs/build/GraphQL.js +0 -204
  84. package/docs/build/GraphQLDataFactory.js +0 -309
  85. package/docs/build/JSONResponse.js +0 -338
  86. package/docs/build/Mochawesome.js +0 -71
  87. package/docs/build/Nightmare.js +0 -2147
  88. package/docs/build/OpenAI.js +0 -122
  89. package/docs/build/Playwright.js +0 -4134
  90. package/docs/build/Polly.js +0 -42
  91. package/docs/build/Protractor.js +0 -2701
  92. package/docs/build/Puppeteer.js +0 -3743
  93. package/docs/build/REST.js +0 -344
  94. package/docs/build/SeleniumWebdriver.js +0 -76
  95. package/docs/build/TestCafe.js +0 -2059
  96. package/docs/build/WebDriver.js +0 -4042
  97. package/docs/changelog.md +0 -2501
  98. package/docs/commands.md +0 -254
  99. package/docs/community-helpers.md +0 -58
  100. package/docs/configuration.md +0 -157
  101. package/docs/continuous-integration.md +0 -22
  102. package/docs/custom-helpers.md +0 -306
  103. package/docs/data.md +0 -375
  104. package/docs/detox.md +0 -235
  105. package/docs/docker.md +0 -137
  106. package/docs/email.md +0 -183
  107. package/docs/examples.md +0 -149
  108. package/docs/helpers/ApiDataFactory.md +0 -266
  109. package/docs/helpers/Appium.md +0 -1317
  110. package/docs/helpers/Detox.md +0 -586
  111. package/docs/helpers/FileSystem.md +0 -152
  112. package/docs/helpers/GraphQL.md +0 -130
  113. package/docs/helpers/GraphQLDataFactory.md +0 -226
  114. package/docs/helpers/JSONResponse.md +0 -254
  115. package/docs/helpers/Mochawesome.md +0 -8
  116. package/docs/helpers/MockRequest.md +0 -377
  117. package/docs/helpers/Nightmare.md +0 -1258
  118. package/docs/helpers/OpenAI.md +0 -70
  119. package/docs/helpers/Playwright.md +0 -2250
  120. package/docs/helpers/Polly.md +0 -44
  121. package/docs/helpers/Puppeteer-firefox.md +0 -86
  122. package/docs/helpers/Puppeteer.md +0 -2147
  123. package/docs/helpers/REST.md +0 -218
  124. package/docs/helpers/TestCafe.md +0 -1224
  125. package/docs/helpers/WebDriver.md +0 -2325
  126. package/docs/hooks.md +0 -340
  127. package/docs/index.md +0 -111
  128. package/docs/installation.md +0 -75
  129. package/docs/internal-api.md +0 -265
  130. package/docs/locators.md +0 -331
  131. package/docs/mobile-react-native-locators.md +0 -67
  132. package/docs/mobile.md +0 -344
  133. package/docs/nightmare.md +0 -223
  134. package/docs/pageobjects.md +0 -291
  135. package/docs/parallel.md +0 -288
  136. package/docs/playwright.md +0 -609
  137. package/docs/plugins.md +0 -1225
  138. package/docs/puppeteer.md +0 -316
  139. package/docs/quickstart.md +0 -163
  140. package/docs/react.md +0 -69
  141. package/docs/reports.md +0 -392
  142. package/docs/secrets.md +0 -36
  143. package/docs/shadow.md +0 -68
  144. package/docs/shared/keys.mustache +0 -31
  145. package/docs/shared/react.mustache +0 -1
  146. package/docs/testcafe.md +0 -174
  147. package/docs/translation.md +0 -247
  148. package/docs/tutorial.md +0 -271
  149. package/docs/typescript.md +0 -180
  150. package/docs/ui.md +0 -59
  151. package/docs/videos.md +0 -28
  152. package/docs/visual.md +0 -202
  153. package/docs/vue.md +0 -121
  154. package/docs/webapi/amOnPage.mustache +0 -11
  155. package/docs/webapi/appendField.mustache +0 -11
  156. package/docs/webapi/attachFile.mustache +0 -12
  157. package/docs/webapi/checkOption.mustache +0 -13
  158. package/docs/webapi/clearCookie.mustache +0 -10
  159. package/docs/webapi/clearField.mustache +0 -9
  160. package/docs/webapi/click.mustache +0 -25
  161. package/docs/webapi/clickLink.mustache +0 -8
  162. package/docs/webapi/closeCurrentTab.mustache +0 -7
  163. package/docs/webapi/closeOtherTabs.mustache +0 -8
  164. package/docs/webapi/dontSee.mustache +0 -11
  165. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
  166. package/docs/webapi/dontSeeCookie.mustache +0 -8
  167. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
  168. package/docs/webapi/dontSeeElement.mustache +0 -8
  169. package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
  170. package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
  171. package/docs/webapi/dontSeeInField.mustache +0 -11
  172. package/docs/webapi/dontSeeInSource.mustache +0 -8
  173. package/docs/webapi/dontSeeInTitle.mustache +0 -8
  174. package/docs/webapi/doubleClick.mustache +0 -13
  175. package/docs/webapi/downloadFile.mustache +0 -12
  176. package/docs/webapi/dragAndDrop.mustache +0 -9
  177. package/docs/webapi/dragSlider.mustache +0 -11
  178. package/docs/webapi/executeAsyncScript.mustache +0 -24
  179. package/docs/webapi/executeScript.mustache +0 -26
  180. package/docs/webapi/fillField.mustache +0 -16
  181. package/docs/webapi/forceClick.mustache +0 -28
  182. package/docs/webapi/forceRightClick.mustache +0 -18
  183. package/docs/webapi/grabAllWindowHandles.mustache +0 -7
  184. package/docs/webapi/grabAttributeFrom.mustache +0 -10
  185. package/docs/webapi/grabAttributeFromAll.mustache +0 -9
  186. package/docs/webapi/grabBrowserLogs.mustache +0 -9
  187. package/docs/webapi/grabCookie.mustache +0 -11
  188. package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
  189. package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
  190. package/docs/webapi/grabCurrentUrl.mustache +0 -9
  191. package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
  192. package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
  193. package/docs/webapi/grabElementBoundingRect.mustache +0 -20
  194. package/docs/webapi/grabGeoLocation.mustache +0 -8
  195. package/docs/webapi/grabHTMLFrom.mustache +0 -10
  196. package/docs/webapi/grabHTMLFromAll.mustache +0 -9
  197. package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
  198. package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
  199. package/docs/webapi/grabPageScrollPosition.mustache +0 -8
  200. package/docs/webapi/grabPopupText.mustache +0 -5
  201. package/docs/webapi/grabSource.mustache +0 -8
  202. package/docs/webapi/grabTextFrom.mustache +0 -10
  203. package/docs/webapi/grabTextFromAll.mustache +0 -9
  204. package/docs/webapi/grabTitle.mustache +0 -8
  205. package/docs/webapi/grabValueFrom.mustache +0 -9
  206. package/docs/webapi/grabValueFromAll.mustache +0 -8
  207. package/docs/webapi/moveCursorTo.mustache +0 -12
  208. package/docs/webapi/openNewTab.mustache +0 -7
  209. package/docs/webapi/pressKey.mustache +0 -12
  210. package/docs/webapi/pressKeyDown.mustache +0 -12
  211. package/docs/webapi/pressKeyUp.mustache +0 -12
  212. package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
  213. package/docs/webapi/refreshPage.mustache +0 -6
  214. package/docs/webapi/resizeWindow.mustache +0 -6
  215. package/docs/webapi/rightClick.mustache +0 -14
  216. package/docs/webapi/saveElementScreenshot.mustache +0 -10
  217. package/docs/webapi/saveScreenshot.mustache +0 -12
  218. package/docs/webapi/say.mustache +0 -10
  219. package/docs/webapi/scrollIntoView.mustache +0 -11
  220. package/docs/webapi/scrollPageToBottom.mustache +0 -6
  221. package/docs/webapi/scrollPageToTop.mustache +0 -6
  222. package/docs/webapi/scrollTo.mustache +0 -12
  223. package/docs/webapi/see.mustache +0 -11
  224. package/docs/webapi/seeAttributesOnElements.mustache +0 -9
  225. package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
  226. package/docs/webapi/seeCookie.mustache +0 -8
  227. package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
  228. package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
  229. package/docs/webapi/seeElement.mustache +0 -8
  230. package/docs/webapi/seeElementInDOM.mustache +0 -8
  231. package/docs/webapi/seeInCurrentUrl.mustache +0 -8
  232. package/docs/webapi/seeInField.mustache +0 -12
  233. package/docs/webapi/seeInPopup.mustache +0 -8
  234. package/docs/webapi/seeInSource.mustache +0 -7
  235. package/docs/webapi/seeInTitle.mustache +0 -8
  236. package/docs/webapi/seeNumberOfElements.mustache +0 -11
  237. package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
  238. package/docs/webapi/seeTextEquals.mustache +0 -9
  239. package/docs/webapi/seeTitleEquals.mustache +0 -8
  240. package/docs/webapi/selectOption.mustache +0 -21
  241. package/docs/webapi/setCookie.mustache +0 -16
  242. package/docs/webapi/setGeoLocation.mustache +0 -12
  243. package/docs/webapi/switchTo.mustache +0 -9
  244. package/docs/webapi/switchToNextTab.mustache +0 -10
  245. package/docs/webapi/switchToPreviousTab.mustache +0 -10
  246. package/docs/webapi/type.mustache +0 -21
  247. package/docs/webapi/uncheckOption.mustache +0 -13
  248. package/docs/webapi/wait.mustache +0 -8
  249. package/docs/webapi/waitForClickable.mustache +0 -11
  250. package/docs/webapi/waitForDetached.mustache +0 -10
  251. package/docs/webapi/waitForElement.mustache +0 -11
  252. package/docs/webapi/waitForEnabled.mustache +0 -6
  253. package/docs/webapi/waitForFunction.mustache +0 -17
  254. package/docs/webapi/waitForInvisible.mustache +0 -10
  255. package/docs/webapi/waitForText.mustache +0 -13
  256. package/docs/webapi/waitForValue.mustache +0 -10
  257. package/docs/webapi/waitForVisible.mustache +0 -10
  258. package/docs/webapi/waitInUrl.mustache +0 -9
  259. package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
  260. package/docs/webapi/waitToHide.mustache +0 -10
  261. package/docs/webapi/waitUrlEquals.mustache +0 -10
  262. package/docs/webdriver.md +0 -657
  263. package/docs/wiki/Books-&-Posts.md +0 -27
  264. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -49
  265. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -29
  266. package/docs/wiki/Examples.md +0 -139
  267. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  268. package/docs/wiki/Home.md +0 -16
  269. package/docs/wiki/Release-Process.md +0 -24
  270. package/docs/wiki/Roadmap.md +0 -23
  271. package/docs/wiki/Tests.md +0 -1393
  272. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  273. package/docs/wiki/Videos.md +0 -19
package/docs/commands.md DELETED
@@ -1,254 +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
- To enable bootstrap script in dry-run mode, pass in `--bootstrap` option when running with `--steps` or `--debug`
156
-
157
- ```
158
- npx codeceptjs dry-run --steps --bootstrap
159
- ```
160
-
161
- ## Run Multiple
162
-
163
- > ⚠️ prefer using run-workers instead
164
-
165
- Run multiple suites. Unlike `run-workers` spawns processes to execute tests.
166
- [Requires additional configuration](/advanced#multiple-browsers-execution) and can be used to execute tests in multiple browsers.
167
-
168
- ```sh
169
- npx codeceptjs run-multiple smoke:chrome regression:firefox
170
- ```
171
-
172
- ## Init
173
-
174
- Creates `codecept.conf.js` file in current directory:
175
-
176
- ```sh
177
- npx codeceptjs init
178
- ```
179
-
180
- Or in provided path
181
-
182
- ```sh
183
- npx codecept init test
184
- ```
185
-
186
- ## Migrate
187
-
188
- Migrate your current `codecept.json` to `codecept.conf.js`
189
-
190
- ```sh
191
- npx codeceptjs migrate
192
- ```
193
-
194
- ## Shell
195
-
196
- Interactive shell. Allows to try `I.` commands in runtime
197
-
198
- ```sh
199
- npx codeceptjs shell
200
- ```
201
-
202
- ## Generators
203
-
204
- Create new test
205
-
206
- ```sh
207
- npx codeceptjs generate:test
208
- ```
209
-
210
- Create new pageobject
211
-
212
- ```sh
213
- npx codeceptjs generate:pageobject
214
- ```
215
-
216
- Create new helper
217
-
218
- ```sh
219
- npx codeceptjs generate:helper
220
- ```
221
-
222
- ## TypeScript Definitions
223
-
224
- TypeScript Definitions allows IDEs to provide autocompletion when writing tests.
225
-
226
- ```sh
227
- npx codeceptjs def
228
- npx codeceptjs def --config path/to/codecept.conf.js
229
- ```
230
-
231
- After doing that IDE should provide autocompletion for `I` object inside `Scenario` and `within` blocks.
232
-
233
- Add optional parameter `output` (or shortcut `-o`), if you want to place your definition file in specific folder:
234
-
235
- ```sh
236
- npx codeceptjs def --output ./tests/typings
237
- npx codeceptjs def -o ./tests/typings
238
- ```
239
-
240
- ## List Commands
241
-
242
- Prints all available methods of `I` to console
243
-
244
- ```sh
245
- npx codeceptjs list
246
- ```
247
-
248
- ## Local Environment Information
249
-
250
- Prints debugging information concerning the local environment
251
-
252
- ```sh
253
- npx codeceptjs info
254
- ```
@@ -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
-