Open marcosmko opened 2 years ago
I haven't dug integration_test
internal code, but if flutter_driver
package also had the same code, they should work as same. (But both behavior depends on Flutter code, not this repository's one)
driver.press_keycode(66)
for android sends key events to the Android OS via UiObject as https://developer.android.com/reference/android/view/KeyEvent
So, probably it depends on how flutter handles UiObject events internally.
I just wondered if the native context could work after calling driver.execute('flutter:setTextEntryEmulation', false)
https://api.flutter.dev/flutter/flutter_driver/FlutterDriver/setTextEntryEmulation.html
@KazuCocoa I am getting Appium error: An unknown server-side error occurred while processing the command. Original error: Command not support: "flutter:setTextEntryEmulation".
What version of driver did you use? Please try out the latest version with Appium 2 if not tried it out yet
anything new here? Appium 2 is used . but did not manage to simulate keyEnter.
await tester.testTextInput.receiveAction(TextInputAction.done);
https://api.flutter.dev/flutter/flutter_driver/SendTextInputAction-class.html flutter driver provide such command
done → const TextInputAction Logical meaning: The user is done providing input to a group of inputs (like a form). Some kind of finalization behavior should now take place.
Android: Corresponds to Android's "IME_ACTION_DONE". The OS displays a button that represents completion, e.g., a checkmark button.
iOS: Corresponds to iOS's "UIReturnKeyDone". The title displayed in the action button is "Done".
But if using flutter appium driver driver.executeScript("flutter:sendTextInputAction","IME_ACTION_DONE", timeOutMilliSecond); it will give error
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Command not support: "flutter:sendTextInputAction"
Then, it is not implemented yet https://github.com/appium-userland/appium-flutter-driver#commands Feel free to create a PR
How to simulate the keyboard ENTER event using flutter driver while testing (since keyboard is disabled)?
await driver.execute('flutter:sendTextInputAction', 'IME_ACTION_DONE') - is this correct?
Got an error :
unknown error: An unknown server-side error occurred while processing the command. Original error: Command not support: "flutter:sendTextInputAction"
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Could you please provide an update?
can use follow code instead of driver.press_keycode
subprocess.run(["adb", "shell", "input", "keyevent", "66"], capture_output=True, text=True, check=True)
How to simulate the keyboard ENTER event using flutter driver while testing (since keyboard is disabled)? await driver.execute('flutter:sendTextInputAction', 'IME_ACTION_DONE') - is this correct? Got an error : unknown error: An unknown server-side error occurred while processing the command. Original error: Command not support: "flutter:sendTextInputAction" at processTicksAndRejections (node:internal/process/task_queues:95:5) Could you please provide an update?
subprocess.run(["adb", "shell", "input", "keyevent", "66"], capture_output=True, text=True, check=True)
is worked
Hello!
I'm using this plugin but it seems I cannot simulate some keyboard events like pressing enter. I would like to know if there is a way for that.
I have tried using (python library):
and
and
But it didn't work.
Using the new package
integration_test
for creating tests, I can simulate keyboard events:As
integration_test
package also usesflutter_driver
to drive app, I suppose it is possible to simulate those events, is it?