Welcome to mirror list, hosted at ThFree Co, Russian Federation.

wait_for_ajax.rb « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0f9dc2dee754e5b6035187db8446e0a9a78e35d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module WaitForAjax
  def wait_for_ajax
    Timeout.timeout(Capybara.default_max_wait_time) do
      loop until finished_all_ajax_requests?
    end
  end

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

  def javascript_test?
    [:selenium, :webkit, :chrome, :poltergeist].include?(Capybara.current_driver)
  end
end