Skip to content

[test-quarantine] Fix Flaky test: FormsInputDateTest.InputDateInteractsWithEditContext_NullableDateTimeOffset - #67513

Closed
NanthiniMahalingam wants to merge 17 commits into
dotnet:mainfrom
NanthiniMahalingam:flakytest-67243
Closed

[test-quarantine] Fix Flaky test: FormsInputDateTest.InputDateInteractsWithEditContext_NullableDateTimeOffset#67513
NanthiniMahalingam wants to merge 17 commits into
dotnet:mainfrom
NanthiniMahalingam:flakytest-67243

Conversation

@NanthiniMahalingam

@NanthiniMahalingam NanthiniMahalingam commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Bug Description

  • The E2E test InputDateInteractsWithEditContext_NullableDateTimeOffset in FormsInputDateTest.cs is intermittently failing.

Description of code changes

  • I have set the native date-input values directly (with ISO-formatted strings) and dispatching the change event, instead of simulating locale-sensitive keystrokes into the browser's native date picker.
  • Also updates the BlazorWasmTestAppFixture to use the Gateway:PathBase config key and map the SPA fallback file so the test host serves the app correctly.

Fixes #67243,
Fixes #31734,
Fixes #35018

Output

Before
image

image

After
image

image

@NanthiniMahalingam
NanthiniMahalingam marked this pull request as ready for review July 7, 2026 08:11
@NanthiniMahalingam
NanthiniMahalingam requested a review from a team as a code owner July 7, 2026 08:11
Copilot AI review requested due to automatic review settings July 7, 2026 08:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses intermittent flakiness in the FormsInputDateTest.InputDateInteractsWithEditContext_NullableDateTimeOffset E2E test by avoiding locale- and timing-sensitive SendKeys interactions with native date/time inputs, and improves the WASM test host configuration so the app is served correctly behind the Blazor Gateway.

Changes:

  • Replace SendKeys-driven interactions with a JS helper that sets native date/time input values directly (ISO-formatted) and dispatches a change event.
  • Enable SPA fallback static web asset generation for BasicTestApp to support correct fallback routing when served via static web assets.
  • Update the WASM test app fixture to configure path base using the Gateway:PathBase configuration key.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj Enables static web asset SPA fallback generation for the test app.
src/Components/test/E2ETest/Tests/FormsInputDateTest.cs Switches date/time input interactions to deterministic JS value setting + change dispatch to reduce flakiness.
src/Components/test/E2ETest/Infrastructure/ServerFixtures/BlazorWasmTestAppFixture.cs Passes path base via Gateway:PathBase so the Blazor Gateway applies it correctly.

Comment on lines 109 to +112
// Can become invalid
// Stricly speaking the following is equivalent to the empty state, because that's how incomplete input is represented
// We don't know of any way to produce a different (non-empty-equivalent) state using UI gestures, so there's nothing else to test
departureTimeInput.SendKeys($"20{Keys.Backspace}\t");
SetDateInputValue(departureTimeInput, "");
@Youssef1313

Copy link
Copy Markdown
Member

Per #35018 (comment), the issue for this test should be only affecting the 8 and 9 release branches, and the test is expected to already be stable on main.

Were you able to reproduce a test failure on main?

@ilonatommy if you can look at this community PR.

@ilonatommy

Copy link
Copy Markdown
Member

Per #35018 (comment), the issue for this test should be only affecting the 8 and 9 release branches, and the test is expected to already be stable on main.

Were you able to reproduce a test failure on main?

@ilonatommy if you can look at this community PR.

Exactly, I think this PR is trying to address to many issues at the same time, without a clear explanation how did they reproduce the failure, what was the hit rate, with unrelated changes already merged in #67903. The mentioned tests are not even quarantined, it's most probably mis-targetted.

@ilonatommy

Copy link
Copy Markdown
Member

Closing in favor of #68107. We don't want to change the nature of the tests, executing JS script is not same as invoking SendKeys by Selenium.

@ilonatommy ilonatommy closed this Jul 30, 2026
@NanthiniMahalingam NanthiniMahalingam changed the title Fix Flaky test: FormsInputDateTest.InputDateInteractsWithEditContext_NullableDateTimeOffset [test-quarantine] Fix Flaky test: FormsInputDateTest.InputDateInteractsWithEditContext_NullableDateTimeOffset Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants