Class JunitXmlReportListener

java.lang.Object
io.karatelabs.output.JunitXmlReportListener
All Implemented Interfaces:
ResultListener

public class JunitXmlReportListener extends Object implements ResultListener
A ResultListener that generates JUnit XML reports.

This listener writes each feature's JUnit XML file as that feature completes. Each feature produces a separate XML file named {packageQualifiedName}.xml. This approach:

  • Makes partial results available as tests complete
  • Compatible with CI systems (Jenkins, GitHub Actions, etc.)
  • Field Details

  • Constructor Details

    • JunitXmlReportListener

      public JunitXmlReportListener(Path outputDir)
      Create a new JUnit XML report listener.
      Parameters:
      outputDir - the base output directory (subfolder will be created)
  • Method Details

    • onSuiteStart

      public void onSuiteStart(Suite suite)
      Description copied from interface: ResultListener
      Called when the suite starts execution.
      Specified by:
      onSuiteStart in interface ResultListener
      Parameters:
      suite - the suite about to run
    • onFeatureEnd

      public void onFeatureEnd(FeatureResult result)
      Description copied from interface: ResultListener
      Called when a feature completes execution.
      Specified by:
      onFeatureEnd in interface ResultListener
      Parameters:
      result - the feature result