codeceptjs 4.0.2-beta.8 → 4.0.2
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.
- package/README.md +39 -28
- package/bin/codecept.js +15 -2
- package/bin/codeceptq.js +49 -0
- package/bin/mcp-server.js +1189 -0
- package/docs/advanced.md +201 -0
- package/docs/agents.md +181 -0
- package/docs/ai.md +489 -0
- package/docs/aitrace.md +266 -0
- package/docs/api.md +332 -0
- package/docs/architecture.md +235 -0
- package/docs/assertions.md +415 -0
- package/docs/auth.md +318 -0
- package/docs/basics.md +424 -0
- package/docs/bdd.md +539 -0
- package/docs/best.md +240 -0
- package/docs/bootstrap.md +132 -0
- package/docs/commands.md +352 -0
- package/docs/community-helpers.md +63 -0
- package/docs/configuration.md +185 -0
- package/docs/continuous-integration.md +431 -0
- package/docs/custom-helpers.md +297 -0
- package/docs/data.md +448 -0
- package/docs/debugging.md +332 -0
- package/docs/detox.md +235 -0
- package/docs/docker.md +107 -0
- package/docs/effects.md +179 -0
- package/docs/element-based-testing.md +295 -0
- package/docs/element-selection.md +125 -0
- package/docs/els.md +328 -0
- package/docs/environment-variables.md +131 -0
- package/docs/examples.md +160 -0
- package/docs/heal.md +213 -0
- package/docs/helpers/ApiDataFactory.md +267 -0
- package/docs/helpers/Appium.md +1419 -0
- package/docs/helpers/Detox.md +665 -0
- package/docs/helpers/ExpectHelper.md +275 -0
- package/docs/helpers/FileSystem.md +152 -0
- package/docs/helpers/GraphQL.md +152 -0
- package/docs/helpers/GraphQLDataFactory.md +226 -0
- package/docs/helpers/JSONResponse.md +255 -0
- package/docs/helpers/MockRequest.md +377 -0
- package/docs/helpers/Playwright.md +2970 -0
- package/docs/helpers/Puppeteer-firefox.md +86 -0
- package/docs/helpers/Puppeteer.md +2583 -0
- package/docs/helpers/REST.md +289 -0
- package/docs/helpers/WebDriver.md +2639 -0
- package/docs/hooks.md +148 -0
- package/docs/index.md +111 -0
- package/docs/installation.md +121 -0
- package/docs/internal-test-server.md +89 -0
- package/docs/locators.md +355 -0
- package/docs/mcp.md +485 -0
- package/docs/migrate-from-cypress.md +98 -0
- package/docs/migrate-from-java.md +108 -0
- package/docs/migrate-from-protractor.md +101 -0
- package/docs/migrate-from-testcafe.md +99 -0
- package/docs/migration-4.md +745 -0
- package/docs/mobile.md +338 -0
- package/docs/pageobjects.md +399 -0
- package/docs/parallel.md +187 -0
- package/docs/playwright.md +714 -0
- package/docs/plugins/aiTrace.md +49 -0
- package/docs/plugins/analyze.md +66 -0
- package/docs/plugins/auth.md +241 -0
- package/docs/plugins/autoDelay.md +48 -0
- package/docs/plugins/browser.md +41 -0
- package/docs/plugins/coverage.md +39 -0
- package/docs/plugins/customLocator.md +119 -0
- package/docs/plugins/customReporter.md +16 -0
- package/docs/plugins/expose.md +75 -0
- package/docs/plugins/heal.md +44 -0
- package/docs/plugins/junitReporter.md +51 -0
- package/docs/plugins/pageInfo.md +34 -0
- package/docs/plugins/pause.md +43 -0
- package/docs/plugins/pauseOnFail.md +18 -0
- package/docs/plugins/retryFailedStep.md +75 -0
- package/docs/plugins/screencast.md +55 -0
- package/docs/plugins/screenshot.md +58 -0
- package/docs/plugins/screenshotOnFail.md +18 -0
- package/docs/plugins/stepTimeout.md +65 -0
- package/docs/plugins.md +87 -0
- package/docs/puppeteer.md +314 -0
- package/docs/quickstart.md +120 -0
- package/docs/reports.md +195 -0
- package/docs/retry.md +311 -0
- package/docs/secrets.md +150 -0
- package/docs/sessions.md +80 -0
- package/docs/shadow.md +68 -0
- package/docs/store.md +94 -0
- package/docs/test-structure.md +275 -0
- package/docs/timeouts.md +183 -0
- package/docs/translation.md +247 -0
- package/docs/tutorial.md +323 -0
- package/docs/typescript.md +159 -0
- package/docs/web-element.md +251 -0
- package/docs/webdriver.md +641 -0
- package/docs/within.md +55 -0
- package/lib/actor.js +1 -36
- package/lib/ai.js +3 -2
- package/lib/aria.js +260 -0
- package/lib/assertions.js +18 -0
- package/lib/codecept.js +34 -25
- package/lib/command/check.js +2 -1
- package/lib/command/definitions.js +6 -7
- package/lib/command/dryRun.js +24 -5
- package/lib/command/generate.js +3 -1
- package/lib/command/gherkin/snippets.js +5 -4
- package/lib/command/init.js +249 -270
- package/lib/command/list.js +150 -10
- package/lib/command/query.js +218 -0
- package/lib/command/run-multiple.js +3 -1
- package/lib/command/run-workers.js +2 -14
- package/lib/command/run.js +3 -17
- package/lib/command/utils.js +14 -0
- package/lib/command/workers/runTests.js +91 -37
- package/lib/config.js +96 -18
- package/lib/container.js +115 -17
- package/lib/effects.js +17 -0
- package/lib/element/WebElement.js +246 -2
- package/lib/els.js +12 -6
- package/lib/globals.js +32 -19
- package/lib/heal.js +7 -4
- package/lib/helper/ApiDataFactory.js +2 -1
- package/lib/helper/Appium.js +8 -8
- package/lib/helper/FileSystem.js +3 -2
- package/lib/helper/GraphQLDataFactory.js +2 -1
- package/lib/helper/Playwright.js +358 -467
- package/lib/helper/Puppeteer.js +335 -192
- package/lib/helper/WebDriver.js +324 -111
- package/lib/helper/errors/ElementNotFound.js +5 -2
- package/lib/helper/errors/MultipleElementsFound.js +52 -0
- package/lib/helper/errors/NonFocusedType.js +8 -0
- package/lib/helper/extras/Download.js +45 -0
- package/lib/helper/extras/PlaywrightLocator.js +7 -107
- package/lib/helper/extras/elementSelection.js +58 -0
- package/lib/helper/extras/focusCheck.js +43 -0
- package/lib/helper/extras/richTextEditor.js +178 -0
- package/lib/helper/scripts/dropFile.js +11 -0
- package/lib/history.js +3 -2
- package/lib/html.js +103 -16
- package/lib/index.js +9 -1
- package/lib/listener/config.js +6 -4
- package/lib/listener/emptyRun.js +2 -1
- package/lib/listener/globalRetry.js +32 -6
- package/lib/listener/helpers.js +4 -1
- package/lib/listener/mocha.js +2 -1
- package/lib/listener/pageobjects.js +43 -0
- package/lib/listener/result.js +3 -2
- package/lib/locator.js +158 -16
- package/lib/mocha/cli.js +19 -1
- package/lib/mocha/factory.js +11 -1
- package/lib/mocha/inject.js +1 -1
- package/lib/mocha/scenarioConfig.js +2 -1
- package/lib/mocha/ui.js +5 -6
- package/lib/parser.js +2 -2
- package/lib/pause.js +38 -4
- package/lib/plugin/aiTrace.js +457 -0
- package/lib/plugin/analyze.js +9 -9
- package/lib/plugin/auth.js +5 -4
- package/lib/plugin/browser.js +77 -0
- package/lib/plugin/expose.js +159 -0
- package/lib/plugin/heal.js +47 -3
- package/lib/plugin/junitReporter.js +303 -0
- package/lib/plugin/pageInfo.js +54 -52
- package/lib/plugin/pause.js +131 -0
- package/lib/plugin/pauseOnFail.js +11 -33
- package/lib/plugin/retryFailedStep.js +43 -32
- package/lib/plugin/screencast.js +289 -0
- package/lib/plugin/screenshot.js +558 -0
- package/lib/plugin/screenshotOnFail.js +9 -170
- package/lib/plugin/stepTimeout.js +3 -2
- package/lib/recorder.js +1 -1
- package/lib/rerun.js +2 -1
- package/lib/result.js +2 -1
- package/lib/step/base.js +10 -9
- package/lib/step/comment.js +2 -2
- package/lib/step/config.js +15 -2
- package/lib/step/helper.js +4 -4
- package/lib/step/meta.js +3 -3
- package/lib/step/record.js +5 -5
- package/lib/store.js +72 -3
- package/lib/translation.js +2 -1
- package/lib/utils/loaderCheck.js +28 -0
- package/lib/utils/mask_data.js +2 -1
- package/lib/utils/pluginParser.js +151 -0
- package/lib/utils/trace.js +297 -0
- package/lib/utils/typescript.js +188 -23
- package/lib/utils.js +77 -3
- package/lib/workers.js +65 -40
- package/package.json +35 -30
- package/typings/index.d.ts +119 -8
- package/typings/promiseBasedTypes.d.ts +3158 -6065
- package/typings/types.d.ts +3453 -6494
- package/docs/webapi/amOnPage.mustache +0 -11
- package/docs/webapi/appendField.mustache +0 -11
- package/docs/webapi/attachFile.mustache +0 -12
- package/docs/webapi/blur.mustache +0 -18
- package/docs/webapi/checkOption.mustache +0 -13
- package/docs/webapi/clearCookie.mustache +0 -9
- package/docs/webapi/clearField.mustache +0 -9
- package/docs/webapi/click.mustache +0 -29
- package/docs/webapi/clickLink.mustache +0 -8
- package/docs/webapi/closeCurrentTab.mustache +0 -7
- package/docs/webapi/closeOtherTabs.mustache +0 -8
- package/docs/webapi/dontSee.mustache +0 -11
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
- package/docs/webapi/dontSeeCookie.mustache +0 -8
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
- package/docs/webapi/dontSeeElement.mustache +0 -8
- package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
- package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
- package/docs/webapi/dontSeeInField.mustache +0 -11
- package/docs/webapi/dontSeeInSource.mustache +0 -8
- package/docs/webapi/dontSeeInTitle.mustache +0 -8
- package/docs/webapi/dontSeeTraffic.mustache +0 -13
- package/docs/webapi/doubleClick.mustache +0 -13
- package/docs/webapi/downloadFile.mustache +0 -12
- package/docs/webapi/dragAndDrop.mustache +0 -9
- package/docs/webapi/dragSlider.mustache +0 -11
- package/docs/webapi/executeAsyncScript.mustache +0 -24
- package/docs/webapi/executeScript.mustache +0 -26
- package/docs/webapi/fillField.mustache +0 -16
- package/docs/webapi/flushNetworkTraffics.mustache +0 -5
- package/docs/webapi/focus.mustache +0 -13
- package/docs/webapi/forceClick.mustache +0 -28
- package/docs/webapi/forceRightClick.mustache +0 -18
- package/docs/webapi/grabAllWindowHandles.mustache +0 -7
- package/docs/webapi/grabAttributeFrom.mustache +0 -10
- package/docs/webapi/grabAttributeFromAll.mustache +0 -9
- package/docs/webapi/grabBrowserLogs.mustache +0 -9
- package/docs/webapi/grabCookie.mustache +0 -11
- package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
- package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
- package/docs/webapi/grabCurrentUrl.mustache +0 -9
- package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
- package/docs/webapi/grabElementBoundingRect.mustache +0 -20
- package/docs/webapi/grabGeoLocation.mustache +0 -8
- package/docs/webapi/grabHTMLFrom.mustache +0 -10
- package/docs/webapi/grabHTMLFromAll.mustache +0 -9
- package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
- package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
- package/docs/webapi/grabPageScrollPosition.mustache +0 -8
- package/docs/webapi/grabPopupText.mustache +0 -5
- package/docs/webapi/grabRecordedNetworkTraffics.mustache +0 -10
- package/docs/webapi/grabSource.mustache +0 -8
- package/docs/webapi/grabTextFrom.mustache +0 -10
- package/docs/webapi/grabTextFromAll.mustache +0 -9
- package/docs/webapi/grabTitle.mustache +0 -8
- package/docs/webapi/grabValueFrom.mustache +0 -9
- package/docs/webapi/grabValueFromAll.mustache +0 -8
- package/docs/webapi/grabWebElement.mustache +0 -9
- package/docs/webapi/grabWebElements.mustache +0 -9
- package/docs/webapi/moveCursorTo.mustache +0 -12
- package/docs/webapi/openNewTab.mustache +0 -7
- package/docs/webapi/pressKey.mustache +0 -12
- package/docs/webapi/pressKeyDown.mustache +0 -12
- package/docs/webapi/pressKeyUp.mustache +0 -12
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
- package/docs/webapi/refreshPage.mustache +0 -6
- package/docs/webapi/resizeWindow.mustache +0 -6
- package/docs/webapi/rightClick.mustache +0 -14
- package/docs/webapi/saveElementScreenshot.mustache +0 -10
- package/docs/webapi/saveScreenshot.mustache +0 -12
- package/docs/webapi/say.mustache +0 -10
- package/docs/webapi/scrollIntoView.mustache +0 -11
- package/docs/webapi/scrollPageToBottom.mustache +0 -6
- package/docs/webapi/scrollPageToTop.mustache +0 -6
- package/docs/webapi/scrollTo.mustache +0 -12
- package/docs/webapi/see.mustache +0 -11
- package/docs/webapi/seeAttributesOnElements.mustache +0 -9
- package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
- package/docs/webapi/seeCookie.mustache +0 -8
- package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
- package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
- package/docs/webapi/seeElement.mustache +0 -8
- package/docs/webapi/seeElementInDOM.mustache +0 -8
- package/docs/webapi/seeInCurrentUrl.mustache +0 -8
- package/docs/webapi/seeInField.mustache +0 -12
- package/docs/webapi/seeInPopup.mustache +0 -8
- package/docs/webapi/seeInSource.mustache +0 -7
- package/docs/webapi/seeInTitle.mustache +0 -8
- package/docs/webapi/seeNumberOfElements.mustache +0 -11
- package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
- package/docs/webapi/seeTextEquals.mustache +0 -9
- package/docs/webapi/seeTitleEquals.mustache +0 -8
- package/docs/webapi/seeTraffic.mustache +0 -36
- package/docs/webapi/selectOption.mustache +0 -21
- package/docs/webapi/setCookie.mustache +0 -16
- package/docs/webapi/setGeoLocation.mustache +0 -12
- package/docs/webapi/startRecordingTraffic.mustache +0 -8
- package/docs/webapi/startRecordingWebSocketMessages.mustache +0 -8
- package/docs/webapi/stopRecordingTraffic.mustache +0 -5
- package/docs/webapi/stopRecordingWebSocketMessages.mustache +0 -7
- package/docs/webapi/switchTo.mustache +0 -9
- package/docs/webapi/switchToNextTab.mustache +0 -10
- package/docs/webapi/switchToPreviousTab.mustache +0 -10
- package/docs/webapi/type.mustache +0 -21
- package/docs/webapi/uncheckOption.mustache +0 -13
- package/docs/webapi/wait.mustache +0 -8
- package/docs/webapi/waitForClickable.mustache +0 -11
- package/docs/webapi/waitForCookie.mustache +0 -9
- package/docs/webapi/waitForDetached.mustache +0 -10
- package/docs/webapi/waitForDisabled.mustache +0 -6
- package/docs/webapi/waitForElement.mustache +0 -11
- package/docs/webapi/waitForEnabled.mustache +0 -6
- package/docs/webapi/waitForFunction.mustache +0 -17
- package/docs/webapi/waitForInvisible.mustache +0 -10
- package/docs/webapi/waitForNumberOfTabs.mustache +0 -9
- package/docs/webapi/waitForText.mustache +0 -13
- package/docs/webapi/waitForValue.mustache +0 -10
- package/docs/webapi/waitForVisible.mustache +0 -10
- package/docs/webapi/waitInUrl.mustache +0 -9
- package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
- package/docs/webapi/waitToHide.mustache +0 -10
- package/docs/webapi/waitUrlEquals.mustache +0 -10
- package/lib/helper/AI.js +0 -214
- package/lib/helper/Mochawesome.js +0 -96
- package/lib/helper/extras/PlaywrightReactVueLocator.js +0 -52
- package/lib/helper/extras/React.js +0 -65
- package/lib/listener/enhancedGlobalRetry.js +0 -110
- package/lib/plugin/enhancedRetryFailedStep.js +0 -99
- package/lib/plugin/htmlReporter.js +0 -3648
- package/lib/plugin/stepByStepReport.js +0 -427
- package/lib/plugin/subtitles.js +0 -89
- package/lib/retryCoordinator.js +0 -207
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/heal
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: heal
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## heal
|
|
11
|
+
|
|
12
|
+
Self-healing tests with AI.
|
|
13
|
+
|
|
14
|
+
Read more about healing in [Self-Healing Tests][1]
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
plugins: {
|
|
18
|
+
heal: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
on: 'fail',
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
More config options are available:
|
|
26
|
+
|
|
27
|
+
* `healLimit` - how many steps can be healed in a single test (default: 2)
|
|
28
|
+
* `on` - trigger mode. `fail` (default), `file` (filter to a path), `url` (filter to a URL pattern).
|
|
29
|
+
|
|
30
|
+
#### `on=` modes
|
|
31
|
+
|
|
32
|
+
Heal always runs on step failures; `on=` narrows when it engages.
|
|
33
|
+
|
|
34
|
+
* **fail** — heal any failing step (default)
|
|
35
|
+
* **file** — heal only failures in `path=...[;line=...]`
|
|
36
|
+
* **url** — heal only failures when the current URL matches `pattern=...`
|
|
37
|
+
|
|
38
|
+
`on=step` and `on=test` are not supported and are rejected with an error.
|
|
39
|
+
|
|
40
|
+
### Parameters
|
|
41
|
+
|
|
42
|
+
* `config`
|
|
43
|
+
|
|
44
|
+
[1]: https://codecept.io/heal/
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/junitReporter
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: junitReporter
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## junitReporter
|
|
11
|
+
|
|
12
|
+
Generates a JUnit-compatible XML report after a test run.
|
|
13
|
+
|
|
14
|
+
Unlike Mocha's `mocha-junit-reporter`, this plugin understands CodeceptJS steps and substeps.
|
|
15
|
+
For every `<testcase>` it includes:
|
|
16
|
+
|
|
17
|
+
* `<properties>` — the test's meta information: every `meta` key from `Scenario('...', { meta })`, plus its `tags` and `retries`
|
|
18
|
+
* `<system-out>` — an indented step/substep log (substeps are nested under their meta step); only failed steps are marked
|
|
19
|
+
* `<failure>` — for failed tests: the error message, type, stack trace and (optionally) the step trace
|
|
20
|
+
|
|
21
|
+
The produced file is consumable by Jenkins, GitLab CI, CircleCI, GitHub Actions test reporters, etc.
|
|
22
|
+
|
|
23
|
+
#### Configuration
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
"plugins": {
|
|
27
|
+
"junitReporter": {
|
|
28
|
+
"enabled": true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Possible config options:
|
|
34
|
+
|
|
35
|
+
* `outputName`: file name for the report. Default: `report.xml`.
|
|
36
|
+
* `output`: directory where the report is stored, relative to the project root. Default: the `output` directory.
|
|
37
|
+
* `testGroupName`: value of the `name` attribute on the root `<testsuites>` element. Default: `CodeceptJS`.
|
|
38
|
+
* `attachMeta`: add the test's meta information (`meta` keys, `tags`, `retries`) as `<properties>`. Default: true.
|
|
39
|
+
* `attachSteps`: add the step/substep log as `<system-out>`. Default: true.
|
|
40
|
+
* `stepsInFailure`: append the step trace to the `<failure>` body. Default: true.
|
|
41
|
+
|
|
42
|
+
CLI examples:
|
|
43
|
+
|
|
44
|
+
npx codeceptjs run -p junitReporter
|
|
45
|
+
npx codeceptjs run -p junitReporter:outputName=junit.xml
|
|
46
|
+
|
|
47
|
+
> ℹ When running with `run-workers`, steps are serialized between processes and substep nesting is flattened.
|
|
48
|
+
|
|
49
|
+
### Parameters
|
|
50
|
+
|
|
51
|
+
* `config` **any**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/pageInfo
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: pageInfo
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## pageInfo
|
|
11
|
+
|
|
12
|
+
Collects information from web page after each failed test and adds it to the test as an artifact.
|
|
13
|
+
It is suggested to enable this plugin if you run tests on CI and you need to debug failed tests.
|
|
14
|
+
This plugin can be paired with `analyze` plugin to provide more context.
|
|
15
|
+
|
|
16
|
+
It collects URL, HTML errors (by classes), and browser logs.
|
|
17
|
+
|
|
18
|
+
Enable this plugin in config:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
plugins: {
|
|
22
|
+
pageInfo: {
|
|
23
|
+
enabled: true,
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Additional config options:
|
|
28
|
+
|
|
29
|
+
* `errorClasses` - list of classes to search for errors (default: `['error', 'warning', 'alert', 'danger']`)
|
|
30
|
+
* `browserLogs` - list of types of errors to search for in browser logs (default: `['error']`)
|
|
31
|
+
|
|
32
|
+
### Parameters
|
|
33
|
+
|
|
34
|
+
* `config`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/pause
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: pause
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## pause
|
|
11
|
+
|
|
12
|
+
Pauses test execution interactively. Replaces the legacy `pauseOnFail`
|
|
13
|
+
plugin. The default `on=fail` matches the old `pauseOnFail` behavior.
|
|
14
|
+
|
|
15
|
+
#### Configuration
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
plugins: {
|
|
19
|
+
pause: {
|
|
20
|
+
enabled: false,
|
|
21
|
+
on: 'fail',
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### `on=` modes
|
|
27
|
+
|
|
28
|
+
* **fail** — pause when a step fails (default)
|
|
29
|
+
* **test** — pause after each test
|
|
30
|
+
* **step** — pause before the first step (interactive walk-through)
|
|
31
|
+
* **file** — pause when execution reaches `path=...[;line=...]`
|
|
32
|
+
* **url** — pause when the browser URL matches `pattern=...`
|
|
33
|
+
|
|
34
|
+
CLI examples:
|
|
35
|
+
|
|
36
|
+
npx codeceptjs run -p pause
|
|
37
|
+
npx codeceptjs run -p pause:on=step
|
|
38
|
+
npx codeceptjs run -p pause:on=file:path=tests/login_test.js;line=43
|
|
39
|
+
npx codeceptjs run -p pause:on=url:pattern=/users/*
|
|
40
|
+
|
|
41
|
+
### Parameters
|
|
42
|
+
|
|
43
|
+
* `config`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/pauseOnFail
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: pauseOnFail
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## pauseOnFail
|
|
11
|
+
|
|
12
|
+
Starts an interactive pause when a test fails.
|
|
13
|
+
|
|
14
|
+
**Deprecated:** use the `pause` plugin with `on: 'fail'`, which is the default behavior.
|
|
15
|
+
|
|
16
|
+
### Parameters
|
|
17
|
+
|
|
18
|
+
* `config`
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/retryFailedStep
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: retryFailedStep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## retryFailedStep
|
|
11
|
+
|
|
12
|
+
Retries each failed step in a test.
|
|
13
|
+
|
|
14
|
+
Add this plugin to config file:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
plugins: {
|
|
18
|
+
retryFailedStep: {
|
|
19
|
+
enabled: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Run tests with plugin enabled:
|
|
25
|
+
|
|
26
|
+
npx codeceptjs run --plugins retryFailedStep
|
|
27
|
+
|
|
28
|
+
#### Configuration:
|
|
29
|
+
|
|
30
|
+
* `retries` - number of retries (by default 3),
|
|
31
|
+
* `factor` - The exponential factor to use. Default is 1.5.
|
|
32
|
+
* `minTimeout` - The number of milliseconds before starting the first retry. Default is 150.
|
|
33
|
+
* `maxTimeout` - The maximum number of milliseconds between two retries. Default is 10000.
|
|
34
|
+
* `randomize` - Randomizes the timeouts by multiplying with a factor from 1 to 2. Default is false.
|
|
35
|
+
* `defaultIgnoredSteps` - an array of steps to be ignored for retry. Includes:
|
|
36
|
+
* `amOnPage`
|
|
37
|
+
* `wait*`
|
|
38
|
+
* `send*`
|
|
39
|
+
* `execute*`
|
|
40
|
+
* `run*`
|
|
41
|
+
* `have*`
|
|
42
|
+
* `ignoredSteps` - an array for custom steps to ignore on retry. Use it to append custom steps to ignored list.
|
|
43
|
+
You can use step names or step prefixes ending with `*`. As such, `wait*` will match all steps starting with `wait`.
|
|
44
|
+
To append your own steps to ignore list - copy and paste a default steps list. Regexp values are accepted as well.
|
|
45
|
+
* `deferToScenarioRetries` - when enabled (default), step retries are automatically disabled if scenario retries are configured to avoid excessive total retries.
|
|
46
|
+
|
|
47
|
+
#### Example
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
plugins: {
|
|
51
|
+
retryFailedStep: {
|
|
52
|
+
enabled: true,
|
|
53
|
+
ignoredSteps: [
|
|
54
|
+
'scroll*', // ignore all scroll steps
|
|
55
|
+
/Cookie/, // ignore all steps with a Cookie in it (by regexp)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Disable Per Test
|
|
62
|
+
|
|
63
|
+
This plugin can be disabled per test. In this case you will need to add `step.retry()` to all flaky steps:
|
|
64
|
+
|
|
65
|
+
Use scenario configuration to disable plugin for a test
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
Scenario('scenario tite', { disableRetryFailedStep: true }, () => {
|
|
69
|
+
// test goes here
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Parameters
|
|
74
|
+
|
|
75
|
+
* `config`  
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/screencast
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: screencast
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## screencast
|
|
11
|
+
|
|
12
|
+
Records WebM video of tests using Playwright's screencast API.
|
|
13
|
+
|
|
14
|
+
When `captions` is enabled, action annotations are burned into the video;
|
|
15
|
+
when `subtitles` is enabled, a standalone `.srt` is also produced. Default
|
|
16
|
+
`on=fail` keeps videos for failed tests only; `on=test` keeps every test's
|
|
17
|
+
video.
|
|
18
|
+
|
|
19
|
+
Note: enabling Playwright's helper-level `video: true` together with this
|
|
20
|
+
plugin produces two independent recordings (`output/videos/*.webm` from the
|
|
21
|
+
helper, `output/screencast/*.webm` from this plugin).
|
|
22
|
+
|
|
23
|
+
#### Configuration
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
plugins: {
|
|
27
|
+
screencast: {
|
|
28
|
+
enabled: true,
|
|
29
|
+
on: 'fail',
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### `on=` modes
|
|
35
|
+
|
|
36
|
+
* **fail** — record while running; delete on pass, keep on fail (default)
|
|
37
|
+
* **test** — record and keep every test's video
|
|
38
|
+
|
|
39
|
+
Other config options:
|
|
40
|
+
|
|
41
|
+
* `captions`: burn-in action overlays via `page.screencast.showActions()`. Default: true.
|
|
42
|
+
* `subtitles`: also write a standalone `.srt` file alongside the video. Default: false.
|
|
43
|
+
* `video`: record a video. With `video=false, subtitles=true`, only the `.srt` is produced. Default: true.
|
|
44
|
+
* `size`: pass-through `{ width, height }` for `screencast.start`.
|
|
45
|
+
* `quality`: pass-through 0–100 for `screencast.start`.
|
|
46
|
+
|
|
47
|
+
CLI examples:
|
|
48
|
+
|
|
49
|
+
npx codeceptjs run -p screencast
|
|
50
|
+
npx codeceptjs run -p screencast:on=test
|
|
51
|
+
npx codeceptjs run -p screencast:on=test;captions=false;subtitles=true
|
|
52
|
+
|
|
53
|
+
### Parameters
|
|
54
|
+
|
|
55
|
+
* `config`
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/screenshot
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: screenshot
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## screenshot
|
|
11
|
+
|
|
12
|
+
Saves screenshots from the browser at points triggered by `on=`.
|
|
13
|
+
|
|
14
|
+
Replaces the legacy `screenshotOnFail` plugin. Default `on=fail` preserves the
|
|
15
|
+
old behavior (screenshot when a test fails). Pass `slides=true` (with `on=step`)
|
|
16
|
+
to generate a step-by-step slideshow report — replaces the legacy
|
|
17
|
+
`stepByStepReport` plugin.
|
|
18
|
+
|
|
19
|
+
#### Configuration
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
plugins: {
|
|
23
|
+
screenshot: {
|
|
24
|
+
enabled: true,
|
|
25
|
+
on: 'fail',
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### `on=` modes
|
|
31
|
+
|
|
32
|
+
* **fail** — screenshot when a test fails (default)
|
|
33
|
+
* **test** — screenshot at the end of every test
|
|
34
|
+
* **step** — screenshot after every step
|
|
35
|
+
* **file** — screenshot for steps in `path=...[;line=...]`
|
|
36
|
+
* **url** — screenshot when the current browser URL matches `pattern=...`
|
|
37
|
+
|
|
38
|
+
Other config options:
|
|
39
|
+
|
|
40
|
+
* `uniqueScreenshotNames`: use unique names for screenshot. Default: false.
|
|
41
|
+
* `fullPageScreenshots`: make full page screenshots. Default: false.
|
|
42
|
+
* `disableScreenshots`: legacy switch to skip the plugin entirely.
|
|
43
|
+
* `slides`: generate a step-by-step slideshow report (requires `on=step`). Default: false.
|
|
44
|
+
* `deleteSuccessful`: when `slides=true`, drop slideshow directories of passing tests. Default: true.
|
|
45
|
+
* `animateSlides`: when `slides=true`, animate transitions between slides. Default: true.
|
|
46
|
+
* `ignoreSteps`: when `slides=true`, RegExps of step names to skip in the slideshow.
|
|
47
|
+
|
|
48
|
+
CLI examples:
|
|
49
|
+
|
|
50
|
+
npx codeceptjs run -p screenshot
|
|
51
|
+
npx codeceptjs run -p screenshot:on=step
|
|
52
|
+
npx codeceptjs run -p screenshot:on=step;slides=true
|
|
53
|
+
npx codeceptjs run -p screenshot:on=file:path=tests/login_test.js
|
|
54
|
+
npx codeceptjs run -p screenshot:on=url:pattern=/users/*
|
|
55
|
+
|
|
56
|
+
### Parameters
|
|
57
|
+
|
|
58
|
+
* `config`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/screenshotOnFail
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: screenshotOnFail
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## screenshotOnFail
|
|
11
|
+
|
|
12
|
+
Saves a screenshot when a test fails.
|
|
13
|
+
|
|
14
|
+
**Deprecated:** use the `screenshot` plugin with `on: 'fail'`, which is the default behavior.
|
|
15
|
+
|
|
16
|
+
### Parameters
|
|
17
|
+
|
|
18
|
+
* `config`
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins/stepTimeout
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: stepTimeout
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
9
|
+
|
|
10
|
+
## stepTimeout
|
|
11
|
+
|
|
12
|
+
Set timeout for test steps globally.
|
|
13
|
+
|
|
14
|
+
Add this plugin to config file:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
plugins: {
|
|
18
|
+
stepTimeout: {
|
|
19
|
+
enabled: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Run tests with plugin enabled:
|
|
25
|
+
|
|
26
|
+
npx codeceptjs run --plugins stepTimeout
|
|
27
|
+
|
|
28
|
+
#### Configuration:
|
|
29
|
+
|
|
30
|
+
* `timeout` - global step timeout, default 150 seconds
|
|
31
|
+
|
|
32
|
+
* `overrideStepLimits` - whether to use timeouts set in plugin config to override step timeouts set in code with `I.action(..., step.timeout(x))`, default false
|
|
33
|
+
|
|
34
|
+
* `noTimeoutSteps` - an array of steps with no timeout. Default:
|
|
35
|
+
|
|
36
|
+
* `amOnPage`
|
|
37
|
+
* `wait*`
|
|
38
|
+
|
|
39
|
+
you could set your own noTimeoutSteps which would replace the default one.
|
|
40
|
+
|
|
41
|
+
* `customTimeoutSteps` - an array of step actions with custom timeout. Use it to override or extend noTimeoutSteps.
|
|
42
|
+
You can use step names or step prefixes ending with `*`. As such, `wait*` will match all steps starting with `wait`.
|
|
43
|
+
|
|
44
|
+
#### Example
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
plugins: {
|
|
48
|
+
stepTimeout: {
|
|
49
|
+
enabled: true,
|
|
50
|
+
overrideStepLimits: true,
|
|
51
|
+
noTimeoutSteps: [
|
|
52
|
+
'scroll*', // ignore all scroll steps
|
|
53
|
+
/Cookie/, // ignore all steps with a Cookie in it (by regexp)
|
|
54
|
+
],
|
|
55
|
+
customTimeoutSteps: [
|
|
56
|
+
['myFlakyStep*', 1],
|
|
57
|
+
['scrollWhichRequiresTimeout', 5],
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
* `config`  
|
package/docs/plugins.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: /plugins
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
5
|
+
title: Plugins
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Plugins
|
|
9
|
+
|
|
10
|
+
CodeceptJS bundles the following plugins. Each plugin has its own page with full configuration reference.
|
|
11
|
+
|
|
12
|
+
## [aiTrace](/plugins/aiTrace)
|
|
13
|
+
|
|
14
|
+
Generates AI-friendly trace files for debugging with AI agents. This plugin creates a markdown file with test execution logs and links to all artifacts (screenshots, HTML, ARIA snapshots, browser logs, HTTP requests) for each step.
|
|
15
|
+
|
|
16
|
+
## [analyze](/plugins/analyze)
|
|
17
|
+
|
|
18
|
+
Uses AI to analyze test failures and provide insights
|
|
19
|
+
|
|
20
|
+
## [auth](/plugins/auth)
|
|
21
|
+
|
|
22
|
+
Logs user in for the first test and reuses session for next tests. Works by saving cookies into memory or file. If a session expires automatically logs in again.
|
|
23
|
+
|
|
24
|
+
## [autoDelay](/plugins/autoDelay)
|
|
25
|
+
|
|
26
|
+
Sometimes it takes some time for a page to respond to user's actions. Depending on app's performance this can be either slow or fast.
|
|
27
|
+
|
|
28
|
+
## [browser](/plugins/browser)
|
|
29
|
+
|
|
30
|
+
Overrides browser helper config from the command line. Works for all browser helpers (Playwright, Puppeteer, WebDriver, Appium) without touching `codecept.conf`.
|
|
31
|
+
|
|
32
|
+
## [coverage](/plugins/coverage)
|
|
33
|
+
|
|
34
|
+
Dumps code coverage from Playwright/Puppeteer after every test.
|
|
35
|
+
|
|
36
|
+
## [customLocator](/plugins/customLocator)
|
|
37
|
+
|
|
38
|
+
Creates a [custom locator][1] by using special attributes in HTML.
|
|
39
|
+
|
|
40
|
+
## [customReporter](/plugins/customReporter)
|
|
41
|
+
|
|
42
|
+
Sample custom reporter for CodeceptJS.
|
|
43
|
+
|
|
44
|
+
## [expose](/plugins/expose)
|
|
45
|
+
|
|
46
|
+
Exposes properties from helper instances as injectable test arguments. Use it to access the underlying Playwright/Puppeteer `page`, the wdio `browser` client, or any other helper internal directly from a Scenario:
|
|
47
|
+
|
|
48
|
+
## [heal](/plugins/heal)
|
|
49
|
+
|
|
50
|
+
Self-healing tests with AI.
|
|
51
|
+
|
|
52
|
+
## [junitReporter](/plugins/junitReporter)
|
|
53
|
+
|
|
54
|
+
Generates a JUnit-compatible XML report after a test run.
|
|
55
|
+
|
|
56
|
+
## [pageInfo](/plugins/pageInfo)
|
|
57
|
+
|
|
58
|
+
Collects information from web page after each failed test and adds it to the test as an artifact. It is suggested to enable this plugin if you run tests on CI and you need to debug failed tests. This plugin can be paired with `analyze` plugin to provide more context.
|
|
59
|
+
|
|
60
|
+
## [pause](/plugins/pause)
|
|
61
|
+
|
|
62
|
+
Pauses test execution interactively. Replaces the legacy `pauseOnFail` plugin. The default `on=fail` matches the old `pauseOnFail` behavior.
|
|
63
|
+
|
|
64
|
+
## [pauseOnFail](/plugins/pauseOnFail)
|
|
65
|
+
|
|
66
|
+
Starts an interactive pause when a test fails.
|
|
67
|
+
|
|
68
|
+
## [retryFailedStep](/plugins/retryFailedStep)
|
|
69
|
+
|
|
70
|
+
Retries each failed step in a test.
|
|
71
|
+
|
|
72
|
+
## [screencast](/plugins/screencast)
|
|
73
|
+
|
|
74
|
+
Records WebM video of tests using Playwright's screencast API.
|
|
75
|
+
|
|
76
|
+
## [screenshot](/plugins/screenshot)
|
|
77
|
+
|
|
78
|
+
Saves screenshots from the browser at points triggered by `on=`.
|
|
79
|
+
|
|
80
|
+
## [screenshotOnFail](/plugins/screenshotOnFail)
|
|
81
|
+
|
|
82
|
+
Saves a screenshot when a test fails.
|
|
83
|
+
|
|
84
|
+
## [stepTimeout](/plugins/stepTimeout)
|
|
85
|
+
|
|
86
|
+
Set timeout for test steps globally.
|
|
87
|
+
|