[release/10.0] Source code updates from dotnet/dotnet#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96519fe962
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _originalH1Element = Browser.Exists(By.TagName("h1")); | ||
| Navigate($"{ServerPathBase}/redirect"); |
There was a problem hiding this comment.
Capture the H1 after navigating to /redirect
InitializeAsync now captures _originalH1Element before calling Navigate. The browser is reused across tests and InitializeAsync does not navigate on its own, so this element will come from whatever page was left open and becomes stale as soon as /redirect loads. The immediate _originalH1Element.Text read can then throw a StaleElementReferenceException or assert against the wrong DOM, making the test flaky. Capture the element after navigation so it points at the redirect page’s H1.
Useful? React with 👍 / 👎.
| // See that 'back' takes you to the place from before the redirection | ||
| Browser.Navigate().Back(); | ||
| Browser.Navigate().Forward(); |
There was a problem hiding this comment.
Use Back() when validating post-redirect history
This test is still documented as verifying that “back” returns to the pre-redirect page, but it now calls Browser.Navigate().Forward(). In the common case where there is no forward history, Forward() is a no-op and the browser stays on the redirected page, so the subsequent assertion for “Redirections” will fail or validate the wrong behavior. This should remain a back navigation.
Useful? React with 👍 / 👎.
| [TestMethod] | ||
| [QuarantinedTest("https://github.com/dotnet/aspnetcore/pull/63708/")] | ||
| public void NavigationException_InAsyncContext_DoesNotBecomeUnobservedTaskException() |
There was a problem hiding this comment.
Keep this test discoverable by xUnit
The E2E test project is xUnit-based (the rest of this file uses [Theory] and the project is configured for xUnit), so swapping [Fact] for MSTest’s [TestMethod] means this test will no longer be discovered or run. That silently drops coverage for the navigation-exception scenario even though it’s marked [QuarantinedTest]. Use [Fact] with [QuarantinedTest] to keep it in the xUnit pipeline.
Useful? React with 👍 / 👎.
Benchmark PR from agentic-review-benchmarks#1