net.thucydides.core.model
Class TestStep
java.lang.Object
net.thucydides.core.model.TestStep
public class TestStep
- extends Object
An acceptance test run is made up of test steps.
Test steps can be either concrete steps or groups of steps.
Each concrete step should represent an action by the user, and (generally) an expected outcome.
A test step is described by a narrative-style phrase (e.g. "the user clicks
on the 'Search' button', "the user fills in the registration form', etc.).
A screenshot is stored for each step.
- Author:
- johnsmart
TestStep
public TestStep()
TestStep
public TestStep(String description)
TestStep
public TestStep(org.joda.time.DateTime startTime,
String description)
setNumber
protected void setNumber(int number)
forStepCalled
public static TestStep.TestStepBuilder forStepCalled(String description)
hasScreenshots
public boolean hasScreenshots()
children
protected List<TestStep> children()
renumberFrom
public int renumberFrom(int count)
toString
public String toString()
- Overrides:
toString in class Object
startingAt
public TestStep startingAt(org.joda.time.DateTime time)
copyOfThisTestStep
protected TestStep copyOfThisTestStep()
recordDuration
public void recordDuration()
getNumber
public int getNumber()
setDescription
public void setDescription(String description)
getDescription
public String getDescription()
getChildren
public List<TestStep> getChildren()
getScreenshots
public List<ScreenshotAndHtmlSource> getScreenshots()
getFirstScreenshot
public ScreenshotAndHtmlSource getFirstScreenshot()
needsScreenshots
public boolean needsScreenshots()
setResult
public void setResult(TestResult result)
- Each test step has a result, indicating the outcome of this step.
- Parameters:
result - The test outcome associated with this step.
getResult
public TestResult getResult()
isSuccessful
public Boolean isSuccessful()
isFailure
public Boolean isFailure()
isError
public Boolean isError()
isIgnored
public Boolean isIgnored()
isSkipped
public Boolean isSkipped()
isPending
public Boolean isPending()
setDuration
public void setDuration(long duration)
getDuration
public long getDuration()
getDurationInSeconds
public double getDurationInSeconds()
failedWith
public void failedWith(Throwable exception)
- Indicate that this step failed with a given error.
- Parameters:
exception - why the test failed.
getErrorMessage
public String getErrorMessage()
testAborted
public void testAborted(Throwable exception)
- The test has been aborted (marked as pending or ignored) for a reason described in the exception.
- Parameters:
exception -
getShortErrorMessage
public String getShortErrorMessage()
getException
public Throwable getException()
getFlattenedSteps
public List<? extends TestStep> getFlattenedSteps()
isAGroup
public boolean isAGroup()
addChildStep
public TestStep addChildStep(TestStep step)
hasChildren
public boolean hasChildren()
getLeafTestSteps
public Collection<? extends TestStep> getLeafTestSteps()
addScreenshot
public TestStep addScreenshot(ScreenshotAndHtmlSource screenshotAndHtmlSource)
getScreenshotCount
public int getScreenshotCount()
removeScreenshot
public void removeScreenshot(int index)
Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.