[Android] Keyboard does NOT close by any action after beeing opened by autofocus on inputfield widget. #2202
Labels
bug
Something isn't working
P2
Issues not at the top of the work list
package: patrol
Related to the patrol package (native automation, test bundling)
platform: android
Android is affected
Steps to reproduce
patrol test --target integration_test/tests/edit_fields_test.dart
Actual results
We have a widget with autofocus on the input field, which causes the keyboard to appear.
The normal flow would be that the keyboard hides after clicking a "Save" button.
Unfortunately when the test clicks "Save" the keyboard stays on the screen and hides other
widgets underneath it. We tried $.native.tap() on some elements on the screen, but that did
not hide the keyboard.
Update:$(widget).tap(): await checkWidgetVisibility(widget); await $ .native.enterText(Selector(focused: true), text: inputText, keyboardBehavior: KeyboardBehavior.showAndDismiss); }
Tried also this approach:
Future nativeEnterText(var widget, String inputText) async { await
This works fine for positive cases, but fails to enter the text when there are multiple invalid inputs
for that field and a final step with valid input that is accepted.
Logs
There are no log errors.
Patrol version
Patrol version: 3.6.1
patrol_cli version: 2.7.0
Device: Android 13.0 Pixel XL API 33
Patrol Doctor output
Patrol doctor:
Patrol CLI version: 2.7.0
Flutter command: flutter
Flutter 3.16.3 • channel stable
Android:
• Program adb found in /opt/homebrew/bin/adb
• Env var $ANDROID_HOME set to /Users/dimitar.stoyanov/Library/Android/sdk
iOS / macOS:
• Program xcodebuild found in /usr/bin/xcodebuild
• Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller
Flutter Doctor output
[✓] Flutter (Channel stable, 3.16.3, on macOS 14.1.2 23B92 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
[✓] Connected device (2 available)
[✓] Network resources
The text was updated successfully, but these errors were encountered: