java.lang.Object
net.thucydides.model.domain.TestStep
- All Implemented Interfaces:
Cloneable
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddChildStep(TestStep step) addScreenshot(ScreenshotAndHtmlSource screenshotAndHtmlSource) asManual()children()voidclone()protected TestStepbooleancorrespondsToLine(int lineNumber) booleanvoidfailedWith(Throwable cause) Indicate that this step failed with a given error.static TestStep.TestStepBuilderforStepCalled(String description) intlongdoublegetError()Collection<? extends TestStep> intgetLevel()intReturns rendered screenshots of this step and of child steps, in order of appearance, and starting with the earliet screenshot overall with the name of this step.intbooleanbooleanhasData()inthashCode()booleanbooleanbooleanbooleanbooleanisAGroup()booleanisError()booleanvoidvoidrecordDuration(ZonedDateTime time) recordReportData(ReportData reportData) voidrecordRestQuery(RestQuery restQuery) voidremoveScreenshot(int index) renderedScreenshotOf(ScreenshotAndHtmlSource from, int level) intrenumberFrom(int count) voidsetDescription(String description) voidsetDuration(long duration) voidsetExternalLink(ExternalLink externalLink) voidsetLineNumber(int lineNumber) protected voidsetNumber(int number) voidsetPrecondition(boolean precondition) voidsetResult(TestResult result) Each test step has a result, indicating the outcome of this step.voidsetStartTime(ZonedDateTime startTime) startingAt(ZonedDateTime time) voidtestAborted(Throwable exception) The test has been aborted (marked as pending or ignored) for a reason described in the exception.toString()voidwithReportData(ReportData reportData) withResult(TestResult annotatedResult)
-
Field Details
-
NO_STEP
-
IGNORED_TESTSTEPS
-
COMPROMISED_TESTSTEPS
-
SUCCESSFUL_TESTSTEPS
-
FAILING_TESTSTEPS
-
ERROR_TESTSTEPS
-
SKIPPED_TESTSTEPS
-
-
Constructor Details
-
TestStep
public TestStep() -
TestStep
-
TestStep
-
-
Method Details
-
setNumber
protected void setNumber(int number) -
forStepCalled
-
hasScreenshots
public boolean hasScreenshots() -
children
-
renumberFrom
public int renumberFrom(int count) -
recordRestQuery
-
updateOverallResult
public void updateOverallResult() -
setPrecondition
public void setPrecondition(boolean precondition) -
withResult
-
setLineNumber
public void setLineNumber(int lineNumber) -
correspondsToLine
public boolean correspondsToLine(int lineNumber) -
getExternalLink
-
setExternalLink
-
setStartTime
-
toString
-
startingAt
-
clone
-
copyOfThisTestStep
-
recordDuration
-
recordDuration
public void recordDuration() -
getNumber
public int getNumber() -
setDescription
-
getDescription
-
unrendered
-
getChildren
-
getScreenshots
-
getAllScreenshots
-
getRenderedScreenshots
Returns rendered screenshots of this step and of child steps, in order of appearance, and starting with the earliet screenshot overall with the name of this step. -
getTopLevelScreenshots
-
renderedScreenshotOf
-
hasRestQuery
public boolean hasRestQuery() -
hasData
public boolean hasData() -
getRestQuery
-
getLevel
public int getLevel() -
getReportEvidence
-
getReportData
-
getFirstScreenshot
-
getEarliestScreenshot
-
getLatestScreenshot
-
getLastScreenshot
-
needsScreenshots
public boolean needsScreenshots() -
setResult
Each test step has a result, indicating the outcome of this step.- Parameters:
result- The test outcome associated with this step.
-
getResult
-
getOverallResult
-
asManual
-
isSuccessful
-
isFailure
-
isError
-
isCompromised
-
isIgnored
-
isSkipped
-
isPending
-
isAPrecondition
public boolean isAPrecondition() -
setDuration
public void setDuration(long duration) -
getDuration
public long getDuration() -
getDurationInSeconds
public double getDurationInSeconds() -
getFormattedDuration
-
failedWith
Indicate that this step failed with a given error.- Parameters:
cause- why the test failed.
-
getError
-
getErrorMessage
-
getConciseErrorMessage
-
testAborted
The test has been aborted (marked as pending or ignored) for a reason described in the exception. -
getShortErrorMessage
-
getException
-
clearException
public void clearException() -
getNestedException
-
getFlattenedSteps
-
isAGroup
public boolean isAGroup() -
hasNestedErrors
public boolean hasNestedErrors() -
addChildStep
-
hasChildren
public boolean hasChildren() -
hasMultipleScreenshots
public boolean hasMultipleScreenshots() -
getLeafTestSteps
-
addScreenshot
-
getStartTime
-
getEndTime
-
getActualScreenshotCount
public int getActualScreenshotCount() -
getScreenshotCount
public int getScreenshotCount() -
removeScreenshot
public void removeScreenshot(int index) -
withReportData
-
recordReportData
-
equals
-
hashCode
public int hashCode()
-