如何解决当在Maven Cucumber Reports中构建失败时,不会生成报告
将以下配置添加到确定的fire插件。失败后,它不会停止执行Maven。然后它将生成报告。
<testFailureIgnore>true</testFailureIgnore>
如下面的现有配置所示。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
解决方法
生成成功后,报告将成功生成,但是如果有任何失败的情况导致生成失败,则不会生成报告。
checkBuildResult 已设置为 false
pom文件插件
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>3.13.0</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Simplify360 Automation Test Report</projectName>
<outputDirectory>${project.build.directory}/site/cucumber-reports</outputDirectory>
<cucumberOutput>${project.build.directory}/cucumber.json</cucumberOutput>
<!-- <jsonFiles>
<param>${project.build.directory}/cucumber.json</param>
</jsonFiles> -->
<!-- <parallelTesting>false</parallelTesting> -->
<buildNumber>8.4.1.2</buildNumber>
<checkBuildResult>false</checkBuildResult>
</configuration>
</execution>
</executions>
</plugin>
跑步班如下
@RunWith(Cucumber.class)
@CucumberOptions(
features = {"classpath:features"},plugin = {"pretty","json:target/cucumber.json"},tags = {"@currentTest"},glue={"helpers","stepDefinitions"},monochrome = true
)
public class RunCukesTest{
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。