public class TestOutcome extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TestOutcome.OptionalElements |
static class |
TestOutcome.StepCountBuilder |
class |
TestOutcome.StepReplacer |
Modifier | Constructor and Description |
---|---|
|
TestOutcome(String name)
The title is immutable once set.
|
|
TestOutcome(String name,
Class<?> testCase) |
|
TestOutcome(String name,
Class<?> testCase,
EnvironmentVariables environmentVariables)
Create a test outcome based on a test method in a test class.
|
protected |
TestOutcome(String name,
Class<?> testCase,
Story userStory) |
protected |
TestOutcome(String name,
Class<?> testCase,
Story userStory,
EnvironmentVariables environmentVariables)
A test outcome should relate to a particular test class or user story class.
|
protected |
TestOutcome(ZonedDateTime startTime,
long duration,
String title,
String description,
String name,
String id,
Class<?> testCase,
List<TestStep> testSteps,
List<String> issues,
List<String> additionalIssues,
List<CastMember> actors,
Set<TestTag> tags,
Story userStory,
FailureCause testFailureCause,
String testFailureClassname,
String testFailureMessage,
String testFailureSummary,
TestResult annotatedResult,
DataTable dataTable,
Optional<String> qualifier,
String driver,
boolean manualTest,
boolean isManualTestingUpToDate,
String lastTested,
List<String> testEvidence,
String projectKey,
EnvironmentVariables environmentVariables,
ExternalLink externalLink,
String context) |
public TestOutcome(String name)
name
- The name of the Java method that implements this test.public TestOutcome(String name, Class<?> testCase, EnvironmentVariables environmentVariables)
name
- testCase
- protected TestOutcome(String name, Class<?> testCase, Story userStory, EnvironmentVariables environmentVariables)
name
- 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(ZonedDateTime startTime, long duration, String title, String description, String name, String id, Class<?> testCase, List<TestStep> testSteps, List<String> issues, List<String> additionalIssues, List<CastMember> actors, Set<TestTag> tags, Story userStory, FailureCause testFailureCause, String testFailureClassname, String testFailureMessage, String testFailureSummary, TestResult annotatedResult, DataTable dataTable, Optional<String> qualifier, String driver, boolean manualTest, boolean isManualTestingUpToDate, String lastTested, List<String> testEvidence, String projectKey, EnvironmentVariables environmentVariables, ExternalLink externalLink, String context)
public static net.thucydides.core.model.TestOutcome.TestOutcomeWithEnvironmentBuilder inEnvironment(EnvironmentVariables environmentVariables)
public void calculateDynamicFieldValues()
public TestOutcome usingIssueTracking(IssueTracking issueTracking)
public TestOutcome setToManual()
public TestOutcome withTestSource(String testSource)
protected TestOutcome withFlagProvider(FlagProvider flagProvider)
public void setEnvironmentVariables(EnvironmentVariables environmentVariables)
public EnvironmentVariables getEnvironmentVariables()
public TestOutcome copy()
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 methodpublic TestOutcome withQualifier(String qualifier)
public TestOutcome withIssues(List<String> issues)
public TestOutcome withTags(Set<TestTag> tags)
public TestOutcome withMethodName(String methodName)
public String getName()
public static TestOutcome forTestInStory(String testName, Story story)
public static TestOutcome forTestInStory(String testName, Class<?> testCase, Story story)
public String getTitle()
public String getTitle(boolean qualified)
public TitleBuilder getUnqualified()
public TitleBuilder getQualified()
public void setAllStepsTo(TestResult result)
public void addDataFrom(DataTable newDataTable)
public void clearForcedResult()
public void setDriver(String driver)
public String getDriver()
public void resetFailingStepsCausedBy(Class<? extends Throwable> expected)
public TestOutcome.StepReplacer replace(List<TestStep> stepsToMerge)
public void mergeMostRecentSteps(int maxStepsToMerge)
public void updateOverallResults()
public String getId()
public String getParentId()
public TestOutcome withId(String id)
public void updateTopLevelStepResultsTo(TestResult result)
public String getTestFailureSummary()
public TestFailureCause getFlakyTestFailureCause()
public void setFlakyTestFailureCause(TestFailureCause flakyTestFailureCause)
public boolean hasTagWithName(String tagName)
public boolean hasTagWithType(String tagType)
public int getDataTableRowCount()
public int getTestStepCount()
public void castActor(String name)
public List<ManualTestEvidence> getRenderedManualTestEvidence()
public void setLink(ExternalLink externalLink)
public boolean hasNoSteps()
public TestOutcome withSteps(List<TestStep> childSteps)
public boolean isUnsuccessful()
public boolean isTitleWithIssues()
public void setDescription(String description)
public void setBackgroundDescription(String description)
public void setBackgroundTitle(String title)
public String getDescription()
public String getBackgroundDescription()
public String getBackgroundTitle()
public Optional<String> getDescriptionText()
public String toJson()
public String getTitleWithLinks()
public String getStoryTitle()
public String getPath()
public String getPathId()
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 boolean hasRestQueries()
public List<ScreenshotAndHtmlSource> getScreenshotAndHtmlSources()
public List<Screenshot> getScreenshots()
public List<Screenshot> getStepScreenshots()
public boolean hasNonStepFailure()
public TestResult getResult()
public TestOutcome recordSteps(List<TestStep> steps)
public TestOutcome recordChildSteps(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 void startGroup()
public void endGroup()
public Optional<TestStep> currentStep()
public TestStep lastStep()
public TestStep currentGroup()
public void setUserStory(Story story)
public void determineTestFailureCause(Throwable cause)
public void appendTestFailure(TestFailureCause failureCause)
public Optional<TestStep> testStepWithDescription(String expectedDescription)
public FailureCause getTestFailureCause()
public String getTestFailureErrorType()
public FailureCause getNestedTestFailureCause()
public String getErrorMessage()
public String getConciseErrorMessage()
public void setTestFailureMessage(String testFailureMessage)
public String getTestFailureMessage()
public String getTestFailureClassname()
public void setAnnotatedResult(TestResult annotatedResult)
public void overrideAnnotatedResult(TestResult annotatedResult)
public void setResult(TestResult annotatedResult)
public void overrideResult(TestResult result)
public TestOutcome withResult(TestResult annotatedResult)
public TestResult getAnnotatedResult()
public Class<?> getTestCase()
public String getTestCaseName()
public TestOutcome addVersion(String version)
public TestOutcome addVersions(List<String> versions)
public TestOutcome forProject(String project)
public Rule getRule()
public void setRule(Rule rule)
public String getProject()
public TestOutcome inTestRunTimestamped(ZonedDateTime testRunTimestamp)
public void setTestRunTimestamp(ZonedDateTime testRunTimestamp)
public String getFormattedIssues()
public void isRelatedToIssue(String issue)
public void addFailingStepAsSibling(List<TestStep> testStepList, Throwable testFailureCause)
public void lastStepFailedWith(StepFailure failure)
public void lastStepFailedWith(Throwable testFailureCause)
public void testFailedWith(Throwable cause)
public void addTag(TestTag tag)
public String getQualifiedMethodName()
public String getQualifiedId()
public String getNonNullContext()
public String getContext()
public void setContext(String context)
context
- public String getCompleteName()
public void useExamplesFrom(DataTable table)
public void addNewExamplesFrom(DataTable table)
public void moveToNextRow()
public void updateCurrentRowResult(TestResult result)
public boolean dataIsPredefined()
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 boolean hasIssue(String issue)
public boolean hasTag(TestTag tag)
public boolean hasAMoreGeneralFormOfTag(TestTag specificTag)
public boolean hasAMoreSpecificFormOfTag(TestTag generalTag)
public void setStartTime(ZonedDateTime startTime)
public void clearStartTime()
public boolean isManual()
public String getLastTested()
public void setLastTested(String lastTested)
public boolean isManualTestingUpToDate()
public void setManualTestingUpToDate(Boolean upToDate)
public boolean isStartTimeNotDefined()
public TestOutcome.OptionalElements has()
public Integer getStepCount()
public Integer getRunningStepCount()
public Integer getNestedStepCount()
public Long getSuccessCount()
public Long getFailureCount()
public Long getErrorCount()
public Long getCompromisedCount()
public Long getIgnoredCount()
public Long getSkippedOrIgnoredCount()
public Long getSkippedCount()
public Long getPendingCount()
public Boolean isSuccess()
public Boolean isFailure()
public Boolean isCompromised()
public Boolean isError()
public Boolean isPending()
public Boolean isSkipped()
public Story getUserStory()
public void recordDuration()
public void setDuration(long duration)
public Long getDuration()
public ZonedDateTime getEndTime()
public double getDurationInSeconds()
public String getVideoLink()
public String getSessionId()
public void setSessionId(String sessionId)
public Integer countTestSteps()
public ZonedDateTime getStartTime()
public String getStartedAt()
public String getTimestamp()
public String getTimestamp(DateTimeFormatter formater)
public boolean isDataDriven()
public void useScenarioOutline(String scenarioOutline)
public String getDataDrivenSampleScenario()
public DataTable getDataTable()
public FailureDetails getFailureDetails()
public String getTestSource()
public void setTestSource(String testSource)
public List<CastMember> getActors()
public boolean hasEvidence()
public List<ReportData> getEvidence()
public TestOutcome withDataRowsfilteredbyTag(TestTag tag)
public TestOutcome withDataRowsfilteredbyTagsFrom(Collection<TestTag> filterTags)
public ExternalLink getExternalLink()
public void setOrder(int order)
public Integer getOrder()
public TestOutcome fromStep(int index)
Copyright © 2022. All rights reserved.