Sha256: e39a77803b2df1e0d68ff9c4c506485404acf0a3d4e92f6fb9b1e08eaf858f27

Contents?: true

Size: 378 Bytes

Versions: 142

Compression:

Stored size: 378 Bytes

Contents

# frozen_string_literal: true

module AjaxHelpers
  def wait_for_ajax(timeout = Capybara.default_max_wait_time)
    Timeout.timeout(timeout) do
      loop until finished_all_ajax_requests?
    end
  end

  def finished_all_ajax_requests?
    if page.driver.is_a? Capybara::RackTest::Driver
      true
    else
      page.evaluate_script("jQuery.active").zero?
    end
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
renalware-core-2.1.1 spec/support/ajax_helpers.rb
renalware-core-2.1.0 spec/support/ajax_helpers.rb
renalware-core-2.0.167 spec/support/ajax_helpers.rb
renalware-core-2.0.166 spec/support/ajax_helpers.rb
renalware-core-2.0.165 spec/support/ajax_helpers.rb
renalware-core-2.0.164 spec/support/ajax_helpers.rb
renalware-core-2.0.163 spec/support/ajax_helpers.rb
renalware-core-2.0.162 spec/support/ajax_helpers.rb
renalware-core-2.0.161 spec/support/ajax_helpers.rb
renalware-core-2.0.160 spec/support/ajax_helpers.rb
renalware-core-2.0.159 lib/test_support/ajax_helpers.rb
renalware-core-2.0.158 lib/test_support/ajax_helpers.rb
renalware-core-2.0.157 lib/test_support/ajax_helpers.rb
renalware-core-2.0.156 lib/test_support/ajax_helpers.rb
renalware-core-2.0.155 lib/test_support/ajax_helpers.rb
renalware-core-2.0.153 lib/test_support/ajax_helpers.rb
renalware-core-2.0.152 lib/test_support/ajax_helpers.rb
renalware-core-2.0.151 lib/test_support/ajax_helpers.rb
renalware-core-2.0.149 lib/test_support/ajax_helpers.rb
renalware-core-2.0.148 lib/test_support/ajax_helpers.rb