-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[net10.0, Testing] Fix LabelFeatureTests Screenshot Issue on Windows #30137
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
[net10.0, Testing] Fix LabelFeatureTests Screenshot Issue on Windows #30137
Conversation
Hey there @@NafeelaNazhir! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this 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 LabelFeatureTests to address the screenshot issue on Windows by explicitly tapping the MainLabel to remove the keyboard focus indicator (black box) before verifying screenshots.
- Added wait and tap steps for MainLabel in four test cases to ensure a clean screenshot.
App.WaitForElement(MainLabel); | ||
App.Tap(MainLabel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The calls to 'WaitForElement(MainLabel)' and 'Tap(MainLabel)' are repeated in each test case. Consider extracting these steps into a helper method to improve maintainability and reduce duplication in your test suite.
App.WaitForElement(MainLabel); | |
App.Tap(MainLabel); | |
WaitForAndTapMainLabel(); |
Copilot uses AI. Check for mistakes.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
This pull request enhances the test cases for verifying label features in LabelFeatureTests.cs by ensuring that the main label is explicitly tapped before taking a screenshot. This interaction removes the keyboard navigation focus indicator (black box) that may appear if a control is previously focused via keyboard. By tapping another region (the label), the black box disappears, resulting in more reliable and cleaner screenshots for verification.
Enhancements to label feature test cases:
VerifyLabelWithTextAndFontSize
: Added steps to wait for and tap onMainLabel
before verifying the screenshot.VerifyLabelWithTextAndCharacterSpacing
: Added steps to wait for and tap onMainLabel
before verifying the screenshot.VerifyLabelWithTextAndMaxlines
: Added steps to wait for and tap onMainLabel
before verifying the screenshot.VerifyLabelWithTextWhenLineHeight
: Added steps to wait for and tap onMainLabel
before verifying the screenshot.