Skip to content

Commit 15c2e70

Browse files
Custom reports Readme
1 parent 5151249 commit 15c2e70

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,36 @@ If you choose the CI-only reporting or even no reporting (CLI is always on) you
529529
$ backstop openReport
530530
```
531531

532+
### Reporting in custom format
533+
534+
To format tests output in a custom way you may provide a script that will transform data. Add below configuration to your test config.
535+
536+
```json
537+
"customReports": {
538+
"reports": [
539+
{
540+
"script": "customReports/customReport.js",
541+
"name": "resultName.json"
542+
}
543+
],
544+
"reportLocation": "backstop_data/custom_report"
545+
}
546+
```
547+
548+
Your script `customReport.js` should take `config, reporter, resultName` as parameters and return a `Promise` when result is processed.
549+
To see example see `/test/configs/backstop_data/engine_scripts/customReports/xrayReport.js`. It can also incorporate additional information passed within scenarios like below:
550+
```json
551+
"scenarios": [
552+
{
553+
"label": "BackstopJstop_data/engine_scripts/cookies.json",
554+
"url": "https://garris.github.io/BackstopJS/",
555+
"metadata": ["TEST-1"]
556+
}
557+
```
558+
559+
560+
561+
Additionally
532562
#### Test report integration with a build system like Jenkins/Travis
533563

534564
The following config would enable the CI - report (*default: junit format*)

0 commit comments

Comments
 (0)