testsAndMisc/python_pkg/android_ui/tests
Krzysztof kuhy Rudnicki 88ffa37fe1
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
Pre-commit checks / pre-commit (push) Waiting to run
Python tests / test (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
Find Material text fields by their hint label
A Flutter/Material TextField publishes its label as `hint` and leaves text
and content-desc empty, so every field on such a form arrived as an
anonymous EditText. The workout app's manual-workout form is nine of them:
the only way to fill it was by screen position, which is precisely the
mis-tap-writes-the-wrong-field failure this tool exists to prevent.

`hint` ranks below text and content-desc but above resource-id. Material
clears the hint once content arrives, so a filled field still answers to its
real text and a caller can tell an empty field from a completed one.

The app-side alternative does not work and is documented as a trap: wrapping
the field in Semantics(label:) emits a second labelled node at the same rect,
and MergeSemantics collapses them by dropping the hint from Android's tree,
which leaves the form MORE anonymous than before. Widget tests cannot catch
that -- they assert on Flutter's SemanticsNode while this tool reads
Android's AccessibilityNodeInfo, so nine of them passed green on the build
whose on-device labels had just gone empty.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AWq9MRemX9ZWvNmnhNWUP2
2026-08-27 20:39:46 +02:00
..
__init__.py Add android_ui: drive Android apps by element, never by coordinates 2026-08-10 17:01:28 +02:00
test_cli.py Add android_ui: drive Android apps by element, never by coordinates 2026-08-10 17:01:28 +02:00
test_driver.py Find Material text fields by their hint label 2026-08-27 20:39:46 +02:00
test_main_entry.py Add android_ui: drive Android apps by element, never by coordinates 2026-08-10 17:01:28 +02:00
test_shell_helpers.py Clear five python_pkg packages under the cap 2026-08-16 18:14:36 +02:00
test_text_entry.py Clear five python_pkg packages under the cap 2026-08-16 18:14:36 +02:00