-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Android] SearchHandler - added focus/unfocus support #24852
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
[Test] | ||
[Category(UITestCategories.Shell)] | ||
[Category(UITestCategories.SearchBar)] | ||
public void SearchHandlerFocusAndUnfocusEventsShouldWork() |
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.
This test is failing on Android. Maybe need to use WaitForElement
before Click the Button.
System.NullReferenceException : Object reference not set to an instance of an object.
at UITest.Appium.HelperExtensions.Click(IUIElement element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 154
at UITest.Appium.HelperExtensions.Click(IApp app, String element) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 34
at Microsoft.Maui.TestCases.Tests.Issues.Issue24670.SearchHandlerFocusAndUnfocusEventsShouldWork() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24670.cs:line 20
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
<ContentPage> | ||
<Shell.SearchHandler> | ||
<SearchHandler | ||
SearchBoxVisibility="Expanded" |
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.
I wanted to add AutomationId("searchHandler") and click this in the UI test, but Appium couldn't find it :/
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cs
Show resolved
Hide resolved
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Description of Change
Added a missing support for focus/unfocus events. Implemented it similar to how it has been done for iOS
(https://github.dev/kubaflo/maui/blob/8921d3bfab72dc78aba940020a6b2ea06a708408/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cs#L32-L49)
Issues Fixed
Fixes #24670
Screen.Recording.2024-09-21.at.03.00.41.mov