Skip to content

Commit 249f03a

Browse files
committed
Feedback.
1 parent a6856fc commit 249f03a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ private void AssertEnhancedNavigation(bool useEnhancedNavigation, IWebElement el
834834
{
835835
bool enhancedNavigationDetected = false;
836836
string logging = "";
837+
string isNavigationSuppressed = "";
837838
for (int i = 0; i < retryCount; i++)
838839
{
839840
try
@@ -856,18 +857,17 @@ private void AssertEnhancedNavigation(bool useEnhancedNavigation, IWebElement el
856857
var suppressKey = $"suppress-enhanced-navigation-{testId}";
857858

858859
var enhancedNavAttached = ((IJavaScriptExecutor)Browser).ExecuteScript("return sessionStorage.getItem('blazor-enhanced-nav-attached');");
859-
var suppressEnhancedNavigation = ((IJavaScriptExecutor)Browser).ExecuteScript($"return sessionStorage.getItem('{suppressKey}');");
860+
isNavigationSuppressed = (string)((IJavaScriptExecutor)Browser).ExecuteScript($"return sessionStorage.getItem('{suppressKey}');");
860861

861862
logging += $" suppressKey: {suppressKey}\n";
862-
logging += $" {suppressKey}: {suppressEnhancedNavigation}\n";
863+
logging += $" {suppressKey}: {isNavigationSuppressed}\n";
863864
// Maybe the check was done too early to change the DOM ref, retry
864865
}
865866

866867
Thread.Sleep(delayBetweenRetriesMs);
867868
}
868869
string expectedNavigation = useEnhancedNavigation ? "enhanced navigation" : "full page load";
869870
string isStale = enhancedNavigationDetected ? "is not stale" : "is stale";
870-
var isNavigationSuppressed = (string)((IJavaScriptExecutor)Browser).ExecuteScript("return sessionStorage.getItem('suppress-enhanced-navigation');");
871871
throw new Exception($"Expected to use {expectedNavigation} because 'suppress-enhanced-navigation' is set to {isNavigationSuppressed} but the element from previous path {isStale}. logging={logging}");
872872
}
873873

0 commit comments

Comments
 (0)