基于 SELENIUM 的自动化测试架构(54)

发表于:2017-04-11来源:gitbook作者:凌俣Linty?点击数: 标签:selenium
.extent = new ExtentReports( outputDirectory + File.separator + reportName, true , NetworkMode.OFFLINE); for (ISuite suite : suites) { MapString, ISuiteResult result = suite.getResults(); for (ISuiteR
.extent = new ExtentReports( outputDirectory + File.separator + reportName, true, NetworkMode.OFFLINE); for (ISuite suite : suites) { Map<String, ISuiteResult> result = suite.getResults(); for (ISuiteResult r : result.values()) { ITestContext context = r.getTestContext(); // 创建测试节点 buildTestNodes(context.getPassedTests(), LogStatus.PASS); buildTestNodes(context.getFailedTests(), LogStatus.FAIL); buildTestNodes(context.getSkippedTests(), LogStatus.SKIP); } } extent.flush(); extent.close(); }
  • 修改 testng.xml

    <suite /> 中添加 <listener/>

    <listeners>
      <listener class-name="runner.ExtentReporterNgListener"/>
    </ 
    
    
    
               

    原文转自:http://gitbook.cn/books/58e54b57cfcd6fa52dcef1d2/index.html

  • ...