Commit 116b9e50046002c4fd000b534b43840c6f15688c

Authored by Heitor
Committed by Daniel
1 parent 8913b9b6

Disabled jQuery animations during tests

jQuery animations make acceptance tests unreliable due to the way
PhantomJS, Poltergeist and Capybara interact.
To click on an element, Capybara finds it's position in the screen, then
literally clicks at the element's x and y coordinates. This works fine
if the element does not move, but if the element is being shown by an
animation, it will move, and the click will miss.

This caused some tests, like the one for Ruby metric configuration
creation, to fail sporadically. Using jQuery's mechanism for globally
disabling animations only during tests seems to fix the unreliability
(20 out of 20 runs of the Ruby metric conf. test succeded).

Signed-off-by: Daniel Miranda <danielkza2@gmail.com>
Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
app/assets/javascripts/testing.js.erb 0 → 100644
... ... @@ -0,0 +1,3 @@
  1 +<% if Rails.env == "test" %>
  2 + $(function(evt) { $.fx.off = true; });
  3 +<% end %>
... ...