-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Reduce Capybara max wait time on Ajax handling.
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#https://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara | ||
module WaitForAjax | ||
def wait_for_ajax | ||
Timeout.timeout(Capybara.default_max_wait_time = 40) do | ||
Timeout.timeout(Capybara.default_max_wait_time = 30) do | ||
loop until finished_all_ajax_requests? | ||
end | ||
end | ||
|
||
def finished_all_ajax_requests? | ||
page.evaluate_script('jQuery.active').zero? | ||
end | ||
end | ||
end |