Class ConsoleLoggingListener

java.lang.Object
net.thucydides.core.logging.ConsoleLoggingListener
All Implemented Interfaces:
StepListener

public class ConsoleLoggingListener extends Object implements StepListener
  • Field Details

  • Constructor Details

    • ConsoleLoggingListener

      public ConsoleLoggingListener(EnvironmentVariables environmentVariables, org.slf4j.Logger logger)
    • ConsoleLoggingListener

      @Inject public ConsoleLoggingListener(EnvironmentVariables environmentVariables)
  • Method Details

    • getLogger

      protected org.slf4j.Logger getLogger()
    • testSuiteStarted

      public void testSuiteStarted(Class<?> storyClass)
      Description copied from interface: StepListener
      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.
      Specified by:
      testSuiteStarted in interface StepListener
    • testSuiteStarted

      public void testSuiteStarted(Story story)
      Description copied from interface: StepListener
      Start a test run using a specific story, without a corresponding Java class.
      Specified by:
      testSuiteStarted in interface StepListener
    • testSuiteFinished

      public void testSuiteFinished()
      Description copied from interface: StepListener
      End of a test case or story.
      Specified by:
      testSuiteFinished in interface StepListener
    • testStarted

      public void testStarted(String description)
      Description copied from interface: StepListener
      A test with a given name has started.
      Specified by:
      testStarted in interface StepListener
    • testStarted

      public void testStarted(String description, String id)
      Specified by:
      testStarted in interface StepListener
    • testFinished

      public void testFinished(TestOutcome result)
      Description copied from interface: StepListener
      Called when a test finishes.
      Specified by:
      testFinished in interface StepListener
    • testFinished

      public void testFinished(TestOutcome result, boolean isInDataDrivenTest)
      Specified by:
      testFinished in interface StepListener
    • testRetried

      public void testRetried()
      Description copied from interface: StepListener
      The last test run is about to be restarted
      Specified by:
      testRetried in interface StepListener
    • stepStarted

      public void stepStarted(ExecutedStepDescription description)
      Description copied from interface: StepListener
      Called when a test step is about to be started.
      Specified by:
      stepStarted in interface StepListener
      Parameters:
      description - the description of the test that is about to be run (generally a class and method name)
    • skippedStepStarted

      public void skippedStepStarted(ExecutedStepDescription description)
      Description copied from interface: StepListener
      Called when a test step is about to be started, but this step is scheduled to be skipped.
      Specified by:
      skippedStepStarted in interface StepListener
      Parameters:
      description - the description of the test that is about to be run (generally a class and method name)
    • stepFinished

      public void stepFinished()
      Description copied from interface: StepListener
      Called when an test step has finished successfully
      Specified by:
      stepFinished in interface StepListener
    • stepFailed

      public void stepFailed(StepFailure failure)
      Description copied from interface: StepListener
      Called when a test step fails.
      Specified by:
      stepFailed in interface StepListener
      Parameters:
      failure - describes the test that failed and the exception that was thrown
    • lastStepFailed

      public void lastStepFailed(StepFailure failure)
      Description copied from interface: StepListener
      Declare that a step has failed after it has finished.
      Specified by:
      lastStepFailed in interface StepListener
    • stepIgnored

      public void stepIgnored()
      Description copied from interface: StepListener
      Called when a step will not be run, generally because a test method is annotated with org.junit.Ignore.
      Specified by:
      stepIgnored in interface StepListener
    • stepPending

      public void stepPending()
      Description copied from interface: StepListener
      The step is marked as pending.
      Specified by:
      stepPending in interface StepListener
    • stepPending

      public void stepPending(String message)
      Description copied from interface: StepListener
      The step is marked as pending with a descriptive message.
      Specified by:
      stepPending in interface StepListener
    • testFailed

      public void testFailed(TestOutcome testOutcome, Throwable cause)
      Description copied from interface: StepListener
      The test failed, but not while executing a step.
      Specified by:
      testFailed in interface StepListener
      Parameters:
      testOutcome - The test outcome structure for the failing test
      cause - The exception that triggered the failure
    • testIgnored

      public void testIgnored()
      Description copied from interface: StepListener
      The test as a whole was ignored.
      Specified by:
      testIgnored in interface StepListener
    • testSkipped

      public void testSkipped()
      Description copied from interface: StepListener
      The test as a whole was skipped.
      Specified by:
      testSkipped in interface StepListener
    • testAborted

      public void testAborted()
      Description copied from interface: StepListener
      The test as a whole was aborted.
      Specified by:
      testAborted in interface StepListener
    • testPending

      public void testPending()
      Description copied from interface: StepListener
      The test as a whole should be marked as 'pending'.
      Specified by:
      testPending in interface StepListener
    • testIsManual

      public void testIsManual()
      Specified by:
      testIsManual in interface StepListener
    • notifyScreenChange

      public void notifyScreenChange()
      Specified by:
      notifyScreenChange in interface StepListener
    • useExamplesFrom

      public void useExamplesFrom(DataTable table)
      Description copied from interface: StepListener
      The current scenario is a data-driven scenario using test data from the specified table.
      Specified by:
      useExamplesFrom in interface StepListener
    • addNewExamplesFrom

      public void addNewExamplesFrom(DataTable table)
      Description copied from interface: StepListener
      If multiple tables are used, this method will add any new rows to the test data
      Specified by:
      addNewExamplesFrom in interface StepListener
    • exampleStarted

      public void exampleStarted(Map<String,String> data)
      Description copied from interface: StepListener
      A new example has just started.
      Specified by:
      exampleStarted in interface StepListener
    • exampleFinished

      public void exampleFinished()
      Description copied from interface: StepListener
      An example has finished.
      Specified by:
      exampleFinished in interface StepListener
    • assumptionViolated

      public void assumptionViolated(String message)
      Specified by:
      assumptionViolated in interface StepListener
    • testRunFinished

      public void testRunFinished()
      Specified by:
      testRunFinished in interface StepListener