summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-18 17:53:39 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-18 17:53:39 +0000
commit7bc5598a72aaa7bf16577cd59c17f72ac0062142 (patch)
tree788d44b051963176d799e25f076d5a0e86eb4471 /spec
parent136ea6940792b0cd9814856a72fee5fd872c2be3 (diff)
parent82033e2edc43b34823625f886f229e5ae944d4d6 (diff)
downloadgitlab-ce-7bc5598a72aaa7bf16577cd59c17f72ac0062142.tar.gz
Merge branch 'dz-spinach-wait-ajax' into 'master'
Wait for ajax for every merge request spinach test ## What does this MR do? * removes duplicate `WaitForAjax` module * ensure we run `wait_for_ajax`after each MR spinach tests ## Why was this MR needed? Because when visit MR page we do ajax call to check CI status. When testing this page with spinach and JS driver we got random failing tests. It happens because of race condition db cleaner drop data before ajax call finished. So we make sure that every MR spinach scenario with js driver waits for ajax before running next scenario ## What are the relevant issue numbers? Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/23461 See merge request !6959
Diffstat (limited to 'spec')
-rw-r--r--spec/support/wait_for_ajax.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/support/wait_for_ajax.rb b/spec/support/wait_for_ajax.rb
index b90fc112671..0f9dc2dee75 100644
--- a/spec/support/wait_for_ajax.rb
+++ b/spec/support/wait_for_ajax.rb
@@ -8,4 +8,8 @@ module WaitForAjax
def finished_all_ajax_requests?
page.evaluate_script('jQuery.active').zero?
end
+
+ def javascript_test?
+ [:selenium, :webkit, :chrome, :poltergeist].include?(Capybara.current_driver)
+ end
end