Skip to content

Instantly share code, notes, and snippets.

@nowk
Last active June 10, 2016 01:07
Show Gist options
  • Save nowk/4747980 to your computer and use it in GitHub Desktop.
Save nowk/4747980 to your computer and use it in GitHub Desktop.
Capybara waits for AJAX (angular & jquery)
def wait_for_ajax(timeout = 5) #Timeout in seconds
page.wait_until(timeout) do
page.evaluate_script "angular.element.active == 0 && jQuery.active == 0"
end
end
@Bartuz
Copy link

Bartuz commented Oct 1, 2015

any solutions to waiting for angularJS ajax?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment