诱惑用junit,cucumber-JVM,maven两次显示测试用例

问题描述

我正在使用Junit和Maven执行一些Cucumber脚本 我想实施吸引力报告。

我使用io.cucumber(6.8.2)allure(allure-cucumber6-jvm:2.13.6)

当我使用IDE运行Cucumber测试时,我的测试执行一次,并且在allure-results文件夹中仅生成一个结果文件。很好

但是,当我使用maven执行相同的测试时,会生成 2个结果文件

有人知道吗?

我的命令行

mvn -PwlmGherkins -Dcucumber.filter.tags="@Allure" clean compile test

我的pom.xml

<profiles>
        <profile>
            <!-- Profile pour l\'execution des tests gherkins -->
            <id>wlmGherkins</id>
            <properties>
                <test.include.tags/>
                <test.includes>**/WlmCucumberTest.java</test.includes>
            </properties>
        </profile>
    </profiles>

       <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M3</version>
                    <configuration>
                        <includes>
                            <include>${test.includes}</include>
                        </includes>
                        <groups>${test.include.tags}</groups>
                        <testFailureIgnore>false</testFailureIgnore>
                        <argLine>
                            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                        </argLine>
                        <systemProperties>
                            <property>
                                <name>junit.jupiter.extensions.autodetection.enabled</name>
                                <value>true</value>
                            </property>
                        </systemProperties>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.junit.platform</groupId>
                            <artifactId>junit-platform-surefire-provider</artifactId>
                            <version>1.2.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>1.9.5</version>
                        </dependency>
                    </dependencies>
                </plugin>
         

我的Junit班

@RunWith(Cucumber.class)
@CucumberOptions(features = "src/testcases/resources/wlm",plugin = {"pretty","html:target/reports/cucumber.html","json:target/reports/cucumber.json","junit:target/reports/cucumber.xml","rerun:target/reports/rerun.txt","io.qameta.allure.cucumber6jvm.AllureCucumber6Jvm"
        },glue = {"com.wlm"},tags = "@Production"
)
public class WlmCucumberTest {
}

我的功能文件

@wlm
@Allure
@WLM-ZZZ
Feature: My feature ZZZZ

  @TmsLink("WLM-ZZZ")
  Scenario: WLM-ZZZ: My Scenario With Bug

    #1
    Then Step "2" : Step With Bug

Generated allure report with the 2 same testcase

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...