簡體   English   中英

空手道 - 如何在單個功能文件中並行運行多個場景?

[英]Karate - how to run multiple scenarios in a single feature file parallely?

我的功能文件中有 4 個場景,我希望所有四個場景並行運行,這是我的功能文件,

  Feature:

  Background:
    * def Json = Java.type('Json')
    * def dq = new Json()
    * def result = dq.makeJson('0')
    * def result1 = dq.makeJson('110')
    * def result2 = dq.makeJson('220')
    * def result3 = dq.makeJson('330')

    Scenario Outline: id : <id>
    * def ds_hotel_id = '<id>'
    *  print ds_hotel_id

    Examples:
    |result|

  Scenario Outline: id : <id>

    * def ds_hotel_id = '<id>'
    *  print ds_hotel_id

    Examples:
      |result1|

  Scenario Outline: id : <id>
    * def ds_hotel_id = '<id>'
    *  print ds_hotel_id


    Examples:
      |result2|

  Scenario Outline: id : <id>

    * def ds_hotel_id = '<id>'
    *  print ds_hotel_id

    Examples:
      |result3|

我通過這個命令行運行它,

mvn clean test -Dcucumber.options="--plugin html:target/cucumber-html " -Dtest=dsRunner.java

我該怎么做,才能讓它同時運行所有場景,從而減少項目的編譯時間? :)

從版本 0.9.0 開始,場景並行啟動,除非另有指定@parallel=false

如果您的功能並行運行,那么您的場景將會並行運行。 如果不是這種情況,您應該切換到 0.9.1。

暫無
暫無

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

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