Sha256: b2e60a8faee77484af95556b6ec11296f9630ee744161dce67bd5278f98ebabf
Contents?: true
Size: 467 Bytes
Versions: 73
Compression:
Stored size: 467 Bytes
Contents
module CapybaraWaitAjaxRequests def wait_ajax_requests(timeout = Capybara.default_max_wait_time) Timeout.timeout(timeout) do sleep 0.1 until all_ajax_requests_finished? end end def all_ajax_requests_finished? page.evaluate_script("jQuery.active").zero? end end World(CapybaraWaitAjaxRequests) # Auto wait ajax request between steps AfterStep do |_scenario| wait_ajax_requests if page.evaluate_script("typeof jQuery") != "undefined" end
Version data entries
73 entries across 73 versions & 1 rubygems