簡體   English   中英

BDD Cucumber Maven Junit 並行執行不起作用

[英]BDD Cucumber Maven Junit Parralel execution not working

我有 3 個功能文件,每個功能包含 3 個測試,因此總共有 9 個測試,但只有 3 個測試正在執行並開始執行;y 第一個功能文件。我在所有功能文件中都給出了全局標簽 @smoke 請在下面找到 pom 文件. io.github.bonigarcia webdrivermanager 4.0.0 org.seleniumhq.Z8E00596AD8DE2213FF8F8D8478D5162CZ selenium-java.3
junit junit 4.13 test org.hamcrest hamcrest-all 1.3 test info.cukes cucumber-java 1.2.5 info.cukes cucumber-junit 1.2.5 info.cukes cucumber-jvm-deps 1.0.5 provided net.masterthought cucumber-reporting 5.0. 2

<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>gherkin</artifactId>
    <version>2.12.2</version>
    <scope>provided</scope>
</dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M4</version>
          <configuration>
          <parallel>methods</parallel>
       <useUnlimitedThreads>true</useUnlimitedThreads>
        </configuration>
        </plugin>   
      </plugins>
    </pluginManagement>
  </build>

有幾個選項可以在 Cucumber 項目中合並並行執行功能,例如:

  1. JUnit
  2. TestNG
  3. CLI

但在執行中存在一些差異。 區別之一是他們如何讀取功能文件並設置單獨的線程來運行場景。 JUnit (您已經使用過)每個功能文件使用一個線程,而不是每個場景或文件中的其他部分。

如果您希望所有場景同時運行,請將它們寫入不同的功能文件或使用TestNG而不是JUnit

更多信息: https://cucumber.io/docs/guides/parallel-execution/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM