lib/testcentricity_web/web_core/page_object.rb
def wait_for_ajax(seconds = nil)
      wait_time = seconds.nil? ? Capybara.default_max_wait_time : seconds
      Timeout.timeout(wait_time) do
        loop do
          active = page.evaluate_script('jQuery.active')
          break if active.zero?
        end
      end
    end
# Wait until all AJAX requests have completed, or until the specified wait time has expired. If the wait time is nil, then
# the wait time will be Capybara.default_max_wait_time.
#
# @param seconds [Integer or Float] wait time in seconds
# @example
#   shopping_basket_page.wait_for_ajax(15)
#

Wait until all AJAX requests have completed, or until the specified wait time has expired. If the wait time is nil, then
the wait time will be Capybara.default_max_wait_time.
Wait until all AJAX requests have completed or until the specified wait time has expired . If the wait time is nil then the wait time will be Capybara . default_max_wait_time .
def wait_for_ajax(seconds = nil)
      wait_time = seconds.nil? ? Capybara.default_max_wait_time : seconds
      Timeout.timeout(wait_time) do
        loop do
          active = page.evaluate_script('jQuery.active')
          break if active.zero?
        end
      end
    end
def wait_for_ajax ( seconds = nil ) wait_time = seconds . nil? ? Capybara . default_max_wait_time : seconds Timeout . timeout ( wait_time ) do loop do active = page . evaluate_script ( 'jQuery.active' ) break if active . zero? end end end
Wait until all AJAX requests have completed, or until the specified wait time has expired.
Wait until all AJAX requests have completed or until the specified wait time has expired .
seconds
wait time in seconds
wait time in seconds
example
None