diff --git a/spec/support/wait_for_vue_resource.rb b/spec/support/wait_for_vue_resource.rb index c2d742009fd9a6d93cc77e832a06d11efc856570..3bb3d9c2e5130dd80b92f9aa9aa99a32930566ed 100644 --- a/spec/support/wait_for_vue_resource.rb +++ b/spec/support/wait_for_vue_resource.rb @@ -1,10 +1,12 @@ module WaitForVueResource def wait_for_vue_resource(spinner: true) Timeout.timeout(Capybara.default_max_wait_time) do - loop until page.evaluate_script('window.activeVueResources').zero? + loop until finished_all_vue_resource_requests? end end + private + def finished_all_vue_resource_requests? return true unless javascript_test?