示例#1
0
 @Override
 public void onTestStart(ITestResult tr) {
   super.onTestStart(tr);
   logger.info(tr.getName() + " Start");
   testResult.setDate(ts.getDate("-"));
   testResult.setStartTime(ts.getTime(":"));
 }
示例#2
0
  @Override
  public void onFinish(ITestContext testContext) {
    super.onFinish(testContext);
    IResultMap passedMap = testContext.getPassedTests();
    IResultMap failedMap = testContext.getFailedTests();

    testResult.setEndTime(ts.getTime(":"));
    testResult.setDuration("");
    testResult.setFailCount(String.valueOf(failedMap.size()));
    testResult.setPassCount(String.valueOf(passedMap.size()));
    testResult.setTotalCount(String.valueOf(failedMap.size() + passedMap.size()));
    logger.info("testContext.getName()=" + testContext.getName());
    initTestCaseInfo();

    ITestClass className = testContext.getAllTestMethods()[0].getTestClass();
    WriteResultUtils utils = new WriteResultUtils();
    utils.writeResultSummary(testResult, getTemplatePath(className.getName()));
  }