Commit fdf78bb9 authored by Stan Hu's avatar Stan Hu

Avoid including Capybara::DSL to conflict with definition of page

parent 806ffd2c
......@@ -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?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment