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
-
-
Constructor Summary
Constructors Constructor Description RobotBuildAction(Run<?,?> build, RobotResult result, String outputPath, TaskListener listener, String logFileLink, String logHtmlLink, boolean enableCache, String xAxisLabel)
Create new Robot build action
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.RobotTestObject
findObjectById(String id)
Find test object from the results object treeList<RobotCaseResult>
getAllTests()
double
getCriticalPassPercentage()
Get ratio of passed tests per total tests.String
getDisplayName()
int
getFailCount()
String
getIconFileName()
String
getLogFileLink()
Get filename to link toString
getLogHtmlLink()
double
getOverallPassPercentage()
Get ratio of passed tests per total tests.Run<?,?>
getOwner()
Get build associated to actionString
getReportFileName()
Get file name for Robot html report.RobotResult
getResult()
Returns Robotresult.FilePath
getRobotDir()
Return path of robot files in buildObject
getTarget()
Get the result object which is responsible for UI.int
getTotalCount()
String
getUrlName()
String
getxAxisLabel()
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 Detail
-
RobotBuildAction
public RobotBuildAction(Run<?,?> build, RobotResult result, String outputPath, TaskListener listener, String logFileLink, String logHtmlLink, boolean enableCache, String xAxisLabel)
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 Detail
-
getOwner
public Run<?,?> getOwner()
Get build associated to action- Returns:
- build object
-
getLogFileLink
public String getLogFileLink()
Get filename to link to- Returns:
- null if no filename specified
-
getLogHtmlLink
public String getLogHtmlLink()
-
setResult
public void setResult(RobotResult result, TaskListener listener)
Loads new data toRobotResult
.- Parameters:
listener
- TaskListener from Jenkinsresult
- RobotResult to set
-
getResult
public RobotResult getResult()
Returns Robotresult. If not in memory loads it from disk.- Specified by:
getResult
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getReportFileName
public String 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
public RobotTestObject findObjectById(String id)
Find test object from the results object tree- Parameters:
id
- path e.g. "suite/nestedsuite/testcase"- Returns:
- test object
-
getTarget
public 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
public String 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
public FilePath 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
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
- Overrides:
getIconFileName
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
- Overrides:
getUrlName
in classhudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
-
getAllTests
public List<RobotCaseResult> getAllTests()
-
-