【问题标题】:TestNG combine multiple HTML TestNG reports into a single TestNG reportTestNG 将多个 HTML TestNG 报告组合成一个 TestNG 报告
【发布时间】:2019-11-05 07:46:57
【问题描述】:

我正在多个节点中运行 Maven 项目的 TestNG 套件。 我正在使用 HTMLReporter 生成 TestNG 运行结果报告。 每个节点运行完成后都会生成一份 HTML 报告。

运行结束后获取综合结果报告的要求。 我们需要将所有测试结果组合成一个 TestNG 结果。

有没有办法做到这一点?

【问题讨论】:

    标签: java html maven testng


    【解决方案1】:

    我有类似的要求。我做到了。

    BaseTest 正在被所有测试类扩展。

    Class BaseTest{
    
                public static ExtentReports extent =new ExtentReports();//initiating here is very important
                public static ExtentHtmlReporter htmlReporter;
    
        @BeforeSuite
            public void beforeSuiteSetup() {
                String filepath = System.getProperty("user.dir");
                htmlReporter = new ExtentHtmlReporter(filepath+"/Report.html");     
                extent.attachReporter(htmlReporter);
            }
    
        @AfterSuite(alwaysRun = true)
            public void afterSuite() {
                extent.flush();
            }
    
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多