net.thucydides.core.model
Class TestStep

Package class diagram package TestStep
java.lang.Object
  extended by 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

Constructor Summary
TestStep()
           
TestStep(String description)
           
 
Method Summary
 void addChildStep(TestStep step)
           
 void addScreenshot(ScreenshotAndHtmlSource screenshotAndHtmlSource)
           
 void failedWith(Throwable exception)
          Indicate that this step failed with a given error.
 List<TestStep> getChildren()
           
 String getDescription()
           
 long getDuration()
           
 double getDurationInSeconds()
           
 String getErrorMessage()
           
 Throwable getException()
           
 ScreenshotAndHtmlSource getFirstScreenshot()
           
 List<? extends TestStep> getFlattenedSteps()
           
 Collection<? extends TestStep> getLeafTestSteps()
           
 TestResult getResult()
           
 int getScreenshotCount()
           
 List<ScreenshotAndHtmlSource> getScreenshots()
           
 String getShortErrorMessage()
           
 boolean hasChildren()
           
 boolean isAGroup()
           
 Boolean isFailure()
           
 Boolean isIgnored()
           
 Boolean isPending()
           
 Boolean isSkipped()
           
 Boolean isSuccessful()
           
 boolean needsScreenshots()
           
 void recordDuration()
           
 void removeScreenshot(int index)
           
 void setDescription(String description)
           
 void setDuration(long duration)
           
 void setResult(TestResult result)
          Each test step has a result, indicating the outcome of this step.
 void testAborted(Throwable exception)
          The test has been aborted (marked as pending or ignored) for a reason described in the exception.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestStep

public TestStep()

TestStep

public TestStep(String description)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

recordDuration

public void recordDuration()

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()

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 void addChildStep(TestStep step)

hasChildren

public boolean hasChildren()

getLeafTestSteps

public Collection<? extends TestStep> getLeafTestSteps()

addScreenshot

public void addScreenshot(ScreenshotAndHtmlSource screenshotAndHtmlSource)

getScreenshotCount

public int getScreenshotCount()

removeScreenshot

public void removeScreenshot(int index)


Copyright © 2011-2012 Wakaleo Consulting. All Rights Reserved.