Using || in a step definition to cater for language options
Say I have a step definition like this
[When(@"I click on the radio button ""([^""]*)""")]
[When(@"I click on the checkbox ""([^""]*)""")]
[When(@"I click on the option ""([^""]*)""")]
public void ThenUserClicksOnOption(string OptionName)
{
OptionSelector(OptionName);
}
Can this be simplified by using || similarly to this:
[When(@"I click on the (radio button || checkbox || option) ""([^""]*)""")]
public void ThenUserClicksOnOption(string OptionName)
{
OptionSelector(OptionName);
}
So that it matches regardless of if I use “option” or “radio button” or “checkbox” when using a step? I'm sure I've seen this somewhere with Gherkin?
1
Please sign in to leave a comment.
Comments
0 comments