Skip to content

[net10.0, Testing] Fix Button & RadioFeatureTests Screenshot Issue on Windows #30416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025

Conversation

HarishKumarSF4517
Copy link
Contributor

I have fixed the UI test in the PR #29281 and improved the stability for the test cases.
Build Link: Azure DevOps - Build #145495

Enhancements to Button feature tests:

  • Added steps to wait for and tap the ClickedEventLabel element in the Button_SetCharacterSpacingAndText_VerifyVisualState test case.
  • Added steps to wait for and tap the ClickedEventLabel element in the Button_SetCornerRadiusAndBorderWidth_VerifyVisualState test case.
  • Added steps to wait for and tap the ClickedEventLabel element in the Button_setFontSizeAndText_VerifyVisualState test case.

Enhancements to RadioButton feature tests:

  • Added steps to wait for and tap the SelectedValueLabelOne element in the RadioButton_SetContentAndFontSize_VerifyVisualState test case.

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 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jul 3, 2025
@anandhan-rajagopal anandhan-rajagopal added the area-testing Unit tests, device tests label Jul 3, 2025
@HarishKumarSF4517 HarishKumarSF4517 changed the title [net10, Testing] Fixed Test case failure in PR 29281 [net10.0, Testing] Fix Button & RadioFeatureTests Screenshot Issue on Windows Jul 3, 2025
@HarishKumarSF4517 HarishKumarSF4517 marked this pull request as ready for review July 3, 2025 13:17
@Copilot Copilot AI review requested due to automatic review settings July 3, 2025 13:17
@HarishKumarSF4517 HarishKumarSF4517 requested a review from a team as a code owner July 3, 2025 13:17
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

This PR enhances the stability of Button and RadioButton feature UI tests on Windows by explicitly waiting for and tapping the event label before taking screenshots.

  • Added App.WaitForElement and App.Tap steps for ClickedEventLabel in three Button tests.
  • Added App.WaitForElement and App.Tap steps for SelectedValueLabelOne in the RadioButton test.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ButtonFeatureTests.cs Added wait-and-tap steps on ClickedEventLabel before VerifyScreenshot() in three methods.
src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/RadioButtonFeatureTests.cs Added wait-and-tap steps on SelectedValueLabelOne before VerifyScreenshot().

@@ -75,6 +75,8 @@ public void Button_SetCharacterSpacingAndText_VerifyVisualState()
App.WaitForElement("Apply");
App.Tap("Apply");
App.WaitForElementTillPageNavigationSettled("ButtonControl");
App.WaitForElement("ClickedEventLabel");
Copy link
Preview

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

[nitpick] The wait-and-tap pattern for 'ClickedEventLabel' is repeated across multiple tests; consider extracting this into a shared helper to reduce duplication and simplify future updates.

Copilot uses AI. Check for mistakes.

@@ -213,6 +213,8 @@ public void RadioButton_SetContentAndFontSize_VerifyVisualState()
App.WaitForElement("Apply");
App.Tap("Apply");
App.WaitForElementTillPageNavigationSettled("RadioButtonControlOne");
App.WaitForElement("SelectedValueLabelOne");
Copy link
Preview

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

Ensure that the AutomationId 'SelectedValueLabelOne' is defined in the TestCases.HostApp UI with a unique value so the test can reliably locate the element.

Copilot uses AI. Check for mistakes.

@@ -75,6 +75,8 @@ public void Button_SetCharacterSpacingAndText_VerifyVisualState()
App.WaitForElement("Apply");
App.Tap("Apply");
App.WaitForElementTillPageNavigationSettled("ButtonControl");
App.WaitForElement("ClickedEventLabel");
Copy link
Preview

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

Verify that the AutomationId 'ClickedEventLabel' has been added to the relevant TestCases.HostApp UI page and is unique to avoid test element collisions.

Copilot uses AI. Check for mistakes.

@rmarinho
Copy link
Member

rmarinho commented Jul 3, 2025

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho merged commit d53fad6 into dotnet:net10.0 Jul 8, 2025
127 of 129 checks passed
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.

4 participants