You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fayizkc
changed the title
Unable to create a step definition with | operator with latest version
Unable to create step definition with | operator with latest version
Jun 24, 2024
Capturing an optional element of expression is not possible with a Cucumber expressions. It looks like you may have been mixing regular and Cucumber Expressions. This should not have been possible and was fixed with cucumber/common#771.
To match your step with regular expressions you would either have to use a regular expression
^Verify "([^"]*)" (|not )exist in the list$
Note: the extra space after not.
Or with Cucumber Expressions, you would use two separate step definitions.
Verify {string} not exist in the list
Verify {string} exist in the list
The latter is probably better. While it does result in more lines of code, it keeps each step one focused on its own distinct task. If not you can probably factor out a more generic helper method. Or use the regular expressions.
👓 What did you see?
When I try to create step as below
with single step definition, it is not identifying. I have create stepDef as below
showing error as "Step undefined
You can implement this step using the snippet(s) below:"
✅ What did you expect to see?
This was working with older cucumber version I hope when i check in this Issue
📦 Which tool/library version are you using?
Cucumber version: 7.15.0
🔬 How could we reproduce it?
No response
📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered: