mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* tests(mobile): fix e2e button assertions after Tamagui v2 upgrade
Tamagui v2 (Button.Text compound pattern) renders SafeButton as a single
accessibility element on iOS: the label is exposed on the button node itself,
not as a descendant text node. Matching via containsDescendants therefore never
matched, even though the button is visible.
Match the button's own label by text instead, in the shared assertions:
- verify-tx-details.yml (transaction-details-button)
- verify-explorer-link.yml (view-on-explorer-button)
Verified add-owner-threshold, remove-owner, change-threshold and swap-owner
history flows pass end-to-end.
* tests(mobile): update token filter description assertion
The tokens filter description copy changed; match the new wording.
* tests(mobile): stabilize change-theme e2e against native theme menu
Add a testID to the appearance FloatingMenu and target it from the
change-theme flow, then settle the native MenuView with
waitForAnimationToEnd before each option tap to avoid intermittent
stalls on the theme selection.
* tests(mobile): match simulation View button label after Tamagui v2
When the SafeShield simulation finishes, the SafeButton gains a link
iconAfter and Tamagui v2 exposes it as a single iOS accessibility element
labelled "View, " (trailing comma from the icon). The anchored text: 'View'
assertion therefore never matched even though the button was visible, while
the icon-less Run/Running states matched fine. Match text: 'View.*' instead,
mirroring the earlier verify-explorer-link / verify-tx-details fixes.
Verified conflicting-transactions flow passes end-to-end.
* tests(mobile): tolerate aged limit-order fixture in pending flow
The staging limit-order fixture's validUntil has passed, so the gateway now
reports the order as "Expired". Two assertions assumed a still-pending order:
- Status row expected "Execution needed|Pending"; broaden to the app's
statusMap labels so an expired (or otherwise progressed) order passes.
- An expired order can't be signed — ConfirmTxForm renders no SignForm and
thus no "Continue" button — so guard the review-and-confirm flow on
"Continue" being visible instead of assuming it.
Verified limit-order flow passes end-to-end.
* tests(mobile): match "Sign with:" label in review-and-confirm flow
The confirm-flow branch asserted text 'Sign with', but SelectSigner renders
the label as "Sign with:" (with a colon), so the anchored match never matched.
This branch was previously unexercised (send uses the execute flow, limit-order
skips it when expired); an active TWAP order is the first to reach it. Match
'Sign with.*' instead.
Verified twap-order flow passes end-to-end.
* tests(mobile): add pending, safe-shield and app-update e2e suites
Add suite orchestrators mirroring the existing history suite (first test
clean-starts, the rest run with SKIP_CLEAN_START and re-seed via their own
e2e button):
- transactions/pending (9 tests, grouped by target safe)
- transactions/pending/safe-shield (13 tests, shared e2eSafeShieldSafe)
- app-update (soft + force update)
Also complete the onboarding suite by adding the missing
add-safe-and-import-signer flow.
All suite flows carry the 'suite' tag so they stay out of default test runs.
* tests(mobile): fix safe-shield simulation label and DAI approve token name
- verify-safe-shield-widget: match the post-simulation button as "View.*" — once
finished it gains a link icon and Tamagui v2 exposes its iOS label as "View, ",
so the anchored "View" never matched (same fix as verify-tx-checks).
- approve-malicious: the approve token's backend name changed from
"Dai Stablecoin" to "Polygon PoS Bridged DAI", so match the new name.
Verified send-matic-benign and approve-malicious pass end-to-end.
* tests(mobile): prefix safe name in home navbar address assertions
The home navbar merges the safe name label and shortened address into a
single accessibility node, so Maestro's anchored regex match needs the
name prefix to match the address assertion.
* tests(mobile): match "Add signer" selection screen title in import flows
The import-signer button and signer-menu "Import signer" now route to the
ImportSigners selection screen titled "Add signer" ("Select how you'd like
to add your signer."), replacing the old "Import a signer" title. Update the
selection-screen assertions; the input-screen "Import a signer" title is
unchanged.
* docs(mobile): note biometric enrollment requirement for signer-import e2e
The signer-import flows go through the biometrics opt-in screen, which
dead-ends without biometrics enrolled on the simulator. Document that local
runs need the same enrollment step CI performs.
* tests(mobile): assert "Your signers" header after signer import
SignersList now flattens signers under a single "Your signers" header with
per-item "Imported" badges, replacing the "My signers" section header. Update
the post-import assertions to match; the specific imported signer is still
verified by the following name/address assertions.
* tests(mobile): assert signers screen header in new-user onboarding
The add-signers-form screen no longer renders the "Not imported signers"
section header (signers show in a flat list). Assert the screen heading
"Import your signers to unlock account" instead, matching add-existing-safe.
* tests(mobile): assert "Imported" badge on imported signer in Your signers list
After importing a signer (private key or seed phrase), verify the corresponding
signer row in the "Your signers" list shows the "Imported" badge. Assert the
badge text directly rather than via containsDescendants, since the signer row is
an accessible button that collapses its subtree on iOS.
* tests(mobile): tighten e2e assertions from PR review feedback
Address review findings on the Maestro stabilization PR:
- Require the trailing comma in the simulation "View," label so it no longer
matches unrelated labels like "View on explorer".
- Require the colon in "Sign with:" so it can't match copy like "Sign with
biometrics".
- Narrow the limit-order status matcher to the only states the fixture can
reach (Execution needed | Expired).
- Gate the limit-order review sub-flow on the SignForm continue button's
testID instead of bare "Continue" text; add that testID to SignForm.
- Tighten the manage-tokens description match to the full "Learn more about
default tokens" phrase.
- Drop the duplicate "pending" tag from the safe-shield suite so a
--include-tags pending run doesn't double-run it.
- Add a component test asserting the AppSettings appearance-menu testID.
* tests(mobile): tolerate transient deletion toast in view-account-info e2e
Removing the last safe redirects to onboarding immediately, dismissing the
"...was deleted" toast before it can be asserted. Make the toast assertion
optional and rely on the onboarding-screen assertion as the authoritative
deletion check.
* tests(mobile): scroll the balance-change block into view before asserting
The "No balance change detected" text sits below the fold on the Confirm
transaction screen, so tests that don't otherwise scroll (batch-2-actions,
batch-3-actions-warn) failed to find it. Use scrollUntilVisible instead of a
plain assertion.
* tests(mobile): scroll simulation Run button clear of the sticky footer
On the Confirm transaction screen the SafeShield "Run" simulation button can
sit underneath the sticky "Continue" footer. Maestro considers it visible and
taps it, but the tap lands on the footer button and navigates to "Review and
confirm", so the simulation never runs and the "View" result never appears.
Scroll the Run button into the clear before tapping it.
* tests(mobile): rename "Execution method" to "Pay fees from" in review flow
The execution-method selector on the Review and execute screen was relabeled
"Pay fees from" (SelectExecutor). Update the label assertion and the two taps
that open the "Choose how to execute" sheet to match; the sheet header and
options are unchanged.
---------
Co-authored-by: Hanzo Dev <[email protected]>
169 lines
6.9 KiB
YAML
169 lines
6.9 KiB
YAML
appId: ${APP_ID}
|
|
tags:
|
|
- util
|
|
---
|
|
# ===========================================
|
|
# SafeShield Transaction Checks (Reusable Component)
|
|
# ===========================================
|
|
# Tests the SafeShield widget for pending transactions
|
|
# The widget is automatically visible on the Confirm transaction screen
|
|
# (no button to click - checks start automatically)
|
|
#
|
|
# Environment variables:
|
|
# WIDGET_HEADER_PATTERN: Optional regex pattern to verify the widget header
|
|
# Possible values: "Review details", "Issues found", "Checks passed", "Risk detected"
|
|
# or "Checking transaction..." (loading) or "Checks unavailable" (error)
|
|
# Defaults to ".*(Review details|Issues found|Checks passed|Risk detected).*"
|
|
# BALANCE_CHANGE_PATTERN: Optional text/pattern to verify in Balance change section
|
|
# Example: ".*-.*0\.00002.*" or "No balance change detected"
|
|
# RUN_SIMULATION: Set to "true" to press the Run button and verify simulation link appears
|
|
# Defaults to false
|
|
# EXPECTED_SIMULATION_RESULT: Expected simulation result - "success" or "fail"
|
|
# Only used when RUN_SIMULATION is "true"
|
|
# If not provided, accepts either result
|
|
# VERIFY_DETAILS_SHEET: Set to "true" to tap on widget header and verify bottom sheet opens
|
|
# Defaults to false
|
|
|
|
# ===========================================
|
|
# SafeShield Widget Verification
|
|
# ===========================================
|
|
# Scroll to ensure SafeShield widget is visible (it takes more space than the old button)
|
|
- scroll
|
|
|
|
# The SafeShield widget should be visible automatically with analysis results
|
|
# Wait for checks to complete (widget may show "Checking transaction..." initially)
|
|
- extendedWaitUntil:
|
|
visible:
|
|
text: '.*(Review details|Issues found|Checks passed|Risk detected|Checks unavailable).*'
|
|
timeout: 15000
|
|
|
|
# Verify widget header matches expected pattern
|
|
- assertVisible:
|
|
text: '${WIDGET_HEADER_PATTERN || ".*(Review details|Issues found|Checks passed|Risk detected).*"}'
|
|
|
|
# ===========================================
|
|
# Analysis Labels Verification
|
|
# ===========================================
|
|
# At least one analysis label should be visible (recipient, contract, or threat analysis)
|
|
# These labels can be: "New recipient", "Known recipient", "Known contract", "No threat detected", etc.
|
|
- assertVisible:
|
|
text: '.*(New recipient|Known recipient|Recurring recipient|Unknown recipient|Low activity|Known contract|New contract|Verified contract|No threat detected|Threat analysis failed).*'
|
|
|
|
# ===========================================
|
|
# Transaction Simulation Section
|
|
# ===========================================
|
|
# Transaction simulation is NOT auto-performed - shows "Run" button initially
|
|
- assertVisible:
|
|
text: 'Transaction simulation'
|
|
|
|
# Verify Run button is visible (simulation not yet performed)
|
|
- assertVisible:
|
|
text: 'Run'
|
|
|
|
# ===========================================
|
|
# Run Simulation (Optional)
|
|
# ===========================================
|
|
# Only run simulation if RUN_SIMULATION is set to "true"
|
|
- evalScript: '${output.shouldRunSimulation = (typeof RUN_SIMULATION !== "undefined" && RUN_SIMULATION === "true")}'
|
|
- evalScript: '${output.expectedSimResult = (typeof EXPECTED_SIMULATION_RESULT !== "undefined") ? EXPECTED_SIMULATION_RESULT : null}'
|
|
- evalScript: '${output.expectSuccess = output.expectedSimResult === "success"}'
|
|
- evalScript: '${output.expectFail = output.expectedSimResult === "fail"}'
|
|
|
|
- runFlow:
|
|
when:
|
|
true: '${output.shouldRunSimulation === true}'
|
|
commands:
|
|
# Tap the Run button to start simulation
|
|
- tapOn:
|
|
text: 'Run'
|
|
# Wait for simulation to complete (shows "Running..." then changes to "View").
|
|
# When finished the button gains a link icon (iconAfter), so on iOS its single
|
|
# accessibility label is exposed as "View, " — match the comma so we don't also
|
|
# match unrelated labels like "View on explorer".
|
|
- extendedWaitUntil:
|
|
visible:
|
|
text: 'View,.*'
|
|
timeout: 30000
|
|
# Verify simulation result based on EXPECTED_SIMULATION_RESULT
|
|
# If "success" expected, verify "Simulation successful"
|
|
- runFlow:
|
|
when:
|
|
true: '${output.expectSuccess === true}'
|
|
commands:
|
|
- assertVisible:
|
|
text: 'Simulation successful'
|
|
# If "fail" expected, verify "Simulation failed"
|
|
- runFlow:
|
|
when:
|
|
true: '${output.expectFail === true}'
|
|
commands:
|
|
- assertVisible:
|
|
text: 'Simulation failed'
|
|
# If no specific result expected, accept either
|
|
- runFlow:
|
|
when:
|
|
true: '${output.expectedSimResult === null}'
|
|
commands:
|
|
- assertVisible:
|
|
text: '.*(Simulation successful|Simulation failed).*'
|
|
|
|
# ===========================================
|
|
# Balance Change Block Verification
|
|
# ===========================================
|
|
# Balance change is now shown in a separate block (always visible)
|
|
- assertVisible:
|
|
id: 'balance-change-block'
|
|
|
|
- assertVisible:
|
|
text: 'Balance change.*'
|
|
|
|
# Verify balance change pattern if provided
|
|
- assertVisible:
|
|
text: '${BALANCE_CHANGE_PATTERN || ".*(No balance change detected|ETH|USDC|DAI|\\d+).*"}'
|
|
|
|
# ===========================================
|
|
# Balance Change Info Sheet Test
|
|
# ===========================================
|
|
# Tap on Balance change info icon to open info sheet
|
|
- tapOn:
|
|
text: 'Balance change.*'
|
|
|
|
# Verify the Balance change info sheet opens
|
|
- assertVisible:
|
|
text: '.*The balance change gives an overview of the implications of a transaction.*'
|
|
|
|
# Dismiss the sheet by swiping down
|
|
- swipe:
|
|
direction: DOWN
|
|
|
|
# Verify we're back on the confirm transaction screen
|
|
- assertVisible: 'Confirm transaction'
|
|
|
|
# ===========================================
|
|
# SafeShield Details Sheet (Optional)
|
|
# ===========================================
|
|
# Test opening the SafeShield details bottom sheet
|
|
- evalScript: '${output.shouldVerifyDetailsSheet = (typeof VERIFY_DETAILS_SHEET !== "undefined" && VERIFY_DETAILS_SHEET === "true")}'
|
|
|
|
- runFlow:
|
|
when:
|
|
true: '${output.shouldVerifyDetailsSheet === true}'
|
|
commands:
|
|
# Scroll back up to make widget header visible
|
|
- swipe:
|
|
direction: 'UP'
|
|
# Tap on the widget header to open details sheet
|
|
- tapOn:
|
|
text: '.*(Review details|Issues found|Checks passed|Risk detected).*'
|
|
# Verify the bottom sheet opens with headline
|
|
- assertVisible:
|
|
text: '.*(REVIEW DETAILS|ISSUES FOUND|CHECKS PASSED|RISK DETECTED).*'
|
|
# Verify "Secured by Safe Shield" footer
|
|
- assertVisible:
|
|
text: '.*Secured by.*'
|
|
# Dismiss the sheet by swiping down
|
|
- swipe:
|
|
direction: 'DOWN'
|
|
# Verify we're back on the confirm transaction screen
|
|
- assertVisible: 'Confirm transaction'
|