Overview
JUnit XML reports provide structured test results that include:- Test Suite Information: Organized by folder structure from your
testdriver
directory - Test Case Details: Individual test files with execution status
- Step-by-Step Results: Each step in your test with pass/fail status
- System Output: Complete logs from test execution (ANSI codes stripped)
- Error Information: Detailed failure messages and stack traces
- Timing Data: Execution duration for tests and individual steps
Basic Usage
Enable JUnit reporting by adding the--junit
flag to your TestDriver command:
- Execute your TestDriver test normally
- Generate a JUnit XML report at the specified file path
- Include all test execution details in the report
Command Line Options
Flag | Description | Example |
---|---|---|
--junit=<path> | Generate JUnit XML report to specified file | --junit=reports/test-results.xml |
Examples
Basic usage:Report Structure
Test Suite Hierarchy
JUnit reports organize your tests using the following structure:- Test Suite: Named after the folder path from your
testdriver
directory - Test Case: Individual test files (
.yaml
files) - Properties: Each step in your test with its status and prompt
Example Report Structure
For a test file attestdriver/features/login.yaml
:
CI/CD Integration
GitHub Actions
Jenkins
GitLab CI
Test Result Details
Successful Tests
For passing tests, the report includes:- Test execution time
- All step prompts with
[passed]
status - Complete system output logs
- Command execution details
Failed Tests
For failing tests, the report includes:- Detailed failure messages
- Failed assertion information
- Failed step prompts with
[failed]
status - Error logs in
<system-err>
section - Exit code information
Example Failure Report
Integration with Test Viewers
JUnit Viewer
Generate HTML reports from your XML:IDE Integration
Most IDEs support JUnit XML reports:- VS Code: Use test result extensions
- IntelliJ IDEA: Import test results directly
- Eclipse: Built-in JUnit viewer support