From fdf78bb9c71c6b3119a054adeec2bb1c55b46284 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 15 Jun 2017 19:54:09 -0700 Subject: Avoid including Capybara::DSL to conflict with definition of page --- spec/support/wait_for_requests.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'spec/support') 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? -- cgit v1.2.1