【问题标题】:Cucumber tests in parallel with Junit and Gradle?黄瓜测试与 Junit 和 Gradle 并行?
【发布时间】:2021-12-27 12:57:15
【问题描述】:

我正在尝试使用 Junit 并行运行黄瓜功能文件,如官方文档 [https://cucumber.io/docs/guides/parallel-execution/#junit] 中所述,但在我的项目中,我改用 Gradle Maven的,不知道如何实现这部分:

<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>

【问题讨论】:

    标签: java maven gradle cucumber


    【解决方案1】:

    Gradle 不支持类级别以下的并行执行。所以使用 Gradle 和 JUnit 4 你不能并行运行 Cucumber。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      • 2015-04-07
      • 2018-12-14
      • 1970-01-01
      • 1970-01-01
      • 2021-07-20
      相关资源
      最近更新 更多