diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index c8fd185..2936723 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -112,14 +112,6 @@ $test_list = simpletest_script_get_test_list(); -if (in_array('Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest', $test_list)) { - // Do the test 50 times. - $test_list = array_fill(0, 50, 'Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest'); -} -else { - $test_list = []; -} - // Try to allocate unlimited time to run the tests. drupal_set_time_limit(0); simpletest_script_reporter_init(); diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php index ba52f47..46f6017 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -22,15 +22,10 @@ class JSWebAssert extends WebAssert { * be displayed. */ public function assertWaitOnAjaxRequest($timeout = 10000, $message = 'Unable to complete AJAX request.') { - $condition = '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))'; - $result = $this->session->wait($timeout, $condition); + $result = $this->session->wait($timeout, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))'); if (!$result) { throw new \RuntimeException($message); } - // In the end we enforce that our condition is now always TRUE, otherwise we - // fail the test. - $result = $this->session->evaluateScript($condition); - $this->assert($result, $message); } /** diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php index 53a60c3..d5156ee 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -50,9 +50,7 @@ protected function tearDown() { if ($this->mink) { // Wait for all requests to finish. It is possible that an AJAX request is // still on-going. - $condition = '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))'; - $this->getSession()->wait(10000, $condition); - $result = $this->getSession()->evaluateScript($condition); + $result = $this->getSession()->wait(5000, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))'); if (!$result) { // If the wait is unsuccessful, there may still be an AJAX request in // progress. If we tear down now, then this AJAX request may fail with @@ -112,10 +110,7 @@ protected function assertElementNotVisible($css_selector, $message = '') { */ protected function assertJsCondition($condition, $timeout = 10000, $message = '') { $message = $message ?: "Javascript condition met:\n" . $condition; - $this->getSession()->wait($timeout, $condition); - // In the end we enforce that our condition is now always TRUE, otherwise we - // fail the test. - $result = $this->getSession()->evaluateScript($condition); + $result = $this->getSession()->getDriver()->wait($timeout, $condition); $this->assertTrue($result, $message); }