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 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 to
      result - Robot result
      outputPath - Path where the Robot report is stored relative to build root
      logFileLink - Link for the log file
      logHtmlLink - Link for the log html
      listener - TaskListener from Jenkins
      enableCache - Whether we want to enable caching or not
  • Method Details

    • 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 to RobotResult.
      Parameters:
      listener - TaskListener from Jenkins
      result - RobotResult to set
    • getResult

      public RobotResult getResult()
      Returns Robotresult. If not in memory loads it from disk.
      Specified by:
      getResult in class hudson.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 interface org.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 - StaplerRequest
      rsp - StaplerResponse
      Throws:
      IOException - thrown exception
      javax.servlet.ServletException - thrown exception
      InterruptedException - 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 class hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
      Parameters:
      req - StaplerRequest
      rsp - 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 class hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
    • getTotalCount

      public int getTotalCount()
      Specified by:
      getTotalCount in class hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
      Overrides:
      getIconFileName in class hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
      Overrides:
      getUrlName in class hudson.tasks.test.AbstractTestResultAction<RobotBuildAction>
    • getAllTests

      public List<RobotCaseResult> getAllTests()
    • isCountSkippedTests

      public boolean isCountSkippedTests()
    • setCountSkippedTests

      public void setCountSkippedTests(boolean countSkippedTests)