gitlab-org--gitlab-foss/spec/support/wait_for_ajax.rb
2016-03-15 11:03:17 -07:00

11 lines
246 B
Ruby

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