debian-mirror-gitlab/spec/support/wait_for_ajax.rb
2015-12-23 02:04:40 +05:30

11 lines
242 B
Ruby

module WaitForAjax
def wait_for_ajax
Timeout.timeout(Capybara.default_wait_time) do
loop until finished_all_ajax_requests?
end
end
def finished_all_ajax_requests?
page.evaluate_script('jQuery.active').zero?
end
end