3

我有以下用于Cucumber-jvm的步骤。如何转义步骤定义中的某些字符?

When user verifies if ABC widget exists
Then the 'The 7 Things $channel' label is displayed

在这种情况下,我需要将7$转义为​​常规字符串。

4

1 回答 1

4

你可以这样做,

Then the /'The 7 Things $channel' label is displayed/

相应的 Step 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");
   }
于 2014-05-13T01:47:45.263 回答