docs/plugins/junitReporter.md
Generates a JUnit-compatible XML report after a test run.
Unlike Mocha's mocha-junit-reporter, this plugin understands CodeceptJS steps and substeps.
For every <testcase> it includes:
<properties> — the test's meta information: every meta key from Scenario('...', { meta }), plus its tags and retries<failure> — for failed tests: the error message, type, stack trace and (optionally) the step traceThe produced file is consumable by Jenkins, GitLab CI, CircleCI, GitHub Actions test reporters, etc.
"plugins": {
"junitReporter": {
"enabled": true
}
}
Possible config options:
outputName: file name for the report. Default: report.xml.output: directory where the report is stored, relative to the project root. Default: the output directory.testGroupName: value of the name attribute on the root <testsuites> element. Default: CodeceptJS.attachMeta: add the test's meta information (meta keys, tags, retries) as <properties>. Default: true.attachSteps: add the step/substep log as ``. Default: true.stepsInFailure: append the step trace to the <failure> body. Default: true.CLI examples:
npx codeceptjs run -p junitReporter
npx codeceptjs run -p junitReporter:outputName=junit.xml
ℹ When running with
run-workers, steps are serialized between processes and substep nesting is flattened.
config any