-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing difference between #step and #steps #171
Comments
I'm pretty sure this is failing because |
That's right. This will work: steps %Q{
When I click on link "Sign up"
And I fill in "Username" with "#{username}"
And I fill in "Email" with "#{email}"
And I fill in "Password" with "123456"
And I fill in "Confirm Password" with "123456"
And I click on button "Sign up"
} @mattwynne - what do you think? Rename |
Uhh.. Yup, that's a good point. Then I have two issues (got When/And missing at some point). Consider this: When /^I sign in with "([^"]*)" and password "([^"]*)"$/ do |username, password|
steps %Q{
When I click on link "Sign in"
And I fill in "Username or email" with "#{username}"
And I fill in "Password" with "#{password}"
And I click on button "Sign in"
}
end Although it looks valid, it fails randomly with
|
Randomly? You mean it will work sometimes and fail other times without any edits in-between? |
I mean that I have /I sign in with "([^"])" and password "([^"])/ in several scenarios of one feature, and lexing error is different each time (as shown above) in one cucumber run. |
Can you isolate it to one scenario? Then do this: gherkin = %Q{...}
Kernel.puts gherkin
steps(gherkin) And show us what gherkin is printed for the scenario where you get lexing error. |
Given When /^I sign in with "([^"]*)" and password "([^"]*)"$/ do |username, password|
gherkin = %Q{
When I click on link "Sign in"
And I fill in "Username or email" with "#{username}"
And I fill in "Password" with "#{password}"
And I click on button "Sign in"
}
Kernel.puts " ---"
Kernel.puts gherkin
Kernel.puts " +++"
steps(gherkin)
end I have the following failures:
and
and one successful:
and another successful:
Where "I am logged in" is defined as: Given /^I am logged in as "([^"]*)" and password "([^"]*)"$/ do |username, password|
step %Q{there is user "#{username}" registered with email "test@user.net"}
step %Q{I sign in with "#{username}" and password "#{password}"}
end |
Actually yes, it does fail randomly. After re-run:
(that was successful a moment ago). Seem to be memory corruption issue here. |
I see you're using MRI 1.9.3--can you run this with 1.9.2 and see what happens? |
Can you confirm that your ruby file is saved with UTF-8 encoding? And what OS are you on? |
On 9 Nov 2011, at 10:26, Aslak Hellesøy wrote:
Sounds good to me. |
broken on MRI 1.9.3, also crashes jruby 1.6.5. Seem to work ok on MRI 1.9.2 |
That's a separate bug in Gherkin then. I created an issue for it here: cucumber/gherkin#142 and renamed this one to accurately reflect its content. |
The related issue opened under Gherkin is closed. Suggest this issue be closed as well. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
having a scenario:
And steps:
The following step works:
But this one fails:
with errors like:
The text was updated successfully, but these errors were encountered: