Reduce spurious cucumber failures by turning off jquery effects with drag & drop, and increasing timeout when waiting for ajax callbacks to complete.

This commit is contained in:
Sarah Mei 2011-01-08 12:33:01 -08:00
parent 0c58d9814b
commit 9411ba31b0
2 changed files with 6 additions and 1 deletions

View file

@ -41,5 +41,9 @@ When /^I wait for the request's profile page to load$/ do
end end
When /^I wait for the ajax to finish$/ do When /^I wait for the ajax to finish$/ do
wait_until { evaluate_script("$.active") == 0 } wait_until(10) { evaluate_script("$.active") == 0 }
end
When /^I have turned off jQuery effects$/ do
evaluate_script("$.fx.off = true")
end end

View file

@ -52,6 +52,7 @@ Then /^I should see (\d+) contact(?:s)? in "([^"]*)"$/ do |contact_count, aspect
end end
When /^I drag the contact request to the "([^"]*)" aspect$/ do |aspect_name| When /^I drag the contact request to the "([^"]*)" aspect$/ do |aspect_name|
Given "I have turned off jQuery effects"
aspect = @me.reload.aspects.find_by_name(aspect_name) aspect = @me.reload.aspects.find_by_name(aspect_name)
aspect_div = find("ul.dropzone[data-aspect_id='#{aspect.id}']") aspect_div = find("ul.dropzone[data-aspect_id='#{aspect.id}']")
request_li = find(".person.request.ui-draggable") request_li = find(".person.request.ui-draggable")