Skip to content

Commit 704ecdd

Browse files
committed
do I need to wait for tubojs
1 parent 9238d30 commit 704ecdd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/support/wait_for_ajax.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module WaitForAjax
44
def wait_for_ajax
5+
wait_for_turbojs
6+
57
start_time = Time.current
68
timeout = Capybara.default_max_wait_time
79

@@ -11,6 +13,11 @@ def wait_for_ajax
1113
end
1214
end
1315

16+
def wait_for_turbojs
17+
has_css?('.turbo-progress-bar', visible: true)
18+
has_no_css?('.turbo-progress-bar')
19+
end
20+
1421
def ajax_requests_finished?
1522
# This method MUST NOT be interrupted. Hence, Timeout.timeout is not used here.
1623
# Otherwise, Selenium and the browser driver might crash, preventing further tests from running.

0 commit comments

Comments
 (0)