Skip to content

Conversation

HarishKumarSF4517
Copy link
Contributor

This pull request updates the VerifyEditorFocusedEvent test method to be asynchronous, improving reliability by adding a short delay after tapping the editor. This ensures the focus event is properly triggered before the assertion is made.

Test reliability improvement:

  • Changed VerifyEditorFocusedEvent in EditorFeatureTests.cs to be an async Task, and added a Task.Delay(100) after tapping the editor to ensure the focus event has time to trigger before the test assertion.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 7, 2025
Copy link
Contributor

Hey there @@HarishKumarSF4517! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 7, 2025
@HarishKumarSF4517 HarishKumarSF4517 marked this pull request as ready for review October 7, 2025 13:22
@Copilot Copilot AI review requested due to automatic review settings October 7, 2025 13:22
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Stabilizes a flaky UI test by converting it to async and inserting a delay to allow the focus event to propagate before assertion.

  • Change test signature to async Task to support awaiting operations
  • Insert 100 ms Task.Delay after tapping the editor to mitigate timing race
  • Preserve existing assertion logic for the Focused event label

{
App.WaitForElement("TestEditor");
App.Tap("TestEditor");
await Task.Delay(100);
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

Using a fixed delay introduces a magic number and can remain flaky on slower CI agents while adding unnecessary wait on fast machines. Prefer a condition-based wait/poll that exits as soon as the label reflects the focused state, e.g., loop with small delays until App.WaitForElement("FocusedLabel").GetText() == "Focused: Event Triggered" or timeout. This removes the arbitrary 100 ms constant and makes the test both faster and more reliable.

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

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

I m not sure just adding the delay is going to work, do we have another way to know the keyboard is dismissed ? is there a event that fires when the keyboard is hidden ?

@rmarinho
Copy link
Member

rmarinho commented Oct 7, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@sheiksyedm sheiksyedm added the area-testing Unit tests, device tests label Oct 7, 2025
@rmarinho
Copy link
Member

rmarinho commented Oct 8, 2025

/rebase

@github-actions github-actions bot force-pushed the harish_flakytest_fix04 branch from b68c8f6 to b042bf7 Compare October 8, 2025 18:43
@rmarinho
Copy link
Member

rmarinho commented Oct 9, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants