diff --git a/README.md b/README.md index 1aa3dc89b..f92fd287c 100644 --- a/README.md +++ b/README.md @@ -251,20 +251,22 @@ Add the `testomatio` plugin to your `codecept.conf.js`: plugins: { testomatio: { enabled: true, - require: '@testomatio/reporter/lib/adapter/codecept', + require: '@testomatio/reporter/codecept', + html: true, + reportDir: 'output/report', }, } ``` ### Usage -Generate HTML reports by setting the `TESTOMATIO_HTML_REPORT_SAVE` environment variable: +Run tests normally: ```sh -TESTOMATIO_HTML_REPORT_SAVE=1 npx codeceptjs run +npx codeceptjs run ``` -The report will be saved to `html-report/testomatio-report.html`. +The report will be saved to `output/report/testomatio-report.html` by default. You can also keep using `TESTOMATIO_HTML_REPORT_SAVE=1` and related environment variables if you prefer env-based setup. ### Features @@ -278,14 +280,11 @@ The report will be saved to `html-report/testomatio-report.html`. ### Customization ```sh -# Custom output folder -TESTOMATIO_HTML_REPORT_SAVE=1 TESTOMATIO_HTML_REPORT_FOLDER=./reports npx codeceptjs run - -# Custom filename -TESTOMATIO_HTML_REPORT_SAVE=1 TESTOMATIO_HTML_FILENAME=my-report.html npx codeceptjs run +# Custom output folder in codecept.conf.js +# reportDir: './reports' # Integrate with Testomat.io cloud -TESTOMATIO_HTML_REPORT_SAVE=1 TESTOMATIO=your_api_key npx codeceptjs run +TESTOMATIO=your_api_key npx codeceptjs run ``` ## PageObjects diff --git a/docs/images/testomatio-html-report.png b/docs/images/testomatio-html-report.png new file mode 100644 index 000000000..cd2103e9b Binary files /dev/null and b/docs/images/testomatio-html-report.png differ diff --git a/docs/images/testomatio-markdown-report.png b/docs/images/testomatio-markdown-report.png new file mode 100644 index 000000000..ad1f9c448 Binary files /dev/null and b/docs/images/testomatio-markdown-report.png differ diff --git a/docs/migration-4.md b/docs/migration-4.md index 3d2681379..2d6987639 100644 --- a/docs/migration-4.md +++ b/docs/migration-4.md @@ -171,16 +171,17 @@ npm install --save-dev @testomatio/reporter plugins: { testomatio: { enabled: true, - require: '@testomatio/reporter/lib/adapter/codecept', + require: '@testomatio/reporter/codecept', + html: true, }, } ``` ```bash -TESTOMATIO_DISABLE_UPLOAD=1 npx codeceptjs run +npx codeceptjs run ``` -The HTML report is written to `output/reports/`. See [Reports → HTML](/reports) for pipe options. +The HTML report is written to `output/report/` by default. See [Reports > HTML](/reports) for pipe options. Reporting notes: diff --git a/docs/reports.md b/docs/reports.md index 9131364ce..36af68e87 100644 --- a/docs/reports.md +++ b/docs/reports.md @@ -21,13 +21,19 @@ plugins: { testomatio: { enabled: true, require: '@testomatio/reporter/codecept', + html: true, + markdown: true, + csv: true, + reportDir: 'output/report', }, } ``` +The local reports above are enabled directly from CodeceptJS config. If `reportDir` is omitted, reports are written to `output/report` using the CodeceptJS `output` directory. + ### Enable an output -Each output turns on when you set its environment variable. Run your tests as usual — one run feeds every output you enabled. +Each output can also be enabled with environment variables. Run your tests as usual and one run feeds every output you enabled. | To get… | Set | Details | | --- | --- | --- | @@ -63,7 +69,9 @@ The GitHub pipe also needs the job to grant `permissions: pull-requests: write`. A single self-contained HTML file with the run summary and, per test, its steps, screenshots, logs, and error. It needs no API key and no service, so it works anywhere — open it locally or attach it to a CI build. -![HTML report](https://raw.githubusercontent.com/testomatio/reporter/master/docs/pipes/images/html-pipe.png) +![HTML report](./images/testomatio-html-report.png) + +- Preferred in CodeceptJS 4: enable `html: true` in `plugins.testomatio` and run `npx codeceptjs run` - `TESTOMATIO_HTML_REPORT_SAVE=1` — enable the report - `TESTOMATIO_HTML_REPORT_FOLDER=output/reports` — keep it inside CodeceptJS's `output/` dir (default folder is `html-report`) @@ -118,6 +126,10 @@ Posts a comment to the Pull Request with the same summary. Comments are created ### Markdown Report +- Preferred in CodeceptJS 4: enable `markdown: true` in `plugins.testomatio` and run `npx codeceptjs run` + +![Markdown report](./images/testomatio-markdown-report.png) + A single self-contained Markdown file — renders in PR comments, CI job summaries, and Slack, and is convenient for AI agents reading test results. Needs no API key. - `TESTOMATIO_MARKDOWN_REPORT_SAVE=1` — enable the report