Feature Request: Allow capturing of alternative text
See original GitHub issueSummary
It would be nice if Cucumber Expressions could capture the alternative text from the feature file and use it as a parameter as we were able to with regex:
Ex.
@And("^I set the (current|comparison) date range to \"([^\"]*)\" through \"([^\"]*)\"$")
vs.
@And("I set the (current/comparison) date range to {string} through {string}")
Expected Behavior
Cucumber users are able to capture alternate text as a parameter to the step definition method.
Current Behavior
Unable to do this currently
Possible Solution
Allow for something like (choice1/choice2)
which would capture that word in that position without quotes around it and pass it as an argument.
Context & Motivation
Updating from cuke 1 to cuke 4 (our stuff is old) and I hit a roadblock here. My current solution is to make an enum and pass that down instead, but this could be nice for more than just my team.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@ddaypunk06 have you considered defining a parameter type for this?
I set the {date-range-type} date range to {string} through {string}
Example, rather sparse because of phone: