首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven + Cucumber4 + Spring集成-无法执行cucumber runner案例

Maven + Cucumber4 + Spring集成-无法执行cucumber runner案例
EN

Stack Overflow用户
提问于 2020-01-05 13:44:54
回答 1查看 89关注 0票数 0

我无法使用mvn测试执行黄瓜弹簧集成测试。请参阅下面的pom.xml -

我使用cucumber-spring,cucumber-java8,cucumber-junit。当我尝试运行mvn测试或mvn全新安装功能时,这些功能没有运行。

代码语言:javascript
复制
//Code
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>4.8.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>4.8.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-spring</artifactId>
        <version>4.8.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>

        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <parallel>both</parallel>
                <threadCount>4</threadCount>
                <includes>
                    <include>**/*RunCucumberTest.java</include>
                </includes>
            </configuration>
        </plugin>
    </plugins>
</build>
</project>
EN

回答 1

Stack Overflow用户

发布于 2020-06-16 20:50:31

如果您删除vintage engine (它负责在新的junit 5平台上运行旧的junit 3/4测试),您的旧测试将不会被选中。它是检测这些测试并在新平台上运行的junit老式引擎。

不幸的是,cucumber仍然在junit 4上,所以它们没有被采摘。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59597351

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档