Minimal report example
<testsuite name="checkout" tests="2" failures="1" time="0.42">
<testcase classname="CheckoutTest" name="accepts_card" time="0.12" />
<testcase classname="CheckoutTest" name="rejects_expired_card" time="0.30">
<failure type="AssertionError" message="Expected declined status">
at CheckoutTest.rejects_expired_card(CheckoutTest.java:42)
</failure>
</testcase>
</testsuite>
Common elements and attributes
| Node | Purpose | Compatibility note |
|---|---|---|
testsuites | Optional container for multiple suites. | Some tools omit it and start with one testsuite. |
testsuite | Groups testcases and may publish totals. | Summary attributes can disagree with actual children. |
testcase | Represents one test with name, classname, and duration. | Identity conventions vary by framework. |
failure | Assertion or expected-condition failure. | Message, type, and stack text are often optional. |
error | Unexpected execution or setup error. | Some generators use failure for every problem. |
skipped | Marks a test that did not run. | May be an element or reflected only in totals. |
system-out / system-err | Captured process output. | Can occur at suite or testcase level and can be large. |
Why reports differ between frameworks
Maven Surefire, Gradle, pytest, JavaScript reporters, and other test systems all target roughly the same vocabulary but make different choices about nesting, identity, timestamps, properties, captured output, and aggregate totals. A robust viewer should calculate from actual testcase elements and disclose inconsistencies.
Safe parsing rules
- Reject external entities and doctypes rather than resolving them.
- Render messages, stack traces, stdout, and stderr as plain text.
- Keep duplicate test identities instead of silently overwriting them.
- Preserve source-file context when merging shards.
- Treat decimal
timevalues as seconds unless the generator documents otherwise.
Validate a report
If a report opens but its totals look wrong, compare suite attributes with the number and status of child testcase elements. TestSignal surfaces those mismatches and uses the testcase records for its own totals.
Open the JUnit XML viewer