Class HtmlReportListener

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

public class HtmlReportListener extends Object implements ResultListener
A ResultListener that generates HTML reports.

This listener writes each feature's HTML file as that feature completes, then generates summary pages at suite end. This approach:

  • Keeps only small summary data in memory
  • Makes partial results available as tests complete
  • Field Details

  • Constructor Details

    • HtmlReportListener

      public HtmlReportListener(Path outputDir, String env)
      Create a new HTML report listener.
      Parameters:
      outputDir - the directory to write reports
      env - the karate environment (may be null)
  • 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
    • onSuiteEnd

      public void onSuiteEnd(SuiteResult result)
      Description copied from interface: ResultListener
      Called when the suite completes execution.
      Specified by:
      onSuiteEnd in interface ResultListener
      Parameters:
      result - the final suite result