diff -u b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php --- b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php @@ -90,8 +90,9 @@ if (isset($new_page_text)) { $page->pressButton($button_text); - // Make sure the changes are present. - $this->assertJsCondition('jQuery("' . $block_selector . ' ' . $label_selector . '").html() == "' . $new_page_text . '"'); + // Make sure the changes are present. Use this method to give the browser + // some time to reload the page. + $this->assertElementHtmlEquals($block_selector . ' ' . $label_selector, $new_page_text); } $this->openBlockForm($block_selector); only in patch2: unchanged: --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -94,6 +94,36 @@ protected function assertElementNotVisible($css_selector, $message = '') { } /** + * Asserts that an element with the given css selector contains the given html. + * + * The assertion will wait the default timeout for the element to contain the + * given HTML. + * + * @param string $css_selector + * The CSS selector identifying the element to check. + * @param string $html + * The expected HTML. + */ + protected function assertElementHtmlEquals($css_selector, $html) { + $this->assertJsCondition('jQuery("' . $css_selector . '").html() == "' . $html . '"'); + } + + /** + * Asserts that an element with the given css selector equals the given html. + * + * The assertion will wait the default timeout for the element to not contain + * the given HTML. + * + * @param string $css_selector + * The CSS selector identifying the element to check. + * @param string $html + * The expected HTML. + */ + protected function assertElementHtmlNotEquals($css_selector, $html) { + $this->assertJsCondition('jQuery("' . $css_selector . '").html() != "' . $html . '"'); + } + + /** * Waits for the given time or until the given JS condition becomes TRUE. * * @param string $condition