Package org.alfresco.utility.testrail
Class TestRailApi
- java.lang.Object
-
- org.alfresco.utility.testrail.TestRailApi
-
public class TestRailApi extends java.lang.ObjectBasic implementation of interacting with Test Rail- Author:
- Paul Brodner
-
-
Field Summary
Fields Modifier and Type Field Description intcurrentProjectIDprotected java.lang.StringserverUrlintsuiteId
-
Constructor Summary
Constructors Constructor Description TestRailApi()Setup configuration from property file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SectionaddNewSection(java.lang.String name, int parent_id, int projectID, int suite_id)voidaddTestCase(org.testng.ITestResult result, Section section, TestRail annotation)voidaddTestSteps(org.testng.ITestResult result, java.lang.String steps, Section section, TestRail annotation)TestCasegetCurrentTestCase()java.lang.StringgetFullTestCaseName(org.testng.ITestResult result)protected java.lang.ObjectgetRequest(java.lang.String path)RungetRun(java.lang.String name, int projectID)RungetRunOfCurrentProject()Returns the current Test Runs of current projectjava.util.List<Run>getRuns(int projectID)java.util.List<Section>getSections(int projectID)java.util.List<Section>getSectionsOfCurrentProject()booleanhasConfigurationErrors()booleanisAutomatedTestCaseInSection(java.lang.String testName, Section section, TestRail annotation)protected java.lang.ObjectpostRequest(java.lang.String path, java.lang.Object data)voidsetCurrentTestCase(TestCase testCase)protected <T> TtoClass(java.lang.Object response, java.lang.Class<T> classz)protected <T> java.util.List<T>toCollection(java.lang.Object response, java.lang.Class<T> classz)Parse the response received and convert it topassed as parameter java.lang.ObjectupdateTestCaseResult(org.testng.ITestResult result, Run run)
-
-
-
Method Detail
-
getCurrentTestCase
public TestCase getCurrentTestCase()
-
setCurrentTestCase
public void setCurrentTestCase(TestCase testCase)
-
toClass
protected <T> T toClass(java.lang.Object response, java.lang.Class<T> classz)
-
toCollection
protected <T> java.util.List<T> toCollection(java.lang.Object response, java.lang.Class<T> classz)Parse the response received and convert it topassed as parameter - Parameters:
response-classz-- Returns:
-
hasConfigurationErrors
public boolean hasConfigurationErrors()
-
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
-
getSectionsOfCurrentProject
public java.util.List<Section> getSectionsOfCurrentProject()
-
addNewSection
public Section addNewSection(java.lang.String name, int parent_id, int projectID, int suite_id)
-
getRun
public Run getRun(java.lang.String name, int projectID)
-
addTestCase
public void addTestCase(org.testng.ITestResult result, Section section, TestRail annotation)
-
addTestSteps
public void addTestSteps(org.testng.ITestResult result, java.lang.String steps, Section section, TestRail annotation)
-
isAutomatedTestCaseInSection
public boolean isAutomatedTestCaseInSection(java.lang.String testName, Section section, TestRail annotation)
-
updateTestCaseResult
public java.lang.Object updateTestCaseResult(org.testng.ITestResult result, Run run)
-
getRunOfCurrentProject
public Run getRunOfCurrentProject()
Returns the current Test Runs of current project
-
getFullTestCaseName
public java.lang.String getFullTestCaseName(org.testng.ITestResult result)
-
getSections
public java.util.List<Section> getSections(int projectID)
-
getRuns
public java.util.List<Run> getRuns(int projectID)
-
-