thoughtbot/capybara-webkit — Issue #256: cucumber moving to next step before request complete
Author: kbaum
Created: 2012-01-30 01:48:14+00:00
State: open

I have the following steps:

````
And I press "Search"
Then there should be exactly 3 space search results on the page
And it says 5 result found
And I follow the 1st search result
And I should have an activity with action: "space details viewed from space search results", subject_type: "SpaceSearchResult"
````

The problem i am noticing is that with capybara-webkit, "And I follow the 1st search result" step definition does not complete before the next step definition runs. This step def looks like:

````
Then /^I follow the (\d+)st search result$/ do |count|
page.find("#search-results .search-result#{count} a").click
end
````

If I add a check for css after the click, it waits properly.

````
Then /^I follow the (\d+)st search result$/ do |count|
page.find("#search-results .search-result#{count} a").click
page.should have_css 'title'
end
````

If i run the same scenario within selenium, this is not necessary.

is this expected?

thx!

-karl