Send "Key Pressed" events to native views #1937
Labels
feature
New feature request
P2
Issues not at the top of the work list
package: patrol
Related to the patrol package (native automation, test bundling)
Use case
I wanted to enter text to a Stripe native card field.
I tried several methods:
$.native.enterText
$.enterText
$.tester.sendKeyEvent
for manual key typing.Querying native views by
Selector("card details")
does work and it finds the card view, butenterText
constantly failed.Depending on what I tried it either failed with "Element doesn't have focus" or it failed to find element for
enterText
and silently crashed without error message even inverbose
.$.tester.sendKeyEvent
- was evident workaround, but, turns out, it operates on Flutter layer and doesn't send keys to native views (it definitely didn't work for me).So I decided to fork and add this functionality.
Final code:
Proposal
I'm not aware of the ability of inputing arbitrary characters on Android, but I've come up with the following API for iOS:
The text was updated successfully, but these errors were encountered: