繁体   English   中英

Cucumber 与 Junit 和 Gradle 并行测试?

[英]Cucumber tests in parallel with Junit and Gradle?

I'm trying to run cucumber feature files in parallel using Junit as described in official documentation[https://cucumber.io/docs/guides/parallel-execution/#junit], but in my project I use Gradle instead of Maven and不知道如何实现这部分:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.0</version>
    <configuration>
        <parallel>methods</parallel>
        <useUnlimitedThreads>true</useUnlimitedThreads>
    </configuration>
</plugin>

Gradle 不支持低于 class 级别的并行执行。 因此,使用 Gradle 和 JUnit 4 您不能并行运行 Cucumber。

使用 Gradle 和 JUnit 5 这不是问题,因为 JUnit 5 将处理并行执行。 但是,您将不得不使用 Cucumbers JUnit 引擎:

https://github.com/cucumber/cucumber-jvm/tree/main/junit-platform-engine

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM