对于相同的值,如何忽略cucmber中的StepDefinition变量声明?
所以假设我有如下例子:
Scenario Outline: Looking up the definition of fruits
Given the user is on the Wikionary home page
When the user <name> looks up the definition of the word <name>
Then they should see the definition 'An edible fruit produced by the pear tree, similar to an apple but elongated towards the stem.'
Examples:
| name |
| pear |
@When("^the user (.*?) looks up the definition of the word (.*?)$")
public void when(String name, String name2){
System.out.println(name);
System.out.println(name2);
}
现在在上面的步骤中,我已经创建了两个不必要的变量,我这样做是因为我的cucumber报告应该在when语句中的两个位置获得名称。
请让我知道如果你需要任何进一步的信息或如果我遗漏了什么。