我正在尝试使用Cucumber标签实现并行执行。我在下面附加了功能文件,而不是使用多个功能文件,而是尝试使用黄瓜标签@au,@nl, @nz
我知道我们可以使用功能文件来实现并行执行,但是我想使用黄瓜标签根据区域设置并行执行我的标签。每个标签都与现有客户进行相关测试。
注意:我正在使用宁静BDD
1. browser 1: au (first execute new user, second execution for existing user )
2. browser 2: nl (first execute new user, second execution for existing user )
3. browser 3: nz (first execute new user, second execution for existing user )
sample.feature
@au @smoke
Scenario: A new user can place a order
Given the user is on homepage
When the user perform checkout
Then order confirmation page is display
@au @smoke
Scenario: A new user can place a order
Given the existing user is on homepage
When the existing user perform checkout
Then order confirmation page is display
@nl @smoke
Scenario: A new user can place a order
Given the user is on homepage
When the user perform checkout
Then order confirmation page is display
@nl @smoke
Scenario: A new user can place a order
Given the existing user is on homepage
When the existing user perform checkout
Then order confirmation page is display
@nz @smoke
Scenario: A new user can place a order
Given the user is on homepage
When the user perform checkout
Then order confirmation page is display
@nz @smoke
Scenario: A new user can place a order
Given the existing user is on homepage
When the existing user perform checkout
Then order confirmation page is display
答案 0 :(得分:0)
如果您使用的是黄瓜4及更高版本,可以这样做
import io.cucumber.core.cli.main
public class MyRunner {
public static void main(String[] args) {
Main.run(new String[]{
"--threads", "3",
"-t", "@au and @nz",
"-g", "com.your.glue",
"src/test/resources/features/",
}, Thread.currentThread().getContextClassLoader());
}
}
注意: