Package org.alfresco.utility.testrail
Class TestRailExecutorListener
java.lang.Object
org.alfresco.utility.testrail.TestRailExecutorListener
- All Implemented Interfaces:
org.testng.ISuiteListener,org.testng.ITestListener,org.testng.ITestNGListener
public class TestRailExecutorListener
extends Object
implements org.testng.ISuiteListener, org.testng.ITestListener
Listen for all test cases created and update them accordingly in Test Rail (configured based on *.properties file)
This is the seconds approach of updating TestRail test cases based on test execution.
The initial approach was to perform queries and update test cases as we go. Running many tests in parallel or multiple suites will throw
"HTTP 429 (No additional error message received)" from the server {@link http://docs.gurock.com/testrail-api2/introduction}
-
In order to bypass this, before we start the suite of test we query the list of test cases from current project specified in default.properties and save it
in memory.
- when the test is executed if the test is not in temporary collection we add it (make a post request to /add_case)
- after test execution, for our test object we define the status and other details from ITestResult
- after the entire tests are executed, we traverse the list of all tests executed and bulk upload their results in TestRail with just one query command.
- Author:
- Paul Brodner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonFinish(org.testng.ISuite suite) voidonFinish(org.testng.ITestContext context) voidonStart(org.testng.ISuite suite) voidonStart(org.testng.ITestContext context) voidonTestFailedButWithinSuccessPercentage(org.testng.ITestResult result) voidonTestFailure(org.testng.ITestResult result) voidonTestSkipped(org.testng.ITestResult result) voidonTestStart(org.testng.ITestResult currentTest) voidonTestSuccess(org.testng.ITestResult result) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testng.ITestListener
onTestFailedWithTimeout
-
Constructor Details
-
TestRailExecutorListener
public TestRailExecutorListener()
-
-
Method Details
-
onStart
public void onStart(org.testng.ISuite suite) - Specified by:
onStartin interfaceorg.testng.ISuiteListener
-
onFinish
public void onFinish(org.testng.ISuite suite) - Specified by:
onFinishin interfaceorg.testng.ISuiteListener
-
onTestStart
public void onTestStart(org.testng.ITestResult currentTest) - Specified by:
onTestStartin interfaceorg.testng.ITestListener
-
onTestSuccess
public void onTestSuccess(org.testng.ITestResult result) - Specified by:
onTestSuccessin interfaceorg.testng.ITestListener
-
onTestFailure
public void onTestFailure(org.testng.ITestResult result) - Specified by:
onTestFailurein interfaceorg.testng.ITestListener
-
onTestSkipped
public void onTestSkipped(org.testng.ITestResult result) - Specified by:
onTestSkippedin interfaceorg.testng.ITestListener
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(org.testng.ITestResult result) - Specified by:
onTestFailedButWithinSuccessPercentagein interfaceorg.testng.ITestListener
-
onStart
public void onStart(org.testng.ITestContext context) - Specified by:
onStartin interfaceorg.testng.ITestListener
-
onFinish
public void onFinish(org.testng.ITestContext context) - Specified by:
onFinishin interfaceorg.testng.ITestListener
-