gpt4 book ai didi

java - Maven Cucumber 报告多个 JSON 文件

转载 作者:行者123 更新时间:2023-12-02 01:36:55 24 4
gpt4 key购买 nike

我的 POM 目前看起来是这样的,

<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>2.8.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>ExecuteAutomation</projectName>
<outputDirectory>${project.build.directory}/cucumber-report-html</outputDirectory>
<cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
</configuration>
</execution>
</executions>
</plugin>

这确实会生成一份报告,但仅包含最后一个功能。我有多个运行者,所以我想找出其中一个:

A.如何将多个 JSON 合并到一份报告中或

B.每次测试完成后,如何附加到一个 JSON 文件?

这两个似乎都是一个可行的解决方案,尽管我更喜欢 A,因为我似乎只在 pom.xml 中缺少一行来执行此操作,因为我目前已经生成了多个 JSON 文件

最佳答案

问题是正在使用的版本(即 2.8)不支持多个 JSON 文件。

解决办法是:

 <plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>4.5.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>ExecuteAutomation</projectName>
<inputDirectory>${project.build.directory}/jsonReports</inputDirectory>
<outputDirectory>${project.build.directory}/cucumber-report-html</outputDirectory>
<jsonFiles>
<!-- supports wildcard or name pattern -->
<param>**/*.json</param>
</jsonFiles>
</configuration>
</execution>
</executions>
</plugin>

了解更多信息 https://github.com/damianszczepanik/maven-cucumber-reporting

关于java - Maven Cucumber 报告多个 JSON 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55103607/

24 4 0
文章推荐: java - 无法找到存在的元素,获取 NullPointerException 而不是 NoSuchElement
文章推荐: visual-studio - Visual Studio 2013 - 为每个项目设置 Nuget 包
文章推荐: r - 计算csv文件中每个字段的最大长度
文章推荐: java - 如何在 java 中将 UnmodifyingRandomAccessList 设置为 Set