diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
index 4e519f6f8b..fe3ec3e307 100644
--- a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
+++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php
@@ -525,4 +525,63 @@ public function testValidationMessages() {
     }
   }
 
+  /**
+   * Test opening multiple forms with saving them.
+   */
+  public function testOpeningMultipleForms() {
+    $block_plugins = [
+      'search_form_block',
+      'system_branding_block',
+      'system_powered_by_block',
+    ];
+
+    foreach ($this->getTestThemes() as $theme) {
+      $this->enableTheme($theme);
+      /** @var \Drupal\block\Entity\Block[] $blocks */
+      $blocks = [];
+      foreach ($block_plugins as $block_plugin) {
+        $blocks[$block_plugin] = $this->placeBlock($block_plugin);
+      }
+      $this->drupalGet('user');
+      $this->enableEditMode();
+
+      // Test first with different blocks and then with the same block.
+      $block_groups = [
+        $blocks,
+        [
+          $blocks['system_branding_block'],
+          $blocks['system_branding_block'],
+          $blocks['system_branding_block'],
+        ],
+      ];
+      foreach ($block_groups as $block_group) {
+        // Keep reopening block forms with out closing them.
+        foreach ($block_group as $block) {
+          $this->openBlockForm($this->getBlockSelector($block));
+        }
+
+        $this->drupalGet('user');
+        // Keeping opening block forms but close them in between.
+        foreach ($block_group as $block) {
+          $this->openBlockForm($this->getBlockSelector($block));
+          $this->closeOffCanvasDialog();
+        }
+      }
+
+      // Delete all blocks for each theme before enabling a new theme.
+      foreach ($blocks as $block) {
+        $block->delete();
+      }
+      $this->disableEditMode();
+    }
+  }
+
+  /**
+   * Closes the off-canvas dialog.
+   */
+  protected function closeOffCanvasDialog() {
+    $this->getSession()->getPage()->find('css', '.ui-dialog .ui-dialog-titlebar-close')->click();
+    $this->waitForNoElement('#drupal-off-canvas');
+  }
+
 }
