コード例 #1
0
 @Override
 public void onTestFailure(ITestResult iTestResult) {
   if (suiteName.toLowerCase().contains("webui")) {
     if (testInvocationCounter < maxCount) {
       testInvocationCounter++;
       iTestResult.setAttribute("retry", true);
     } else {
       LogUtils.log("Number of retries expired.");
       iTestResult.setStatus(ITestResult.FAILURE);
       // reset count
       testInvocationCounter = 1;
       testMethodName = TestNGUtils.constructTestMethodName(iTestResult);
       LogUtils.log("Test Failed: " + testMethodName, iTestResult.getThrowable());
       File testFolder = DumpUtils.createTestFolder(testMethodName, suiteName);
       write2LogFile(iTestResult, testFolder);
       write2ErrorTxtFile(iTestResult, testFolder);
     }
   } else {
     testMethodName = TestNGUtils.constructTestMethodName(iTestResult);
     LogUtils.log("Test Failed: " + testMethodName, iTestResult.getThrowable());
     File testFolder = DumpUtils.createTestFolder(testMethodName, suiteName);
     write2LogFile(iTestResult, testFolder);
     write2ErrorTxtFile(iTestResult, testFolder);
   }
   super.onTestFailure(iTestResult);
 }
コード例 #2
0
 @Override
 public void onTestSkipped(ITestResult iTestResult) {
   super.onTestSkipped(iTestResult);
   testMethodName = TestNGUtils.constructTestMethodName(iTestResult);
   LogUtils.log("Test Skipped: " + testMethodName, iTestResult.getThrowable());
   write2LogFile(iTestResult, DumpUtils.createTestFolder(testMethodName, suiteName));
 }
コード例 #3
0
 @Override
 public void onTestStart(ITestResult iTestResult) {
   super.onTestStart(iTestResult);
   String testName = TestNGUtils.constructTestMethodName(iTestResult);
   LogUtils.log("Test Start: " + testName);
   if (enableLogstash) {
     initLogstash(testName);
   }
 }
コード例 #4
0
 @Override
 public void onTestSuccess(ITestResult iTestResult) {
   super.onTestSuccess(iTestResult);
   if (suiteName.toLowerCase().contains("webui")) {
     testInvocationCounter = 1;
   }
   testMethodName = TestNGUtils.constructTestMethodName(iTestResult);
   LogUtils.log("Test Passed: " + testMethodName);
   write2LogFile(iTestResult, DumpUtils.createTestFolder(testMethodName, suiteName));
 }