- All Known Implementing Classes:
ConsoleLoggingListener
public interface StepListener
Represents a class interested in knowing about test execution flow and results.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewExamplesFrom(DataTable table) If multiple tables are used, this method will add any new rows to the test datavoidassumptionViolated(String message) voidAn example has finished.voidexampleStarted(Map<String, String> data) A new example has just started.default voidexampleStarted(Map<String, String> data, String exampleName) default voidexampleStarted(Map<String, String> data, String exampleName, ZonedDateTime time) default voidexampleStarted(Map<String, String> data, ZonedDateTime time) voidlastStepFailed(StepFailure failure) Declare that a step has failed after it has finished.voidvoidskippedStepStarted(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.voidstepFailed(StepFailure failure, List<ScreenshotAndHtmlSource> screenshotList) Called when a test step fails.voidCalled when an test step has finished successfullydefault voidstepFinished(List<ScreenshotAndHtmlSource> screenshotList) voidstepFinished(List<ScreenshotAndHtmlSource> screenshotList, ZonedDateTime time) voidCalled when a step will not be run, generally because a test method is annotated withorg.junit.Ignore.voidThe step is marked as pending.voidstepPending(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.default voidstepStarted(ExecutedStepDescription description, ZonedDateTime startTime) voidtakeScreenshots(List<ScreenshotAndHtmlSource> screenshots) voidtakeScreenshots(TestResult testResult, List<ScreenshotAndHtmlSource> screenshots) default voidThe test as a whole was aborted.voidtestFailed(TestOutcome testOutcome, Throwable cause) The test failed, but not while executing a step.voidtestFinished(TestOutcome result) Called when a test finishes.default voidtestFinished(TestOutcome result, boolean isInDataDrivenTest) voidtestFinished(TestOutcome result, boolean isInDataDrivenTest, ZonedDateTime finishTime) voidThe test as a whole was ignored.voidvoidThe test as a whole should be marked as 'pending'.voidThe last test run is about to be restartedvoidvoidThe test as a whole was skipped.voidtestStarted(String description) A test with a given name has started.voidtestStarted(String description, String id) default voidtestStarted(String testName, String testMethod, String id, String scenarioId) voidtestStarted(String description, String id, ZonedDateTime startTime) default voidtestStarted(String description, ZonedDateTime startTime) voidEnd of a test case or story.voidtestSuiteStarted(Class<?> storyClass) Start a test run using a test case or a user story.default voidtestSuiteStarted(Class<?> testClass, String testCaseName) Start a test run using JUnit 5 with a specific namevoidtestSuiteStarted(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.
-
Method Details
-
testSuiteStarted
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
Start a test run using a specific story, without a corresponding Java class. -
testSuiteStarted
Start a test run using JUnit 5 with a specific name -
testSuiteFinished
void testSuiteFinished()End of a test case or story. -
testStarted
A test with a given name has started. -
testStarted
-
testStarted
-
testStarted
-
testStarted
-
testFinished
Called when a test finishes. -
testFinished
-
testFinished
-
testRetried
void testRetried()The last test run is about to be restarted -
stepStarted
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)
-
stepStarted
-
skippedStepStarted
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
Called when a test step fails.- Parameters:
failure- describes the test that failed and the exception that was thrown
-
stepFailed
Called when a test step fails.- Parameters:
failure- describes the test that failed and the exception that was thrown
-
lastStepFailed
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 withorg.junit.Ignore. -
stepPending
void stepPending()The step is marked as pending. -
stepPending
The step is marked as pending with a descriptive message.- Parameters:
message-
-
stepFinished
void stepFinished()Called when an test step has finished successfully -
stepFinished
-
stepFinished
-
testFailed
The test failed, but not while executing a step.- Parameters:
testOutcome- The test outcome structure for the failing testcause- 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
The current scenario is a data-driven scenario using test data from the specified table. -
addNewExamplesFrom
If multiple tables are used, this method will add any new rows to the test data -
exampleStarted
A new example has just started. -
exampleStarted
-
exampleStarted
-
exampleStarted
-
exampleFinished
void exampleFinished()An example has finished. -
assumptionViolated
-
testRunFinished
void testRunFinished() -
takeScreenshots
-
takeScreenshots
-