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.10.4 spec/support/wait_for_ajax.rb
tabulatr2-0.10.3 spec/support/wait_for_ajax.rb
tabulatr2-0.10.2 spec/support/wait_for_ajax.rb
tabulatr2-0.10.1 spec/support/wait_for_ajax.rb
tabulatr2-0.10.0 spec/support/wait_for_ajax.rb
tabulatr2-0.9.48 spec/support/wait_for_ajax.rb
tabulatr2-0.9.47 spec/support/wait_for_ajax.rb
tabulatr2-0.9.46 spec/support/wait_for_ajax.rb
tabulatr2-0.9.45 spec/support/wait_for_ajax.rb
tabulatr2-0.9.44 spec/support/wait_for_ajax.rb
tabulatr2-0.9.43 spec/support/wait_for_ajax.rb
tabulatr2-0.9.42 spec/support/wait_for_ajax.rb
tabulatr2-0.9.41 spec/support/wait_for_ajax.rb
tabulatr2-0.9.40 spec/support/wait_for_ajax.rb
tabulatr2-0.9.39 spec/support/wait_for_ajax.rb
tabulatr2-0.9.38 spec/support/wait_for_ajax.rb
tabulatr2-0.9.37 spec/support/wait_for_ajax.rb
tabulatr2-0.9.36 spec/support/wait_for_ajax.rb
tabulatr2-0.9.35 spec/support/wait_for_ajax.rb
tabulatr2-0.9.34 spec/support/wait_for_ajax.rb