Package net.thucydides.core.logging
Class ConsoleLoggingListener
java.lang.Object
net.thucydides.core.logging.ConsoleLoggingListener
- All Implemented Interfaces:
StepListener
public class ConsoleLoggingListener extends java.lang.Object implements StepListener
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSERENITY_BIG_BANNERstatic java.lang.StringSERENITY_NONE_BANNERstatic java.lang.StringSERENITY_SMALL_BANNER -
Constructor Summary
Constructors Constructor Description ConsoleLoggingListener(EnvironmentVariables environmentVariables)ConsoleLoggingListener(EnvironmentVariables environmentVariables, org.slf4j.Logger logger) -
Method Summary
Modifier and Type Method Description voidaddNewExamplesFrom(DataTable table)If multiple tables are used, this method will add any new rows to the test datavoidassumptionViolated(java.lang.String message)voidexampleFinished()An example has finished.voidexampleStarted(java.util.Map<java.lang.String,java.lang.String> data)A new example has just started.protected org.slf4j.LoggergetLogger()voidlastStepFailed(StepFailure failure)Declare that a step has failed after it has finished.voidnotifyScreenChange()voidskippedStepStarted(ExecutedStepDescription description)Called when a test step is about to be started, but this step is scheduled to be skipped.voidstepFailed(StepFailure failure)Called when a test step fails.voidstepFinished()Called when an test step has finished successfullyvoidstepIgnored()Called when a step will not be run, generally because a test method is annotated withorg.junit.Ignore.voidstepPending()The step is marked as pending.voidstepPending(java.lang.String message)The step is marked as pending with a descriptive message.voidstepStarted(ExecutedStepDescription description)Called when a test step is about to be started.voidtestAborted()The test as a whole was aborted.voidtestFailed(TestOutcome testOutcome, java.lang.Throwable cause)The test failed, but not while executing a step.voidtestFinished(TestOutcome result)Called when a test finishes.voidtestFinished(TestOutcome result, boolean isInDataDrivenTest)voidtestIgnored()The test as a whole was ignored.voidtestIsManual()voidtestPending()The test as a whole should be marked as 'pending'.voidtestRetried()The last test run is about to be restartedvoidtestRunFinished()voidtestSkipped()The test as a whole was skipped.voidtestStarted(java.lang.String description)A test with a given name has started.voidtestStarted(java.lang.String description, java.lang.String id)voidtestSuiteFinished()End of a test case or story.voidtestSuiteStarted(java.lang.Class<?> storyClass)Start a test run using a test case or a user story.voidtestSuiteStarted(Story story)Start a test run using a specific story, without a corresponding Java class.voiduseExamplesFrom(DataTable table)The current scenario is a data-driven scenario using test data from the specified table.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.thucydides.core.steps.StepListener
exampleStarted
-
Field Details
-
SERENITY_BIG_BANNER
public static final java.lang.String SERENITY_BIG_BANNER- See Also:
- Constant Field Values
-
SERENITY_SMALL_BANNER
public static final java.lang.String SERENITY_SMALL_BANNER- See Also:
- Constant Field Values
-
SERENITY_NONE_BANNER
public static final java.lang.String SERENITY_NONE_BANNER- See Also:
- Constant Field Values
-
-
Constructor Details
-
ConsoleLoggingListener
-
ConsoleLoggingListener
-
-
Method Details
-
getLogger
protected org.slf4j.Logger getLogger() -
testSuiteStarted
public void testSuiteStarted(java.lang.Class<?> storyClass)Description copied from interface:StepListenerStart 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:
testSuiteStartedin interfaceStepListener
-
testSuiteStarted
Description copied from interface:StepListenerStart a test run using a specific story, without a corresponding Java class.- Specified by:
testSuiteStartedin interfaceStepListener
-
testSuiteFinished
public void testSuiteFinished()Description copied from interface:StepListenerEnd of a test case or story.- Specified by:
testSuiteFinishedin interfaceStepListener
-
testStarted
public void testStarted(java.lang.String description)Description copied from interface:StepListenerA test with a given name has started.- Specified by:
testStartedin interfaceStepListener
-
testStarted
public void testStarted(java.lang.String description, java.lang.String id)- Specified by:
testStartedin interfaceStepListener
-
testFinished
Description copied from interface:StepListenerCalled when a test finishes.- Specified by:
testFinishedin interfaceStepListener
-
testFinished
- Specified by:
testFinishedin interfaceStepListener
-
testRetried
public void testRetried()Description copied from interface:StepListenerThe last test run is about to be restarted- Specified by:
testRetriedin interfaceStepListener
-
stepStarted
Description copied from interface:StepListenerCalled when a test step is about to be started.- Specified by:
stepStartedin interfaceStepListener- Parameters:
description- the description of the test that is about to be run (generally a class and method name)
-
skippedStepStarted
Description copied from interface:StepListenerCalled when a test step is about to be started, but this step is scheduled to be skipped.- Specified by:
skippedStepStartedin interfaceStepListener- 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:StepListenerCalled when an test step has finished successfully- Specified by:
stepFinishedin interfaceStepListener
-
stepFailed
Description copied from interface:StepListenerCalled when a test step fails.- Specified by:
stepFailedin interfaceStepListener- Parameters:
failure- describes the test that failed and the exception that was thrown
-
lastStepFailed
Description copied from interface:StepListenerDeclare that a step has failed after it has finished.- Specified by:
lastStepFailedin interfaceStepListener
-
stepIgnored
public void stepIgnored()Description copied from interface:StepListenerCalled when a step will not be run, generally because a test method is annotated withorg.junit.Ignore.- Specified by:
stepIgnoredin interfaceStepListener
-
stepPending
public void stepPending()Description copied from interface:StepListenerThe step is marked as pending.- Specified by:
stepPendingin interfaceStepListener
-
stepPending
public void stepPending(java.lang.String message)Description copied from interface:StepListenerThe step is marked as pending with a descriptive message.- Specified by:
stepPendingin interfaceStepListener
-
testFailed
Description copied from interface:StepListenerThe test failed, but not while executing a step.- Specified by:
testFailedin interfaceStepListener- Parameters:
testOutcome- The test outcome structure for the failing testcause- The exception that triggered the failure
-
testIgnored
public void testIgnored()Description copied from interface:StepListenerThe test as a whole was ignored.- Specified by:
testIgnoredin interfaceStepListener
-
testSkipped
public void testSkipped()Description copied from interface:StepListenerThe test as a whole was skipped.- Specified by:
testSkippedin interfaceStepListener
-
testAborted
public void testAborted()Description copied from interface:StepListenerThe test as a whole was aborted.- Specified by:
testAbortedin interfaceStepListener
-
testPending
public void testPending()Description copied from interface:StepListenerThe test as a whole should be marked as 'pending'.- Specified by:
testPendingin interfaceStepListener
-
testIsManual
public void testIsManual()- Specified by:
testIsManualin interfaceStepListener
-
notifyScreenChange
public void notifyScreenChange()- Specified by:
notifyScreenChangein interfaceStepListener
-
useExamplesFrom
Description copied from interface:StepListenerThe current scenario is a data-driven scenario using test data from the specified table.- Specified by:
useExamplesFromin interfaceStepListener
-
addNewExamplesFrom
Description copied from interface:StepListenerIf multiple tables are used, this method will add any new rows to the test data- Specified by:
addNewExamplesFromin interfaceStepListener
-
exampleStarted
public void exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)Description copied from interface:StepListenerA new example has just started.- Specified by:
exampleStartedin interfaceStepListener
-
exampleFinished
public void exampleFinished()Description copied from interface:StepListenerAn example has finished.- Specified by:
exampleFinishedin interfaceStepListener
-
assumptionViolated
public void assumptionViolated(java.lang.String message)- Specified by:
assumptionViolatedin interfaceStepListener
-
testRunFinished
public void testRunFinished()- Specified by:
testRunFinishedin interfaceStepListener
-