Skip to content

test(e2e): match the resume button's flattened accessibility text - #658

Open
RonenMars wants to merge 1 commit into
mainfrom
test/e2e-resume-session-glyph
Open

test(e2e): match the resume button's flattened accessibility text#658
RonenMars wants to merge 1 commit into
mainfrom
test/e2e-resume-session-glyph

Conversation

@RonenMars

Copy link
Copy Markdown
Owner

codex_parity and feat2_export_in_info_shelf both failed the mock suite on an assertion that was correct about the app.

The cause

The resume button renders a Phosphor <Play weight="fill"/> beside its label (app/conversation/[id].tsx:912), and iOS flattens a button's children into a single accessibility string.
The element therefore reads ▶ Resume Session, not Resume Session.

Maestro matches text: against the whole element as a regex, so the bare label could never match — the text was on screen and in the hierarchy the whole time.

The app is correct here: a Phosphor icon is exactly what the repo's icon rule calls for. Only the assertions were wrong.

This is the same root cause as the Line <n>: terminal-label mismatch fixed in #648, and the third instance of it in this suite.
The general rule worth remembering: an icon rendered next to a label becomes part of that label's accessibility text.

What changed

A leading .* on the assertions in both suite flows, and in promo_04_multi_machine, which carries the same assertion but is not part of the mock suite so it never surfaced.

codex_parity's assertNotVisible: "Can't resume" had the same mismatch with the opposite consequence: it matched nothing and so passed unconditionally, asserting nothing about the app at all.
It now matches .*Can't resume and can actually fail.

Verified

On an iPhone 17 Pro Max simulator, Release build, against the mock server.

Both suite flows pass, exit 0: codex_parity (36s), feat2_export_in_info_shelf (31s).

promo_04_multi_machine is a recording flow outside the mock suite and was not run; its change is identical to the other two.

Refs #600.

The resume button renders a Phosphor <Play weight="fill"/> beside its label, and iOS flattens a button's children into a single accessibility string, so the element reads "▶ Resume Session" rather than "Resume Session".
Maestro matches text against the whole element as a regex, so the bare label could never match and codex_parity and feat2_export_in_info_shelf both failed on an assertion that was correct about the app.

Match with a leading .* in both flows, and in promo_04_multi_machine, which carries the same assertion but is not part of the mock suite so it never surfaced.

codex_parity's assertNotVisible: "Can't resume" had the same mismatch with the opposite consequence: it matched nothing and therefore passed unconditionally, asserting nothing about the app.
It now matches ".*Can't resume" and can fail.

Verified on an iPhone 17 Pro Max simulator, Release build, against the mock server: both suite flows pass, exit 0.

Refs #600.
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