Package net.thucydides.core.reports
Class TestOutcomes
java.lang.Object
net.thucydides.core.reports.TestOutcomes
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 ClassesModifier and TypeClassDescriptionclassclassstatic final class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTestOutcomes(Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount) protectedTestOutcomes(Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label) protectedTestOutcomes(Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestTag testTag, TestResult resultFilter, TestOutcomes rootOutcomes, EnvironmentVariables environmentVariables) protectedTestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestResult resultFilter) protectedTestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestTag tag) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsMatchingTag(TestTag containedTag) booleancontainsTag(TestTag testTag) booleancontainTestFor(Requirement requirement) protected intcountTestsWithResult(TestResult expectedResult, TestType testType) decimalPercentageSteps(String testType) flagCountFor(Flag flag) forRequirement(Requirement requirement) doubledoubleFind the failing test outcomes in this setlonggetFlags()getFormattedPercentage(String testType) getFormattedPercentage(TestType testType) getLabel()getMostSpecificTagsOfType(String tagType) List<? extends TestOutcome>Find the successful test outcomes in this setFind the pending or ignored test outcomes in this setlongintgetTags()getTagsOfType(String tagType) getTagsOfTypeExcluding(String tagType, String excludedTag) intList<? extends TestOutcome>getTests()intgetTotal()intintintThe total number of test scenarios (a data-driven test is counted as one test scenario).booleanbooleanhavingResult(String result) havingResult(TestResult result) static TestOutcomesof(Collection<? extends TestOutcome> outcomes) proportionalStepsOf(String testType) proportionalStepsOf(TestType testType) proportionOf(String testType) proportionOf(TestType testType) scenarioCountWithResult(TestResult result) intsuccessCount(String testType) testOutcomesWithName(String name) Optional<? extends TestOutcome>testOutcomeWithName(String name) withCardNumber(String issueCardNumber) withErrorType(String testFailureErrorType) static TestOutcomeswithResult(TestResult result) withResultFilter(TestResult testResult) Find the test outcomes with a given tag namewithTags(Collection<TestTag> tags) withTagType(String tagType) Find the test outcomes with a given tag typewithTagTypes(List<String> tagTypes)
-
Constructor Details
-
TestOutcomes
@Inject protected TestOutcomes(Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestTag testTag, TestResult resultFilter, TestOutcomes rootOutcomes, EnvironmentVariables environmentVariables) -
TestOutcomes
protected TestOutcomes(Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label) -
TestOutcomes
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestTag tag) -
TestOutcomes
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, TestResult resultFilter) -
TestOutcomes
protected TestOutcomes(Collection<? extends TestOutcome> outcomes, double estimatedAverageStepCount)
-
-
Method Details
-
withLabel
-
withResultFilter
-
filteredByEnvironmentTags
-
getEnvironmentVariables
-
havingResult
-
havingResult
-
of
-
withNoResults
-
getFlagCounts
-
haveFlags
public boolean haveFlags() -
getFlags
-
flagCountFor
-
getLabel
-
getTagTypes
- Returns:
- The list of all of the different tag types that appear in the test outcomes.
-
getFirstClassTagTypes
-
getRequirementTagTypes
-
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
-
getRootOutcomes
-
forRequirement
-
getTestTag
-
containsTag
-
containsMatchingTag
-
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
-
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
- 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
-
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
- 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
-
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
-