Skip to content

feat: Semantics identifiers for native UI-automation verbs + Android native suite - #5

Open
pbertsch wants to merge 1 commit into
mainfrom
feat/flutter-native-verb-ids
Open

pbertsch wants to merge 1 commit into
mainfrom
feat/flutter-native-verb-ids

Conversation

@pbertsch

Copy link
Copy Markdown
Member

Summary

flutter-probe's new native UI-automation verb family (tap native / see native / type native — uiautomator resource-id on Android, accessibilityIdentifier on iOS) had nothing real to test against in this fixture: widgets were keyed only with ValueKey('name'), which does not propagate to the platform accessibility tree. Semantics(identifier: 'name') does.

  • 79 Semantics(identifier:) wrappers added across 12 files (app.dart, navigation/home_page.dart, and all feature presentation pages), each mirroring the existing ValueKey string. ValueKeys are kept — this is additive, so #name (Dart agent) and native resource-id selectors resolve to the same widget.
  • Deliberately skipped (3 sites): the item-level ValueKeys on the three BottomNavigationBarItems (tab_home, tab_tests, tab_about) — BottomNavigationBarItem is not a Widget and cannot be wrapped in Semantics. The tab icons (tab_home_icon etc.) carry the native identifiers and serve as the native handles for tab navigation.
  • New mobile/tests/native/ suite (4 tests, tagged @native, Android-only per the verb docs): home tab navigation by resource-id, items-list search via type native, gesture hit-area exposure, and device-capability taps whose state changes are cross-checked with Flutter-side see — proving both selector styles drive one widget.
  • New mobile/tests/probe.android.yaml: the native suite needs the Android package id (com.alphawavesystems.probe_test_app), which differs from the iOS bundle id in probe.yaml.
  • README: test count 78 → 82, native suite usage documented.

Test plan

  • flutter analyze — no new issues (remaining warning/error are pre-existing in test/widget_test.dart and untouched files)
  • flutter build apk --debug --dart-define=PROBE_AGENT=true — success
  • flutter build ios --debug --simulator --dart-define=PROBE_AGENT=true — success
  • Verified identifiers land in the OS accessibility tree via uiautomator dump (home, items, device screens all expose resource-ids)
  • Native suite run live on emulator-5554 with probe 0.13.0: 4/4 passed, twice consecutively
  • Regression: existing tests/smoke/ + tests/ui/ run on the same emulator — 29/30 passed; the one failure (smoke/launch.probe) is environmental (it uses open the app without restart and asserts the home screen; passes from a clean launch, unrelated to this change)

🤖 Generated with Claude Code

https://claude.ai/code/session_01R8STRkxzYNXcJCb5kdyJ7E

…oid native suite

Pair every ValueKey('name') widget with Semantics(identifier: 'name') so
flutter-probe's native verb family (tap native / see native / type native,
uiautomator resource-id on Android, accessibilityIdentifier on iOS) resolves
the same widgets as the Flutter-side #name selectors. 79 identifiers added
across 12 files; ValueKeys kept — both selector styles now hit one widget.

Skipped: the three BottomNavigationBarItem-level ValueKeys (tab_home,
tab_tests, tab_about) — BottomNavigationBarItem is not a Widget and cannot
be wrapped; their tab icons carry the native identifiers instead.

New mobile/tests/native/ suite (4 tests, @Native, Android-only): home tab
navigation, items search via type native, gesture hit-areas, device
capability taps cross-checked with Flutter-side assertions. Runs against
new mobile/tests/probe.android.yaml (Android package id differs from the
iOS bundle id in probe.yaml). Verified live: 4/4 passing twice on
emulator-5554; existing smoke/ui suites still green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant