diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php
index e7ae850d42..d2bdbba2dc 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php
@@ -84,6 +84,7 @@ public function testFieldBlock() {
     $assert_session->fieldNotExists('settings[formatter][settings][format_type]');
     $assert_session->fieldExists('settings[formatter][settings][granularity]');
     $page->pressButton('Save block');
+    $assert_session->waitForText('The block configuration has been saved.');
     $assert_session->pageTextContains('The block configuration has been saved.');
 
     // Configure the block and change the formatter again.
@@ -94,6 +95,7 @@ public function testFieldBlock() {
     $page->selectFieldOption('settings[formatter][settings][format_type]', 'long');
 
     $page->pressButton('Save block');
+    $assert_session->waitForText('The block configuration has been saved.');
     $assert_session->pageTextContains('The block configuration has been saved.');
 
     // Assert that the field value is updated.
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
index 10ae701533..c18aed420d 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php
@@ -100,6 +100,22 @@ public function waitForElementVisible($selector, $locator, $timeout = 10000) {
 
     return $result;
   }
+
+  /**
+   * Waits for the specified text and returns its element when available.
+   *
+   * @param string $text
+   *   The text to wait for.
+   * @param int $timeout
+   *   (Optional) Timeout in milliseconds, defaults to 10000.
+   *
+   * @return \Behat\Mink\Element\NodeElement|null
+   *   The page element node if found and visible, NULL if not.
+   */
+  public function waitForText($text, $timeout = 10000) {
+    return $this->waitForElement('css', '*:contains(' . $text . ')', $timeout);
+  }
+
   /**
    * Waits for a button (input[type=submit|image|button|reset], button) with
    * specified locator and returns it.
