Interface ResultListener

All Known Implementing Classes:
CucumberJsonReportListener, HtmlReportListener, JunitXmlReportListener

public interface ResultListener
Interface for receiving test execution results as they stream in.

Unlike RunListener, ResultListener is purely observational and cannot abort execution. Use this for reporting and external integrations.

The scenario is the smallest unit of granularity - step-level events are not streamed as they add overhead without significant reporting value.

Example usage:

 Runner.path("features/")
     .resultListener(new HtmlReportListener())
     .parallel(10);
 
  • Method Details

    • onSuiteStart

      default void onSuiteStart(Suite suite)
      Called when the suite starts execution.
      Parameters:
      suite - the suite about to run
    • onSuiteEnd

      default void onSuiteEnd(SuiteResult result)
      Called when the suite completes execution.
      Parameters:
      result - the final suite result
    • onFeatureStart

      default void onFeatureStart(Feature feature)
      Called when a feature starts execution.
      Parameters:
      feature - the feature about to run
    • onFeatureEnd

      default void onFeatureEnd(FeatureResult result)
      Called when a feature completes execution.
      Parameters:
      result - the feature result
    • onScenarioStart

      default void onScenarioStart(Scenario scenario)
      Called when a scenario starts execution.
      Parameters:
      scenario - the scenario about to run
    • onScenarioEnd

      default void onScenarioEnd(ScenarioResult result)
      Called when a scenario completes execution. This is the finest granularity - step events are not streamed.
      Parameters:
      result - the scenario result