cypress-rwx-reporter
v0.1.0
Published
A Cypress reporter that writes RWX v1 test results.
Readme
cypress-rwx-reporter
A Cypress reporter that writes RWX v1 test results for Captain.
Install
npm install --save-dev cypress-rwx-reporterConfigure
const { defineConfig } = require("cypress");
module.exports = defineConfig({
reporter: "cypress-rwx-reporter",
reporterOptions: {
outputFile: "rwx-results/results-[hash].json",
},
});The reporter defaults to rwx-results/results-[hash].json. Cypress runs each spec separately, so [hash] keeps later specs from overwriting earlier reports.
Output
The reporter emits RWX v1 JSON with:
frameworkset to JavaScript Cypress- final test results in
test.attempt - earlier retry attempts in
test.pastAttempts - failure screenshots attached as
attempt.meta.fileAttachments - a
attempt.meta.screenshot.imagealias for Captain compatibility
Failure screenshots are discovered from Cypress's default screenshot layout:
cypress/screenshots/<spec path>/<suite -- test> (failed).png
cypress/screenshots/<spec path>/<suite -- test> (failed) (attempt 2).pngIf your Cypress config changes screenshotsFolder, pass the same value:
module.exports = defineConfig({
screenshotsFolder: "tmp/screenshots",
reporter: "cypress-rwx-reporter",
reporterOptions: {
screenshotsFolder: "tmp/screenshots",
},
});Options
outputFile,resultsFile, orrwxFile: output path. Defaults torwx-results/results-[hash].json.screenshotsFolder: Cypress screenshots folder. Defaults tocypress/screenshots.projectRoot: project root for relative output and screenshot paths. Defaults toprocess.cwd().includeScreenshots: set tofalseto skip screenshot lookup.toConsole: set totrueto print the RWX JSON to stdout.
