Skip to content

test(e2e): harden Appium Test Dapp readiness for confirmations smokes (MMQA-2254) - #34577

Draft
chrisleewilcox wants to merge 10 commits into
mainfrom
MMQA-2254-appium-confirmations-dapp
Draft

test(e2e): harden Appium Test Dapp readiness for confirmations smokes (MMQA-2254)#34577
chrisleewilcox wants to merge 10 commits into
mainfrom
MMQA-2254-appium-confirmations-dapp

Conversation

@chrisleewilcox

Copy link
Copy Markdown
Contributor

Description

appium-confirmations-android-smoke has been consistently failing across unrelated PRs (shards 1 and 2), blocking merges.

Root cause is the shared Test Dapp → confirmation path, not a product regression:

  1. Appium waitForTestDappToLoad only asserted the URL bar, while Test Dapp action buttons stay disabled until page JS runs and the provider connects / EIP-1559 support is detected.
  2. Android WebView.tapById preferred CDP clicks that can report success without MetaMask opening the confirmation sheet (confirm-button never appears).

This PR hardens the shared helpers used by confirmations Appium smokes:

  • Wait for Test Dapp page chrome (title / logo) after the URL bar
  • Wait for provider readiness (selectedAddress / #accounts) and DOM-enabled target before tap
  • Prefer native UiAutomator taps on Android confirmation flows (preferNative)
  • Keep confirm-sheet retry + push-notification dismiss

Changelog

CHANGELOG entry: null

Related issues

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

Related: https://consensyssoftware.atlassian.net/browse/MMQA-2232

Manual testing steps

Feature: Confirmations Appium Android smoke stability

  Scenario: Test Dapp transaction and approve flows open confirmations
    Given a main-e2e Android build and emulator
    And fixtures with the test dapp connected on Anvil

    When appium-confirmations-android-smoke runs
    Then shard 1 specs can find/enable Test Dapp buttons (sendEIP1559 / createToken / eip5792SendCalls)
    And shard 2 setApprovalForAll opens confirm-button after the dapp tap

Local validation so far:

yarn jest tests/framework/AndroidWebViewNative.test.ts --watchman=false

Screenshots/Recordings

N/A — test/infra-only change; 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
  • 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.

Made with Cursor

… (MMQA-2254)

Wait for page chrome, provider injection, and enabled controls before tapping;
prefer native Android WebView taps so CDP false-success clicks do not block CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

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 added the team-qa QA team label Aug 11, 2026
@metamask-ci

metamask-ci Bot commented Aug 11, 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.

chrisleewilcox and others added 5 commits August 10, 2026 17:35
iOS WebView logo/title waits left the session in WEBVIEW, breaking native
close-browser taps in network-manager2. Use native WebView + title text instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
… reset (MMQA-2254)

iOS does not expose the Test Dapp title in the native tree. Keep WebView
logo/title waits on iOS and always switch back to NATIVE_APP afterward.

Co-authored-by: Cursor <cursoragent@cursor.com>
…QA-2254)

After reload, fixture permissions can inject ethereum without
globalConnectionChange, leaving action buttons disabled. Request accounts,
emit the dapp connection event, then use trusted CDP clicks with native
fallback so confirm sheets open reliably on Android Appium.

Co-authored-by: Cursor <cursoragent@cursor.com>
…s (MMQA-2254)

Screenshots showed Create Token already clicked ("Creation Failed") while
CI re-tapped every 3s waiting for confirm-button. Wait 15s per tap for gas
estimation, nudge dapp UI gates without eth_requestAccounts, and emit
blockBaseFeePerGasUpdate so EIP-1559 send enables.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.11%. Comparing base (cbe5e23) to head (0e53415).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #34577      +/-   ##
==========================================
- Coverage   85.12%   85.11%   -0.01%     
==========================================
  Files        6350     6369      +19     
  Lines      173080   173713     +633     
  Branches    42804    42977     +173     
==========================================
+ Hits       147333   147864     +531     
- Misses      15708    15771      +63     
- Partials    10039    10078      +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

chrisleewilcox and others added 2 commits August 10, 2026 20:27
…s (MMQA-2254)

CI screenshots showed NOT CONNECTED / Account undefined after we dispatched
globalConnectionChange — buttons enabled without src.provider. Click Connect
so the dapp runs its real eth_requestAccounts handler, then wait for #accounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
chrisleewilcox and others added 2 commits August 10, 2026 21:07
…MMQA-2254)

CI showed Active Provider UUID/Name empty while eth_accounts still worked —
Connect used unset globalContext.provider. Click "Use MetaMask" after the
EIP-6963 button appears, then hydrate accounts via Connect as before.

Co-authored-by: Cursor <cursoragent@cursor.com>
…2254)

iOS evaluateInWebView cannot await async eth_accounts Promises, so the new
hydration path timed out and broke previously-green iOS confirmations smokes.
Keep EIP-6963 Active Provider + Connect hydration on Android only.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeNetworkExpansion, SmokeNetworkAbstractions, SmokeConfirmations, SmokeWalletPlatform, SmokeBrowser, SmokeMultiChainAPI, SmokeSnaps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
Shared test infra changed (tests/flows/browser.flow.ts, tests/flows/confirmations.flow.ts, tests/selectors/Browser/TestDapp.selectors.ts). Found 60 affected spec file(s). Running tags: SmokeNetworkExpansion, SmokeNetworkAbstractions, SmokeConfirmations, SmokeWalletPlatform, SmokeBrowser, SmokeMultiChainAPI, SmokeSnaps

Performance Test Selection:
All changes are confined to test infrastructure files (flows, framework utilities, selectors). No app source code was modified. There is no performance impact to measure.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants