Files
387b78c309 # tests(mobile): E2E transaction-request flow for WalletConnect dApps (#8303)
* tests(mobile): record dApp responses in the fake WalletKit e2e side-channel

respondSessionRequest now records the delivered JSON-RPC result/error
into walletKitE2eState.lastRequestResponse so tx-request flows can
assert exactly what the dApp received. Also adds proposeBehavior to
drive the CGW /propose fetch interceptor.

* tests(mobile): add armable e2e fetch interceptor for CGW /propose

Intercepting at the fetch layer keeps the real RTK Query matchers
firing, which the walletKit listeners depend on for their
proposing/abandon bookkeeping. Armed via proposeBehavior: 'fail500';
the per-flow state reset disarms it.

* tests(mobile): add WC tx-request setup and synthesis fixtures

setupWcDappsTx seeds a session plus an owner signer whose throwaway
Sepolia key goes into the simulator keychain (biometrics-enabled so the
confirm flow signs without the opt-in detour). synthTxRequest/synthTxBatch
dispatch through sessionRequestReceived so the real router runs. Fixture
values carry wei-level jitter: the Safe's on-chain nonce never advances,
so identical calldata would reproduce the previous run's already-signed
safeTxHash and skip the sign tail.

* tests(mobile): surface WC response markers and tx TestCtrls to Maestro

WcResponseIndicator renders e2e-wc-response-error-<code> and strict
hash-match markers (bare safeTxHash / EIP-5792 { id } envelope) by
comparing the delivered result against the outstandingRequests key
observed at hand-off. TestCtrls gains the tx setup/synthesis buttons and
installs the propose fetch interceptor; ReviewFooter's confirm button
gets a testID because its text collides with the screen title.

* tests(mobile): add WalletConnect transaction-request Maestro flows

Covers WA-2326: eth_sendTransaction happy path (real keychain signing +
staging /propose, safeTxHash delivery verified end-to-end via the
hash-match marker, tx visible in the queue UI), reject (USER_REJECTED
5000), EIP-5792 batch (both actions render; { id: safeTxHash } envelope
asserted), read-only Safe (4100 + toast, sheet never opens), and CGW
/propose failure (error screen, request retained for retry, USER_REJECTED
only after abandoning review). Markers are asserted from the home tab —
native modals hide the root accessibility tree. README documents the
deviations from the ticket text.

* tests(mobile): drop ticket references from e2e code comments

* tests(mobile): remove walletconnect-dapps suite README

The flow files carry their own rationale comments; the remaining
README pointers are inlined where they dangled.

* tests(mobile): surface tx-request setup outcome as e2e markers

setupWcDappsTx's keychain write is async and can fail on a simulator;
it now records txSetupStatus and WcTxSetupIndicator renders
e2e-wc-tx-setup-ready/-failed so flows can gate on a successful setup
instead of failing later on a missing signer. Also marks the committed
throwaway key as intentionally public.

* tests(mobile): harden response-indicator effect and document fetch-mock contract

Give the hash-capture effect a proper deps array and pin the
one-outstanding-tx invariant its last-key read relies on; spell out the
propose interceptor's install-once-per-runtime contract.

* tests(mobile): gate tx flows on setup, share timeouts, tighten selectors

Flows wait for e2e-wc-tx-setup-ready before synthesising; UI and
network waits come from shared defaults (wcTxUiTimeout /
wcTxNetworkTimeout); amount-based selectors replace the loose 'Send'
and unsigned-amount matches.

* tests(mobile): trim verbose e2e comments

Keep only the non-obvious rationale (nonce/jitter collision, modal
marker visibility, -32603-by-design, install-once fetch contract);
drop comments that restate the code.

* tests(mobile): remove walletconnect-dapps suite orchestration file

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-29 16:16:18 +02:00
..