Interface StepListener

All Known Implementing Classes:
ConsoleLoggingListener

public interface StepListener
Represents a class interested in knowing about test execution flow and results.
  • Method Details

    • testSuiteStarted

      void testSuiteStarted​(java.lang.Class<?> storyClass)
      Start a test run using a test case or a user story. For JUnit tests, the test case should be provided. The test case should be annotated with the Story annotation to indicate what user story it tests. Otherwise, the test case itself will be treated as a user story. For easyb stories, the story class can be provided directly.
    • testSuiteStarted

      void testSuiteStarted​(Story story)
      Start a test run using a specific story, without a corresponding Java class.
    • testSuiteFinished

      void testSuiteFinished()
      End of a test case or story.
    • testStarted

      void testStarted​(java.lang.String description)
      A test with a given name has started.
    • testStarted

      void testStarted​(java.lang.String description, java.lang.String id)
    • testFinished

      void testFinished​(TestOutcome result)
      Called when a test finishes.
    • testFinished

      default void testFinished​(TestOutcome result, boolean isInDataDrivenTest)
    • testRetried

      void testRetried()
      The last test run is about to be restarted
    • stepStarted

      void stepStarted​(ExecutedStepDescription description)
      Called when a test step is about to be started.
      Parameters:
      description - the description of the test that is about to be run (generally a class and method name)
    • skippedStepStarted

      void skippedStepStarted​(ExecutedStepDescription description)
      Called when a test step is about to be started, but this step is scheduled to be skipped.
      Parameters:
      description - the description of the test that is about to be run (generally a class and method name)
    • stepFailed

      void stepFailed​(StepFailure failure)
      Called when a test step fails.
      Parameters:
      failure - describes the test that failed and the exception that was thrown
    • lastStepFailed

      void lastStepFailed​(StepFailure failure)
      Declare that a step has failed after it has finished.
    • stepIgnored

      void stepIgnored()
      Called when a step will not be run, generally because a test method is annotated with org.junit.Ignore.
    • stepPending

      void stepPending()
      The step is marked as pending.
    • stepPending

      void stepPending​(java.lang.String message)
      The step is marked as pending with a descriptive message.
      Parameters:
      message -
    • stepFinished

      void stepFinished()
      Called when an test step has finished successfully
    • testFailed

      void testFailed​(TestOutcome testOutcome, java.lang.Throwable cause)
      The test failed, but not while executing a step.
      Parameters:
      testOutcome - The test outcome structure for the failing test
      cause - The exception that triggered the failure
    • testIgnored

      void testIgnored()
      The test as a whole was ignored.
    • testSkipped

      void testSkipped()
      The test as a whole was skipped.
    • testAborted

      default void testAborted()
      The test as a whole was aborted.
    • testPending

      void testPending()
      The test as a whole should be marked as 'pending'.
    • testIsManual

      void testIsManual()
    • notifyScreenChange

      void notifyScreenChange()
    • useExamplesFrom

      void useExamplesFrom​(DataTable table)
      The current scenario is a data-driven scenario using test data from the specified table.
    • addNewExamplesFrom

      void addNewExamplesFrom​(DataTable table)
      If multiple tables are used, this method will add any new rows to the test data
    • exampleStarted

      void exampleStarted​(java.util.Map<java.lang.String,​java.lang.String> data)
      A new example has just started.
    • exampleStarted

      default void exampleStarted​(java.util.Map<java.lang.String,​java.lang.String> data, java.lang.String exampleName)
    • exampleFinished

      void exampleFinished()
      An example has finished.
    • assumptionViolated

      void assumptionViolated​(java.lang.String message)
    • testRunFinished

      void testRunFinished()