only in patch2: unchanged: --- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -88,11 +88,15 @@ public function waitForElement($selector, $locator, $timeout = 10000) { * @see \Behat\Mink\Element\ElementInterface::findAll() */ public function waitForElementVisible($selector, $locator, $timeout = 10000) { - $page = $this->session->getPage(); + $session = $this->session; + $page = $session->getPage(); - $result = $page->waitFor($timeout / 1000, function() use ($page, $selector, $locator) { + $result = $page->waitFor($timeout / 1000, function() use ($session, $page, $selector, $locator, $timeout) { $element = $page->find($selector, $locator); if (!empty($element) && $element->isVisible()) { + // Make sure no elements are animating before returning. + $session->wait($timeout, "(typeof jQuery === 'undefined' || jQuery(':animated').length === 0)"); + return $element; } return NULL;