codeceptjs 4.0.0-beta.2 → 4.0.0-beta.21

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 (209) hide show
  1. package/README.md +133 -120
  2. package/bin/codecept.js +107 -96
  3. package/bin/test-server.js +64 -0
  4. package/docs/webapi/clearCookie.mustache +1 -1
  5. package/docs/webapi/click.mustache +5 -1
  6. package/lib/actor.js +73 -103
  7. package/lib/ai.js +159 -188
  8. package/lib/assert/empty.js +22 -24
  9. package/lib/assert/equal.js +30 -37
  10. package/lib/assert/error.js +14 -14
  11. package/lib/assert/include.js +43 -48
  12. package/lib/assert/throws.js +11 -11
  13. package/lib/assert/truth.js +22 -22
  14. package/lib/assert.js +20 -18
  15. package/lib/codecept.js +262 -162
  16. package/lib/colorUtils.js +50 -52
  17. package/lib/command/check.js +206 -0
  18. package/lib/command/configMigrate.js +56 -51
  19. package/lib/command/definitions.js +96 -109
  20. package/lib/command/dryRun.js +77 -79
  21. package/lib/command/generate.js +234 -194
  22. package/lib/command/gherkin/init.js +42 -33
  23. package/lib/command/gherkin/snippets.js +76 -74
  24. package/lib/command/gherkin/steps.js +20 -17
  25. package/lib/command/info.js +74 -38
  26. package/lib/command/init.js +301 -290
  27. package/lib/command/interactive.js +41 -32
  28. package/lib/command/list.js +28 -27
  29. package/lib/command/run-multiple/chunk.js +51 -48
  30. package/lib/command/run-multiple/collection.js +5 -5
  31. package/lib/command/run-multiple/run.js +5 -1
  32. package/lib/command/run-multiple.js +97 -97
  33. package/lib/command/run-rerun.js +19 -25
  34. package/lib/command/run-workers.js +68 -92
  35. package/lib/command/run.js +39 -27
  36. package/lib/command/utils.js +80 -64
  37. package/lib/command/workers/runTests.js +388 -226
  38. package/lib/config.js +109 -50
  39. package/lib/container.js +765 -261
  40. package/lib/data/context.js +60 -61
  41. package/lib/data/dataScenarioConfig.js +47 -47
  42. package/lib/data/dataTableArgument.js +32 -32
  43. package/lib/data/table.js +22 -22
  44. package/lib/effects.js +307 -0
  45. package/lib/element/WebElement.js +327 -0
  46. package/lib/els.js +160 -0
  47. package/lib/event.js +173 -163
  48. package/lib/globals.js +141 -0
  49. package/lib/heal.js +89 -85
  50. package/lib/helper/AI.js +131 -41
  51. package/lib/helper/ApiDataFactory.js +107 -75
  52. package/lib/helper/Appium.js +542 -404
  53. package/lib/helper/FileSystem.js +100 -79
  54. package/lib/helper/GraphQL.js +44 -43
  55. package/lib/helper/GraphQLDataFactory.js +52 -52
  56. package/lib/helper/JSONResponse.js +126 -88
  57. package/lib/helper/Mochawesome.js +54 -29
  58. package/lib/helper/Playwright.js +2547 -1316
  59. package/lib/helper/Puppeteer.js +1578 -1181
  60. package/lib/helper/REST.js +209 -68
  61. package/lib/helper/WebDriver.js +1482 -1342
  62. package/lib/helper/errors/ConnectionRefused.js +6 -6
  63. package/lib/helper/errors/ElementAssertion.js +11 -16
  64. package/lib/helper/errors/ElementNotFound.js +5 -9
  65. package/lib/helper/errors/RemoteBrowserConnectionRefused.js +5 -5
  66. package/lib/helper/extras/Console.js +11 -11
  67. package/lib/helper/extras/PlaywrightLocator.js +110 -0
  68. package/lib/helper/extras/PlaywrightPropEngine.js +18 -18
  69. package/lib/helper/extras/PlaywrightReactVueLocator.js +17 -8
  70. package/lib/helper/extras/PlaywrightRestartOpts.js +25 -11
  71. package/lib/helper/extras/Popup.js +22 -22
  72. package/lib/helper/extras/React.js +27 -28
  73. package/lib/helper/network/actions.js +36 -42
  74. package/lib/helper/network/utils.js +78 -84
  75. package/lib/helper/scripts/blurElement.js +5 -5
  76. package/lib/helper/scripts/focusElement.js +5 -5
  77. package/lib/helper/scripts/highlightElement.js +8 -8
  78. package/lib/helper/scripts/isElementClickable.js +34 -34
  79. package/lib/helper.js +2 -3
  80. package/lib/history.js +23 -19
  81. package/lib/hooks.js +8 -8
  82. package/lib/html.js +94 -104
  83. package/lib/index.js +38 -27
  84. package/lib/listener/config.js +30 -23
  85. package/lib/listener/emptyRun.js +54 -0
  86. package/lib/listener/enhancedGlobalRetry.js +110 -0
  87. package/lib/listener/exit.js +16 -18
  88. package/lib/listener/globalRetry.js +70 -0
  89. package/lib/listener/globalTimeout.js +181 -0
  90. package/lib/listener/helpers.js +76 -51
  91. package/lib/listener/mocha.js +10 -11
  92. package/lib/listener/result.js +11 -0
  93. package/lib/listener/retryEnhancer.js +85 -0
  94. package/lib/listener/steps.js +71 -59
  95. package/lib/listener/store.js +20 -0
  96. package/lib/locator.js +214 -197
  97. package/lib/mocha/asyncWrapper.js +274 -0
  98. package/lib/mocha/bdd.js +167 -0
  99. package/lib/mocha/cli.js +341 -0
  100. package/lib/mocha/factory.js +163 -0
  101. package/lib/mocha/featureConfig.js +89 -0
  102. package/lib/mocha/gherkin.js +231 -0
  103. package/lib/mocha/hooks.js +121 -0
  104. package/lib/mocha/index.js +21 -0
  105. package/lib/mocha/inject.js +46 -0
  106. package/lib/{interfaces → mocha}/scenarioConfig.js +58 -34
  107. package/lib/mocha/suite.js +89 -0
  108. package/lib/mocha/test.js +184 -0
  109. package/lib/mocha/types.d.ts +42 -0
  110. package/lib/mocha/ui.js +242 -0
  111. package/lib/output.js +141 -71
  112. package/lib/parser.js +54 -44
  113. package/lib/pause.js +173 -145
  114. package/lib/plugin/analyze.js +403 -0
  115. package/lib/plugin/{autoLogin.js → auth.js} +178 -79
  116. package/lib/plugin/autoDelay.js +36 -40
  117. package/lib/plugin/coverage.js +131 -78
  118. package/lib/plugin/customLocator.js +22 -21
  119. package/lib/plugin/customReporter.js +53 -0
  120. package/lib/plugin/enhancedRetryFailedStep.js +99 -0
  121. package/lib/plugin/heal.js +101 -110
  122. package/lib/plugin/htmlReporter.js +3648 -0
  123. package/lib/plugin/pageInfo.js +140 -0
  124. package/lib/plugin/pauseOnFail.js +12 -11
  125. package/lib/plugin/retryFailedStep.js +82 -47
  126. package/lib/plugin/screenshotOnFail.js +111 -92
  127. package/lib/plugin/stepByStepReport.js +159 -101
  128. package/lib/plugin/stepTimeout.js +20 -25
  129. package/lib/plugin/subtitles.js +38 -38
  130. package/lib/recorder.js +193 -130
  131. package/lib/rerun.js +94 -49
  132. package/lib/result.js +238 -0
  133. package/lib/retryCoordinator.js +207 -0
  134. package/lib/secret.js +20 -18
  135. package/lib/session.js +95 -89
  136. package/lib/step/base.js +239 -0
  137. package/lib/step/comment.js +10 -0
  138. package/lib/step/config.js +50 -0
  139. package/lib/step/func.js +46 -0
  140. package/lib/step/helper.js +50 -0
  141. package/lib/step/meta.js +99 -0
  142. package/lib/step/record.js +74 -0
  143. package/lib/step/retry.js +11 -0
  144. package/lib/step/section.js +55 -0
  145. package/lib/step.js +18 -329
  146. package/lib/steps.js +54 -0
  147. package/lib/store.js +38 -7
  148. package/lib/template/heal.js +3 -12
  149. package/lib/template/prompts/generatePageObject.js +31 -0
  150. package/lib/template/prompts/healStep.js +13 -0
  151. package/lib/template/prompts/writeStep.js +9 -0
  152. package/lib/test-server.js +334 -0
  153. package/lib/timeout.js +60 -0
  154. package/lib/transform.js +8 -8
  155. package/lib/translation.js +34 -21
  156. package/lib/utils/loaderCheck.js +124 -0
  157. package/lib/utils/mask_data.js +47 -0
  158. package/lib/utils/typescript.js +237 -0
  159. package/lib/utils.js +411 -228
  160. package/lib/workerStorage.js +37 -34
  161. package/lib/workers.js +532 -296
  162. package/package.json +124 -95
  163. package/translations/de-DE.js +5 -3
  164. package/translations/fr-FR.js +5 -4
  165. package/translations/index.js +22 -12
  166. package/translations/it-IT.js +4 -3
  167. package/translations/ja-JP.js +4 -3
  168. package/translations/nl-NL.js +76 -0
  169. package/translations/pl-PL.js +4 -3
  170. package/translations/pt-BR.js +4 -3
  171. package/translations/ru-RU.js +4 -3
  172. package/translations/utils.js +10 -0
  173. package/translations/zh-CN.js +4 -3
  174. package/translations/zh-TW.js +4 -3
  175. package/typings/index.d.ts +546 -185
  176. package/typings/promiseBasedTypes.d.ts +150 -875
  177. package/typings/types.d.ts +547 -992
  178. package/lib/cli.js +0 -249
  179. package/lib/dirname.js +0 -5
  180. package/lib/helper/Expect.js +0 -425
  181. package/lib/helper/ExpectHelper.js +0 -399
  182. package/lib/helper/MockServer.js +0 -223
  183. package/lib/helper/Nightmare.js +0 -1411
  184. package/lib/helper/Protractor.js +0 -1835
  185. package/lib/helper/SoftExpectHelper.js +0 -381
  186. package/lib/helper/TestCafe.js +0 -1410
  187. package/lib/helper/clientscripts/nightmare.js +0 -213
  188. package/lib/helper/testcafe/testControllerHolder.js +0 -42
  189. package/lib/helper/testcafe/testcafe-utils.js +0 -63
  190. package/lib/interfaces/bdd.js +0 -98
  191. package/lib/interfaces/featureConfig.js +0 -69
  192. package/lib/interfaces/gherkin.js +0 -195
  193. package/lib/listener/artifacts.js +0 -19
  194. package/lib/listener/retry.js +0 -68
  195. package/lib/listener/timeout.js +0 -109
  196. package/lib/mochaFactory.js +0 -110
  197. package/lib/plugin/allure.js +0 -15
  198. package/lib/plugin/commentStep.js +0 -136
  199. package/lib/plugin/debugErrors.js +0 -67
  200. package/lib/plugin/eachElement.js +0 -127
  201. package/lib/plugin/fakerTransform.js +0 -49
  202. package/lib/plugin/retryTo.js +0 -121
  203. package/lib/plugin/selenoid.js +0 -371
  204. package/lib/plugin/standardActingHelpers.js +0 -9
  205. package/lib/plugin/tryTo.js +0 -105
  206. package/lib/plugin/wdio.js +0 -246
  207. package/lib/scenario.js +0 -222
  208. package/lib/ui.js +0 -238
  209. package/lib/within.js +0 -70
