Files
TimandGitHub eaed706643 tests(mobile): add E2E tests for Connect Signer flow (#7676)
* tests(mobile): add E2E tests for Connect Signer flow

Add Maestro E2E infrastructure and happy-path test for the WalletConnect-based signer import flow. Includes a mock
WalletConnectContext override, external e2e state store, TestCtrls setup buttons, and a success-path test covering signer list verification, name validation, and post-import assertions.

* test(mobile): enhance E2E tests for Connect Signer validation

Update the connect-signer-success.yml to improve validation checks for the name input field. Ensure the continue button is disabled when the name is empty or exceeds 20 characters, and re-enable it upon valid input. This enhances the robustness of the E2E tests for the Connect Signer flow.

* test(mobile): enhance E2E tests for signer details verification

Update connect-signer-success.yml to include additional assertions for the imported signer's details page. New tests verify the visibility of the wallet icon, connected status badge, and the remove signer button, ensuring comprehensive validation of the signer details in the Connect Signer flow.

* test(mobile): add E2E test for non-owner Connect Signer flow

Introduce a new test case in connect-signer-not-owner.yml to validate the error handling when a non-owner attempts to connect a wallet. The test verifies the visibility of error messages and the transition to the owner state, enhancing the robustness of the Connect Signer flow. Additionally, update TestCtrls and connectSignerSetup to support the new test scenario.

* docs(mobile): update README with environment variable configuration for Maestro tests

Add a new section detailing the required environment variables for running Maestro E2E tests, including descriptions and default values for iOS and Android configurations. This enhances clarity for developers setting up their testing environment.

* fix(mobile): improve type safety in WalletConnect E2E context

- Make `instance` prop optional since it's unused in the E2E mock
- Replace unsafe `{} as unknown` return in sign() with a thrown error

* tests(mobile): derive test constants from mock data in connectSignerSetup

- Get OWNER_ADDRESS from mockedActiveSafeInfo.owners[0] instead of hardcoding
- Replace external URL wallet icon with inline base64 1x1 PNG

* tests(mobile): add error handling to WalletConnect E2E state listeners

Extract notifyListeners() helper that catches per-listener errors,
preventing a single throwing listener from breaking state propagation.
2026-04-21 18:01:37 +02:00

109 lines
2.7 KiB
YAML

appId: ${APP_ID}
tags:
- connect-signer
---
# Happy path: Connect wallet → Name signer → Success → Signers list
- runFlow:
file: ../../utils/setup/app-start.yml
# Setup: onboard with test Safe, configure WC mock to return an owner address
- tapOn:
id: 'e2eConnectSignerOwner'
# Wait for home to load
- assertVisible:
id: 'home-tab'
# Navigate to Settings → Signers
- tapOn: 'Account, tab, 3 of 3'
- tapOn:
id: 'settings-signers-list-item'
- assertVisible: 'Signers'
# Verify the owner address is in the list but has no wallet icon badge (not yet imported)
- assertVisible:
id: 'signer-0x3336745b7EA628F5134Bd9d08aa68b4979fA3472'
- assertNotVisible:
id: 'signer-type-badge-0x3336745b7EA628F5134Bd9d08aa68b4979fA3472'
# Tap "Add signer"
- tapOn:
id: 'import-signer-button'
- assertVisible: 'Add signer'
# Verify "Connect wallet app" option is visible
- assertVisible: 'Connect wallet app'
# Tap "Connect wallet app"
- tapOn:
id: 'connectSigner'
# Verify Name Signer screen appears with prefilled name
- assertVisible: 'Name your signer'
- assertVisible:
id: 'name-signer-input'
- assertVisible: 'E2E Wallet - 3472'
# Test validation: clear name — button should be disabled when empty
- tapOn:
id: 'clear-name-button'
- assertVisible:
id: 'name-signer-continue'
enabled: false
# Test validation: type a name that is too long (>20 chars) — button should stay disabled
- tapOn:
id: 'name-signer-input'
- inputText: 'This name is way too long'
- assertVisible: 'Name must be at most 20 characters long'
- assertVisible:
id: 'name-signer-continue'
enabled: false
# Clear the too-long text and type a valid custom name
- hideKeyboard
- tapOn:
id: 'clear-name-button'
- tapOn:
id: 'name-signer-input'
- inputText: 'My WC Signer'
# Continue button should be re-enabled with valid input
- assertVisible:
id: 'name-signer-continue'
enabled: true
- tapOn:
id: 'name-signer-continue'
# Verify Success screen
- assertVisible:
id: 'import-success'
- assertVisible: 'Your signer is ready!'
- assertVisible: 'My WC Signer, 0x3336...3472'
# Tap Done
- tapOn:
id: 'import-success-continue'
# Verify we're back on Signers list
- assertVisible:
id: 'signers-screen'
# Verify imported signer shows with the submitted name
- assertVisible: 'My WC Signer, 0x3336...3472'
# Tap on the imported signer to open details
- tapOn:
id: 'signer-0x3336745b7EA628F5134Bd9d08aa68b4979fA3472'
# Verify signer details page shows wallet icon and connected status badge
- assertVisible: 'My WC Signer'
- assertVisible: 'Address'
- assertVisible:
id: 'signer-detail-badge'
- assertVisible:
id: 'signer-detail-badge-status-connected'
- assertVisible:
id: 'remove-wc-signer-button'