Skip to content

test(e2e): add iOS repro for issue #1409 (accessibilityLabel hides text)#3310

Open
proksh wants to merge 1 commit into
mainfrom
repro/issue-1409-ios-accessibility-label
Open

test(e2e): add iOS repro for issue #1409 (accessibilityLabel hides text)#3310
proksh wants to merge 1 commit into
mainfrom
repro/issue-1409-ios-accessibility-label

Conversation

@proksh

@proksh proksh commented May 21, 2026

Copy link
Copy Markdown
Contributor

What this adds

A Flutter screen + Maestro flow that reproduces #1409.

Why it fails

When accessibilityLabel is set on a touchable, iOS replaces its children with that label. So:

<Pressable accessibilityLabel="easy-button">
  <Text>Click me!</Text>
</Pressable>

…looks like this to iOS (and to Maestro): a button labeled "easy-button". The string "Click me!" only exists as pixels on screen — it's gone from any tree Maestro can read. So tapOn: "Click me!" fails.

Screenshot 2026-05-21 at 1 26 45 PM

The flow mirrors this in Flutter and is tagged failing, ios so the regression suite asserts the failure.

Note on PR #3165

The case PR #3165 targets (label == visible text) already works on mainFilters.textMatches falls back to accessibilityText, which is populated from element.label. The literal #1409 case (label ≠ visible text) is harder and can't be fixed by any label-fallback. Only OCR can recover text iOS has truly hidden.

How to verify

iOS demo_app is skipped in CI (documented OOM on GHA), so verify locally:

cd e2e/demo_app && flutter pub get && flutter build ios --simulator
# install Runner.app on a booted iOS sim, then:
maestro --platform ios test e2e/demo_app/.maestro/fail_issue1409_accessibility_label.yaml

Expected: fails at Tap on "Click me!" with Element not found: Text matching regex: Click me!. Verified locally on iPhone 16, iOS 18.2.

Adds a Flutter screen mirroring React Native's
<Pressable accessibilityLabel="easy-button"><Text>Click me!</Text></Pressable>
pattern via Semantics(container, button, label, excludeSemantics) over a
GestureDetector. On iOS this produces a single accessibility element whose
label is "easy-button" with empty title/value, and the inner Text("Click me!")
is removed from the accessibility tree entirely.

Maestro's Filters.textMatches (Filters.kt) already falls back to
accessibilityText for plain tapOn selectors, so tapOn: "easy-button" already
works on main. The failure this flow guards is the literal #1409 case:
tapOn: "Click me!" - the visible inner text - which iOS has truly hidden.
That string lives in no element's text/label/accessibilityText and cannot be
recovered by IOSDriver.mapViewHierarchy fallbacks (e.g. the one in #3165);
only a screenshot/OCR fallback could.

Tagged failing, ios so the regression suite asserts the failure. Touchable
is positioned top-left (not centered) so a parent-bounds-center tap fallback
would land outside the touchable region.

Heads-up: e2e/run_tests skips demo_app on iOS in CI (documented OOM on GHA),
so verification is local-only today.
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