1

我正在为 4 个套件执行 selenium-automation,如下所示:

<suite name="allSuites">
  <suite-files>
    <suite-file path="suite1.xml" />
    <suite-file path="suite2.xml" />
    <suite-file path="suite3.xml" />
    <suite-file path="suite4.xml" />
  </suite-files>
</suite>

我正在按如下方式创建报告名称:“extent-report-current-date-time.html”

但是当我执行这个套件时,我会看到第一个套件的范围报告。

范围报告文件还指出:

"The ExtentReports report client for starting reporters and building reports. For most applications, you should have one ExtentReports instance for the entire JVM."

这就是我只收到一份报告的原因吗?

我的 ExtentManager 类:

extent = new ExtentReports();
htmlReporter = new ExtentHtmlReporter(getReportName(config));
ClassLoader classLoader = ExtentReportService.class.getClassLoader();
        File extentConfigFile = new File(classLoader.getResource("extent-config.xml").getFile());
htmlReporter.loadXMLConfig(extentConfigFile);
htmlReporter.setAppendExisting(true);
extent.attachReporter(htmlReporter);
extent.setSystemInfo("Environment", config.getAutomationServer());

这个问题有转机吗?或者我应该一个一个地执行我的测试用例?

4

1 回答 1

1

找到了一个可行的解决方案来满足我的目的。

我的单人套房看起来像:

<suite>
 <parameter1>
 <parameter2>
 <test>
   <classes>
   </classes>
 </test>
<suite>

我为我的所有套房使用了相同的课程(这可能不是必需的)。我在范围报告中遇到了“分配类别”的概念。所以我将我的参数设置在<test>水平而不是<suite>水平。而不是多个套房,我创建了一个套房。

于 2018-10-24T08:53:18.700 回答