@rwx-cloud/cypress-rwx-reporter
v1.0.0
Published
A Cypress reporter that writes RWX v1 test results.
Downloads
467
Readme
@rwx-cloud/cypress-rwx-reporter
A Cypress reporter that writes RWX v1 test results for use in RWX.
Install
npm install --save-dev @rwx-cloud/cypress-rwx-reporterConfigure
const { defineConfig } = require("cypress");
module.exports = defineConfig({
reporter: "@rwx-cloud/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. Unlike other Cypress reporters, all retry attempts of a test will appear in the test results. Additionally, if Cypress produced screenshots for a failing test, the screenshot path will be attached to the test in attempt.meta.fileAttachments and attempt.meta.screenshot.image.
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, configure the screenshotsFolder in reporterOptions as well:
module.exports = defineConfig({
screenshotsFolder: "tmp/screenshots",
reporter: "@rwx-cloud/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: optional project root override for relative output and screenshot paths. Defaults to Cypress's project root when available, thenprocess.cwd().includeScreenshots: set tofalseto skip screenshot lookup.toConsole: set totrueto print the RWX JSON to stdout.
