当在Maven Cucumber Reports中构建失败时,不会生成报告 [英] Reports are not generated when the build is failed in Maven Cucumber Reports

查看:63
本文介绍了当在Maven Cucumber Reports中构建失败时,不会生成报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

构建成功后,报告将成功生成,但是如果有任何失败的情况导致构建失败,则不会生成报告.

Reports are generating successfully when the build is successful but when there are any failed cases which cause build failure, reports are not generated.

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{

    }

推荐答案

将以下配置添加到肯定的fire插件中.失败后,它不会停止执行Maven.然后它将生成报告.

Add the following configuration to the sure fire plugin. It will not stop the maven execution after the failure. Then it will generate the report.

<testFailureIgnore>true</testFailureIgnore>

,如下所示,其中包含您的现有配置.

as given below with your existing configuration.

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.20</version>
      <configuration>
        <testFailureIgnore>true</testFailureIgnore>
     </configuration>
</plugin>

这篇关于当在Maven Cucumber Reports中构建失败时,不会生成报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