diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-08 12:50:25 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-08 12:50:25 +0100 |
commit | 3c80a543153f8f686ec99d2d04b181b2d2c8a665 (patch) | |
tree | 679ca3921b00bd9e0904b4ad1be4e01d0a753ee9 /spec/support/wait_for_ajax.rb | |
parent | 1a942111653e9376d6275c5bd31f23cb27f58ab5 (diff) | |
parent | f5430e48b42227f1c1874ca27c6907f0f704be28 (diff) | |
download | gitlab-ce-ui/misc.tar.gz |
Merge branch 'master' into ui/miscui/misc
Diffstat (limited to 'spec/support/wait_for_ajax.rb')
-rw-r--r-- | spec/support/wait_for_ajax.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/wait_for_ajax.rb b/spec/support/wait_for_ajax.rb new file mode 100644 index 00000000000..692d219e9f1 --- /dev/null +++ b/spec/support/wait_for_ajax.rb @@ -0,0 +1,11 @@ +module WaitForAjax + def wait_for_ajax + Timeout.timeout(Capybara.default_wait_time) do + loop until finished_all_ajax_requests? + end + end + + def finished_all_ajax_requests? + page.evaluate_script('jQuery.active').zero? + end +end |