fix(test): logout flow typo + remove broken .verify shims for logout/delete#39
Merged
Conversation
The canonical Maestro flow 26 was tapping `text: "Log out"` (two words) against the native iOS Alert raised by `services/handleLogout.tsx`. The i18n value of `profile.logout` resolves to `"Logout"` (one word — see packages/shared/i18n/locales/en/translation.json:270), so the regex selector never matched the destructive button. The dialog stayed open and the subsequent `assertVisible: signin-submit` failed, producing the spurious "logout journey" FAIL verdict from the validator. No app-code changes — `Alert.alert(...)` was already correct. Updated the inline comments to point at the i18n source of truth so this can't silently drift again. Root cause + full evidence in ~/Desktop/pegada-e2e-videos/LOGOUT_DELETE_DIAGNOSIS.md (diagnoser ID HIGH-confidence findings, sections D and F).
Owner
Author
|
Follow-up issue for the pre-existing login-returning utility bug that blocked sim verification of this PR: #40 |
There was a problem hiding this comment.
Pull request overview
Fixes a failing Maestro logout E2E journey by correcting the button label selector to match the app’s i18n string, ensuring the native iOS logout confirmation dialog is actually confirmed during the test run.
Changes:
- Update
tapOn: textin the logout confirmation step from"Log out"to"Logout"to matchprofile.logoutinen/translation.json. - Expand inline YAML comments to clarify the dialog is a native
Alert.alert(...)and why text-based selection should work via the iOS accessibility tree.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+51
to
+54
| # Native iOS Alert presented by Alert.alert in services/handleLogout.tsx. | ||
| # Buttons: destructive "Logout" (right), "Cancel" (left). i18n key | ||
| # profile.logout = "Logout" (one word — see packages/shared/i18n/locales/ | ||
| # en/translation.json). Maestro's tapOn:text matches the visible label |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
Maestro validator marked flows 26 (logout) and 27 (delete-account) as FAIL. A read-only diagnoser determined neither failure was app code — both were test-harness defects (full diagnosis:
~/Desktop/pegada-e2e-videos/LOGOUT_DELETE_DIAGNOSIS.md). Two compounding defects:Primary cause (both flows): the validator did not run the canonical YAML in
.maestro/. It ran broken.verify/shims (apps/mobile/.maestro/.verify/{26,27}-*.yaml) that stripassertVisible:and replace text/id selectors with hard-coded coordinate taps, built on a wrong premise that the confirm dialogs were custom RN Modals. They are nativeAlert.alert(...)calls (handleLogout.tsx,deleteAccount.tsx, both already onmainsince 158039e) whose buttons are in the XCUITest accessibility tree on iOS 26.Latent typo in canonical flow 26: the YAML tapped
text: "Log out"(two words, with a space). The i18n valueprofile.logoutresolves to"Logout"(one word —packages/shared/i18n/locales/en/translation.json:270). MaestrotapOn: text:is an exact-regex match, so the destructive button was never tapped, the dialog stayed open, andassertVisible: signin-submitfailed.Canonical flow 27 was already correct (taps
text: "Delete"which matchesprofile.delete = "Delete").Changes
apps/mobile/.maestro/26-logout-journey.yaml(lines 51-54) —text: "Log out"→text: "Logout", plus rewritten comments pointing at the i18n source of truth.apps/mobile/.maestro/.verify/{26,27}-*.yaml— deleted from disk. They were untracked (no PR diff impact) but they were overriding the canonical flows in the validator's harness. Their entire premise (custom RN Modal needing coordinate taps) is wrong.No app code changes —
Alert.alertwas already correct.handleLogout.tsxanddeleteAccount.tsxare untouched.Verification
Sim verification was attempted on iPhone 17 Pro Max (iOS 26.4, sim UDID
6351098E-…, build app.pegada 1.3.1). Locale pinned to en-US, DB re-seeded (pnpm -F @pegada/database maestro:seedconfirmsdelete-me@pegada.appis present).Result: blocked by an unrelated pre-existing utility bug in
apps/mobile/.maestro/utils/login-returning.yaml. ThetapOn: point: "50%, 84%"(introduced in d807d1c "Maestro login email tap coord 65% -> 84%") lands inside the iOS keyboard region on this resolution — it types avinto the focused email field, soinputText: "test@pegada.app"producesvtest@pegada.app. The OTP screen then shows the wrong email, magic-code auth fails silently, the test never reaches the Profile screen, andscrollUntilVisible id: profile-logouterrors out.Evidence:
/Users/gabrieltaveira/.maestro/tests/2026-05-20_110307/screenshot-…1779285837598-(26-logout-journey.yaml).pngshowsvtest@pegada.appon the OTP screen with empty OTP cells, captured afterrunFlow: utils/login-returning.yamlreported COMPLETED (the sub-flow does not actually verify login success).This is a separate defect in another flow's utility, not in 26 or 27. Per the hard rule "If sim verification reveals additional bugs, file as separate issue, do NOT bundle into this PR" — leaving this fix scoped to the test correctness changes the diagnoser identified with HIGH confidence.
Direct evidence the typo fix is correct — diagnoser's smoking-gun screenshot
~/.maestro/tests/2026-05-19_203407/screenshot-…1779233706913-(26-logout-journey.yaml).png(captured by a prior canonical-flow run that did reach the dialog) shows the iOS Alert withCancel | Logoutbuttons in English. The "Logout" label is whattapOn: text: "Logout"will now match.DB verification (preflight)
Seed is wired correctly and
delete-me@pegada.appis present pre-test. The post-test hard-delete assertion (SELECT … WHERE email = 'delete-me@pegada.app'returns 0 rows) couldn't be exercised because the test never reached the delete confirmation due to the upstream login-utility bug.Test plan
utils/login-returning.yamlkeyboard-tap bug is fixed (separate issue/PR), re-runmaestro test apps/mobile/.maestro/26-logout-journey.yamlagainst a clean en-US sim — expect PASS.27-delete-account-journey.yamlwith the seed wrapper.SELECT … WHERE email = 'delete-me@pegada.app'returns 0 rows.e2e-mobile.ymlonce the login utility is fixed.