-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android, iOS, Mac] Fixed Entry ClearButton not visible on dark theme Change #32889
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+20.4 KB
....Android.Tests/snapshots/android/EntryClearButtonShouldBeVisibleOnDarkTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.5 KB
...Android.Tests/snapshots/android/EntryClearButtonShouldBeVisibleOnLightTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 32886, "[Android, iOS, Mac] Entry ClearButton not visible on dark theme", PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.macOS)] | ||
| public class Issue32886 : TestContentPage | ||
| { | ||
| protected override void Init() | ||
| { | ||
| Title = "Issue32886"; | ||
|
|
||
| // Create the UITestEntry with ClearButtonVisibility | ||
| var entry = new UITestEntry | ||
| { | ||
| Text = "Entry Text", | ||
| IsCursorVisible = false, | ||
| IsSpellCheckEnabled = false, | ||
| IsTextPredictionEnabled = false, | ||
| AutomationId = "TestEntry", | ||
| ClearButtonVisibility = ClearButtonVisibility.WhileEditing | ||
| }; | ||
|
|
||
| var button = new Button | ||
| { | ||
| Text = "Change theme", | ||
| AutomationId = "ThemeButton" | ||
| }; | ||
| button.Clicked += Button_Clicked; | ||
|
|
||
| var layout = new VerticalStackLayout(); | ||
| layout.Children.Add(entry); | ||
| layout.Children.Add(button); | ||
|
|
||
| Content = layout; | ||
|
|
||
| // Set background color based on app theme | ||
| this.SetAppThemeColor(BackgroundColorProperty, Colors.White, Colors.Black); | ||
| } | ||
|
|
||
| private void Button_Clicked(object sender, EventArgs e) | ||
| { | ||
| if (Application.Current is not null) | ||
| { | ||
| Application.Current.UserAppTheme = Application.Current.UserAppTheme != AppTheme.Dark ? AppTheme.Dark : AppTheme.Light; | ||
| } | ||
| } | ||
| } |
Binary file added
BIN
+8.07 KB
...estCases.Mac.Tests/snapshots/mac/EntryClearButtonShouldBeVisibleOnDarkTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.59 KB
...stCases.Mac.Tests/snapshots/mac/EntryClearButtonShouldBeVisibleOnLightTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions
55
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32886.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue32886 : _IssuesUITest | ||
| { | ||
| public Issue32886(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "[Android, iOS, Mac] Entry ClearButton not visible on dark theme"; | ||
|
|
||
| [Test, Order(1)] | ||
| [Category(UITestCategories.Entry)] | ||
| public void EntryClearButtonShouldBeVisibleOnLightTheme() | ||
| { | ||
| App.WaitForElement("TestEntry"); | ||
| App.Tap("TestEntry"); | ||
| #if ANDROID // On Android, to address CI flakiness, the keyboard is dismissed. | ||
| if (App.WaitForKeyboardToShow(timeout: TimeSpan.FromSeconds(1))) | ||
| { | ||
| App.DismissKeyboard(); | ||
| } | ||
| #endif | ||
|
|
||
| #if IOS | ||
| // On iOS, the virtual keyboard appears inconsistent with keyboard characters casing, can cause flaky test results. As this test verifying only the entry clear button color, crop the bottom portion of the screenshot to exclude the keyboard. | ||
| // Using DismissKeyboard() would unfocus the control in iOS, so we're using cropping instead to maintain focus during testing. | ||
| VerifyScreenshot(cropBottom: 1550); | ||
| #else | ||
| VerifyScreenshot(); | ||
| #endif | ||
| } | ||
|
|
||
| [Test, Order(2)] | ||
| [Category(UITestCategories.Entry)] | ||
| public void EntryClearButtonShouldBeVisibleOnDarkTheme() | ||
| { | ||
| App.WaitForElement("TestEntry"); | ||
| App.Tap("ThemeButton"); | ||
| #if WINDOWS // On Windows, the clear button isn't visible when Entry loses focus, so manually focused to check its icon color. | ||
| App.Tap("TestEntry"); | ||
| #endif | ||
|
|
||
| #if IOS | ||
| // On iOS, the virtual keyboard appears inconsistent with keyboard characters casing, can cause flaky test results. As this test verifying only the entry clear button color, crop the bottom portion of the screenshot to exclude the keyboard. | ||
| // Using DismissKeyboard() would unfocus the control in iOS, so we're using cropping instead to maintain focus during testing. | ||
| VerifyScreenshot(cropBottom: 1550); | ||
| #else | ||
| VerifyScreenshot(); | ||
| #endif | ||
| } | ||
| } | ||
Binary file added
BIN
+7.73 KB
...es.WinUI.Tests/snapshots/windows/EntryClearButtonShouldBeVisibleOnDarkTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.58 KB
...s.WinUI.Tests/snapshots/windows/EntryClearButtonShouldBeVisibleOnLightTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.3 KB
...estCases.iOS.Tests/snapshots/ios/EntryClearButtonShouldBeVisibleOnDarkTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...stCases.iOS.Tests/snapshots/ios/EntryClearButtonShouldBeVisibleOnLightTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.