Package net.thucydides.core.reports
Class TestOutcomes
java.lang.Object
net.thucydides.core.reports.TestOutcomes
public class TestOutcomes
extends java.lang.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
Nested Classes Modifier and Type Class Description class
TestOutcomes.OutcomeProportionCounter
class
TestOutcomes.OutcomeProportionStepCounter
static class
TestOutcomes.TestOutcomeMatcher
-
Constructor Summary
Constructors Modifier Constructor Description protected
TestOutcomes(java.util.Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount)
protected
TestOutcomes(java.util.Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label)
protected
TestOutcomes(java.util.Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label, TestTag testTag, TestResult resultFilter, TestOutcomes rootOutcomes, EnvironmentVariables environmentVariables)
protected
TestOutcomes(java.util.List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label, TestResult resultFilter)
protected
TestOutcomes(java.util.List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label, TestTag tag)
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TestOutcomes
@Inject protected TestOutcomes(java.util.Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label, TestTag testTag, TestResult resultFilter, TestOutcomes rootOutcomes, EnvironmentVariables environmentVariables) -
TestOutcomes
protected TestOutcomes(java.util.Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label) -
TestOutcomes
protected TestOutcomes(java.util.List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label, TestTag tag) -
TestOutcomes
protected TestOutcomes(java.util.List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, java.lang.String label, TestResult resultFilter) -
TestOutcomes
protected TestOutcomes(java.util.Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount)
-
-
Method Details
-
withLabel
-
withResultFilter
-
filteredByEnvironmentTags
-
getEnvironmentVariables
-
havingResult
-
havingResult
-
of
-
withNoResults
-
getFlagCounts
-
haveFlags
public boolean haveFlags() -
getFlags
-
flagCountFor
-
getLabel
public java.lang.String getLabel() -
getTagTypes
public java.util.List<java.lang.String> getTagTypes()- Returns:
- The list of all of the different tag types that appear in the test outcomes.
-
getFirstClassTagTypes
public java.util.List<java.lang.String> getFirstClassTagTypes() -
getRequirementTagTypes
public java.util.List<java.lang.String> getRequirementTagTypes() -
getTagNames
public java.util.List<java.lang.String> getTagNames()- Returns:
- The list of all the names of the different tags in these test outcomes
-
getTags
- Returns:
- The list of all the different tags in these test outcomes
-
getTagsOfType
- Returns:
- The list of all the tags associated with a given tag type.
-
getMostSpecificTagsOfType
- Returns:
- The list of all the tags associated with a given tag type.
-
getTagsOfTypeExcluding
public java.util.List<TestTag> getTagsOfTypeExcluding(java.lang.String tagType, java.lang.String excludedTag) -
getRootOutcomes
-
forRequirement
-
getTestTag
-
containsTag
-
containsMatchingTag
-
getStartTime
public java.util.Optional<java.time.ZonedDateTime> getStartTime() -
ofType
-
scenarioCountWithResult
-
withErrorType
-
withResult
-
withRequirementsTags
-
testOutcomeWithName
-
testOutcomesWithName
-
getFastestTestDuration
public long getFastestTestDuration() -
getSlowestTestDuration
public long getSlowestTestDuration() -
containTestFor
-
withTagType
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
-
withTagTypes
-
withTag
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
-
withCardNumber
-
withTags
-
getResultFilterName
public java.lang.String getResultFilterName() -
getUnsuccessfulTests
-
getFailingTests
Find the failing test outcomes in this set- Returns:
- A new set of test outcomes containing only the failing tests
-
getErrorTests
-
getCompromisedTests
-
getPassingTests
Find the successful test outcomes in this set- Returns:
- A new set of test outcomes containing only the successful tests
-
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
- Returns:
- The list of TestOutcomes contained in this test outcome set.
-
getDuration
public java.lang.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.
-
getResultTypeLabel
public java.lang.String getResultTypeLabel() -
getTotal
public int getTotal()- Returns:
- The total number of test runs in this set (including rows in data-driven tests).
-
getTotalMatchingScenarios
public int getTotalMatchingScenarios() -
getTotalTestScenarios
public int getTotalTestScenarios()The total number of test scenarios (a data-driven test is counted as one test scenario). -
getOutcomes
-
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(java.lang.String testType)- Parameters:
testType
- 'manual' or 'automated' (this is a string because it is mainly called from the freemarker templates
-
getTotalTests
-
getTotalScenarios
-
count
-
count
-
getProportion
-
proportionOf
-
proportionOf
-
getPercentSteps
-
proportionalStepsOf
-
proportionalStepsOf
-
decimalPercentageSteps
-
getFormattedPercentageSteps
-
getFormattedPercentage
-
getFormattedPercentage
public TestCoverageFormatter.FormattedPercentageCoverage getFormattedPercentage(java.lang.String testType) -
getFormattedPercentage
-
getFormatted
- Returns:
- Formatted version of the test coverage metrics
-
countTestsWithResult
-
getAverageTestSize
public double getAverageTestSize() -
getTestCount
public int getTestCount() -
hasDataDrivenTests
public boolean hasDataDrivenTests() -
getTotalDataRows
public int getTotalDataRows() -
findMatchingTags
-