《The Cucumber Book》的笔记-Noncapturing
- 2015-03-08 22:18:14
When /I (?:visit|go to) the homepage/ do # TODO: code goes here end Notice that we’ve had to prefix the list of alternates with another bit of regular expression magic. The ?: at the start of the group marks it as noncapturing, meaning Cucumber won’t pass it as an argument to our block.
糖罐86对本书的所有笔记 · · · · · ·
Thatâ€™s no good. To fix this, we can use the modifier, which means at least once: Given ...
The question mark modifier means zero or one times
Anchors You might have noticed that the step definition snippets that Cucumber prints for ...
5.4 Nesting Steps Now, use Cucumberâ€™s built-in steps method to call out to the original ...
说明 · · · · · ·