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 3ee24b47f6..bce4ff8bd4 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();
 
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 14a2ea909e..aeb2ef49e5 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -142,9 +142,9 @@
 
 $test_list = simpletest_script_get_test_list();
 
-if (in_array('Drupal\Tests\ckeditor\FunctionalJavascript\AjaxCssTest', $test_list)) {
+if (in_array('Drupal\Tests\ckeditor\FunctionalJavascript\FormErrorHandlerCKEditorTest', $test_list)) {
   // Do the test 25 times.
-  $test_list = array_fill(0, 25, 'Drupal\Tests\ckeditor\FunctionalJavascript\AjaxCssTest');
+  $test_list = array_fill(0, 25, 'Drupal\Tests\ckeditor\FunctionalJavascript\FormErrorHandlerCKEditorTest');
 }
 else {
   $test_list = [];
