Skip to content

test(e2e): migrate token-approve confirmations to Appium (MMQA-2189) - #34293

Merged
vivek-consensys merged 2 commits into
mainfrom
MMQA-2189-token-approve-appium
Aug 5, 2026
Merged

test(e2e): migrate token-approve confirmations to Appium (MMQA-2189)#34293
vivek-consensys merged 2 commits into
mainfrom
MMQA-2189-token-approve-appium

Conversation

@vivek-consensys

@vivek-consensys vivek-consensys commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Migrates the Detox token-approve confirmation smoke specs to Appium as part of MMQA-2189 (PR1 of the confirmations transactions Detox→Appium migration).

  • Ports approve, increase-allowance, and set-approval-for-all under tests/smoke-appium/confirmations/transactions/token-approve/
  • Adds shared tests/flows/confirmations.flow.ts helpers (navigateToContractAndTap, confirmCloseAndAssertActivity)
  • Updates confirmation POMs / framework helpers for Appium BottomSheet existence, iOS number-pad spending-cap edit, and Android CDP WebView taps
  • Removes the Detox twins under tests/smoke/confirmations/transactions/token-approve/
  • Makes simulations.ts safe to import under Appium (no Detox device at module load)

Local validation against main-e2e builds: approve / increase-allowance / set-approval-for-all green on iOS and Android.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-2189

Manual testing steps

Feature: Token approve confirmations (Appium smoke)

  Scenario: ERC-20 approve with spending-cap edit
    Given a fixture wallet connected to the local test dapp on Anvil
    When the user opens the ERC-20 approve confirmation and edits the spending cap
    And the user confirms the transaction
    Then Activity shows Approve as Confirmed

  Scenario: setApprovalForAll (ERC-721 / ERC-1155 / revoke)
    Given a fixture wallet connected to the local test dapp on Anvil
    When the user triggers setApprovalForAll or revoke from the test dapp
    And the user confirms the transaction
    Then Activity shows Set approval for all as Confirmed

Local Appium runs (main-e2e release binary):

# iOS
IOS_APP_PATH=build/ci-main-e2e/MetaMask.app \
IOS_SIMULATOR_UDID=<udid> \
yarn appium-smoke:ios -- confirmations/transactions/token-approve/

# Android
ANDROID_APK_PATH=build/ci-main-e2e/app-prod-release.apk \
ANDROID_AVD_NAME=<avd> \
yarn appium-smoke:android -- confirmations/transactions/token-approve/

Screenshots/Recordings

N/A — E2E test migration only; no product UI changes.

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Low Risk
Changes are limited to E2E tests and test helpers; no production app, auth, or wallet logic is modified.

Overview
Moves token-approve confirmation smoke coverage from Detox to Appium and deletes the matching specs under tests/smoke/confirmations/transactions/token-approve/. New Appium suites cover approve, increase-allowance, and set-approval-for-all (including ERC-721 revoke).

Shared confirmations.flow helpers drive the dapp → confirmation → Activity path: Android prefers CDP WebView clicks with a native tap fallback (no double-submit), then confirm, dismiss push opt-in, close browser, and assert Activity.

Test framework / POM updates target confirmation BottomSheets where Appium reports isDisplayed=false: expectElementToExist, confirm wait/gone and single-click confirm with retry in FooterActions, and iOS number-pad spending-cap edit in TokenApproveConfirmation. simulations.ts resolves the localhost sentinel URL at use-time via PlatformDetector so Appium can import it without Detox device. Minor Appium gesture fixes: W3C pointer long press, checkForDisplayed on Gestures.typeText, and iOS keyboard numberPad typing.

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

Port approve, increase-allowance, and set-approval-for-all to smoke-appium with shared confirmations flow helpers, and remove the Detox twins.
@vivek-consensys vivek-consensys added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Aug 4, 2026
@metamask-ci metamask-ci Bot added the team-qa QA team label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamask-ci

metamask-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors."). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps, SmokeMMConnect
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (test-framework-infra-change): Test framework infrastructure changed: tests/framework/Assertions.ts, tests/framework/Gestures.ts. Running all tests.

Performance Test Selection:
No app code changes in this PR — all changes are confined to test infrastructure (smoke specs, page objects, framework helpers, flows, mock responses). There is no impact on app performance metrics such as launch time, login, onboarding, asset loading, swaps, or perps. No performance test tags are warranted.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@vivek-consensys
vivek-consensys marked this pull request as ready for review August 5, 2026 05:21
@vivek-consensys
vivek-consensys requested a review from a team as a code owner August 5, 2026 05:21
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Aug 5, 2026
@vivek-consensys
vivek-consensys added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit a5df6a2 Aug 5, 2026
267 of 272 checks passed
@vivek-consensys
vivek-consensys deleted the MMQA-2189-token-approve-appium branch August 5, 2026 09:29
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 2026
@metamask-ci metamask-ci Bot added the release-8.7.0 Issue or pull request that will be included in release 8.7.0 label Aug 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-8.7.0 Issue or pull request that will be included in release 8.7.0 risk:low AI analysis: low risk size-XL team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants