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 TypeMethodDescriptionvoid
addSuite
(RobotSuiteResult suite) Add a suite to this result.doReport
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse 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()
long
Deprecated.long
Deprecated.long
Deprecated.}long
Get the total duration of the test rungetDynamic
(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Return the object represented by url-stringint
Get all failed test case names related to result.getName()
long
Get number of all failed tests.long
Get number of all passed tests.long
Get number of all skipped tests.long
Get number of all tests.int
Get all passed test case names related to result.double
double
getPassPercentage
(boolean countSkipped) Returns pass percentage of passed tests per total tests.int
Get all skipped test case names related to result.double
Get pass/fail stats by category.Get top level suite by nameGet all top level suitesGet the timestamp of the original test run.void
setStatsByCategory
(List<RobotResultStatistics> statsByCategory) void
setTimeStamp
(String timeStamp) Set the timestamp of test run.void
tally
(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, urlEncode
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, 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:
getName
in classRobotTestObject
-
getDescription
- Specified by:
getDescription
in classRobotTestObject
-
getCriticalPassed
Deprecated.Get number of passed critical tests.- Specified by:
getCriticalPassed
in classRobotTestObject
- Returns:
- number of passed critical tests
-
getCriticalFailed
Deprecated.Get number of failed critical tests.- Specified by:
getCriticalFailed
in classRobotTestObject
- Returns:
- number of failed critical tests
-
getCriticalTotal
Deprecated.Get total number of critical tests.- Returns:
- total number of critical tests
-
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 'critical tests' and '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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse 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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.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 exceptionjavax.servlet.ServletException
- thrown exceptionInterruptedException
- thrown exception
-
getParent
- Specified by:
getParent
in classRobotTestObject
-
getDuration
public long getDuration()Get the total duration of the test run- Overrides:
getDuration
in classRobotTestObject
- Returns:
- duration
-
getPreviousResult
- Specified by:
getPreviousResult
in classRobotTestObject
-
getFailed
public int getFailed()- Specified by:
getFailed
in classRobotTestObject
-
getPassed
public int getPassed()- Specified by:
getPassed
in classRobotTestObject
-
getSkipped
public int getSkipped()- Specified by:
getSkipped
in classRobotTestObject
-
getApi
-
getAllCases
-