我想匹配以下任一 BDD:
Then the response status should be "200"
Then response status should be "200"
我想让“the”成为可选的。我希望这两个规则映射到同一步骤。
这是我的尝试,但它不起作用:
@Then("^(?:the | )response status should be \"([^\"]*)\"$")
public void the_response_status_should_be(String arg1) {
...
}
最佳答案
这可能有效... "^(?:the )*response status should be\"([^\"]*)\"$"
关于cucumber - 如何在我的 cucumber BDD 步骤定义中使 "the"可选?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40312047/