Package hudson.plugins.robot.model
Class RobotResult
java.lang.Object
hudson.model.AbstractModelObject
hudson.plugins.robot.model.RobotTestObject
hudson.plugins.robot.model.RobotResult
- All Implemented Interfaces:
ModelObject,SearchableModelObject,SearchItem,Serializable
- Direct Known Subclasses:
AggregatedRobotAction.AggregatedRobotResult
Class representing Robot Framework test results.
- See Also:
-
Field Summary
Fields inherited from class hudson.plugins.robot.model.RobotTestObject
duration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSuite(RobotSuiteResult suite) Add a suite to this result.doReport(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Serves Robot html report via robot url.findObjectById(String id) Find a testobject in the result tree with id-pathGet all failed test cases related to result.Get all passed test cases related to result.Get all skipped test cases related to result.Get all testsuites related to result.getApi()}longGet the total duration of the test rungetDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Return the object represented by url-stringintGet all failed test case names related to result.getName()longGet number of all failed tests.longGet number of all passed tests.longGet number of all skipped tests.longGet number of all tests.intGet all passed test case names related to result.doubledoublegetPassPercentage(boolean countSkipped) Returns pass percentage of passed tests per total tests.intGet all skipped test case names related to result.doubleGet pass/fail stats by category.Get top level suite by nameGet all top level suitesGet the timestamp of the original test run.voidsetStatsByCategory(List<RobotResultStatistics> statsByCategory) voidsetTimeStamp(String timeStamp) Set the timestamp of test run.voidtally(RobotBuildAction robotBuildAction) Count the totals in result tree and assign parent action.Methods inherited from class hudson.plugins.robot.model.RobotTestObject
doDurationGraph, doGraph, getDuplicateSafeName, getDurationDiff, getHasLog, getHasReport, getHumanReadableDuration, getId, getLogFile, getOldFormatName, getOwner, getParentAction, getRelativeId, getRelativePackageName, getRelativeParent, getReportFile, getResultInBuild, isNeedToGenerate, setDuplicateSafeName, setId, setLogFile, setParentAction, setReportFile, urlEncodeMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
-
Constructor Details
-
RobotResult
public RobotResult()
-
-
Method Details
-
findObjectById
Find a testobject in the result tree with id-path- Parameters:
id- path e.g. "suite/subsuite/testcase"- Returns:
- null if not found
-
getName
- Specified by:
getNamein classRobotTestObject
-
getDescription
- Specified by:
getDescriptionin classRobotTestObject
-
getOverallPassed
@Exported public long getOverallPassed()Get number of all passed tests.- Returns:
- number of all passed tests
-
getOverallFailed
@Exported public long getOverallFailed()Get number of all failed tests.- Returns:
- number of all failed tests
-
getOverallSkipped
@Exported public long getOverallSkipped()Get number of all skipped tests.- Returns:
- number of all skipped tests
-
getOverallTotal
@Exported public long getOverallTotal()Get number of all tests.- Returns:
- number of all tests
-
getStatsByCategory
Get pass/fail stats by category.- Returns:
- List containing 'all tests'
-
setStatsByCategory
-
getTimeStamp
Get the timestamp of the original test run.- Returns:
- timestamp of the original test run
-
setTimeStamp
Set the timestamp of test run.- Parameters:
timeStamp- The wanted timestamp.
-
getPassPercentage
public double getPassPercentage(boolean countSkipped) Returns pass percentage of passed tests per total tests.- Parameters:
countSkipped- true if skipped tests should be included in calculating total tests- Returns:
- Percentage value rounded to 1 decimal
-
getPassPercentage
@Exported public double getPassPercentage() -
getSkipPercentage
@Exported public double getSkipPercentage() -
getDisplayName
} -
getSearchUrl
-
getSuite
Get top level suite by name- Parameters:
name- suite name- Returns:
- suite result, null when not found
-
addSuite
Add a suite to this result. If suite with same name exists, store this with sequential numbering- Parameters:
suite- RobotSuiteResult to add
-
getSuites
Get all top level suites- Returns:
- Collection of suiteresults
-
getExecutedSuites
-
getAllSuites
Get all testsuites related to result.- Returns:
- List of suiteresults
-
getAllFailedCases
Get all failed test cases related to result.- Returns:
- list of test case results
-
getAllPassedCases
Get all passed test cases related to result.- Returns:
- list of test case results
-
getAllSkippedCases
Get all skipped test cases related to result.- Returns:
- list of test case results
-
getFailedCases
Get all failed test case names related to result.- Returns:
- list of test case names as strings
-
getPassedCases
Get all passed test case names related to result.- Returns:
- list of test case names as strings
-
getSkippedCases
Get all skipped test case names related to result.- Returns:
- list of test case names as strings
-
tally
Count the totals in result tree and assign parent action.- Parameters:
robotBuildAction- The action to be used as the base
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Return the object represented by url-string- Parameters:
token- Tokenreq- StaplerRequestrsp- StaplerResponse- Returns:
- object represented by url-string
-
doReport
public DirectoryBrowserSupport doReport(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException, InterruptedException Serves Robot html report via robot url. Shows not found page if file is missing. If reportfilename is specified, the report is served (To be compatible with v1.0 builds)- Parameters:
req- StaplerRequestrsp- StaplerResponse- Returns:
- DirectoryBrowserSupport for the report or null
- Throws:
IOException- thrown exceptionjakarta.servlet.ServletException- thrown exceptionInterruptedException- thrown exception
-
getParent
- Specified by:
getParentin classRobotTestObject
-
getDuration
public long getDuration()Get the total duration of the test run- Overrides:
getDurationin classRobotTestObject- Returns:
- duration
-
getPreviousResult
- Specified by:
getPreviousResultin classRobotTestObject
-
getFailed
public int getFailed()- Specified by:
getFailedin classRobotTestObject
-
getPassed
public int getPassed()- Specified by:
getPassedin classRobotTestObject
-
getSkipped
public int getSkipped()- Specified by:
getSkippedin classRobotTestObject
-
getApi
-
getAllCases
-