Class TestRailAPI


  • public class TestRailAPI
    extends java.lang.Object
    TestRail Interaction
    • Constructor Detail

      • TestRailAPI

        public TestRailAPI()
    • Method Detail

      • getCurrentRun

        public Run getCurrentRun()
      • getWateRateLimit

        public int getWateRateLimit()
      • waitForRateLimit

        public void waitForRateLimit()
      • getSections

        public java.util.List<Section> getSections​(int projectID)
      • getAllTestCases

        public java.util.List<TestCase> getAllTestCases​(int projectID)
      • getRuns

        public java.util.List<Run> getRuns​(int projectID)
      • getRequest

        protected java.lang.Object getRequest​(java.lang.String path)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • postRequest

        protected java.lang.Object postRequest​(java.lang.String path,
                                               java.lang.Object data)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toCollection

        protected <T> java.util.List<T> toCollection​(java.lang.Object response,
                                                     java.lang.Class<T> classz)
        Parse the response received and convert it to > passed as parameter
        Parameters:
        response -
        classz -
        Returns:
      • getRunOfCurrentProject

        public Run getRunOfCurrentProject()
        Returns the current Test Runs of current project
      • getRun

        public Run getRun​(java.lang.String name,
                          int projectID)
        Perform TestRAIL query of all runs and return the Run object related to and run
        Parameters:
        name -
        projectID -
        Returns:
      • toClass

        protected <T> T toClass​(java.lang.Object response,
                                java.lang.Class<T> classz)
      • getSectionsOfCurrentProject

        public java.util.List<Section> getSectionsOfCurrentProject()
        Returns:
        all Section from TestRail from current project
      • getAllTestCasesFromCurrentProject

        public java.util.List<TestCase> getAllTestCasesFromCurrentProject()
      • updateTestRunWithSelectedTestCases

        public void updateTestRunWithSelectedTestCases​(java.util.List<TestCaseDetail> currentTestCases)
                                                throws java.lang.Exception
        Update current test run and select/add in test run ONLY the executed test cases
        Parameters:
        currentTestCases -
        Throws:
        java.lang.Exception
      • addResultsForCases

        public java.lang.Object addResultsForCases​(java.util.List<TestCaseDetail> currentTestCases)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addNewSection

        public Section addNewSection​(java.lang.String name,
                                     java.lang.Object parent_id,
                                     int projectID,
                                     int suite_id)
      • createNewSection

        public void createNewSection​(TestCaseDetail currentTestCase,
                                     java.util.List<Section> allSections)