Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,10 @@ public void CanUpdateHrefOnLinkTagWithIntegrity()
}

[Theory]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/60875")]
[InlineData(false, false, false)]
// [InlineData(false, false, false)] // https://github.com/dotnet/aspnetcore/issues/60875
[InlineData(false, true, false)]
[InlineData(true, true, false)]
[InlineData(true, false, false)]
// [InlineData(true, false, false)] // https://github.com/dotnet/aspnetcore/issues/60875
// [InlineData(false, false, true)] programmatic navigation doesn't work without enhanced navigation
[InlineData(false, true, true)]
[InlineData(true, true, true)]
Expand Down Expand Up @@ -723,9 +722,9 @@ public void EnhancedNavigationScrollBehavesSameAsBrowserOnNavigation(bool enable
}

[Theory]
[InlineData(false, false, false)]
[InlineData(false, false, false)] // https://github.com/dotnet/aspnetcore/issues/60875
[InlineData(false, true, false)]
[InlineData(true, true, false)]
[InlineData(true, true, false)] // https://github.com/dotnet/aspnetcore/issues/60875
[InlineData(true, false, false)]
// [InlineData(false, false, true)] programmatic navigation doesn't work without enhanced navigation
[InlineData(false, true, true)]
Expand Down Expand Up @@ -819,7 +818,7 @@ private void AssertScrollPositionCorrect(bool useEnhancedNavigation, long previo
Assert.True(success, $"The expected scroll position was {messagePart}, but it was found at {currentScrollPosition}.");
}

private void AssertEnhancedNavigation(bool useEnhancedNavigation, IWebElement elementForStalenessCheck, int retryCount = 3, int delayBetweenRetriesMs = 100)
private void AssertEnhancedNavigation(bool useEnhancedNavigation, IWebElement elementForStalenessCheck, int retryCount = 3, int delayBetweenRetriesMs = 1000)
{
bool enhancedNavigationDetected = false;
for (int i = 0; i < retryCount; i++)
Expand Down
15 changes: 6 additions & 9 deletions src/Components/test/E2ETest/Tests/RoutingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,16 +571,13 @@ public void NavigationToSamePathDoesNotScrollToTheTop()
BrowserScrollY = maxScrollPosition;

app.FindElement(By.Id("do-self-navigate")).Click();
var scrollPosition = BrowserScrollY;
Assert.True(scrollPosition == maxScrollPosition, "Expected to stay scrolled down.");
WaitAssert.True(Browser, () => maxScrollPosition == BrowserScrollY, default, $"Expected to stay scrolled down in {maxScrollPosition} but the scroll is in position {BrowserScrollY}.");

app.FindElement(By.Id("do-self-navigate-with-query")).Click();
scrollPosition = BrowserScrollY;
Assert.True(scrollPosition == maxScrollPosition, "Expected to stay scrolled down.");
WaitAssert.True(Browser, () => maxScrollPosition == BrowserScrollY, default, $"Expected to stay scrolled down in {maxScrollPosition} but the scroll is in position {BrowserScrollY}.");

app.FindElement(By.Id("do-self-navigate-to-fragment")).Click();
scrollPosition = BrowserScrollY;
Assert.True(scrollPosition == fragmentScrollPosition, "Expected to scroll to the fragment.");
WaitAssert.True(Browser, () => fragmentScrollPosition == BrowserScrollY, default, $"Expected to scroll to the fragment in position {fragmentScrollPosition} but the scroll is in position {BrowserScrollY}.");
}

[Fact]
Expand Down Expand Up @@ -1840,11 +1837,11 @@ public void NavigationManagerNavigateToSameUrlWithParamQueryAndHash_ScrollsToEle

app.FindElement(By.Id("navigate-test1-with-param-and-query")).Click();

var currentWindowScrollY = BrowserScrollY;
var test1VerticalLocation = app.FindElement(By.Id("test1")).Location.Y;
var currentRelativeUrl = _serverFixture.RootUri.MakeRelativeUri(new Uri(Browser.Url)).ToString();
Assert.Equal("subdir/LongPageWithHash/22?color=green&number=123#test1", currentRelativeUrl);
Assert.Equal(test1VerticalLocation, currentWindowScrollY);
string expectedUrl = "subdir/LongPageWithHash/22?color=green&number=123#test1";
WaitAssert.True(Browser, () => expectedUrl == currentRelativeUrl, default, $"Expected {expectedUrl} but got {currentRelativeUrl}");
WaitAssert.True(Browser, () => BrowserScrollY == test1VerticalLocation, default, $"Expected {test1VerticalLocation} but got {BrowserScrollY}");
}

private long BrowserScrollY
Expand Down
Loading