fix: Android E2E search — unfocus IME keyboard before polling results

On Android, the soft keyboard keeps viewInsets.bottom non-zero while the
search TextField is focused.  ListView.builder is allocated near-zero
height and renders 0 items, so find.text(subject) always finds nothing
even though the IMAP search returned results.  Unfocusing the primary
focus after enterText dismisses the keyboard and gives the results list
full body height before pumpUntil starts polling.

Also fix pumpUntil to use pump(300ms) instead of pumpAndSettle() so a
continuously-running animation (spinner under CPU load) never prevents
settling, and override accountConnectionStatusProvider so _AccountTile
never shows a CircularProgressIndicator during the test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Güttler
2026-04-26 22:31:25 +02:00
co-authored by Claude Sonnet 4.6
parent ad31a3bf14
commit a2d98ed9bc
5 changed files with 52 additions and 20 deletions
+6 -4
View File
@@ -119,10 +119,12 @@ cd "$ROOT"
"$ADB" -s "$EMULATOR_ID" reverse tcp:1025 tcp:"$STALWART_SMTP_PORT"
# Clear any leftover app state from previous runs (stale DB, cached APK process).
# Force-stop first so adb uninstall doesn't fail with DELETE_FAILED_INTERNAL_ERROR.
"$ADB" -s "$EMULATOR_ID" shell am force-stop com.example.sharedinbox 2>/dev/null || true
"$ADB" -s "$EMULATOR_ID" shell pm clear com.example.sharedinbox 2>/dev/null || true
"$ADB" -s "$EMULATOR_ID" uninstall com.example.sharedinbox 2>/dev/null || true
# Only run if the package is installed — that way any failure is a real error.
if "$ADB" -s "$EMULATOR_ID" shell pm list packages | grep -qF "com.example.sharedinbox"; then
"$ADB" -s "$EMULATOR_ID" shell am force-stop com.example.sharedinbox
"$ADB" -s "$EMULATOR_ID" shell pm clear com.example.sharedinbox
"$ADB" -s "$EMULATOR_ID" uninstall com.example.sharedinbox
fi
ts "flutter test start"
fvm flutter test integration_test/ -d "$EMULATOR_ID" | grep -Ev "was tree-shaken|Tree-shaking can be disabled"