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

Nested Class Summary
static class TestStep.TestStepBuilder
           
 
Constructor Summary
TestStep()
           
TestStep(org.joda.time.DateTime startTime, String description)
           
TestStep(String description)
           
 
Method Summary
 TestStep addChildStep(TestStep step)
           
 TestStep addScreenshot(ScreenshotAndHtmlSource screenshotAndHtmlSource)
           
protected  List<TestStep> children()
           
protected  TestStep copyOfThisTestStep()
           
 void failedWith(Throwable exception)
          Indicate that this step failed with a given error.
static TestStep.TestStepBuilder forStepCalled(String description)
           
 List<TestStep> getChildren()
           
 String getDescription()
           
 long getDuration()
           
 double getDurationInSeconds()
           
 String getErrorMessage()
           
 Throwable getException()
           
 ScreenshotAndHtmlSource getFirstScreenshot()
           
 List<? extends TestStep> getFlattenedSteps()
           
 Collection<? extends TestStep> getLeafTestSteps()
           
 int getNumber()
           
 TestResult getResult()
           
 int getScreenshotCount()
           
 List<ScreenshotAndHtmlSource> getScreenshots()
           
 String getShortErrorMessage()
           
 boolean hasChildren()
           
 boolean hasScreenshots()
           
 boolean isAGroup()
           
 Boolean isError()
           
 Boolean isFailure()
           
 Boolean isIgnored()
           
 Boolean isPending()
           
 Boolean isSkipped()
           
 Boolean isSuccessful()
           
 boolean needsScreenshots()
           
 void recordDuration()
           
 void removeScreenshot(int index)
           
 int renumberFrom(int count)
           
 void setDescription(String description)
           
 void setDuration(long duration)
           
protected  void setNumber(int number)
           
 void setResult(TestResult result)
          Each test step has a result, indicating the outcome of this step.
 TestStep startingAt(org.joda.time.DateTime time)
           
 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)

TestStep

public TestStep(org.joda.time.DateTime startTime,
                String description)
Method Detail

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.