mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 21:56:19 +10:00
Make sure we wait for AJAX request to finish before end test and cleanup database Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
12 lines
242 B
Ruby
12 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
|