diff --git a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs index c7f52c3c155e..5b28c9d299ac 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs @@ -989,7 +989,4 @@ private static Func ElementWithTextAppears(By selector, string // Ensure we actually observed the new content, not just the presence of the element. return string.Equals(elements[0].Text, expectedText, StringComparison.Ordinal); }; - - private static bool IsElementStale(IWebElement element) - => EnhancedNavigationTestUtil.IsElementStale(element); } diff --git a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTestUtil.cs b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTestUtil.cs index 12fac8e74548..1fa7b8fce9e3 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTestUtil.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTestUtil.cs @@ -97,17 +97,4 @@ public static long GetScrollY(this IWebDriver browser) public static long SetScrollY(this IWebDriver browser, long value) => Convert.ToInt64(((IJavaScriptExecutor)browser).ExecuteScript($"window.scrollTo(0, {value})"), CultureInfo.CurrentCulture); - - public static bool IsElementStale(IWebElement element) - { - try - { - _ = element.Enabled; - return false; - } - catch (StaleElementReferenceException) - { - return true; - } - } } diff --git a/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs index 4ea368a72437..4fe0a5d42647 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/InteractivityTest.cs @@ -1308,7 +1308,7 @@ public void CanPerformNavigateToFromInteractiveEventHandler(bool suppressEnhance // Verify the elements were preserved if and only if they should be var shouldPreserveElements = !suppressEnhancedNavigation && !forceLoad; - Assert.Equal(shouldPreserveElements, !EnhancedNavigationTestUtil.IsElementStale(originalNavElem)); + Assert.Equal(shouldPreserveElements, !originalNavElem.IsStale()); } private void BlockWebAssemblyResourceLoad()