Skip to content

Commit 2a242e4

Browse files
DavertMikDavertMik
and
DavertMik
authoredJan 24, 2025
Feat/analyze result (#4753)
* added result object, improved transport of tests * fixed setting name for test * fixed workers tests * improved handling information between workers and main process * fixed tests * added result to typings * fixed printing steps * fixed def & failing tests * fixing timeout errors * fixed mocha hooks, analyze plugin, added custom reporter tests * improved prompt for analyze plugin * refactored timeouts to fix tests * fixed saving screenshot file * fixed step sections * fixed tests for timeout errors * added change fot pageInfo plugin * fixed timeout tests * fixed timeout tests with retries --------- Co-authored-by: DavertMik <davert@testomat.io>
1 parent f27e662 commit 2a242e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1661
-892
lines changed
 

‎.github/workflows/webdriver.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
3939
- name: start a server
4040
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
41-
- name: Check CodeceptJS can be started
41+
- name: check
4242
run: './bin/codecept.js check -c test/acceptance/codecept.WebDriver.js'
4343
- name: run unit tests
4444
run: ./node_modules/.bin/mocha test/helper/WebDriver_test.js --exit

‎docs/plugins.md

+35-19
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ title: Plugins
77

88
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
99

10+
## analyze
11+
12+
### Parameters
13+
14+
- `config` **any** (optional, default `{}`)
15+
1016
## autoDelay
1117

1218
Sometimes it takes some time for a page to respond to user's actions.
@@ -521,29 +527,13 @@ I.click('=sign-up') // matches => [data-qa=sign-up],[data-test=sign-up]
521527
522528
- `config` &#x20;
523529
524-
## debugErrors
525-
526-
Prints errors found in HTML code after each failed test.
530+
## customReporter
527531
528-
It scans HTML and searches for elements with error classes.
529-
If an element found prints a text from it to console and adds as artifact to the test.
530-
531-
Enable this plugin in config:
532-
533-
```js
534-
plugins: {
535-
debugErrors: {
536-
enabled: true,
537-
}
538-
```
539-
540-
Additional config options:
541-
542-
- `errorClasses` - list of classes to search for errors (default: `['error', 'warning', 'alert', 'danger']`)
532+
Sample custom reporter for CodeceptJS.
543533
544534
### Parameters
545535
546-
- `config` (optional, default `{}`)
536+
- `config` &#x20;
547537
548538
## eachElement
549539
@@ -672,6 +662,32 @@ More config options are available:
672662
673663
- `config` (optional, default `{}`)
674664
665+
## pageInfo
666+
667+
Collects information from web page after each failed test and adds it to the test as an artifact.
668+
It is suggested to enable this plugin if you run tests on CI and you need to debug failed tests.
669+
This plugin can be paired with `analyze` plugin to provide more context.
670+
671+
It collects URL, HTML errors (by classes), and browser logs.
672+
673+
Enable this plugin in config:
674+
675+
```js
676+
plugins: {
677+
pageInfo: {
678+
enabled: true,
679+
}
680+
```
681+
682+
Additional config options:
683+
684+
- `errorClasses` - list of classes to search for errors (default: `['error', 'warning', 'alert', 'danger']`)
685+
- `browserLogs` - list of types of errors to search for in browser logs (default: `['error']`)
686+
687+
### Parameters
688+
689+
- `config` (optional, default `{}`)
690+
675691
## pauseOnFail
676692
677693
Automatically launches [interactive pause][11] when a test fails.

0 commit comments

Comments
 (0)