gitlab-org--gitlab-foss/features/support/wait_for_ajax.rb

12 lines
246 B
Ruby
Raw Normal View History

2016-08-12 05:10:59 -04:00
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