Package io.karatelabs.output
Class JunitXmlWriter
java.lang.Object
io.karatelabs.output.JunitXmlWriter
Generates JUnit XML reports compatible with CI systems (Jenkins, GitHub Actions, etc.).
Output follows the standard JUnit XML schema with per-feature files:
<testsuite name="feature" tests="N" failures="N" time="secs">
<testcase name="scenario" classname="feature.path" time="secs">
<properties>
<property name="tag" value="@smoke"/>
</properties>
<system-out>step logs</system-out>
<failure message="error">stacktrace</failure>
</testcase>
</testsuite>
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringfeatureToXml(FeatureResult result) Convert a single feature result to JUnit XML string.static voidwriteFeature(FeatureResult result, Path outputDir) Write JUnit XML report for a single feature.
-
Method Details
-
writeFeature
Write JUnit XML report for a single feature.Output file is named
{packageQualifiedName}.xml.- Parameters:
result- the feature result to convertoutputDir- the directory to write the report
-
featureToXml
Convert a single feature result to JUnit XML string.- Parameters:
result- the feature result- Returns:
- XML string
-