test(mobile): add Maestro e2e flows for the critical paths - #602
Open
Olorunfemi20 wants to merge 1 commit into
Open
test(mobile): add Maestro e2e flows for the critical paths#602Olorunfemi20 wants to merge 1 commit into
Olorunfemi20 wants to merge 1 commit into
Conversation
Port the web Playwright scenarios in frontend/wallet/e2e/ to Maestro so the create-wallet, send, and receive paths are protected by device tests. The previous attempt asserted against screens that no longer exist: the navigation shell moved /send and /receive into the (tabs) group and made app/index.tsx an entry router, so every flow failed on its cold-start assertion. The flows are rewritten against the current app, and the screens they drive now carry testIDs. - Screens gain testIDs only, no behaviour change: welcome, dashboard, send, receive, and offline. ScreenScaffold forwards an optional testID so any scaffolded screen can be identified. - subflows/launch-fresh.yaml cold-starts every flow from wiped state, which the entry router resolves to the welcome screen; open-dashboard.yaml deep-links into the tab group, since the dashboard is unreachable until a wallet address is persisted (backlog Miracle656#25). - subflows/dismiss-offline.yaml gets past the offline screen that ConnectivityGate pushes when NetInfo reports no connection. This is what failed the previous run: a freshly booted emulator has no validated network yet. The workflow now also waits for connectivity before running the flows. - skip-tutorial.yaml dismisses the first-run tutorial (backlog Miracle656#27) through its own Skip button, the device equivalent of the web suite pre-seeding veil_seen_tutorial; dashboard.yaml is where that skip is exercised. - flows/passkey-smoke.yaml stays tagged `device` and excluded by default, since an emulator has no enrolled credential for the biometric prompt.
|
@Olorunfemi20 is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
What
Ports the web Playwright scenarios in
frontend/wallet/e2e/to Maestro, so the create-wallet, send, and receive paths are protected by device tests, plus a real-device passkey smoke test.closes #499
Replaces #510. That branch's net diff is gone — this is a fresh branch off current
main, so there is no overlap with the deep-linking work that merged in #508 and nothing to reconcile.Why the last run failed, and what changed
All four flows failed on the same line, the
assertVisible: id: "home-screen"at the end oflaunch-fresh.yaml, so nothing past the cold start was ever exercised. Two separate causes, both addressed:1. The flows described an app that no longer exists.
home-screen,send-screen,receive-addressand the rest were written against the placeholder screens from #508. Since thenapp/index.tsxbecame an entry router,/sendand/receivemoved into(tabs), and #539 replaced the receive placeholder outright. Every selector has been rewritten against the current source, and the missing testIDs are added.2. The offline gate. Your diagnosis was right.
ConnectivityGatepushes/offlinewhenever NetInfo positively reports no usable connection, and a freshly booted emulator often has not validated its network when the first flow launches. That is handled in two places: the workflow now waits fordumpsys connectivityto reportVALIDATEDbefore running Maestro, andsubflows/dismiss-offline.yamlretries the probe and falls back tobackif it is still up. A slow network now delays a flow instead of failing it, and the fallback means a genuinely offline emulator still runs everything — none of these flows needs the network.testIDs added
Additive only; no behaviour changes.
components/ScreenScaffold.tsxtestIDprop forwarded to the root view, so any scaffolded screen can be identifiedapp/(tabs)/dashboard.tsxdashboard-screenapp/(tabs)/send.tsxsend-screen,send-submitapp/(tabs)/receive.tsxreceive-screen,receive-address,receive-copy-button,receive-share-buttonapp/(onboarding)/welcome.tsxwelcome-screen,welcome-get-started-button,welcome-recover-button(plusaccessibilityRole="button"on both, which they were missing)app/offline.tsxoffline-screen,offline-retry-buttonsend-recipient,send-amountandsend-memowere already there from your #508 merge and are used as-is.tutorial-overlay/tutorial-skip-buttonlanded with #530, so the guard inskip-tutorial.yamlis now live rather than a no-op —dashboard.yamlis where it actually fires.Two structural notes
Reaching the tabs takes a deep link.
app/index.tsxroutes to/dashboardonly once a wallet address is in secure storage, and the placeholder create-wallet screen does not persist one (backlog #25). Soopen-dashboard.yamlopensveil://sendto mount the tab navigator and crosses the tab bar from there. It is one subflow, and it is the single place to change when registration starts persisting an address.One flow asserts an unfinished behaviour on purpose. In
create-wallet.yaml, tapping Continue returns to/, and with no wallet persisted the entry router sends you back to create-wallet rather than the dashboard. That is the current correct behaviour, so the flow asserts it — with a comment saying the assertion becomesdashboard-screenonce registration writes an address, and that it failing is exactly the signal that the wallet is now being persisted. I would rather encode that than leave a gap.Layout
The pieces you called out as worth keeping are unchanged:
flows/*.yamlas the only entry points withsubflows/as fragments,deviceexcluded by default with the documented--include-tags deviceescape hatch, andclearState: trueon every launch.What the flows assert
send.yamlpicks up the validation from #540 — a malformed address raises the error, a valid one clears it, andsend-submitonly enables once the address parses and the amount is positive.receive.yamlasserts the copy confirmation and a tab round-trip; the share sheet is OS UI, so it asserts the button rather than the dialog.deep-link.yamlcovers all three schemes on both launch paths plus the unrecognised-link fallback, which now lands on the welcome screen via the entry router.Selectors are testIDs. Text assertions are limited to copy that is itself under test (the validation message, the "Copied" confirmation), tab-bar labels, and system UI.
Identifiers
Untouched, per your note —
xyz.veil.walletandapp.veil.xyzare used exactly as they are onmain. If the canonical values change,appIdin the flow headers and theadb installtarget in the workflow are the only places to update.Verification
Locally:
npm run typecheckclean,npm testgreen (16 suites, 275 tests), and all twelve YAML files parse.The emulator run is what this PR needs to prove and it is what the workflow does on this PR. I have no emulator or passkey-enrolled handset here, so I am not claiming a green run I have not seen — if CI is still red I will work it until it is green rather than hand it back to you.