junitReporter
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: everymetakey fromScenario('...', { meta }), plus itstagsandretries<system-out>— an indented step/substep log (substeps are nested under their meta step); only failed steps are marked<failure>— for failed tests: the error message, type, stack trace and (optionally) the step trace
The produced file is consumable by Jenkins, GitLab CI, CircleCI, GitHub Actions test reporters, etc.
Configuration
Section titled “Configuration”"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: theoutputdirectory.testGroupName: value of thenameattribute on the root<testsuites>element. Default:CodeceptJS.attachMeta: add the test’s meta information (metakeys,tags,retries) as<properties>. Default: true.attachSteps: add the step/substep log as<system-out>. Default: true.stepsInFailure: append the step trace to the<failure>body. Default: true.
CLI examples:
npx codeceptjs run -p junitReporternpx codeceptjs run -p junitReporter:outputName=junit.xmlℹ When running with
run-workers, steps are serialized between processes and substep nesting is flattened.
Parameters
Section titled “Parameters”configany