diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-10-18 20:53:39 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-20 18:03:13 +0300 |
commit | 33ee90b4efd64cebe1d3919d553cf15f64b4ca56 (patch) | |
tree | b0e4802908430d8281542425bdd22c2282e18430 /spec | |
parent | 9adc3f4ca3ceee01f6abf6ec6ea29a02d045244c (diff) |
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.rb | 4 |
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 |