JUnit-XML Reports
Gwen can generete JUnit-XML reports enabling you to integrate evaluation results with build servers (such as Jenkins) and other tools.
Generate reports
- Project
- Standalone
Launch Gwen with the -f junit
option to generate JUnit-XML reports when executing your features.
- Yarn
- npm
- pnpm
Execute features in the gwen/features/todo folder and generate JUnit-XML reports only.
yarn gwen -b -f junit gwen/features/todo
Execute features in the gwen/features/todo folder and generate HTML and JUnit-XML reports.
yarn gwen -b -f html,junit gwen/features/todo
Execute features in the gwen/features/todo folder and generate JUnit-XML reports only.
npm run gwen -- -b -f junit gwen/features/todo
Execute features in the gwen/features/todo folder and generate HTML and JUnit-XML reports.
npm run gwen -- -b -f html,junit gwen/features/todo
Execute features in the gwen/features/todo folder and generate JUnit-XML reports only.
pnpm gwen -b -f junit gwen/features/todo
Execute features in the gwen/features/todo folder and generate HTML and JUnit-XML reports.
pnpm gwen -b -f html,junit gwen/features/todo
Output
- Reports will be generated in the
gwen/output/reports
directory as per the defaultgwen.cli.options.report
setting- The JUnit-XML report files will be generated at
gwen/output/reports/junit/TEST-*.xml
. You can set this path in your Jenkins reporting configuration for example. - The HTML report will be generated at
gwen/output/reports/index.html
. - If you want reports generated in a different directory, you can either:
- Amend the above setting to change the default
- Or include the
-r|--report
CLI option and specify a directory on every launch
- The JUnit-XML report files will be generated at
Launch Gwen with the -f junit
option to generate JUnit-XML reports when executing your features.
- Linux
- Windows
Execute features in the features/todo folder and generate JUnit-XML reports only.
gwen -b -f junit features/todo
Execute features in the features/todo folder and generate HTML and JUnit-XML reports.
gwen -b -f html,junit features/todo
Execute features in the features/todo folder and generate JUnit-XML reports only.
gwen -b -f junit features\todo
Execute features in the features/todo folder and generate HTML and JUnit-XML reports.
gwen -b -f html,junit features\todo
Output
- Since Gwen 3
- Reports will be generated by default to the
output/reports
directory- The JUnit-XML report files will be generated at
output/reports/junit/TEST-*.xml
. You can set this path in your Jenkins reporting configuration for example. - The HTML report will be generated at
output/reports/index.html
.
- The JUnit-XML report files will be generated at
- Reports will be generated by default to the
- In prior versions
- You will need to specify
-r outdir
on the CLI to generate reports in a desired directory.
- You will need to specify
Sample output
File: junit/TEST-features-todo-Todo.feature.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite hostname="machine-hostname"
name="features/todo/Todo.feature.Feature: Add todo items"
package="features/todo/Todo.feature"
tests="1"
errors="0"
failures="0"
skipped="0"
time="8.320"
timestamp="2021-10-09T01:48:54.888Z">
<properties>
..
</properties>
<testcase name="Scenario 0001: Create todo list"
time="8.153601684"
status="Passed"/>
</testsuite>