java.lang.Object
net.thucydides.model.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) protectedTestOutcomes(Collection<? extends TestOutcome> outcomes, String label) protectedTestOutcomes(Collection<? extends TestOutcome> outcomes, String label, TestTag testTag, TestResult resultFilter, TestOutcomes rootOutcomes, EnvironmentVariables environmentVariables) protectedTestOutcomes(List<? extends TestOutcome> outcomes, String label, TestResult resultFilter) protectedTestOutcomes(List<? extends TestOutcome> outcomes, String label, TestTag tag) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsMatchingTag(TestTag containedTag) booleancontainsTag(TestTag testTag) booleancontainTestFor(Requirement requirement) protected intcountTestsWithResult(TestResult expectedResult, TestType testType) longcountWithResult(TestType expectedType, TestResult expectedResult) longcountWithType(TestType expectedType) decimalPercentageSteps(String testType) directlyUnder(Requirement requirement) booleanflagCountFor(Flag flag) forRequirement(Requirement requirement) doubledoubleFind the failing test outcomes in this setlonggetFlags()getFormattedPercentage(String testType) getFormattedPercentage(TestType testType) getLabel()getMostSpecificTagsOfType(String tagType) longList<? extends TestOutcome> Find the successful test outcomes in this setFind the pending or ignored test outcomes in this setlonglongThe scenario count include all individual tests and rows in data-driven tests.longintgetTags()getTagsOfType(String tagType) getTagsOfTypeExcluding(String tagType, String excludedTag) longThe test case count include all individual tests data-driven tests.List<? extends TestOutcome> longList<? extends TestOutcome> getTests()intgetTotal()intintintThe total number of test scenarios (a data-driven test is counted as one test scenario).booleaninthashCode()booleanhavingResult(String result) havingResult(TestResult expectedResult) booleanisEmpty()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) toString()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
protected TestOutcomes(Collection<? extends TestOutcome> outcomes, String label, TestTag testTag, TestResult resultFilter, TestOutcomes rootOutcomes, EnvironmentVariables environmentVariables) -
TestOutcomes
-
TestOutcomes
-
TestOutcomes
-
TestOutcomes
-
-
Method Details
-
withLabel
-
withResultFilter
-
filteredByEnvironmentTags
-
getEnvironmentVariables
-
havingResult
-
havingResult
-
getResultCount
public long getResultCount() -
getAllResults
-
getDistinctResults
-
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
-
directlyUnder
-
forRequirement
-
getTestTag
-
containsTag
-
containsMatchingTag
-
getStartTime
-
ofType
-
scenarioCountWithResult
-
withErrorType
-
countWithResult
-
countWithType
-
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
-
getAbortedTests
-
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.
-
getTestCases
- 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
-
getNumberOfTestScenarios
public long getNumberOfTestScenarios() -
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 long getTestCount() -
getTestCaseCount
public long getTestCaseCount()The test case count include all individual tests data-driven tests. A data-driven test counts as 1 test. -
getScenarioCount
public long getScenarioCount()The scenario count include all individual tests and rows in data-driven tests. -
getAllStepsText
-
hasDataDrivenTests
public boolean hasDataDrivenTests() -
getTotalDataRows
public int getTotalDataRows() -
findMatchingTags
-
isEmpty
public boolean isEmpty() -
getPlatformContexts
-
getBrowserContexts
-
toString
-
equals
-
hashCode
public int hashCode()
-