问题描述:
我正在尝试使用黄瓜和Java在多个区域运行相同的黄瓜方案。
我想实现什么?
我尝试了什么?
我不确定如何使用黄瓜达到同样的效果。请找到下面的代码以供参考
@au-en @nl-nl @gb-en
Scenario: A new user can place order using ecom sites
Given the Guest user buying product
Then the user perform checkout
//step definition cucumber
@Before
public void setUp(Scenario scenario) {
listTags= (List) scenario.getSourceTagNames();
listTags
.stream()
.forEach(System.out::println);
}
@Given("^the Guest user buying product$") {
public void buyProduct() {
for(Object item : listTags) {
System.out.println("******item*********" + item);
homepage.navigateToPage(baseUrl.concat(url)); //call url
productSelection.selectProduct();
productSelection.AddTobasket()
basketPageSteps.clickCheckoutButton();
}
}
@Then("^the user perform checkout$")
public void theUserIsOnTheCheckoutCompletePage() {
cheeckoutPage.ClickCheckout();
}
而不是使用标签,而是使用示例表来存储区域名称,然后使用方案大纲来执行具有不同区域的相同方案。