diff --git a/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php b/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php index 3ee24b47f6112cfe16ca099baa0bd0ec375af4a8..bce4ff8bd47fb1cd00722916b7fbdcca6576e903 100644 --- a/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php +++ b/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php @@ -82,8 +82,6 @@ public function testFragmentLink() { $this->drupalGet('node/add/page'); - $page = $this->getSession()->getPage(); - // Only enter a title in the node add form and leave the body field empty. $edit = ['edit-title-0-value' => 'Test inline form error with CKEditor']; @@ -99,8 +97,8 @@ public function testFragmentLink() { // Check if we can find the error fragment link within the errors summary // message. - $errors_link = $page->find('css', '.messages--error a[href=\#edit-body-0-value]'); - $this->assertTrue($errors_link->isVisible(), 'Error fragment link is visible.'); + $errors_link = $this->assertSession()->waitForElementVisible('css', '.messages--error a[href="#edit-body-0-value"]'); + $this->assertNotEmpty($errors_link, 'Error fragment link is visible.'); $errors_link->click();