package/README.md CHANGED
@@ -1,20 +1,16 @@
1
1
  [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua)
2
2
 
3
-
4
-
5
3
  [<img src="https://img.shields.io/badge/slack-@codeceptjs-purple.svg?logo=slack">](https://join.slack.com/t/codeceptjs/shared_invite/enQtMzA5OTM4NDM2MzA4LWE4MThhN2NmYTgxNTU5MTc4YzAyYWMwY2JkMmZlYWI5MWQ2MDM5MmRmYzZmYmNiNmY5NTAzM2EwMGIwOTNhOGQ) [<img src="https://img.shields.io/badge/discourse-codeceptjs-purple">](https://codecept.discourse.group) [![NPM version][npm-image]][npm-url] [<img src="https://img.shields.io/badge/dockerhub-images-blue.svg?logo=codeceptjs">](https://hub.docker.com/r/codeceptjs/codeceptjs)
6
- [![AI features](https://img.shields.io/badge/AI-features?logo=openai&logoColor=white)](https://github.com/codeceptjs/CodeceptJS/edit/3.x/docs/ai.md) [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
4
+ [![AI features](https://img.shields.io/badge/AI-features?logo=openai&logoColor=white)](https://github.com/codeceptjs/CodeceptJS/edit/3.x/docs/ai.md) [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
7
5
 
8
- Build Status:
6
+ ## Build Status
9
7
 
10
- Appium Helper:
11
- [![Appium V2 Tests - Android](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appiumV2_Android.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appiumV2_Android.yml)
12
-
13
- Web Helper:
14
- [![Playwright Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/playwright.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/playwright.yml)
15
- [![Puppeteer Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/puppeteer.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/puppeteer.yml)
16
- [![WebDriver Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml)
17
- [![TestCafe Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/testcafe.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/testcafe.yml)
8
+ | Type | Engine | Status |
9
+ | --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10
+ | 🌐 Web | Playwright | [![Playwright Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/playwright.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/playwright.yml) |
11
+ | 🌐 Web | Puppeteer | [![Puppeteer Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/puppeteer.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/puppeteer.yml) |
12
+ | 🌐 Web | WebDriver | [![WebDriver Tests](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml) |
13
+ | 📱 Mobile | Appium | [![Appium Tests - Android](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium_Android.yml/badge.svg)](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium_Android.yml) |
18
14
 
19
15
  # CodeceptJS [![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)
20
16
 
@@ -27,28 +23,27 @@ It abstracts browser interaction to simple steps that are written from a user's
27
23
  A simple test that verifies the "Welcome" text is present on a main page of a site will look like:
28
24
 
29
25
  ```js
30
- Feature('CodeceptJS demo');
26
+ Feature('CodeceptJS demo')
31
27
 
32
28
  Scenario('check Welcome page on site', ({ I }) => {
33
- I.amOnPage('/');
34
- I.see('Welcome');
35
- });
29
+ I.amOnPage('/')
30
+ I.see('Welcome')
31
+ })
36
32
  ```
37
33
 
38
34
  CodeceptJS tests are:
39
35
 
40
- * **Synchronous**. You don't need to care about callbacks or promises or test scenarios which are linear. But, your tests should be linear.
41
- * Written from **user's perspective**. Every action is a method of `I`. That makes test easy to read, write and maintain even for non-tech persons.
42
- * Backend **API agnostic**. We don't know which WebDriver implementation is running this test.
36
+ - **Synchronous**. You don't need to care about callbacks or promises or test scenarios which are linear. But, your tests should be linear.
37
+ - Written from **user's perspective**. Every action is a method of `I`. That makes test easy to read, write and maintain even for non-tech persons.
38
+ - Backend **API agnostic**. We don't know which WebDriver implementation is running this test.
43
39
 
44
40
  CodeceptJS uses **Helper** modules to provide actions to `I` object. Currently, CodeceptJS has these helpers:
45
41
 
46
- * [**Playwright**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Playwright.md) - is a Node library to automate the Chromium, WebKit and Firefox browsers with a single API.
47
- * [**Puppeteer**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Puppeteer.md) - uses Google Chrome's Puppeteer for fast headless testing.
48
- * [**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver or Devtools protocol.
49
- * [**TestCafe**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/TestCafe.md) - cheap and fast cross-browser test automation.
50
- * [**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium
51
- * [**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps.
42
+ - [**Playwright**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Playwright.md) - is a Node library to automate the Chromium, WebKit and Firefox browsers with a single API.
43
+ - [**Puppeteer**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Puppeteer.md) - uses Google Chrome's Puppeteer for fast headless testing.
44
+ - [**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver or Devtools protocol.
45
+ - [**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium
46
+ - [**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps.
52
47
 
53
48
  And more to come...
54
49
 
@@ -56,19 +51,20 @@ And more to come...
56
51
 
57
52
  CodeceptJS is a successor of [Codeception](http://codeception.com), a popular full-stack testing framework for PHP.
58
53
  With CodeceptJS your scenario-driven functional and acceptance tests will be as simple and clean as they can be.
59
- You don't need to worry about asynchronous nature of NodeJS or about various APIs of Playwright, Selenium, Puppeteer, TestCafe, etc. as CodeceptJS unifies them and makes them work as they are synchronous.
60
-
54
+ You don't need to worry about asynchronous nature of NodeJS or about various APIs of Playwright, Selenium, Puppeteer, etc. as CodeceptJS unifies them and makes them work as they are synchronous.
61
55
 
62
56
  ## Features
63
-
64
- * 🪄 **AI-powered** with GPT features to assist and heal failing tests.
65
- * ☕ Based on [Mocha](https://mochajs.org/) testing framework.
66
- * 💼 Designed for scenario driven acceptance testing in BDD-style.
67
- * 💻 Uses ES6 natively without transpiler.
68
- * Also plays nice with TypeScript.
69
- * </> Smart locators: use names, labels, matching text, CSS or XPath to locate elements.
70
- * 🌐 Interactive debugging shell: pause test at any point and try different commands in a browser.
71
- * Easily create tests, pageobjects, stepobjects with CLI generators.
57
+
58
+ - 🪄 **AI-powered** with GPT features to assist and heal failing tests.
59
+ - ☕ Based on [Mocha](https://mochajs.org/) testing framework.
60
+ - 💼 Designed for scenario driven acceptance testing in BDD-style.
61
+ - 💻 Uses ES6 natively without transpiler.
62
+ - Also plays nice with TypeScript.
63
+ - </> Smart locators: use names, labels, matching text, CSS or XPath to locate elements.
64
+ - 🌐 Interactive debugging shell: pause test at any point and try different commands in a browser.
65
+ - **Parallel testing** with dynamic test pooling for optimal load balancing and performance.
66
+ - 📊 **Built-in HTML Reporter** with interactive dashboard, step-by-step execution details, and comprehensive test analytics.
67
+ - Easily create tests, pageobjects, stepobjects with CLI generators.
72
68
 
73
69
  ## Installation
74
70
 
@@ -105,7 +101,8 @@ npx codeceptjs def .
105
101
  Later you can even automagically update Type Definitions to include your own custom [helpers methods](docs/helpers.md).
106
102
 
107
103
  Note:
108
- - CodeceptJS requires Node.js version `12+` or later.
104
+
105
+ - CodeceptJS requires Node.js version `12+` or later.
109
106
 
110
107
  ## Usage
111
108
 
@@ -116,18 +113,18 @@ Learn CodeceptJS by examples. Let's assume we have CodeceptJS installed and WebD
116
113
  Let's see how we can handle basic form testing:
117
114
 
118
115
  ```js
119
- Feature('CodeceptJS Demonstration');
116
+ Feature('CodeceptJS Demonstration')
120
117
 
121
118
  Scenario('test some forms', ({ I }) => {
122
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
123
- I.fillField('Email', 'hello@world.com');
124
- I.fillField('Password', secret('123456'));
125
- I.checkOption('Active');
126
- I.checkOption('Male');
127
- I.click('Create User');
128
- I.see('User is valid');
129
- I.dontSeeInCurrentUrl('/documentation');
130
- });
119
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
120
+ I.fillField('Email', 'hello@world.com')
121
+ I.fillField('Password', secret('123456'))
122
+ I.checkOption('Active')
123
+ I.checkOption('Male')
124
+ I.click('Create User')
125
+ I.see('User is valid')
126
+ I.dontSeeInCurrentUrl('/documentation')
127
+ })
131
128
  ```
132
129
 
133
130
  All actions are performed by `I` object; assertions functions start with `see` function.
@@ -172,11 +169,11 @@ The same way you can locate element by name, `CSS` or `XPath` locators in tests:
172
169
 
173
170
  ```js
174
171
  // by name
175
- I.fillField('user_basic[email]', 'hello@world.com');
172
+ I.fillField('user_basic[email]', 'hello@world.com')
176
173
  // by CSS
177
- I.fillField('#user_basic_email', 'hello@world.com');
174
+ I.fillField('#user_basic_email', 'hello@world.com')
178
175
  // don't make us guess locator type, specify it
179
- I.fillField({css: '#user_basic_email'}, 'hello@world.com');
176
+ I.fillField({ css: '#user_basic_email' }, 'hello@world.com')
180
177
  ```
181
178
 
182
179
  Other methods like `checkOption`, and `click` work in a similar manner. They can take labels or CSS or XPath locators to find elements to interact.
@@ -187,9 +184,9 @@ Assertions start with `see` or `dontSee` prefix. In our case we are asserting th
187
184
  However, we can narrow the search to particular element by providing a second parameter:
188
185
 
189
186
  ```js
190
- I.see('User is valid');
187
+ I.see('User is valid')
191
188
  // better to specify context:
192
- I.see('User is valid', '.alert-success');
189
+ I.see('User is valid', '.alert-success')
193
190
  ```
194
191
 
195
192
  In this case 'User is valid' string will be searched only inside elements located by CSS `.alert-success`.
@@ -200,13 +197,13 @@ In case you need to return a value from a webpage and use it directly in test, y
200
197
  They are expected to be used inside `async/await` functions, and their results will be available in test:
201
198
 
202
199
  ```js
203
- Feature('CodeceptJS Demonstration');
200
+ Feature('CodeceptJS Demonstration')
204
201
 
205
202
  Scenario('test page title', async ({ I }) => {
206
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
207
- const title = await I.grabTitle();
208
- I.expectEqual(title, 'Example application with SimpleForm and Twitter Bootstrap'); // Avaiable with Expect helper. -> https://codecept.io/helpers/Expect/
209
- });
203
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
204
+ const title = await I.grabTitle()
205
+ I.expectEqual(title, 'Example application with SimpleForm and Twitter Bootstrap') // Avaiable with Expect helper. -> https://codecept.io/helpers/Expect/
206
+ })
210
207
  ```
211
208
 
212
209
  The same way you can grab text, attributes, or form values and use them in next test steps.
@@ -216,25 +213,69 @@ The same way you can grab text, attributes, or form values and use them in next
216
213
  Common preparation steps like opening a web page, logging in a user, can be placed in `Before` or `Background`:
217
214
 
218
215
  ```js
219
- const { I } = inject();
216
+ const { I } = inject()
220
217
 
221
- Feature('CodeceptJS Demonstration');
218
+ Feature('CodeceptJS Demonstration')
222
219
 
223
- Before(() => { // or Background
224
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
225
- });
220
+ Before(() => {
221
+ // or Background
222
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
223
+ })
226
224
 
227
225
  Scenario('test some forms', () => {
228
- I.click('Create User');
229
- I.see('User is valid');
230
- I.dontSeeInCurrentUrl('/documentation');
231
- });
226
+ I.click('Create User')
227
+ I.see('User is valid')
228
+ I.dontSeeInCurrentUrl('/documentation')
229
+ })
232
230
 
233
231
  Scenario('test title', () => {
234
- I.seeInTitle('Example application');
235
- });
232
+ I.seeInTitle('Example application')
233
+ })
236
234
  ```
237
235
 
236
+ ## HTML Reporter
237
+
238
+ CodeceptJS includes a powerful built-in HTML Reporter that generates comprehensive, interactive test reports with detailed information about your test runs. The HTML reporter is **enabled by default** for all new projects and provides:
239
+
240
+ ### Features
241
+
242
+ - **Interactive Dashboard**: Visual statistics, pie charts, and expandable test details
243
+ - **Step-by-Step Execution**: Shows individual test steps with timing and status indicators
244
+ - **BDD/Gherkin Support**: Full support for feature files with proper scenario formatting
245
+ - **System Information**: Comprehensive environment details including browser versions
246
+ - **Advanced Filtering**: Real-time filtering by status, tags, features, and test types
247
+ - **History Tracking**: Multi-run history with trend visualization
248
+ - **Error Details**: Clean formatting of error messages and stack traces
249
+ - **Artifacts Support**: Display screenshots and other test artifacts
250
+
251
+ ### Visual Examples
252
+
253
+ #### Interactive Test Dashboard
254
+
255
+ The main dashboard provides a complete overview with interactive statistics and pie charts:
256
+
257
+ ![HTML Reporter Dashboard](docs/shared/html-reporter-main-dashboard.png)
258
+
259
+ #### Detailed Test Results
260
+
261
+ Each test shows comprehensive execution details with expandable step information:
262
+
263
+ ![HTML Reporter Test Details](docs/shared/html-reporter-test-details.png)
264
+
265
+ #### Advanced Filtering Capabilities
266
+
267
+ Real-time filtering allows quick navigation through test results:
268
+
269
+ ![HTML Reporter Filtering](docs/shared/html-reporter-filtering.png)
270
+
271
+ #### BDD/Gherkin Support
272
+
273
+ Full support for Gherkin scenarios with proper feature formatting:
274
+
275
+ ![HTML Reporter BDD Details](docs/shared/html-reporter-bdd-details.png)
276
+
277
+ The HTML reporter generates self-contained reports that can be easily shared with your team. Learn more about configuration and features in the [HTML Reporter documentation](https://codecept.io/plugins/#htmlreporter).
278
+
238
279
  ## PageObjects
239
280
 
240
281
  CodeceptJS provides the most simple way to create and use page objects in your test.
@@ -248,83 +289,55 @@ It will create a page object file for you and add it to the config.
248
289
  Let's assume we created one named `docsPage`:
249
290
 
250
291
  ```js
251
- const { I } = inject();
292
+ const { I } = inject()
252
293
 
253
294
  module.exports = {
254
295
  fields: {
255
296
  email: '#user_basic_email',
256
- password: '#user_basic_password'
297
+ password: '#user_basic_password',
257
298
  },
258
- submitButton: {css: '#new_user_basic input[type=submit]'},
299
+ submitButton: { css: '#new_user_basic input[type=submit]' },
259
300
 
260
301
  sendForm(email, password) {
261
- I.fillField(this.fields.email, email);
262
- I.fillField(this.fields.password, password);
263
- I.click(this.submitButton);
264
- }
302
+ I.fillField(this.fields.email, email)
303
+ I.fillField(this.fields.password, password)
304
+ I.click(this.submitButton)
305
+ },
265
306
  }
266
307
  ```
267
308
 
268
309
  You can easily inject it to test by providing its name in test arguments:
269
310
 
270
311
  ```js
271
- Feature('CodeceptJS Demonstration');
312
+ Feature('CodeceptJS Demonstration')
272
313
 
273
- Before(({ I }) => { // or Background
274
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
275
- });
314
+ Before(({ I }) => {
315
+ // or Background
316
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
317
+ })
276
318
 
277
319
  Scenario('test some forms', ({ I, docsPage }) => {
278
- docsPage.sendForm('hello@world.com','123456');
279
- I.see('User is valid');
280
- I.dontSeeInCurrentUrl('/documentation');
281
- });
320
+ docsPage.sendForm('hello@world.com', '123456')
321
+ I.see('User is valid')
322
+ I.dontSeeInCurrentUrl('/documentation')
323
+ })
282
324
  ```
283
325
 
284
326
  When using Typescript, replace `module.exports` with `export` for autocompletion.
285
327
 
286
-
287
328
  ## Contributing
288
329
 
289
- - ### [Contributing Guide](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CONTRIBUTING.md)
290
- - ### [Code of conduct](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CODE_OF_CONDUCT.md)
291
-
330
+ - ### [Contributing Guide](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CONTRIBUTING.md)
331
+ - ### [Code of conduct](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CODE_OF_CONDUCT.md)
292
332
 
293
333
  ## Contributors
294
334
 
295
- Thanks all to those who are and will have contributing to this awesome project!
296
-
297
- [//]: contributor-faces
298
- <a href="https://github.com/DavertMik"><img src="https://avatars.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a>
299
- <a href="https://github.com/kobenguyent"><img src="https://avatars.githubusercontent.com/u/7845001?v=4" title="kobenguyent" width="80" height="80"></a>
300
- <a href="https://github.com/Vorobeyko"><img src="https://avatars.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a>
301
- <a href="https://github.com/reubenmiller"><img src="https://avatars.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a>
302
- <a href="https://github.com/Arhell"><img src="https://avatars.githubusercontent.com/u/26163841?v=4" title="Arhell" width="80" height="80"></a>
303
- <a href="https://github.com/APshenkin"><img src="https://avatars.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a>
304
- <a href="https://github.com/fabioel"><img src="https://avatars.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a>
305
- <a href="https://github.com/pablopaul"><img src="https://avatars.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a>
306
- <a href="https://github.com/mirao"><img src="https://avatars.githubusercontent.com/u/12584138?v=4" title="mirao" width="80" height="80"></a>
307
- <a href="https://github.com/Georgegriff"><img src="https://avatars.githubusercontent.com/u/9056958?v=4" title="Georgegriff" width="80" height="80"></a>
308
- <a href="https://github.com/KMKoushik"><img src="https://avatars.githubusercontent.com/u/24666922?v=4" title="KMKoushik" width="80" height="80"></a>
309
- <a href="https://github.com/nikocanvacom"><img src="https://avatars.githubusercontent.com/u/83254493?v=4" title="nikocanvacom" width="80" height="80"></a>
310
- <a href="https://github.com/elukoyanov"><img src="https://avatars.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a>
311
- <a href="https://github.com/gkushang"><img src="https://avatars.githubusercontent.com/u/3663389?v=4" title="gkushang" width="80" height="80"></a>
312
- <a href="https://github.com/tsuemura"><img src="https://avatars.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
313
- <a href="https://github.com/EgorBodnar"><img src="https://avatars.githubusercontent.com/u/63167966?v=4" title="EgorBodnar" width="80" height="80"></a>
314
- <a href="https://github.com/VikalpP"><img src="https://avatars.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a>
315
- <a href="https://github.com/elaichenkov"><img src="https://avatars.githubusercontent.com/u/29764053?v=4" title="elaichenkov" width="80" height="80"></a>
316
- <a href="https://github.com/BorisOsipov"><img src="https://avatars.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a>
317
- <a href="https://github.com/nitschSB"><img src="https://avatars.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a>
318
- <a href="https://github.com/hubidu"><img src="https://avatars.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
319
- <a href="https://github.com/jploskonka"><img src="https://avatars.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a>
320
- <a href="https://github.com/ngraf"><img src="https://avatars.githubusercontent.com/u/7094389?v=4" title="ngraf" width="80" height="80"></a>
321
- <a href="https://github.com/maojunxyz"><img src="https://avatars.githubusercontent.com/u/28778042?v=4" title="maojunxyz" width="80" height="80"></a>
322
- <a href="https://github.com/abhimanyupandian"><img src="https://avatars.githubusercontent.com/u/36107381?v=4" title="abhimanyupandian" width="80" height="80"></a>
323
- <a href="https://github.com/martomo"><img src="https://avatars.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a>
324
- <a href="https://github.com/hatufacci"><img src="https://avatars.githubusercontent.com/u/4963181?v=4" title="hatufacci" width="80" height="80"></a>
325
- <a href="https://github.com/johnyb"><img src="https://avatars.githubusercontent.com/u/86358?v=4" title="johnyb" width="80" height="80"></a>
326
-
327
- [//]: contributor-faces
335
+ Thanks to our awesome contributors! 🎉
336
+ <a href="https://github.com/codeceptjs/codeceptjs/graphs/contributors">
337
+ <img src="https://contrib.rocks/image?repo=codeceptjs/codeceptjs" />
338
+ </a>
339
+
340
+ Made with [contrib.rocks](https://contrib.rocks).
328
341
 
329
342
  ## License
330
343