将多个范围报告合并到单个报告中

时间:2017-07-30 14:55:01

标签: selenium-webdriver extent

我有一个maven多模块项目,我能够为每个单独的模块生成Extent HTML报告。如何将各个报告合并并附加到单个报告中。

版本: 范围报告:2.41.2

3 个答案:

答案 0 :(得分:0)

如果您对文件使用相同的位置和文件名,并按如下所示进行初始化:

extentReportFile = some-path-that-you-use-in-all-modules;
ExtentReports extentReports = new ExtentReports(extentReportFile, false);

它应该将所有报告存储在一个单独的.html文件中。

您可以在核心模块中创建一个ExtentReports工厂 - 所有其他模块可以看到的工厂 - 并在您的模块中实现代码。

答案 1 :(得分:0)

You can check Klov. demo here In a nice looking dashboard you have all tests as builds and general info's about them. What I like the most is that once a TC's is executed will be automatically updated in the dashboard - so you can check the results in real time no need to wait for full report. It is simple to be implemented, you can check here.

Some issues are present also :(

  • Screenshots are not displayed correctly
  • Category and description are not displayed

答案 2 :(得分:0)

我有类似的要求。我做到了。 (范围报告V3及更高版本)

所有测试类都将扩展BaseTest。

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();
    }

}