Package net.thucydides.core.steps
Class SilentEventBus
java.lang.Object
net.thucydides.core.steps.StepEventBus
net.thucydides.core.steps.SilentEventBus
public class SilentEventBus extends StepEventBus
-
Constructor Summary
Constructors Constructor Description SilentEventBus(EnvironmentVariables environmentVariables)
-
Method Summary
Modifier and Type Method Description void
addDescriptionToCurrentTest(java.lang.String description)
void
addIssuesToCurrentStory(java.util.List<java.lang.String> issues)
void
addIssuesToCurrentTest(java.util.List<java.lang.String> issues)
void
addNewExamplesFrom(DataTable newTable)
void
addTagsToCurrentStory(java.util.List<TestTag> tags)
void
addTagsToCurrentTest(java.util.List<TestTag> tags)
boolean
areStepsRunning()
boolean
assumptionViolated()
void
assumptionViolated(java.lang.String message)
boolean
aStepInTheCurrentTestHasFailed()
void
cancelPreviousTest()
void
clear()
void
clearStepFailures()
boolean
currentTestIsSuspended()
boolean
currentTestOutcomeIsDataDriven()
void
disableSoftAsserts()
void
dropAllListeners()
void
dropListener(StepListener stepListener)
void
enableDryRun()
void
enableSoftAsserts()
void
exampleFinished()
void
exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)
void
exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected)
protected java.util.List<StepListener>
getAllListeners()
java.lang.String
getAssumptionViolatedMessage()
BaseStepListener
getBaseStepListener()
java.util.Optional<TestStep>
getCurrentStep()
java.util.Optional<TestResult>
getForcedResult()
java.lang.String
getTestSource()
boolean
isBaseStepListenerRegistered()
boolean
isCurrentTestDataDriven()
boolean
isDryRun()
boolean
isUniqueSession()
void
lastStepFailed(StepFailure failure)
void
lastTestPassedAfterRetries(int remainingTries, java.util.List<java.lang.String> failureMessages, TestFailureCause testFailureCause)
void
mergePreviousStep()
void
notifyScreenChange()
void
reenableWebdriverCalls()
StepEventBus
registerListener(StepListener listener)
Register a listener to receive notification at different points during a test's execution.void
reset()
java.util.Optional<TestResult>
resultSoFar()
void
setAllStepsTo(TestResult result)
Set all steps in the current test outcome to a given result.void
setBackgroundDescription(java.lang.String description)
void
setBackgroundTitle(java.lang.String title)
void
setTestSource(java.lang.String testSource)
void
setUniqueSession(boolean uniqueSession)
void
skippedStepStarted(ExecutedStepDescription executedStepDescription)
Record a step that is not scheduled to be executed (e.g.boolean
softAssertsActive()
void
stepFailed(StepFailure failure)
void
stepFinished()
void
stepIgnored()
void
stepPending()
void
stepPending(java.lang.String message)
void
stepStarted(ExecutedStepDescription stepDescription)
Start the execution of a test step.void
stepStarted(ExecutedStepDescription stepDescription, boolean isPrecondition)
Start the execution of a test step.void
suspendTest()
void
suspendTest(TestResult result)
void
takeScreenshot()
Forces Thucydides to take a screenshot now.void
temporarilySuspendWebdriverCalls()
void
testFailed(java.lang.Throwable cause)
The test failed, but not during the execution of a step.void
testFinished()
void
testFinished(TestOutcome result)
void
testIgnored()
void
testIsManual()
Mark the current test method as pending.void
testPending()
Mark the current test method as pending.void
testRetried()
void
testRunFinished()
void
testSkipped()
void
testStarted(java.lang.String testName)
void
testStarted(java.lang.String newTestName, java.lang.Class<?> testClass)
void
testStarted(java.lang.String testName, java.lang.String id)
void
testStarted(java.lang.String newTestName, Story story)
void
testSuiteFinished()
boolean
testSuiteHasStarted()
void
testSuiteStarted(java.lang.Class<?> testClass)
void
testSuiteStarted(Story story)
void
updateCurrentStepTitle(java.lang.String stepTitle)
void
updateCurrentStepTitleAsPrecondition(java.lang.String stepTitle)
void
updateOverallResults()
void
useExamplesFrom(DataTable table)
boolean
webdriverCallsAreSuspended()
Methods inherited from class net.thucydides.core.steps.StepEventBus
castActor, clearEventBusFor, currentTestHasTag, dropAgent, dropAgents, eventBusFor, exampleStarted, finishTestRun, getEnvironmentVariables, getEventBus, initialiseSession, isASingleBrowserScenario, mergeActivitiesToDefaultStepListener, mergeActivitiesToDefaultStepListener, notifyFailure, overrideEventBusWith, reenableWebDriver, registerAgent, registerAgents, setCurrentBusToEventBusFor, setRule, testAborted, testFinished, unsuspend, updateExampleLineNumber, useScenarioOutline, wrapUpCurrentCucumberStep
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SilentEventBus
-
-
Method Details
-
registerListener
Description copied from class:StepEventBus
Register a listener to receive notification at different points during a test's execution. If you are writing your own listener, you shouldn't need to call this method - just set up your listener implementation as a service (see http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html), place the listener class on the classpath and it will be detected automatically.- Overrides:
registerListener
in classStepEventBus
-
isBaseStepListenerRegistered
public boolean isBaseStepListenerRegistered()- Overrides:
isBaseStepListenerRegistered
in classStepEventBus
-
getBaseStepListener
- Overrides:
getBaseStepListener
in classStepEventBus
-
testStarted
public void testStarted(java.lang.String testName)- Overrides:
testStarted
in classStepEventBus
-
testStarted
public void testStarted(java.lang.String testName, java.lang.String id)- Overrides:
testStarted
in classStepEventBus
-
isUniqueSession
public boolean isUniqueSession()- Overrides:
isUniqueSession
in classStepEventBus
-
setUniqueSession
public void setUniqueSession(boolean uniqueSession)- Overrides:
setUniqueSession
in classStepEventBus
-
testStarted
- Overrides:
testStarted
in classStepEventBus
-
testStarted
public void testStarted(java.lang.String newTestName, java.lang.Class<?> testClass)- Overrides:
testStarted
in classStepEventBus
-
getAllListeners
- Overrides:
getAllListeners
in classStepEventBus
-
testSuiteStarted
public void testSuiteStarted(java.lang.Class<?> testClass)- Overrides:
testSuiteStarted
in classStepEventBus
-
testSuiteStarted
- Overrides:
testSuiteStarted
in classStepEventBus
-
clear
public void clear()- Overrides:
clear
in classStepEventBus
-
testFinished
public void testFinished()- Overrides:
testFinished
in classStepEventBus
-
testFinished
- Overrides:
testFinished
in classStepEventBus
-
testRetried
public void testRetried()- Overrides:
testRetried
in classStepEventBus
-
clearStepFailures
public void clearStepFailures()- Overrides:
clearStepFailures
in classStepEventBus
-
aStepInTheCurrentTestHasFailed
public boolean aStepInTheCurrentTestHasFailed()- Overrides:
aStepInTheCurrentTestHasFailed
in classStepEventBus
-
isCurrentTestDataDriven
public boolean isCurrentTestDataDriven()- Overrides:
isCurrentTestDataDriven
in classStepEventBus
-
stepStarted
Description copied from class:StepEventBus
Start the execution of a test step.- Overrides:
stepStarted
in classStepEventBus
-
stepStarted
Description copied from class:StepEventBus
Start the execution of a test step.- Overrides:
stepStarted
in classStepEventBus
-
skippedStepStarted
Description copied from class:StepEventBus
Record a step that is not scheduled to be executed (e.g. a skipped or ignored step).- Overrides:
skippedStepStarted
in classStepEventBus
-
stepFinished
public void stepFinished()- Overrides:
stepFinished
in classStepEventBus
-
stepFailed
- Overrides:
stepFailed
in classStepEventBus
-
lastStepFailed
- Overrides:
lastStepFailed
in classStepEventBus
-
stepIgnored
public void stepIgnored()- Overrides:
stepIgnored
in classStepEventBus
-
stepPending
public void stepPending()- Overrides:
stepPending
in classStepEventBus
-
stepPending
public void stepPending(java.lang.String message)- Overrides:
stepPending
in classStepEventBus
-
assumptionViolated
public void assumptionViolated(java.lang.String message)- Overrides:
assumptionViolated
in classStepEventBus
-
dropListener
- Overrides:
dropListener
in classStepEventBus
-
dropAllListeners
public void dropAllListeners()- Overrides:
dropAllListeners
in classStepEventBus
-
webdriverCallsAreSuspended
public boolean webdriverCallsAreSuspended()- Overrides:
webdriverCallsAreSuspended
in classStepEventBus
-
reenableWebdriverCalls
public void reenableWebdriverCalls()- Overrides:
reenableWebdriverCalls
in classStepEventBus
-
temporarilySuspendWebdriverCalls
public void temporarilySuspendWebdriverCalls()- Overrides:
temporarilySuspendWebdriverCalls
in classStepEventBus
-
testFailed
public void testFailed(java.lang.Throwable cause)Description copied from class:StepEventBus
The test failed, but not during the execution of a step.- Overrides:
testFailed
in classStepEventBus
- Parameters:
cause
- the underlying cause of the failure.
-
testPending
public void testPending()Description copied from class:StepEventBus
Mark the current test method as pending. The test will stil be executed to record the steps, but any webdriver calls will be skipped.- Overrides:
testPending
in classStepEventBus
-
testIsManual
public void testIsManual()Description copied from class:StepEventBus
Mark the current test method as pending. The test will stil be executed to record the steps, but any webdriver calls will be skipped.- Overrides:
testIsManual
in classStepEventBus
-
suspendTest
public void suspendTest()- Overrides:
suspendTest
in classStepEventBus
-
suspendTest
- Overrides:
suspendTest
in classStepEventBus
-
currentTestIsSuspended
public boolean currentTestIsSuspended()- Overrides:
currentTestIsSuspended
in classStepEventBus
-
assumptionViolated
public boolean assumptionViolated()- Overrides:
assumptionViolated
in classStepEventBus
-
testIgnored
public void testIgnored()- Overrides:
testIgnored
in classStepEventBus
-
testSkipped
public void testSkipped()- Overrides:
testSkipped
in classStepEventBus
-
areStepsRunning
public boolean areStepsRunning()- Overrides:
areStepsRunning
in classStepEventBus
-
notifyScreenChange
public void notifyScreenChange()- Overrides:
notifyScreenChange
in classStepEventBus
-
testSuiteFinished
public void testSuiteFinished()- Overrides:
testSuiteFinished
in classStepEventBus
-
testRunFinished
public void testRunFinished()- Overrides:
testRunFinished
in classStepEventBus
-
updateCurrentStepTitle
public void updateCurrentStepTitle(java.lang.String stepTitle)- Overrides:
updateCurrentStepTitle
in classStepEventBus
-
updateCurrentStepTitleAsPrecondition
public void updateCurrentStepTitleAsPrecondition(java.lang.String stepTitle)- Overrides:
updateCurrentStepTitleAsPrecondition
in classStepEventBus
-
addIssuesToCurrentStory
public void addIssuesToCurrentStory(java.util.List<java.lang.String> issues)- Overrides:
addIssuesToCurrentStory
in classStepEventBus
-
addIssuesToCurrentTest
public void addIssuesToCurrentTest(java.util.List<java.lang.String> issues)- Overrides:
addIssuesToCurrentTest
in classStepEventBus
-
addTagsToCurrentTest
- Overrides:
addTagsToCurrentTest
in classStepEventBus
-
addTagsToCurrentStory
- Overrides:
addTagsToCurrentStory
in classStepEventBus
-
addDescriptionToCurrentTest
public void addDescriptionToCurrentTest(java.lang.String description)- Overrides:
addDescriptionToCurrentTest
in classStepEventBus
-
setBackgroundTitle
public void setBackgroundTitle(java.lang.String title)- Overrides:
setBackgroundTitle
in classStepEventBus
-
setBackgroundDescription
public void setBackgroundDescription(java.lang.String description)- Overrides:
setBackgroundDescription
in classStepEventBus
-
useExamplesFrom
- Overrides:
useExamplesFrom
in classStepEventBus
-
addNewExamplesFrom
- Overrides:
addNewExamplesFrom
in classStepEventBus
-
exampleStarted
public void exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)- Overrides:
exampleStarted
in classStepEventBus
-
exampleFinished
public void exampleFinished()- Overrides:
exampleFinished
in classStepEventBus
-
currentTestOutcomeIsDataDriven
public boolean currentTestOutcomeIsDataDriven()- Overrides:
currentTestOutcomeIsDataDriven
in classStepEventBus
-
takeScreenshot
public void takeScreenshot()Description copied from class:StepEventBus
Forces Thucydides to take a screenshot now.- Overrides:
takeScreenshot
in classStepEventBus
-
testSuiteHasStarted
public boolean testSuiteHasStarted()- Overrides:
testSuiteHasStarted
in classStepEventBus
-
getAssumptionViolatedMessage
public java.lang.String getAssumptionViolatedMessage()- Overrides:
getAssumptionViolatedMessage
in classStepEventBus
-
getCurrentStep
- Overrides:
getCurrentStep
in classStepEventBus
-
setAllStepsTo
Description copied from class:StepEventBus
Set all steps in the current test outcome to a given result. Used to set all steps to PENDING or SKIPPED, for example.- Overrides:
setAllStepsTo
in classStepEventBus
-
getForcedResult
- Overrides:
getForcedResult
in classStepEventBus
-
isDryRun
public boolean isDryRun()- Overrides:
isDryRun
in classStepEventBus
-
enableDryRun
public void enableDryRun()- Overrides:
enableDryRun
in classStepEventBus
-
exceptionExpected
public void exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected)- Overrides:
exceptionExpected
in classStepEventBus
-
resultSoFar
- Overrides:
resultSoFar
in classStepEventBus
-
mergePreviousStep
public void mergePreviousStep()- Overrides:
mergePreviousStep
in classStepEventBus
-
updateOverallResults
public void updateOverallResults()- Overrides:
updateOverallResults
in classStepEventBus
-
reset
public void reset()- Overrides:
reset
in classStepEventBus
-
disableSoftAsserts
public void disableSoftAsserts()- Overrides:
disableSoftAsserts
in classStepEventBus
-
enableSoftAsserts
public void enableSoftAsserts()- Overrides:
enableSoftAsserts
in classStepEventBus
-
softAssertsActive
public boolean softAssertsActive()- Overrides:
softAssertsActive
in classStepEventBus
-
getTestSource
public java.lang.String getTestSource()- Overrides:
getTestSource
in classStepEventBus
-
setTestSource
public void setTestSource(java.lang.String testSource)- Overrides:
setTestSource
in classStepEventBus
-
cancelPreviousTest
public void cancelPreviousTest()- Overrides:
cancelPreviousTest
in classStepEventBus
-
lastTestPassedAfterRetries
public void lastTestPassedAfterRetries(int remainingTries, java.util.List<java.lang.String> failureMessages, TestFailureCause testFailureCause)- Overrides:
lastTestPassedAfterRetries
in classStepEventBus
-