Package hudson.plugins.robot
Class RobotBuildAction
java.lang.Object
hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
hudson.plugins.robot.RobotBuildAction
- All Implemented Interfaces:
Action
,HealthReportingAction
,ModelObject
,RunAction2
,org.kohsuke.stapler.StaplerProxy
public class RobotBuildAction
extends hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
implements org.kohsuke.stapler.StaplerProxy
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.tasks.test.AbstractTestResultAction
hudson.tasks.test.AbstractTestResultAction.Summarizer
-
Field Summary
Fields inherited from class hudson.tasks.test.AbstractTestResultAction
owner, run
-
Constructor Summary
ConstructorsConstructorDescriptionRobotBuildAction
(Run<?, ?> build, RobotResult result, String outputPath, TaskListener listener, String logFileLink, String logHtmlLink, boolean enableCache, String xAxisLabel, boolean countSkippedTests) Create new Robot build action -
Method Summary
Modifier and TypeMethodDescriptionvoid
doGraph
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Return robot trend graph in the request.void
doIndex
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Serves Robot html report via robot url.findObjectById
(String id) Find test object from the results object treedouble
Get ratio of passed tests per total tests.int
Get filename to link todouble
Get ratio of passed tests per total tests.Run<?,
?> getOwner()
Get build associated to actionGet file name for Robot html report.Returns Robotresult.Return path of robot files in buildGet the result object which is responsible for UI.int
boolean
void
setCountSkippedTests
(boolean countSkippedTests) void
setResult
(RobotResult result, TaskListener listener) Loads new data toRobotResult
.Methods inherited from class hudson.tasks.test.AbstractTestResultAction
doGraphMap, findCorrespondingResult, findPreviousCorresponding, getApi, getBuildHealth, getDescription, getFailedTests, getFailureDiffString, getHealthScaleFactor, getPassedTests, getPreviousResult, getPreviousResult, getSkipCount, getSkippedTests, getTestResultPath, onAttached, onLoad, readResolve, setDescription
-
Constructor Details
-
RobotBuildAction
public RobotBuildAction(Run<?, ?> build, RobotResult result, String outputPath, TaskListener listener, String logFileLink, String logHtmlLink, boolean enableCache, String xAxisLabel, boolean countSkippedTests) Create new Robot build action- Parameters:
build
- Build which this action is associated toresult
- Robot resultoutputPath
- Path where the Robot report is stored relative to build rootlogFileLink
- Link for the log filelogHtmlLink
- Link for the log htmllistener
- TaskListener from JenkinsenableCache
- Whether we want to enable caching or not
-
-
Method Details
-
getOwner
Get build associated to action- Returns:
- build object
-
getLogFileLink
Get filename to link to- Returns:
- null if no filename specified
-
getLogHtmlLink
-
setResult
Loads new data toRobotResult
.- Parameters:
listener
- TaskListener from Jenkinsresult
- RobotResult to set
-
getResult
Returns Robotresult. If not in memory loads it from disk.- Specified by:
getResult
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getReportFileName
Get file name for Robot html report.- Returns:
- file name as string
-
getOverallPassPercentage
public double getOverallPassPercentage()Get ratio of passed tests per total tests. Accounts for all tests run.- Returns:
- percent number
-
getCriticalPassPercentage
public double getCriticalPassPercentage()Get ratio of passed tests per total tests. Accounts for only critical tests run.- Returns:
- percent number
-
findObjectById
Find test object from the results object tree- Parameters:
id
- path e.g. "suite/nestedsuite/testcase"- Returns:
- test object
-
getTarget
Get the result object which is responsible for UI. If an old project doesn't have it provides buildaction as this.- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
-
getxAxisLabel
-
doIndex
public void doIndex(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.- Parameters:
req
- StaplerRequestrsp
- StaplerResponse- Throws:
IOException
- thrown exceptionjavax.servlet.ServletException
- thrown exceptionInterruptedException
- thrown exception
-
doGraph
public void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException Return robot trend graph in the request.- Overrides:
doGraph
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
- Parameters:
req
- StaplerRequestrsp
- StaplerResponse- Throws:
IOException
- thrown exception
-
getRobotDir
Return path of robot files in build- Returns:
- path of robot files in build
-
getFailCount
public int getFailCount()- Specified by:
getFailCount
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getTotalCount
public int getTotalCount()- Specified by:
getTotalCount
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
- Overrides:
getIconFileName
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
- Overrides:
getUrlName
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getAllTests
-
isCountSkippedTests
public boolean isCountSkippedTests() -
setCountSkippedTests
public void setCountSkippedTests(boolean countSkippedTests)
-