diff options
-rw-r--r-- | spec/support/wait_for_requests.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/support/wait_for_requests.rb b/spec/support/wait_for_requests.rb index 4712ecc658c..1cbe609c0e0 100644 --- a/spec/support/wait_for_requests.rb +++ b/spec/support/wait_for_requests.rb @@ -3,8 +3,6 @@ require_relative './wait_for_requests' module WaitForRequests extend self - include Capybara::DSL - # This is inspired by http://www.salsify.com/blog/engineering/tearing-capybara-ajax-tests def block_and_wait_for_requests_complete Gitlab::Testing::RequestBlockerMiddleware.block_requests! @@ -42,13 +40,13 @@ module WaitForRequests end def finished_all_vue_resource_requests? - page.evaluate_script('window.activeVueResources || 0').zero? + Capybara.page.evaluate_script('window.activeVueResources || 0').zero? end def finished_all_ajax_requests? - return true if page.evaluate_script('typeof jQuery === "undefined"') + return true if Capybara.page.evaluate_script('typeof jQuery === "undefined"') - page.evaluate_script('jQuery.active').zero? + Capybara.page.evaluate_script('jQuery.active').zero? end def javascript_test? |