From c46c847140e5f77a512e6dd9c29a195cc6470c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 25 Nov 2026 15:10:02 +0100 Subject: [PATCH] Stabilize persisted state Auto render test Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../test/E2ETest/Tests/StatePersistenceTest.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Components/test/E2ETest/Tests/StatePersistenceTest.cs b/src/Components/test/E2ETest/Tests/StatePersistenceTest.cs index 983080f7d8dd..f8ae89ea4595 100644 --- a/src/Components/test/E2ETest/Tests/StatePersistenceTest.cs +++ b/src/Components/test/E2ETest/Tests/StatePersistenceTest.cs @@ -83,11 +83,9 @@ public void CanRenderComponentWithPersistedState(bool suppressEnhancedNavigation } else { + // For auto mode, the WebAssembly resource load is blocked on the destination page right before + // Blazor starts. The page loaded here auto-starts Blazor, which would consume the one-shot block flag. EnhancedNavigationTestUtil.SuppressEnhancedNavigation(this, true); - if (mode == "auto") - { - BlockWebAssemblyResourceLoad(); - } } if (mode != "auto") @@ -419,6 +417,11 @@ private void RenderComponentsWithPersistentStateAndValidate( streamingCompleted: false, interactiveRuntime: interactiveRuntime); + if (mode == "auto" && interactiveRuntime == "server") + { + BlockWebAssemblyResourceLoad(); + } + Browser.Click(By.Id("call-blazor-start")); }