Skip to content

Commit 81aa6e3

Browse files
csharpfritzCopilot
andcommitted
fix: use Expect assertion for redirect test to avoid CI timeouts
The Redirect_NavigatesToSessionPage test timed out on CI because WaitForURLAsync relies on navigation lifecycle events which are slow when Blazor Server routes through SignalR -> JS interop -> location.href. Switch to Playwright's auto-retrying Expect(page).ToHaveURLAsync which polls the URL property directly, with a 60s timeout for slow CI runners. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c3fc7a1 commit 81aa6e3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

samples/AfterBlazorServerSide.Tests/Migration/ResponseRedirectTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ await page.WaitForFunctionAsync("typeof window.__doPostBack === 'function'",
4141

4242
await button.ClickAsync();
4343

44-
// forceLoad: true triggers full page navigation
45-
await page.WaitForURLAsync("**/migration/session", new PageWaitForURLOptions
46-
{
47-
WaitUntil = WaitUntilState.Load,
48-
Timeout = 30000
49-
});
44+
// forceLoad: true goes through SignalR → JS interop → location.href,
45+
// which can be slow on CI. Use auto-retrying Expect assertion instead
46+
// of WaitForURLAsync, which depends on navigation lifecycle events.
47+
await Assertions.Expect(page).ToHaveURLAsync(
48+
new System.Text.RegularExpressions.Regex(".*migration/session.*"),
49+
new PageAssertionsToHaveURLOptions { Timeout = 60000 });
5050

5151
Assert.Contains("/migration/session", page.Url);
5252
}

0 commit comments

Comments
 (0)