Java 即使在测试失败后也要建立成功
我在pom.xml中添加了cucumber报告插件,如下所示:Java 即使在测试失败后也要建立成功,java,maven,automation,cucumber,cucumber-jvm,Java,Maven,Automation,Cucumber,Cucumber Jvm,我在pom.xml中添加了cucumber报告插件,如下所示: <plugin> <groupId>net.masterthought</groupId> <artifactId>maven-cucumber-reporting</artifactId> <version>${maven.cucumber.reporting.version}</v
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${maven.cucumber.reporting.version}</version>
<executions>
<execution>
<id>execution</id>
<phase>test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>cucumber-jvm-example</projectName>
<outputDirectory>${project.build.directory}/cucumber-html-reports</outputDirectory>
<cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
<parallelTesting>false</parallelTesting>
</configuration>
</execution>
</executions>
</plugin>
网络智囊团
马文黄瓜报道
${maven.cumber.reporting.version}
执行
测试
生成
黄瓜jvm示例
${project.build.directory}/html报告
${project.build.directory}/cucumber.json
假的
只有在没有故障的情况下才会生成报告,但要在故障后生成报告,我必须添加:
<testFailureIgnore>true</testFailureIgnore>
true
在maven surefire插件中,这是生成报告,即使在测试失败后也是如此,但问题是生成了构建成功消息,应该是构建失败。
有什么想法吗?所以你告诉它忽略测试失败,然后你会惊讶地发现它忽略了测试失败?您需要解决的问题是如何在失败后生成报告-显然忽略测试失败不是正确的方法。@ErwinBolwidt我对自动化不熟悉,所以我使用了该解决方案,我不应该使用该解决方案,但如果没有该解决方案,则不生成报告请尝试打开一个。