Sha256: 2c65272bb1a60c6faa7c7767347cc8b8cd74314c2f9ffb24e66cdc17f92e8cc8
Contents?: true
Size: 476 Bytes
Versions: 20
Compression:
Stored size: 476 Bytes
Contents
module CucumberWaitAjaxRequests 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(CucumberWaitAjaxRequests) # Auto wait ajax request between steps AfterStep do |scenario| if page.evaluate_script('typeof jQuery') != "undefined" wait_ajax_requests end end
Version data entries
20 entries across 20 versions & 1 rubygems