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.0.40 lib/test_support/ajax_helpers.rb
renalware-core-2.0.39 lib/test_support/ajax_helpers.rb
renalware-core-2.0.38 lib/test_support/ajax_helpers.rb
renalware-core-2.0.37 lib/test_support/ajax_helpers.rb
renalware-core-2.0.36 lib/test_support/ajax_helpers.rb
renalware-core-2.0.35 lib/test_support/ajax_helpers.rb
renalware-core-2.0.34 lib/test_support/ajax_helpers.rb
renalware-core-2.0.33 lib/test_support/ajax_helpers.rb
renalware-core-2.0.32 lib/test_support/ajax_helpers.rb
renalware-core-2.0.31 lib/test_support/ajax_helpers.rb
renalware-core-2.0.30 lib/test_support/ajax_helpers.rb
renalware-core-2.0.28 lib/test_support/ajax_helpers.rb
renalware-core-2.0.27 lib/test_support/ajax_helpers.rb
renalware-core-2.0.26 lib/test_support/ajax_helpers.rb
renalware-core-2.0.25 lib/test_support/ajax_helpers.rb
renalware-core-2.0.24 lib/test_support/ajax_helpers.rb
renalware-core-2.0.23 lib/test_support/ajax_helpers.rb
renalware-core-2.0.22 lib/test_support/ajax_helpers.rb
renalware-core-2.0.21 lib/test_support/ajax_helpers.rb
renalware-core-2.0.20 lib/test_support/ajax_helpers.rb