Skip to content

test(appium): harden wallet and TPSL keypad readiness in iOS smoke flows#32107

Open
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/metamask-mobile-flaky-8a1e
Open

test(appium): harden wallet and TPSL keypad readiness in iOS smoke flows#32107
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/metamask-mobile-flaky-8a1e

Conversation

@cursor

@cursor cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Description

Stabilizes two recurring iOS Appium flaky paths from the Mobile Appium health report:

  • flaky report issue 3: deletes the account (flaky 6/44, 13.6%)
  • flaky report issue 4: adds stop loss to an open long from market details and closes when mark crosses SL (flaky 4/7, 57.1%)

Failure signatures observed:

  • Error: element ("~wallet-screen") still not displayed after 300ms in delete-account.spec.ts
  • Error: element ("~keypad-key-2") still not displayed after 10000ms in perps-edit-tpsl-trigger.spec.ts

Fix:

  • loginAndOpenAccountList now waits for a stronger wallet-ready Appium signal (walletSwapButton) instead of relying on wallet container visibility in this flow.
  • PerpsOrderView.enterTpslTriggerPriceViaKeypad now uses retry-backed keypad readiness before typing and retry-backed taps per keypad digit.

Framework extrapolation rationale:

  • The fixes are in shared flow/POM layers (wallet.flow.ts, PerpsOrderView.ts) rather than single-spec patches, so all Appium tests reusing these paths get the same stability improvements.

Validation:

  • yarn eslint tests/flows/wallet.flow.ts tests/page-objects/Perps/PerpsOrderView.ts (fails in this environment before lint execution: missing Yarn install state / node_modules state file).

Changelog

CHANGELOG entry: null

Related issues

Refs: flaky report issue 3, flaky report issue 4 — https://consensys.slack.com/archives/C08388MPZ9V/p1781885100119159?thread_ts=1781885100.119159&cid=C08388MPZ9V

Manual testing steps

Feature: iOS Appium flaky stabilization for wallet readiness and perps TPSL keypad entry

  Scenario: Open account list after login in account flows
    Given an iOS Appium smoke test logs in with an existing wallet
    When account-list navigation starts immediately after login
    Then wallet-ready assertions should wait for the wallet swap CTA and avoid transient wallet container races

  Scenario: Enter stop loss trigger in perps auto-close flow
    Given an iOS Appium smoke test opens Auto close in perps market details
    When the test focuses the stop-loss trigger input and types a trigger value
    Then keypad readiness and digit taps should retry until the keypad is interactable

Screenshots/Recordings

Before

After

  • N/A (CI rerun pending)

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
  • I've tested with a power user scenario
  • I've instrumented key operations with Sentry traces for production performance metrics

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Open in Web View Automation 

Note

Low Risk
Test-only changes in wallet.flow.ts and PerpsOrderView.ts; no production app logic. Slightly longer waits on failure paths in CI.

Overview
Reduces iOS Appium flake in shared test helpers by tightening when flows consider the UI ready, not by changing app code.

Wallet account-list path: After Playwright login, loginAndOpenAccountList no longer waits on the wallet container. It waits on the wallet swap control via PlaywrightAssertions, so account-list navigation runs only after a stronger “wallet is usable” signal.

Perps TP/SL keypad: enterTpslTriggerPriceViaKeypad retries focusing the trigger input until the first keypad key is visible, then retries each digit tap. Take-profit and stop-loss entry that use this helper inherit the same behavior.

Callers of these helpers (account smoke specs, perps TP/SL specs) get the stabilization without per-spec changes.

Reviewed by Cursor Bugbot for commit 6435c1c. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-authored-by: ramon.acitores <ramon.acitores@consensys.net>
@github-actions github-actions Bot added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. size-S labels Jun 19, 2026
@cmd-ob cmd-ob marked this pull request as ready for review June 19, 2026 16:26
@cmd-ob cmd-ob requested a review from a team as a code owner June 19, 2026 16:26
@cmd-ob cmd-ob added skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-qa QA team and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jun 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low AI analysis: low risk size-S skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants