Skip to content

test: migrate MMConnect multichain e2e from performance BrowserStack to Appium smoke CI#33380

Draft
chrisleewilcox wants to merge 12 commits into
mainfrom
MMQA-1982-smoke-mmconnect-thin-slice
Draft

test: migrate MMConnect multichain e2e from performance BrowserStack to Appium smoke CI#33380
chrisleewilcox wants to merge 12 commits into
mainfrom
MMQA-1982-smoke-mmconnect-thin-slice

Conversation

@chrisleewilcox

@chrisleewilcox chrisleewilcox commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Add a thin-slice Appium smoke path for the active MMConnect multichain browser test, using the standard e2e CI wallet (fixtures) instead of the BrowserStack baked-SRP performance path.

This is a reset of the earlier approach (#31937, closed). Per team guidance: fixtures + scenarioType: 'e2e', CI mocking via withFixtures/DEFAULT_MOCKS, and Chrome on CI via google_apis.

  • Add SmokeMMConnect tag and yarn appium-smoke:mmconnect:android
  • Add tests/smoke-appium/mm-connect/connection-multichain.spec.ts with withFixtures, Solana permission fixture, e2e login, and safelyOnboardChrome: true
  • Wire appium-mmconnect-android-smoke (1 shard, 35 min) with android-tag: google_apis

Not in this PR: removing MMConnect from the performance workflow, migrating the other 11 skipped specs (WAPI-1511).

Changelog

CHANGELOG entry: null

Related issues

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

Manual testing steps

Feature: SmokeMMConnect thin slice discovery and local run

  Scenario: suite is discoverable under SmokeMMConnect tag
    Given the branch is checked out locally

    When I run `yarn playwright test --config tests/playwright.smoke-appium.config.ts --project android-smoke --grep SmokeMMConnect --list`
    Then 1 test is listed: connection-multichain under SmokeMMConnect

  Scenario: active MMConnect test runs on local Android emulator
    Given a main-e2e release APK is available and a google_apis Android emulator is running

    When I run `yarn appium-smoke:mmconnect:android` with ANDROID_APK_PATH set to the main-e2e APK
    Then connection-multichain.spec.ts passes

Screenshots/Recordings

No app UI changes — CI/test infrastructure thin slice. Evidence is the before/after migration below.

Before

Active MMConnect multichain test lived only in the performance BrowserStack pipeline:

Area Before
Suite path tests/performance/mm-connect/connection-multichain.spec.ts
Tag Performance
Wallet Baked SRP / loginToAppPlaywright()E2E_PASSWORD
Mocks Live/network (no withFixtures)
CI Performance BrowserStack workflow
Chrome BrowserStack device Chrome + optional BS Local

After

Thin slice on Appium smoke CI with the standard e2e wallet:

Area After
Suite path tests/smoke-appium/mm-connect/connection-multichain.spec.ts
Tag SmokeMMConnect
Wallet withFixtures + FixtureBuilder().withSolanaAccountPermission() + scenarioType: 'e2e'
Mocks DEFAULT_MOCKS via withFixtures
CI appium-mmconnect-android-smoke (google_apis for Chrome)
Chrome Emulator Chrome + safelyOnboardChrome: true
Performance suite Still present on main (removal is follow-up after this job is green)

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.

Made with Cursor

Migrate the active connection-multichain spec to smoke-appium with e2e
fixtures and wire appium-mmconnect-android-smoke on google_apis for Chrome.

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 Jul 15, 2026
@chrisleewilcox chrisleewilcox self-assigned this Jul 15, 2026
@metamask-ci

metamask-ci Bot commented Jul 15, 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 documented my code using JSDoc format if applicable"). 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 chrisleewilcox changed the title test: add SmokeMMConnect thin slice for multichain Appium smoke test: migrate MMConnect multichain e2e from performance BrowserStack to Appium smoke CI Jul 15, 2026
chrisleewilcox and others added 3 commits July 15, 2026 13:02
Format mm-connect utils for CI format:check. Harden Android Chrome launch
(clear → FRE flags → force-stop) and open dapp URLs via VIEW intent to
avoid flaky omnibox selectors on google_apis emulators.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PlaywrightElement exposes isVisible, not isDisplayed — fixes lint:tsc.

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 84.40%. Comparing base (96abde9) to head (30bde6f).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33380   +/-   ##
=======================================
  Coverage   84.40%   84.40%           
=======================================
  Files        6133     6133           
  Lines      163917   163918    +1     
  Branches    40007    40020   +13     
=======================================
+ Hits       138354   138360    +6     
+ Misses      16054    16052    -2     
+ Partials     9509     9506    -3     

☔ 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 July 15, 2026 13:58
CI loaded the playground in Chrome but Appium selected MetaMask's
webview when URL metadata was stale. Prefer WEBVIEW_chrome for http
dapps, accept emulator host aliases, and fix VIEW intent -p packaging.

Co-authored-by: Cursor <cursoragent@cursor.com>
After opening the dapp via VIEW intent, dismiss leftover Chrome dialogs
and only skip omnibox navigation when the NTP search placeholder is gone.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added size-L and removed size-M labels Jul 15, 2026
Appium switchContext(WEBVIEW_chrome) hangs during Chromedriver session
creation on google_apis Chrome 113 despite a live debugger URL. Bypass
Chromedriver for smoke by attaching over CDP and use localhost+adb reverse.

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

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🧪 Flaky unit test detection

✅ All previously detected unit test flakiness issues in this PR have been fixed.

View recent run history

This check is informational only and does not block merging.

chrisleewilcox and others added 4 commits July 15, 2026 15:54
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added size-XL and removed size-L labels Jul 16, 2026
Synthetic JS clicks never reach MetaMask because the SDK defers
metamask:// navigation; use trusted CDP mouse input and Appium deepLink.

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

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeMMConnect, SmokeMultiChainAPI, SmokeNetworkExpansion
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR introduces the new SmokeMMConnect tag and its first smoke test spec (connection-multichain.spec.ts), along with supporting infrastructure:

  1. SmokeMMConnect (primary): The PR adds the SmokeMMConnect tag to tags.js, creates the first spec file (tests/smoke-appium/mm-connect/connection-multichain.spec.ts), adds the CI workflow job (appium-mmconnect-android-smoke), and all supporting utilities. This tag must run to validate the new test infrastructure works end-to-end.

  2. SmokeMultiChainAPI and SmokeNetworkExpansion: Per the SmokeMMConnect tag description, it is 'Related to SmokeMultiChainAPI and SmokeNetworkExpansion for CAIP-25 / multi-chain provider behavior.' The new test exercises Multichain API connect/disconnect with eip155:1 session scopes, which overlaps with these tags' coverage areas.

Shared infrastructure changes:

  • PlaywrightContextHelpers.ts: Modified WebView context switching with URL alias matching (10.0.2.2/localhost/127.0.0.1) and Chrome package detection. These changes are improvements targeted at MMConnect but could affect other Appium tests that switch WebView contexts. The changes preserve existing fallback behavior.
  • native-browser.flow.ts: Enhanced Chrome navigation with VIEW intent approach and better dialog handling. Used by performance mm-connect specs and uniswap-interaction.spec.ts.
  • EmulatorConfigBuilder.ts: Added chromedriverArgs: ['--remote-allow-origins=*'] and recreateChromeDriverSessions: true - these affect all Appium tests using ChromeDriver but are targeted compatibility fixes.
  • PlaywrightUtilities.ts: Additive new methods (forceStopChrome, openUrlInChrome, grantChromeNotificationPermission, collapseStatusBar) - no modification to existing methods.
  • AndroidScreenHelpers.ts: Significantly enhanced deeplink chooser handling - only used by MMConnect tests.

The shared infrastructure changes (PlaywrightContextHelpers, EmulatorConfigBuilder) could theoretically affect other Appium smoke tests, but the changes are carefully scoped to Chrome/MMConnect scenarios with fallback paths preserved. No app code was changed, so broader smoke suites are not warranted.

Performance Test Selection:
No app code was changed in this PR - all changes are to test infrastructure (smoke specs, framework helpers, page objects, CI workflows). The native-browser.flow.ts and PlaywrightContextHelpers.ts changes affect performance mm-connect specs and uniswap-interaction.spec.ts (PerformanceLogin), but: (1) the mm-connect performance specs use a 'Performance' tag that doesn't map to any available performance tag, and (2) the changes to native-browser.flow.ts are improvements to Chrome navigation reliability (not performance regressions). The uniswap-interaction.spec.ts uses @PerformanceLogin but the changes to native-browser.flow.ts are additive improvements (VIEW intent approach, better dialog handling) that should not negatively impact measured performance. No performance-sensitive app code was modified.

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