Kat*_*tie 4 bdd cucumber gherkin cucumber-jvm cucumber-java
我想匹配以下 BDD 之一:
Then the response status should be "200"
Then response status should be "200"
Run Code Online (Sandbox Code Playgroud)
我想让“the”可选。我希望这两个规则映射到同一步骤。
这是我的尝试,但它不起作用:
@Then("^(?:the | )response status should be \"([^\"]*)\"$")
public void the_response_status_should_be(String arg1) {
...
}
Run Code Online (Sandbox Code Playgroud)
这可能有效..."^(?:the )*response status should be \"([^\"]*)\"$"