My regular expression is not recognized in Cucumber - help!

So this is a really new question.

I have a step that looks like this:

Then /^I should see ((phrase 1) | (phrase 2))$/ do
  #stuff
end

After that, I have a step that looks like this:

Then /^I should see phrase 3$/ do
  And %{I should see phrase 2}
end

I am trying to check the registration flow.

phrase 1 describes the required information that needs to be filled in, and I need to check that they are displayed in the user profile.

phrase 3describes the required and optional information that the user fills. Optional information should also be displayed in the user profile, and I want to verify that this is also displayed.

, phrase 1 , phrase 3, , , . , Cucumber, I should see phrase 2 undefined.

? ?

+3
1

<

:

Then %{I should see phrase 1 }

Then %{I should see  phrase 2}

( , see phrase2 ). , .

:

Then /^I should see (phrase 1|phrase 2)$/ do |phrase_name|

end

| , (, , , ).

, phrase_name, . , , , :

Then /^I should see phrase ([\d]+)$/ do |phrase_number|

end

, 1. [\ d] + 1 .

, , . , , . , - , .

+4

All Articles