Sha256: 2979efe324d156310c8db0338cb598084242169f69ba502e8436254b02cc546c

Contents?: true

Size: 397 Bytes

Versions: 38

Compression:

Stored size: 397 Bytes

Contents

# from http://robots.thoughtbot.com/automatically-wait-for-ajax-with-capybara
module WaitForAjax
  def wait_for_ajax
    Timeout.timeout(Capybara.default_wait_time) do
      loop until finished_all_ajax_requests?
    end
  end

  def finished_all_ajax_requests?
    page.evaluate_script('jQuery.active').zero?
  end
end

RSpec.configure do |config|
  config.include WaitForAjax, type: :feature
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
tabulatr2-0.9.33 spec/support/wait_for_ajax.rb
tabulatr2-0.9.32 spec/support/wait_for_ajax.rb
tabulatr2-0.9.31 spec/support/wait_for_ajax.rb
tabulatr2-0.9.30 spec/support/wait_for_ajax.rb
tabulatr2-0.9.29 spec/support/wait_for_ajax.rb
tabulatr2-0.9.28 spec/support/wait_for_ajax.rb
tabulatr2-0.9.27 spec/support/wait_for_ajax.rb
tabulatr2-0.9.26 spec/support/wait_for_ajax.rb
tabulatr2-0.9.25 spec/support/wait_for_ajax.rb
tabulatr2-0.9.24 spec/support/wait_for_ajax.rb
tabulatr2-0.9.23 spec/support/wait_for_ajax.rb
tabulatr2-0.9.22 spec/support/wait_for_ajax.rb
tabulatr2-0.9.21 spec/support/wait_for_ajax.rb
tabulatr2-0.9.20 spec/support/wait_for_ajax.rb
tabulatr2-0.9.19 spec/support/wait_for_ajax.rb
tabulatr2-0.9.18 spec/support/wait_for_ajax.rb
tabulatr2-0.9.17 spec/support/wait_for_ajax.rb
tabulatr2-0.9.16 spec/support/wait_for_ajax.rb