public class StepEventBus
extends java.lang.Object
Constructor and Description |
---|
StepEventBus(net.thucydides.core.util.EnvironmentVariables environmentVariables) |
Modifier and Type | Method and 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(net.thucydides.core.model.DataTable newTable) |
void |
addTagsToCurrentStory(java.util.List<net.thucydides.core.model.TestTag> tags) |
void |
addTagsToCurrentTest(java.util.List<net.thucydides.core.model.TestTag> tags) |
boolean |
areStepsRunning() |
boolean |
assumptionViolated() |
void |
assumptionViolated(java.lang.String message) |
boolean |
aStepInTheCurrentTestHasFailed() |
void |
cancelPreviousTest() |
void |
castActor(java.lang.String name) |
void |
clear() |
static void |
clearEventBusFor(java.lang.Object key) |
void |
clearStepFailures() |
boolean |
currentTestIsSuspended() |
boolean |
currentTestOutcomeIsDataDriven() |
void |
disableSoftAsserts() |
void |
dropAllListeners() |
void |
dropListener(net.thucydides.core.steps.StepListener stepListener) |
void |
enableDryRun() |
void |
enableSoftAsserts() |
static StepEventBus |
eventBusFor(java.lang.Object key) |
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.lang.String |
getAssumptionViolatedMessage() |
BaseStepListener |
getBaseStepListener() |
java.util.Optional<net.thucydides.core.model.TestStep> |
getCurrentStep() |
net.thucydides.core.util.EnvironmentVariables |
getEnvironmentVariables() |
static StepEventBus |
getEventBus()
The event bus used to inform listening classes about when tests and test steps start and finish.
|
java.util.Optional<net.thucydides.core.model.TestResult> |
getForcedResult() |
java.lang.String |
getTestSource() |
boolean |
isBaseStepListenerRegistered() |
boolean |
isCurrentTestDataDriven() |
boolean |
isDryRun() |
boolean |
isUniqueSession() |
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) |
void |
mergePreviousStep() |
void |
notifyScreenChange() |
static void |
overrideEventBusWith(StepEventBus stepEventBus) |
void |
reenableWebdriverCalls() |
StepEventBus |
registerListener(net.thucydides.core.steps.StepListener listener)
Register a listener to receive notification at different points during a test's execution.
|
void |
reset() |
java.util.Optional<net.thucydides.core.model.TestResult> |
resultSoFar() |
void |
setAllStepsTo(net.thucydides.core.model.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) |
static void |
setCurrentBusToEventBusFor(java.lang.Object key) |
void |
setTestSource(java.lang.String testSource) |
void |
setUniqueSession(boolean uniqueSession) |
void |
skippedStepStarted(net.thucydides.core.steps.ExecutedStepDescription executedStepDescription)
Record a step that is not scheduled to be executed (e.g.
|
boolean |
softAssertsActive() |
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 stepDescription)
Start the execution of a test step.
|
void |
stepStarted(net.thucydides.core.steps.ExecutedStepDescription stepDescription,
boolean isPrecondition)
Start the execution of a test step.
|
void |
suspendTest() |
void |
suspendTest(net.thucydides.core.model.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(net.thucydides.core.model.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 newTestName,
net.thucydides.core.model.Story story) |
void |
testStarted(java.lang.String testName,
java.lang.String id) |
void |
testSuiteFinished() |
boolean |
testSuiteHasStarted() |
void |
testSuiteStarted(java.lang.Class<?> testClass) |
void |
testSuiteStarted(net.thucydides.core.model.Story story) |
void |
unsuspend()
Removes a test suspension
|
void |
updateCurrentStepTitle(java.lang.String stepTitle) |
void |
updateCurrentStepTitleAsPrecondition(java.lang.String stepTitle) |
void |
updateOverallResults() |
void |
useExamplesFrom(net.thucydides.core.model.DataTable table) |
void |
useScenarioOutline(java.lang.String scenarioOutline) |
boolean |
webdriverCallsAreSuspended() |
@Inject public StepEventBus(net.thucydides.core.util.EnvironmentVariables environmentVariables)
public static StepEventBus getEventBus()
public static StepEventBus eventBusFor(java.lang.Object key)
public static void setCurrentBusToEventBusFor(java.lang.Object key)
public static void clearEventBusFor(java.lang.Object key)
public net.thucydides.core.util.EnvironmentVariables getEnvironmentVariables()
public StepEventBus registerListener(net.thucydides.core.steps.StepListener listener)
public boolean isBaseStepListenerRegistered()
public BaseStepListener getBaseStepListener()
public void testStarted(java.lang.String testName)
public void testStarted(java.lang.String testName, java.lang.String id)
public boolean isUniqueSession()
public void setUniqueSession(boolean uniqueSession)
public void testStarted(java.lang.String newTestName, net.thucydides.core.model.Story story)
public void testStarted(java.lang.String newTestName, java.lang.Class<?> testClass)
public void testSuiteStarted(java.lang.Class<?> testClass)
public void testSuiteStarted(net.thucydides.core.model.Story story)
public void clear()
public void unsuspend()
public void testFinished()
public void testFinished(net.thucydides.core.model.TestOutcome result)
public void testRetried()
public void clearStepFailures()
public boolean aStepInTheCurrentTestHasFailed()
public boolean isCurrentTestDataDriven()
public void stepStarted(net.thucydides.core.steps.ExecutedStepDescription stepDescription)
public void stepStarted(net.thucydides.core.steps.ExecutedStepDescription stepDescription, boolean isPrecondition)
public void skippedStepStarted(net.thucydides.core.steps.ExecutedStepDescription executedStepDescription)
public void stepFinished()
public void stepFailed(net.thucydides.core.steps.StepFailure failure)
public void lastStepFailed(net.thucydides.core.steps.StepFailure failure)
public void stepIgnored()
public void stepPending()
public void stepPending(java.lang.String message)
public void assumptionViolated(java.lang.String message)
public void dropListener(net.thucydides.core.steps.StepListener stepListener)
public void dropAllListeners()
public boolean webdriverCallsAreSuspended()
public void reenableWebdriverCalls()
public void temporarilySuspendWebdriverCalls()
public void testFailed(java.lang.Throwable cause)
cause
- the underlying cause of the failure.public void testPending()
public void testIsManual()
public void suspendTest()
public void suspendTest(net.thucydides.core.model.TestResult result)
public void useScenarioOutline(java.lang.String scenarioOutline)
public boolean currentTestIsSuspended()
public boolean assumptionViolated()
public void testIgnored()
public void testSkipped()
public boolean areStepsRunning()
public void notifyScreenChange()
public void testSuiteFinished()
public void testRunFinished()
public void updateCurrentStepTitle(java.lang.String stepTitle)
public void updateCurrentStepTitleAsPrecondition(java.lang.String stepTitle)
public void addIssuesToCurrentStory(java.util.List<java.lang.String> issues)
public void addIssuesToCurrentTest(java.util.List<java.lang.String> issues)
public void addTagsToCurrentTest(java.util.List<net.thucydides.core.model.TestTag> tags)
public void addTagsToCurrentStory(java.util.List<net.thucydides.core.model.TestTag> tags)
public void addDescriptionToCurrentTest(java.lang.String description)
public void setBackgroundTitle(java.lang.String title)
public void setBackgroundDescription(java.lang.String description)
public void useExamplesFrom(net.thucydides.core.model.DataTable table)
public void addNewExamplesFrom(net.thucydides.core.model.DataTable newTable)
public void exampleStarted(java.util.Map<java.lang.String,java.lang.String> data)
public void exampleFinished()
public boolean currentTestOutcomeIsDataDriven()
public void takeScreenshot()
public boolean testSuiteHasStarted()
public java.lang.String getAssumptionViolatedMessage()
public java.util.Optional<net.thucydides.core.model.TestStep> getCurrentStep()
public void setAllStepsTo(net.thucydides.core.model.TestResult result)
result
- public java.util.Optional<net.thucydides.core.model.TestResult> getForcedResult()
public boolean isDryRun()
public void enableDryRun()
public void exceptionExpected(java.lang.Class<? extends java.lang.Throwable> expected)
public java.util.Optional<net.thucydides.core.model.TestResult> resultSoFar()
public void mergePreviousStep()
public void updateOverallResults()
public void reset()
public void disableSoftAsserts()
public void enableSoftAsserts()
public boolean softAssertsActive()
public java.lang.String getTestSource()
public void setTestSource(java.lang.String testSource)
public void cancelPreviousTest()
public void lastTestPassedAfterRetries(int remainingTries, java.util.List<java.lang.String> failureMessages, net.thucydides.core.steps.TestFailureCause testFailureCause)
public static void overrideEventBusWith(StepEventBus stepEventBus)
public void castActor(java.lang.String name)