From 9411ba31b0c50b56711f26a2e71032bb69a552e0 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sat, 8 Jan 2011 12:33:01 -0800 Subject: [PATCH] Reduce spurious cucumber failures by turning off jquery effects with drag & drop, and increasing timeout when waiting for ajax callbacks to complete. --- features/step_definitions/custom_web_steps.rb | 6 +++++- features/step_definitions/user_steps.rb | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 88a82d4e4..923040c46 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -41,5 +41,9 @@ When /^I wait for the request's profile page to load$/ do end 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 diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 4f052f998..4a92c2ec9 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -52,6 +52,7 @@ Then /^I should see (\d+) contact(?:s)? in "([^"]*)"$/ do |contact_count, aspect end 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_div = find("ul.dropzone[data-aspect_id='#{aspect.id}']") request_li = find(".person.request.ui-draggable")