空手道 - 如何在单个功能文件中并行 运行 多个场景?

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。