otwarchive-symphonyarchive/features/support/wait_for_ajax.rb

12 lines
285 B
Ruby
Raw Normal View History

2026-03-11 22:22:11 +00:00
# from https://thoughtbot.com/blog/automatically-wait-for-ajax-with-capybara
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