net.thucydides.core.reports
Class TestOutcomes

Package class diagram package TestOutcomes
java.lang.Object
  extended by net.thucydides.core.reports.TestOutcomes

public class TestOutcomes
extends Object

A set of test outcomes, which lets you perform query operations on the test outcomes. In particular, you can filter a set of test outcomes by tag type and by tag values. Since these operations also return TestOutcomes, you can then further drill down into the test outcome sets. The TestOutcomes object will usually return a list of TestOutcome objects. You can also inject statistics and test run history by using the withHistory() method. This will return a list of TestOutcomeWithHistory instances.


Nested Class Summary
 class TestOutcomes.OutcomeProportionCounter
           
 class TestOutcomes.OutcomeProportionStepCounter
           
 class TestOutcomes.TestOutcomeMatcher
           
 
Constructor Summary
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount)
           
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label)
           
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestOutcomes rootOutcomes)
           
 
Method Summary
 boolean containsTag(TestTag testTag)
           
 OutcomeCounter count(String testType)
           
 OutcomeCounter count(TestType testType)
           
protected  int countStepsWithResult(TestResult expectedResult)
           
protected  int countTestsWithResult(TestResult expectedResult)
           
protected  int countTestsWithResult(TestResult expectedResult, TestType testType)
           
 TestOutcomes.OutcomeProportionStepCounter decimalPercentageSteps(String testType)
           
 TestOutcomes.TestOutcomeMatcher findMatchingTags()
           
 TestOutcomes forRequirement(Requirement requirement)
           
 double getAverageTestSize()
           
 Long getDuration()
           
 double getDurationInSeconds()
           
 TestOutcomes getErrorTests()
           
 TestOutcomes getFailingTests()
          Find the failing test outcomes in this set
 List<String> getFirstClassTagTypes()
           
 TestCoverageFormatter getFormatted()
           
 TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage()
           
 TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage(String testType)
           
 TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage(TestType testType)
           
 TestCoverageFormatter.FormattedPercentageStepCoverage getFormattedPercentageSteps()
           
 String getLabel()
           
 List<? extends TestOutcome> getOutcomes()
           
 double getOverallStability()
           
 TestOutcomes getPassingTests()
          Find the successful test outcomes in this set
 TestOutcomes getPendingTests()
          Find the pending or ignored test outcomes in this set
 Double getPercentageTestCount(TestResult expectedResult)
           
 TestOutcomes.OutcomeProportionStepCounter getPercentSteps()
           
 TestOutcomes.OutcomeProportionCounter getProportion()
           
 double getRecentStability()
           
 TestResult getResult()
           
 TestOutcomes getRootOutcomes()
           
 org.joda.time.DateTime getStartTime()
           
 int getStepCount()
           
 List<String> getTagNames()
           
 List<TestTag> getTags()
           
 List<String> getTagsOfType(String tagType)
           
 List<String> getTagsOfTypeExcluding(String tagType, String excludedTags)
           
 List<String> getTagTypes()
           
 int getTestCount()
           
 List<? extends TestOutcome> getTests()
           
 int getTotal()
           
 int getTotalDataRows()
           
 OutcomeCounter getTotalTests()
           
 int getTotalTestScenarios()
          The total number of test scenarios (a data-driven test is counted as one test scenario).
 boolean hasDataDrivenTests()
           
static TestOutcomes of(List<? extends TestOutcome> outcomes)
           
 TestOutcomes ofType(TestType testType)
           
 TestOutcomes.OutcomeProportionStepCounter proportionalStepsOf(String testType)
           
 TestOutcomes.OutcomeProportionStepCounter proportionalStepsOf(TestType testType)
           
 TestOutcomes.OutcomeProportionCounter proportionOf(String testType)
           
 TestOutcomes.OutcomeProportionCounter proportionOf(TestType testType)
           
 int successCount(String testType)
           
 TestOutcomes withHistory()
          Return a copy of the current test outcomes, with test run history and statistics.
 TestOutcomes withLabel(String label)
           
static TestOutcomes withNoResults()
           
 TestOutcomes withTag(String tagName)
          Find the test outcomes with a given tag name
 TestOutcomes withTag(TestTag tag)
           
 TestOutcomes withTags(List<TestTag> tags)
           
 TestOutcomes withTagType(String tagType)
          Find the test outcomes with a given tag type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestOutcomes

@Inject
protected TestOutcomes(List<? extends TestOutcome> outcomes,
                              double estimatedAverageStepCount,
                              String label,
                              TestOutcomes rootOutcomes)

TestOutcomes

protected TestOutcomes(List<? extends TestOutcome> outcomes,
                       double estimatedAverageStepCount,
                       String label)

TestOutcomes

protected TestOutcomes(List<? extends TestOutcome> outcomes,
                       double estimatedAverageStepCount)
Method Detail

withLabel

public TestOutcomes withLabel(String label)

of

public static TestOutcomes of(List<? extends TestOutcome> outcomes)

withNoResults

public static TestOutcomes withNoResults()

getLabel

public String getLabel()

getTagTypes

public List<String> getTagTypes()
Returns:
The list of all of the different tag types that appear in the test outcomes.

