How to run WalletConnect (WC) flows locally, what the mock dApp does, and how to troubleshoot common issues.
WalletConnect tests exercise the WC request/approve/reject flows using a local
mock dApp server. The app connects to the mock dApp via a WC URI and uses
Maestro flows under e2e/flows/walletconnect/.
- App built and running (iOS simulator or Android emulator).
.envconfigured as described in Local Setup & Environment.- Mock dApp running (see below).
From the mobile folder:
cd freighter-mobile
./e2e/scripts/start-mock-server.shThis starts the mock dApp on http://localhost:3001.
To stop it:
cd freighter-mobile
./e2e/scripts/stop-mock-server.shFlows live under e2e/flows/walletconnect/. Run a single flow by name:
yarn test:e2e:ios WalletConnectConnectyarn test:e2e:ios WalletConnectSignMessageyarn test:e2e:ios WalletConnectSignXdrUse Android similarly:
yarn test:e2e:android WalletConnectSignMessageThe flow name is case-insensitive and matches the YAML filename without the
.yaml extension. See Running Tests for
more examples.
The mock dApp provides a minimal API to create sessions, send requests, and poll for responses:
POST /sessioncreates a WC session and returnsurianddeepLink.GET /session/:idreturns session status.GET /session/:id/waitwaits for approval.POST /session/:id/request/signMessagesendsstellar_signMessage.POST /session/:id/request/signXDRsendsstellar_signXDR.GET /session/:id/responsepolls the latest response.DELETE /session/:iddisconnects a session.DELETE /sessionsdisconnects all sessions.
- If the app cannot connect to the mock dApp, verify the server is running on
localhost:3001and no other process is using that port. - If the WC approval sheet does not appear, confirm the app is on the home screen and no modal is blocking input.
- If a flow hangs on response polling, check the mock dApp logs and confirm the wallet approved the request.
- If a flow fails due to selectors, ensure the target UI has a stable
testIDand update the YAML selector to useid:.