The strings which are used to annotate your steps (e.g. "the users (\w+) should be (\w+)"
) are regular expressions. They're used to match up step definitions against the text found in the Gherkin file and parse arguments out of the text.
In this case the (\w+)
is looking for one or more "word" characters, which doesn't include @
. Actually the @ isn't your only problem, \w
won't match the dot in .com
either.
You've got two options, either change the (\w+)
to a regex which will match email or just put quotes around the parameters and use (.*)
to match anything inside those quotes.
Matching an email address with regex is harder than you'd think (see http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html), so just use the quotes:
Then the users "<field_name>" should be "<field_value>"
@Then('the users "(.*)" should be "(.*)"')