|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectnet.thucydides.core.model.TestOutcome
public class TestOutcome
Represents the results of a test (or "scenario") execution. This includes the narrative steps taken during the test, screenshots at each step, the results of each step, and the overall result. A test scenario can be associated with a user story using the UserStory annotation. A TestOutcome is stored as an XML file after a test is executed. When the aggregate reports are generated, the test outcome XML files are loaded into memory and processed.
| Nested Class Summary | |
|---|---|
static class |
TestOutcome.StepCountBuilder
|
| Constructor Summary | |
|---|---|
protected |
TestOutcome(long startTime,
long duration,
String title,
String description,
String methodName,
Class<?> testCase,
List<TestStep> testSteps,
List<String> issues,
List<String> additionalIssues,
Set<TestTag> tags,
Story userStory,
Throwable testFailureCause,
TestResult annotatedResult,
DataTable dataTable,
com.google.common.base.Optional<String> qualifier,
boolean manualTest)
|
|
TestOutcome(String methodName)
The title is immutable once set. |
|
TestOutcome(String methodName,
Class<?> testCase)
|
protected |
TestOutcome(String methodName,
Class<?> testCase,
Story userStory)
A test outcome should relate to a particular test class or user story class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TestOutcome(String methodName)
methodName - The name of the Java method that implements this test.
public TestOutcome(String methodName,
Class<?> testCase)
protected TestOutcome(String methodName,
Class<?> testCase,
Story userStory)
methodName - The name of the Java method implementing this test, if the test is a JUnit or TestNG test (for example)testCase - The test class that contains this test method, if the test is a JUnit or TestNG testuserStory - If the test is not implemented by a Java class (e.g. an easyb story), we may just use the Story class to
represent the story in which the test is implemented.
protected TestOutcome(long startTime,
long duration,
String title,
String description,
String methodName,
Class<?> testCase,
List<TestStep> testSteps,
List<String> issues,
List<String> additionalIssues,
Set<TestTag> tags,
Story userStory,
Throwable testFailureCause,
TestResult annotatedResult,
DataTable dataTable,
com.google.common.base.Optional<String> qualifier,
boolean manualTest)
| Method Detail |
|---|
public TestOutcome usingIssueTracking(IssueTracking issueTracking)
public TestOutcome asManualTest()
public void setEnvironmentVariables(EnvironmentVariables environmentVariables)
public EnvironmentVariables getEnvironmentVariables()
public static TestOutcome forTest(String methodName,
Class<?> testCase)
methodName - The name of the Java method implementing this test,testCase - The JUnit or TestNG test class that contains this test method
public TestOutcome withQualifier(String qualifier)
public TestOutcome withIssues(List<String> issues)
public TestOutcome withMethodName(String methodName)
public String getMethodName()
public static TestOutcome forTestInStory(String testName,
Story story)
public static TestOutcome forTestInStory(String testName,
Class<?> testCase,
Story story)
public String toString()
toString in class Objectpublic String getTitle()
public void setDescription(String description)
public String getDescription()
public com.google.common.base.Optional<String> getDescriptionText()
public String getTitleWithLinks()
public String getStoryTitle()
public String getPath()
public String getReportName(ReportType type)
public String getSimpleReportName(ReportType type)
public String getHtmlReport()
public String getReportName()
public String getScreenshotReportName()
public List<TestStep> getTestSteps()
public boolean hasScreenshots()
public List<ScreenshotAndHtmlSource> getScreenshotAndHtmlSources()
public List<Screenshot> getScreenshots()
public boolean hasNonStepFailure()
public List<TestStep> getFlattenedTestSteps()
public List<TestStep> getLeafTestSteps()
public TestResult getResult()
public TestOutcome recordSteps(List<TestStep> steps)
public TestOutcome recordStep(TestStep step)
step - a completed step to be added to this test outcome.
public ApplicationFeature getFeature()
public void setTitle(String title)
@Deprecated public void startGroup(String groupName)
public com.google.common.base.Optional<String> getQualifier()
public void startGroup()
public void endGroup()
public TestStep getCurrentStep()
public TestStep getLastStep()
public TestStep getCurrentGroup()
public void setUserStory(Story story)
public void setTestFailureCause(Throwable cause)
public Throwable getTestFailureCause()
public void setAnnotatedResult(TestResult annotatedResult)
public List<String> getIssues()
public List<String> getVersions()
public Class<?> getTestCase()
public TestOutcome addVersion(String version)
public TestOutcome addVersions(List<String> versions)
public void addIssues(List<String> issues)
public String getFormattedIssues()
public void isRelatedToIssue(String issue)
public void addFailingExternalStep(Throwable testFailureCause)
public void addFailingStepAsSibling(List<TestStep> testStepList,
Throwable testFailureCause)
public void lastStepFailedWith(StepFailure failure)
public void lastStepFailedWith(Throwable testFailureCause)
public Set<TestTag> getTags()
public void setTags(Set<TestTag> tags)
public void addTags(List<TestTag> tags)
public List<String> getIssueKeys()
public String getQualifiedMethodName()
public String getCompleteName()
public void useExamplesFrom(DataTable table)
public void moveToNextRow()
public void updateCurrentRowResult(TestResult result)
public boolean dataIsPredefined()
public void addRow(Map<String,?> data)
public void addRow(DataTableRow dataTableRow)
public int getTestCount()
public int getImplementedTestCount()
public int countResults(TestResult expectedResult)
public int countResults(TestResult expectedResult,
TestType expectedType)
public boolean typeCompatibleWith(TestType testType)
public int countNestedStepsWithResult(TestResult expectedResult,
TestType testType)
public com.google.common.base.Optional<String> getTagValue(String tagType)
public boolean hasIssue(String issue)
public boolean hasTag(TestTag tag)
public void setStartTime(org.joda.time.DateTime startTime)
public void clearStartTime()
public boolean isManual()
public boolean isStartTimeNotDefined()
public Integer getStepCount()
public Integer getNestedStepCount()
public Integer getSuccessCount()
public Integer getFailureCount()
public Integer getErrorCount()
public Integer getIgnoredCount()
public Integer getSkippedOrIgnoredCount()
public Integer getSkippedCount()
public Integer getPendingCount()
public Boolean isSuccess()
public Boolean isFailure()
public Boolean isError()
public Boolean isPending()
public Boolean isSkipped()
public Story getUserStory()
public void recordDuration()
public void setDuration(long duration)
public Long getDuration()
public double getDurationInSeconds()
public String getVideoLink()
public String getSessionId()
public void setSessionId(String sessionId)
public Integer countTestSteps()
public void setStatistics(TestStatistics statistics)
public TestStatistics getStatistics()
public double getOverallStability()
public double getRecentStability()
public Long getRecentTestRunCount()
public int getRecentPassCount()
public int getRecentFailCount()
public int getRecentPendingCount()
public org.joda.time.DateTime getStartTime()
public boolean isDataDriven()
public List<String> getExampleFields()
public String getDataDrivenSampleScenario()
public DataTable getDataTable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||