Skip to main content

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

Launch Gwen with the -f junit option to generate JUnit-XML reports when executing your features.

Example

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

Gwen CLI

Output

  • Reports will be generated in the gwen/output/reports directory as per the default gwen.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

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>