cucumber+webrat+selenium not waiting for response

24 views
Skip to first unread message

Scott Johnson

unread,
May 29, 2009, 9:00:36 PM5/29/09
to webrat
I have this combo running (followed instructions on
http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium),
but I'm getting lots of failures in my features because Webrat will
click a button (say), then immediately check the next Then step
(assertion) before the browser has followed the link and gone to the
next page. For example:

And I press "Create" #
features/step_definitions/webrat_steps.rb:14
Then I should be on the Foo Profile: my_new_profile page #
features/step_definitions/webrat_steps.rb:117
expected: "/profiles/19",
got: "/spaces/Foo/profiles/new" (using ==)

But the browser was on the way to /profiles/19, just hadn't made it
there yet.

This happens with form buttons and with regular links.

I've already added a step that I thought would cause it to wait, and
it helped somewhat, but not fully.

Then /^I should be on (.+)$/ do |page_name|
response.should contain(/./) # make webrat wait for some response to
come
URI.parse(current_url).path.should == path_to(page_name)
end

Scott Johnson

unread,
May 29, 2009, 9:07:06 PM5/29/09
to webrat
I should mention that this particular case involves a redirect, but I
have other failing cases that do not have any redirect.


On May 29, 6:00 pm, Scott Johnson <sc...@scottjohnson.org> wrote:
> I have this combo running (followed instructions onhttp://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium),

Scott Johnson

unread,
May 30, 2009, 5:17:09 AM5/30/09
to webrat
Looks like this is a known issue. I guess I'll just hang on to my hat.

https://webrat.lighthouseapp.com/projects/10503/tickets/226-not-waiting-for-page-load-with-selenium
Reply all
Reply to author
Forward
0 new messages