我未使用黄瓜Maven报告插件see image here
时,报告未生成答案 0 :(得分:0)
主要问题:消息“ net.masterthought.cucumber.ValidationException:未添加报告文件!”通常会在Maven Cucumber Html报表插件的配置出现问题时出现。 (下面的配置示例)
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>4.2.3</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>TheDayAfterTomorrow</projectName>
<!-- output directory for the generated report -->
<outputDirectory>${project.build.directory}/cucumber-maven-report</outputDirectory>
<inputDirectory>${project.build.directory}/cucumber-json</inputDirectory>
<jsonFiles>
<!-- supports wildcard or name pattern -->
<param>**/*.json</param>
</jsonFiles>
<skippedFails>true</skippedFails>
<enableFlashCharts>true</enableFlashCharts>
<buildNumber>10.2.1</buildNumber>
<parallelTesting>false</parallelTesting>
</configuration>
</execution>
</executions>
</plugin>
次要事情,如果您仍在使用旧版本的黄瓜(1.2.5),请使用最新的可用黄瓜版本或任何大于等于4.0.0的版本更新POM文件,以便更好的结果。
通过JUnit执行黄瓜:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>4.2.6</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.2.6</version>
</dependency>
通过TestNG执行黄瓜:
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>4.2.6</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-testng</artifactId>
<version>4.2.6</version>
</dependency>