getFirstClassTagTypes

public List<String> getFirstClassTagTypes()

getTagNames

public List<String> getTagNames()
Returns:
The list of all the names of the different tags in these test outcomes

getTags

public List<TestTag> getTags()
Returns:
The list of all the different tags in these test outcomes

getTagsOfType

public List<String> getTagsOfType(String tagType)
Returns:
The list of all the tags associated with a given tag type.

getTagsOfTypeExcluding

public List<String> getTagsOfTypeExcluding(String tagType,
                                           String excludedTags)

getRootOutcomes

public TestOutcomes getRootOutcomes()

forRequirement

public TestOutcomes forRequirement(Requirement requirement)

containsTag

public boolean containsTag(TestTag testTag)

getStartTime

public org.joda.time.DateTime getStartTime()

ofType

public TestOutcomes ofType(TestType testType)

withTagType

public TestOutcomes withTagType(String tagType)
Find the test outcomes with a given tag type

Parameters:
tagType - the tag type we are filtering on
Returns:
A new set of test outcomes for this tag type

withTag

public TestOutcomes withTag(String tagName)
Find the test outcomes with a given tag name

Parameters:
tagName - the name of the tag type we are filtering on
Returns:
A new set of test outcomes for this tag name

withTag

public TestOutcomes withTag(TestTag tag)

withTags

public TestOutcomes withTags(List<TestTag> tags)

withHistory

public TestOutcomes withHistory()
Return a copy of the current test outcomes, with test run history and statistics.

Returns:
a TestOutcome instance containing a list of TestOutcomeWithHistory instances.

getFailingTests

public TestOutcomes getFailingTests()
Find the failing test outcomes in this set

Returns:
A new set of test outcomes containing only the failing tests

getErrorTests

public TestOutcomes getErrorTests()

getPassingTests

public TestOutcomes getPassingTests()
Find the successful test outcomes in this set

Returns:
A new set of test outcomes containing only the successful tests

getPendingTests

public TestOutcomes getPendingTests()
Find the pending or ignored test outcomes in this set

Returns:
A new set of test outcomes containing only the pending or ignored tests

getTests

public List<? extends TestOutcome> getTests()
Returns:
The list of TestOutcomes contained in this test outcome set.

getDuration

public Long getDuration()
Returns:
The total duration of all of the tests in this set in milliseconds.

getDurationInSeconds

public double getDurationInSeconds()
Returns:
The total duration of all of the tests in this set in milliseconds.

getTotal

public int getTotal()
Returns:
The total number of test runs in this set (including rows in data-driven tests).

getTotalTestScenarios

public int getTotalTestScenarios()
The total number of test scenarios (a data-driven test is counted as one test scenario).


getOutcomes

public List<? extends TestOutcome> getOutcomes()

getResult

public TestResult getResult()
Returns:
The overall result for the tests in this test outcome set.

getStepCount

public int getStepCount()
Returns:
The total number of nested steps in these test outcomes.

successCount

public int successCount(String testType)
Parameters:
testType - 'manual' or 'automated' (this is a string because it is mainly called from the freemarker templates
Returns:

getTotalTests

public OutcomeCounter getTotalTests()

count

public OutcomeCounter count(String testType)

count

public OutcomeCounter count(TestType testType)

getProportion

public TestOutcomes.OutcomeProportionCounter getProportion()

proportionOf

public TestOutcomes.OutcomeProportionCounter proportionOf(String testType)

proportionOf

public TestOutcomes.OutcomeProportionCounter proportionOf(TestType testType)

getPercentSteps

public TestOutcomes.OutcomeProportionStepCounter getPercentSteps()

proportionalStepsOf

public TestOutcomes.OutcomeProportionStepCounter proportionalStepsOf(String testType)

proportionalStepsOf

public TestOutcomes.OutcomeProportionStepCounter proportionalStepsOf(TestType testType)

decimalPercentageSteps

public TestOutcomes.OutcomeProportionStepCounter decimalPercentageSteps(String testType)

getPercentageTestCount

public Double getPercentageTestCount(TestResult expectedResult)

getFormattedPercentageSteps

public TestCoverageFormatter.FormattedPercentageStepCoverage getFormattedPercentageSteps()

getFormattedPercentage

public TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage()

getFormattedPercentage

public TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage(String testType)

getFormattedPercentage

public TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage(TestType testType)

getFormatted

public TestCoverageFormatter getFormatted()
Returns:
Formatted version of the test coverage metrics

countStepsWithResult

protected int countStepsWithResult(TestResult expectedResult)

countTestsWithResult

protected int countTestsWithResult(TestResult expectedResult)

countTestsWithResult

protected int countTestsWithResult(TestResult expectedResult,
                                   TestType testType)

getAverageTestSize

public double getAverageTestSize()

getRecentStability

public double getRecentStability()

getOverallStability

public double getOverallStability()

getTestCount

public int getTestCount()

hasDataDrivenTests

public boolean hasDataDrivenTests()

getTotalDataRows

public int getTotalDataRows()

findMatchingTags

public TestOutcomes.TestOutcomeMatcher findMatchingTags()


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