Skip to content

Commit

Permalink
Make tests more resilient to timing issues.
Browse files Browse the repository at this point in the history
This tackles Issue bernat#87 when running tests via X11 forwarding (or Xvfb).
  • Loading branch information
Flameeyes committed Jan 19, 2012
1 parent 4394c5a commit 8a601b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/integration/js_spec.rb
Expand Up @@ -466,11 +466,15 @@


bip_text @user, :address, "New address" bip_text @user, :address, "New address"


sleep 1

id = BestInPlace::Utils.build_best_in_place_id @user, :address id = BestInPlace::Utils.build_best_in_place_id @user, :address
page.execute_script <<-JS page.execute_script <<-JS
$("##{id}").click(); $("##{id}").click();
JS JS


sleep 1

text = page.find("##{id} input").value text = page.find("##{id} input").value
text.should == "New address" text.should == "New address"
end end
Expand Down Expand Up @@ -547,11 +551,15 @@


bip_text @user, :money, "40" bip_text @user, :money, "40"


sleep 1

id = BestInPlace::Utils.build_best_in_place_id @user, :money id = BestInPlace::Utils.build_best_in_place_id @user, :money
page.execute_script <<-JS page.execute_script <<-JS
$("##{id}").click(); $("##{id}").click();
JS JS


sleep 1

text = page.find("##{id} input").value text = page.find("##{id} input").value
text.should == "40" text.should == "40"
end end
Expand Down

0 comments on commit 8a601b3

Please sign in to comment.