public class BaseStepListener extends java.lang.Object implements StepListener, StepPublisher
| Modifier and Type | Class and Description |
|---|---|
class |
BaseStepListener.StepMerger |
| 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,
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(DataTable table)
If multiple tables are used, this method will add any new rows to the test data
|
void |
addTagsToCurrentStory(java.util.List<TestTag> tags) |
void |
assumptionViolated(java.lang.String message) |
boolean |
aStepHasFailed()
Should return true if a step failure has been logged.
|
void |
clearForcedResult() |
com.google.common.base.Optional<TestStep> |
cloneCurrentStep() |
void |
exampleFinished()
An example has finished.
|
void |
exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)
A new example has just started.
|
void |
exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected) |
org.openqa.selenium.WebDriver |
getDriver()
The currently-used WebDriver instance for these tests.
|
StepEventBus |
getEventBus() |
com.google.common.base.Optional<TestResult> |
getForcedResult() |
java.lang.String |
getPageSource() |
Photographer |
getPhotographer() |
int |
getStepCount() |
FailureCause |
getTestFailureCause()
If a test failed, what was the error.
|
java.util.List<TestOutcome> |
getTestOutcomes()
A step listener should be able to return a set of test results at the end of the test run.
|
void |
lastStepFailed(StepFailure failure)
Declare that a step has failed after it has finished.
|
BaseStepListener.StepMerger |
mergeLast(int maxStepsToMerge) |
void |
notifyScreenChange() |
void |
recordRestQuery(RestQuery restQuery) |
void |
setAllStepsTo(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(ExecutedStepDescription description)
Called when a test step is about to be started, but this step is scheduled to be skipped.
|
void |
stepFailed(StepFailure failure)
Called when a test step fails.
|
void |
stepFinished()
Called when an test step has finished successfully
|
void |
stepIgnored()
Called when a step will not be run, generally because a test method is annotated
with
Ignore. |
void |
stepPending()
The step is marked as pending.
|
void |
stepPending(java.lang.String message)
The step is marked as pending with a descriptive message.
|
void |
stepStarted(ExecutedStepDescription description)
A step within a test is called.
|
void |
takeScreenshot()
Take a screenshot now.
|
void |
testFailed(TestOutcome testOutcome,
java.lang.Throwable cause)
The test failed, but not while executing a step.
|
void |
testFinished(TestOutcome outcome)
A test has finished.
|
void |
testIgnored()
The test as a whole was ignored.
|
void |
testIsManual() |
void |
testPending()
The test as a whole should be marked as 'pending'.
|
void |
testRetried()
The last test run is about to be restarted
|
void |
testSkipped()
The test as a whole was skipped.
|
void |
testStarted(java.lang.String testMethod)
An individual test starts.
|
void |
testSuiteFinished()
End of a test case or story.
|
boolean |
testSuiteRunning() |
void |
testSuiteStarted(java.lang.Class<?> startedTestSuite)
A test suite (containing a series of tests) starts.
|
void |
testSuiteStarted(Story story)
Start a test run using a specific story, without a corresponding Java class.
|
void |
updateCurrentStepTitle(java.lang.String updatedStepTitle) |
void |
updateOverallResults() |
void |
useExamplesFrom(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,
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 com.google.common.base.Optional<TestStep> cloneCurrentStep()
public void setAllStepsTo(TestResult result)
public void exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected)
public BaseStepListener.StepMerger mergeLast(int maxStepsToMerge)
public int getStepCount()
public void updateOverallResults()
public void testSuiteStarted(java.lang.Class<?> startedTestSuite)
testSuiteStarted in interface StepListenerstartedTestSuite - the class implementing the test suite (e.g. a JUnit test case)public void testSuiteStarted(Story story)
StepListenertestSuiteStarted in interface StepListenerpublic boolean testSuiteRunning()
public void addIssuesToCurrentStory(java.util.List<java.lang.String> issues)
public void addTagsToCurrentStory(java.util.List<TestTag> tags)
public void testSuiteFinished()
StepListenertestSuiteFinished in interface StepListenerpublic void testStarted(java.lang.String testMethod)
testStarted in interface StepListenertestMethod - the name of the test method in the test suite class.public void updateCurrentStepTitle(java.lang.String updatedStepTitle)
public void testFinished(TestOutcome outcome)
testFinished in interface StepListeneroutcome - the result of the test that just finished.public void testRetried()
StepListenertestRetried in interface StepListenerpublic void stepStarted(ExecutedStepDescription description)
stepStarted in interface StepListenerdescription - the description of the test that is about to be runpublic void skippedStepStarted(ExecutedStepDescription description)
StepListenerskippedStepStarted in interface StepListenerdescription - the description of the test that is about to be run
(generally a class and method name)public void stepFinished()
StepListenerstepFinished in interface StepListenerpublic void stepFailed(StepFailure failure)
StepListenerstepFailed in interface StepListenerfailure - describes the test that failed and the exception that was thrownpublic void lastStepFailed(StepFailure failure)
StepListenerlastStepFailed in interface StepListenerpublic void stepIgnored()
StepListenerIgnore.stepIgnored in interface StepListenerpublic void stepPending()
StepListenerstepPending in interface StepListenerpublic void stepPending(java.lang.String message)
StepListenerstepPending in interface StepListenerpublic void assumptionViolated(java.lang.String message)
assumptionViolated in interface StepListenerpublic com.google.common.base.Optional<TestResult> getForcedResult()
public void clearForcedResult()
public java.lang.String getPageSource()
public Photographer getPhotographer()
public java.util.List<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 FailureCause getTestFailureCause()
StepPublishergetTestFailureCause in interface StepPublisherpublic void testFailed(TestOutcome testOutcome, java.lang.Throwable cause)
StepListenertestFailed in interface StepListenertestOutcome - The test outcome structure for the failing testcause - The exception that triggered the failurepublic void testIgnored()
StepListenertestIgnored in interface StepListenerpublic void testSkipped()
StepListenertestSkipped in interface StepListenerpublic void testPending()
StepListenertestPending in interface StepListenerpublic void testIsManual()
testIsManual in interface StepListenerpublic void notifyScreenChange()
notifyScreenChange in interface StepListenerpublic void takeScreenshot()
public void useExamplesFrom(DataTable table)
useExamplesFrom in interface StepListenerpublic void addNewExamplesFrom(DataTable table)
StepListeneraddNewExamplesFrom in interface StepListenerpublic void exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)
StepListenerexampleStarted in interface StepListenerpublic void exampleFinished()
StepListenerexampleFinished in interface StepListenerpublic void recordRestQuery(RestQuery restQuery)