Karate 空手道-如何在单个功能文件中并行运行多个场景?
我的功能文件中有4个场景,我希望所有四个场景并行运行,这是我的功能文件Karate 空手道-如何在单个功能文件中并行运行多个场景?,karate,Karate,我的功能文件中有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 res
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|
我应该怎么做,以便它能够同时运行所有场景,从而减少项目的编译时间?:) 从版本0.9.0开始,场景以并行方式启动,除非使用
@parallel=false
如果您的功能是并行运行的,那么您的场景将是并行的。
如果不是这样的话,你应该切换到0.9.1。我不知道你想问什么……瓦伦:显然你没有花时间阅读文档。我不会在这里解释这一点,但是
--plugin html:target/cucumber html
是错误的,不受支持,如果dsRunner.java
使用@RunWith(Karate.class)
注释,它将不会并行运行。请阅读文件,不要问不必要的问题。
mvn clean test -Dcucumber.options="--plugin html:target/cucumber-html " -Dtest=dsRunner.java