diff -u b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php --- b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -57,18 +57,17 @@ * be displayed. */ public function waitForJavascriptActivity($timeout = 10000, $message = 'Unable to complete javascript activity.') { - $condition = << 0; -i--) { - if (Drupal.ajax.instances[i-1].ajaxing) { - return true; - } - } + if (instance) { + return !instance.ajaxing; + } + else { + return true; } - return false; } return ( @@ -78,8 +77,8 @@ jQuery(':animated').length === 0 ) ) && - Drupal.debounceCount === 0 && - !DrupalIsAjaxing() + (typeof Drupal.debounceCount === 'undefined' || Drupal.debounceCount === 0) && + Drupal.ajax.instances.every(IsNotAjaxing) ); }()); JS;