nab*_*ter 3 bdd escaping cucumber gherkin cucumber-java
我有以下用于Cucumber-jvm的步骤。如何转义步骤定义中的某些字符?
When user verifies if ABC widget exists
Then the 'The 7 Things $channel' label is displayed
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我需要将7和$作为常规字符串转义。
你可以这样做,
Then the /'The 7 Things $channel' label is displayed/
Run Code Online (Sandbox Code Playgroud)
相应的步骤 def 是,
@Then("^the /'The 7 Things \\$channel' label is displayed/$")
public void the_The_Things_$channel_label_is_displayed() throws Throwable {
System.out.println("hello");
}
Run Code Online (Sandbox Code Playgroud)