public class BaseStepListener extends java.lang.Object implements net.thucydides.core.steps.StepListener, StepPublisher
| Modifier and Type | Class and Description |
|---|---|
class |
BaseStepListener.StepMerger |
class |
BaseStepListener.StepMutator |
| Constructor and Description |
|---|
BaseStepListener(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass,
java.io.File outputDirectory)
Create a step listener with a given web driver type.
|
BaseStepListener(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass,
java.io.File outputDirectory,
net.thucydides.core.webdriver.Configuration configuration) |
BaseStepListener(java.io.File outputDirectory) |
BaseStepListener(java.io.File outputDirectory,
com.google.inject.Injector injector) |
BaseStepListener(java.io.File outputDirectory,
Pages pages)
Create a step listener using the driver from a given page factory.
|
BaseStepListener(java.io.File outputDirectory,
WebdriverManager webdriverManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIssuesToCurrentStory(java.util.List<java.lang.String> issues) |
void |
addNewExamplesFrom(net.thucydides.core.model.DataTable table) |
void |
addTagsToCurrentStory(java.util.List<net.thucydides.core.model.TestTag> tags) |
void |
assumptionViolated(java.lang.String message) |
boolean |
aStepHasFailed()
Should return true if a step failure has been logged.
|
boolean |
aStepHasFailedInTheCurrentExample() |
void |
cancelPreviousTest() |
void |
clearForcedResult() |
java.util.Optional<net.thucydides.core.model.TestStep> |
cloneCurrentStep() |
void |
currentStepIsAPrecondition() |
void |
exampleFinished() |
void |
exampleStarted(java.util.Map<java.lang.String,java.lang.String> data) |
void |
exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected) |
java.util.Optional<net.thucydides.core.model.TestResult> |
getAnnotatedResult() |
java.util.Optional<java.lang.reflect.Method> |
getCurrentStepMethod() |
org.openqa.selenium.WebDriver |
getDriver()
The currently-used WebDriver instance for these tests.
|
StepEventBus |
getEventBus() |
java.util.Optional<net.thucydides.core.model.TestResult> |
getForcedResult() |
Photographer |
getPhotographer() |
int |
getRunningStepCount() |
int |
getStepCount() |
net.thucydides.core.model.stacktrace.FailureCause |
getTestFailureCause()
If a test failed, what was the error.
|
java.util.List<net.thucydides.core.model.TestOutcome> |
getTestOutcomes()
A step listener should be able to return a set of test results at the end of the test run.
|
boolean |
isAvailable() |
void |
lastStepFailed(net.thucydides.core.steps.StepFailure failure) |
void |
lastTestPassedAfterRetries(int remainingTries,
java.util.List<java.lang.String> failureMessages,
net.thucydides.core.steps.TestFailureCause testfailureCause) |
java.util.Optional<net.thucydides.core.model.TestOutcome> |
latestTestOutcome() |
BaseStepListener.StepMerger |
mergeLast(int maxStepsToMerge) |
void |
notifyScreenChange() |
void |
overrideResultTo(net.thucydides.core.model.TestResult result) |
void |
recordRestQuery(net.serenitybdd.core.rest.RestQuery restQuery) |
void |
setAllStepsTo(net.thucydides.core.model.TestResult result) |
void |
setDriver(org.openqa.selenium.WebDriver driver)
Used to update the webdriver driver for screenshots if a listener is reused between scenarios.
|
void |
setEventBus(StepEventBus eventBus) |
void |
skippedStepStarted(net.thucydides.core.steps.ExecutedStepDescription description) |
void |
stepFailed(net.thucydides.core.steps.StepFailure failure) |
void |
stepFinished() |
void |
stepIgnored() |
void |
stepPending() |
void |
stepPending(java.lang.String message) |
void |
stepStarted(net.thucydides.core.steps.ExecutedStepDescription description)
A step within a test is called.
|
void |
takeScreenshot()
Take a screenshot now.
|
void |
testFailed(net.thucydides.core.model.TestOutcome testOutcome,
java.lang.Throwable cause) |
void |
testFinished(net.thucydides.core.model.TestOutcome outcome)
A test has finished.
|
void |
testIgnored() |
void |
testIsManual() |
void |
testPending() |
void |
testRetried() |
void |
testRunFinished() |
void |
testSkipped() |
void |
testStarted(java.lang.String testMethod)
An individual test starts.
|
void |
testStarted(java.lang.String testMethod,
java.lang.String id) |
void |
testSuiteFinished() |
boolean |
testSuiteRunning() |
void |
testSuiteStarted(java.lang.Class<?> startedTestSuite)
A test suite (containing a series of tests) starts.
|
void |
testSuiteStarted(net.thucydides.core.model.Story story) |
BaseStepListener.StepMutator |
updateCurrentStepTitle(java.lang.String updatedStepTitle) |
void |
updateOverallResults() |
void |
useExamplesFrom(net.thucydides.core.model.DataTable table)
The current scenario is a data-driven scenario using test data from the specified table.
|
public BaseStepListener(java.io.File outputDirectory)
public BaseStepListener(java.io.File outputDirectory,
com.google.inject.Injector injector)
public BaseStepListener(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass,
java.io.File outputDirectory)
driverClass - a driver of this type will be usedoutputDirectory - reports and screenshots are generated herepublic BaseStepListener(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass,
java.io.File outputDirectory,
net.thucydides.core.webdriver.Configuration configuration)
public BaseStepListener(java.io.File outputDirectory,
WebdriverManager webdriverManager)
public BaseStepListener(java.io.File outputDirectory,
Pages pages)
outputDirectory - reports and screenshots are generated herepages - a pages factory.public void setEventBus(StepEventBus eventBus)
public StepEventBus getEventBus()
public java.util.Optional<net.thucydides.core.model.TestStep> cloneCurrentStep()
public java.util.Optional<net.thucydides.core.model.TestResult> getAnnotatedResult()
public void setAllStepsTo(net.thucydides.core.model.TestResult result)
public void overrideResultTo(net.thucydides.core.model.TestResult result)
public void exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected)
public BaseStepListener.StepMerger mergeLast(int maxStepsToMerge)
public int getStepCount()
public int getRunningStepCount()
public void updateOverallResults()
public Photographer getPhotographer()
public void cancelPreviousTest()
public void lastTestPassedAfterRetries(int remainingTries,
java.util.List<java.lang.String> failureMessages,
net.thucydides.core.steps.TestFailureCause testfailureCause)
public void currentStepIsAPrecondition()
public boolean isAvailable()
public java.util.Optional<net.thucydides.core.model.TestOutcome> latestTestOutcome()
public void testSuiteStarted(java.lang.Class<?> startedTestSuite)
testSuiteStarted in interface net.thucydides.core.steps.StepListenerstartedTestSuite - the class implementing the test suite (e.g. a JUnit test case)public void testSuiteStarted(net.thucydides.core.model.Story story)
testSuiteStarted in interface net.thucydides.core.steps.StepListenerpublic boolean testSuiteRunning()
public void addIssuesToCurrentStory(java.util.List<java.lang.String> issues)
public void addTagsToCurrentStory(java.util.List<net.thucydides.core.model.TestTag> tags)
public void testSuiteFinished()
testSuiteFinished in interface net.thucydides.core.steps.StepListenerpublic void testStarted(java.lang.String testMethod)
testStarted in interface net.thucydides.core.steps.StepListenertestMethod - the name of the test method in the test suite class.public void testStarted(java.lang.String testMethod,
java.lang.String id)
testStarted in interface net.thucydides.core.steps.StepListenerpublic BaseStepListener.StepMutator updateCurrentStepTitle(java.lang.String updatedStepTitle)
public void testFinished(net.thucydides.core.model.TestOutcome outcome)
testFinished in interface net.thucydides.core.steps.StepListeneroutcome - the result of the test that just finished.public void testRetried()
testRetried in interface net.thucydides.core.steps.StepListenerpublic void stepStarted(net.thucydides.core.steps.ExecutedStepDescription description)
stepStarted in interface net.thucydides.core.steps.StepListenerdescription - the description of the test that is about to be runpublic void skippedStepStarted(net.thucydides.core.steps.ExecutedStepDescription description)
skippedStepStarted in interface net.thucydides.core.steps.StepListenerpublic java.util.Optional<java.lang.reflect.Method> getCurrentStepMethod()
public void stepFinished()
stepFinished in interface net.thucydides.core.steps.StepListenerpublic void stepFailed(net.thucydides.core.steps.StepFailure failure)
stepFailed in interface net.thucydides.core.steps.StepListenerpublic void lastStepFailed(net.thucydides.core.steps.StepFailure failure)
lastStepFailed in interface net.thucydides.core.steps.StepListenerpublic void stepIgnored()
stepIgnored in interface net.thucydides.core.steps.StepListenerpublic void stepPending()
stepPending in interface net.thucydides.core.steps.StepListenerpublic void stepPending(java.lang.String message)
stepPending in interface net.thucydides.core.steps.StepListenerpublic void assumptionViolated(java.lang.String message)
assumptionViolated in interface net.thucydides.core.steps.StepListenerpublic void testRunFinished()
testRunFinished in interface net.thucydides.core.steps.StepListenerpublic java.util.Optional<net.thucydides.core.model.TestResult> getForcedResult()
public void clearForcedResult()
public java.util.List<net.thucydides.core.model.TestOutcome> getTestOutcomes()
StepPublishergetTestOutcomes in interface StepPublisherpublic void setDriver(org.openqa.selenium.WebDriver driver)
StepPublishersetDriver in interface StepPublisherpublic org.openqa.selenium.WebDriver getDriver()
StepPublishergetDriver in interface StepPublisherpublic boolean aStepHasFailed()
StepPublisheraStepHasFailed in interface StepPublisherpublic boolean aStepHasFailedInTheCurrentExample()
public net.thucydides.core.model.stacktrace.FailureCause getTestFailureCause()
StepPublishergetTestFailureCause in interface StepPublisherpublic void testFailed(net.thucydides.core.model.TestOutcome testOutcome,
java.lang.Throwable cause)
testFailed in interface net.thucydides.core.steps.StepListenerpublic void testIgnored()
testIgnored in interface net.thucydides.core.steps.StepListenerpublic void testSkipped()
testSkipped in interface net.thucydides.core.steps.StepListenerpublic void testPending()
testPending in interface net.thucydides.core.steps.StepListenerpublic void testIsManual()
testIsManual in interface net.thucydides.core.steps.StepListenerpublic void notifyScreenChange()
notifyScreenChange in interface net.thucydides.core.steps.StepListenerpublic void takeScreenshot()
public void useExamplesFrom(net.thucydides.core.model.DataTable table)
useExamplesFrom in interface net.thucydides.core.steps.StepListenerpublic void addNewExamplesFrom(net.thucydides.core.model.DataTable table)
addNewExamplesFrom in interface net.thucydides.core.steps.StepListenerpublic void exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)
exampleStarted in interface net.thucydides.core.steps.StepListenerpublic void exampleFinished()
exampleFinished in interface net.thucydides.core.steps.StepListenerpublic void recordRestQuery(net.serenitybdd.core.rest.RestQuery restQuery)