Skip to content

Instantly share code, notes, and snippets.

@dsantuc
Created April 25, 2018 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsantuc/236e8080c7ac1d1476125e3cc4f14b3f to your computer and use it in GitHub Desktop.
Save dsantuc/236e8080c7ac1d1476125e3cc4f14b3f to your computer and use it in GitHub Desktop.
// Behat code to wait for ajax calls to complete
public function waitForAjax ($seconds=5) {
if(!$this->getSession()->wait((1000 * $seconds), "jQuery.active == 0")) {
throw new Exception("Ajax calls still pending after $seconds seconds.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment