Skip to content

test: MM Connect Multichain E2E#40818

Merged
adonesky1 merged 23 commits intomainfrom
am/test-e2e-mm-connect-multichain
Mar 26, 2026
Merged

test: MM Connect Multichain E2E#40818
adonesky1 merged 23 commits intomainfrom
am/test-e2e-mm-connect-multichain

Conversation

@wenfix
Copy link
Copy Markdown
Contributor

@wenfix wenfix commented Mar 11, 2026

Description

Adds E2E tests for the Multichain API using Metamask Connect (formerly SDK).

Five scenarios:

  1. Simultaneous multi-chain + Solana connection — Verifies wallet_createSession can grant 3 EVM chains + Solana scope simultaneously and that all ScopeCards render.
  2. Per-chain personal_sign routing — Confirms personal_sign requests are routed to the correct chain scope and return valid signatures.
  3. Per-chain eth_chainId isolation — Validates that eth_chainId returns the correct hex chain ID for each connected scope.
  4. Permission removal reflection — Tests that removing a chain permission via the extension UI immediately reflects in the dapp (ScopeCard disappears).
  5. Full session termination — Verifies wallet_revokeSession (via sdkDisconnect()) clears session state on both dapp and wallet sides.

New Test Dapp and Page Object

Adds the MM Connect Test Dapp (test/e2e/page-objects/pages/test-dapp-mm-connect.ts):

  • The dapp exposes the MM Connect connectors.
  • Replicates @metamask/playground-ui test ID logic in-tree for stable selectors
  • Provides clean abstraction: selectNetworks(), clickConnect(), triggerMethod(), checkMethodResult(), checkScopeCardVisible()
  • Handles async dialog flow correctly (trigger → approve → assert result via waitForSelector)

Infrastructure

  • Added DAPP_PATH.TEST_DAPP_MM_CONNECT constant
  • Added MM_CONNECT_EVM_CHAINS and MM_CONNECT_FEATURED_CHAIN_IDS constants
  • Added @metamask/browser-playground@0.3.0 devDependency
  • Updated privacy-snapshot.json with eth.merkle.io (RPC) and mm-sdk-analytics.api.cx.metamask.io (telemetry)
  • All tests use FixtureBuilderV2

Privacy Changes

Adds two entries:

  • https://eth.merkle.io: is the default RPC for Ethereum mainnet chain definition at viem, the base library on top of which wagmi is built. wagmi is used by the browser-playground to enable testing the new MM Connect wagmi connector.
  • mm-sdk-analytics.api.cx.metamask.io: is the analytics endpoint for SDK related metrics.

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes: WAPI-1044

Manual testing steps

  1. yarn && yarn build:test
  2. yarn test:e2e:single test/e2e/tests/sdk/connect-multichain.spec.ts --browser=chrome

Screenshots/Recordings

Before

After

Pre-merge author checklist

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

Medium Risk
Primarily adds E2E tests and test infrastructure, but introduces a new dev dependency (@metamask/browser-playground) and expands the privacy allowlist, which can affect CI stability and policy expectations.

Overview
Adds a new MM Connect multichain E2E suite (connect-multichain.spec.ts) that exercises wallet_createSession across multiple EVM chains plus Solana, per-scope signing/eth_chainId, permission removal propagation, and wallet_revokeSession disconnect behavior.

Introduces a dedicated page object (test-dapp-mm-connect.ts) and new E2E constants (DAPP_PATH.TEST_DAPP_MM_CONNECT, MM_CONNECT_EVM_CHAINS, MM_CONNECT_FEATURED_CHAIN_IDS) to drive the @metamask/browser-playground dapp, and refactors permission-page navigation by extracting getPermissionsPageForHost into permissions.flow.ts.

Updates test tooling/config by adding @metamask/browser-playground@0.3.0 to dev deps and depcheck ignores, plus extends privacy-snapshot.json with eth.merkle.io and mm-sdk-analytics.api.cx.metamask.io.

Written by Cursor Bugbot for commit 35ed097. This will update automatically on new commits. Configure here.

@wenfix wenfix added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Mar 11, 2026
@wenfix wenfix requested review from a team as code owners March 11, 2026 18:16
@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.

@metamaskbot metamaskbot added the team-wallet-integrations Wallet Integrations team label Mar 11, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 11, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​metamask/​browser-playground@​0.3.0781001009480

View full report

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 11, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • @metamask/browser-playground@0.3.0

View full report

@wenfix
Copy link
Copy Markdown
Contributor Author

wenfix commented Mar 11, 2026

@SocketSecurity ignore npm/@metamask/browser-playground@0.3.0

This is MM Connect's test dapp.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 11, 2026

✨ Files requiring CODEOWNER review ✨

🕵️ @MetaMask/extension-privacy-reviewers (1 files, +2 -0)
  • 📄 privacy-snapshot.json +2 -0

🧪 @MetaMask/qa (2 files, +359 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 flows/
          • 📄 permissions.flow.ts +26 -0
        • 📁 pages/
          • 📄 test-dapp-mm-connect.ts +333 -0

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 11, 2026

Builds ready [3e23c47]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28226230014293300
total28226230014293300
Confirm Txconfirm_tx6046601660732160526073
total6046601660732160526073
Bridge User Actionsbridge_load_page21220222911214229
bridge_load_asset_picker22919927833260278
bridge_search_token73870178232759782
total1200110412667712651266
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14261178188012014781625
load118096315439812381336
domContentLoaded117396015349712311322
domInteractive2917116212585
firstPaint183651176151215335
backgroundConnect21119325912216234
firstReactRender21126072134
initialActions1011224
loadScripts97876613359510351126
setupStore1364971525
numNetworkReqs352792182782
Power User HomeuiStartup5515220211990199366528055
load13681186223315113971639
domContentLoaded13481179219214513661608
domInteractive3921168253799
firstPaint1968639681265329
backgroundConnect19263009305181034165108
firstReactRender28194853039
initialActions107114
loadScripts1107945190113711281352
setupStore208195202135
numNetworkReqs1276127142130245
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182242221224
srpButtonToSrpForm97911035101103
confirmSrpToPwForm21212202122
pwFormToMetricsScreen15151601616
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen5935836049598604
openAccountMenuToAccountListLoaded2923289529361629312936
total3886384539202738973920
Onboarding New WalletcreateWalletToSocialScreen2182172201219220
srpButtonToPwForm1051041082106108
createPwToRecoveryScreen888088
skipBackupToMetricsScreen35333713637
agreeButtonToOnboardingSuccess16151711617
doneButtonToAssetList52247262356541623
total9068511002549301002
Asset DetailsassetClickToPriceChart13211514511140145
total13211514511140145
Solana Asset DetailsassetClickToPriceChart8780103984103
total8780103984103
Import Srp HomeloginToHomeScreen2309226723342623272334
openAccountMenuAfterLogin65517497174
homeAfterImportWithNewWallet24162187264015325112640
total47734577504517748355045
Send TransactionsopenSendPageFromHome25173262932
selectTokenToSendFormLoaded20182532225
reviewTransactionToConfirmationPage968849115713911161157
total1013894121414011521214
SwapopenSwapPageFromHome45394944949
fetchAndDisplaySwapQuotes2694268327131127002713
total2728270827491527302749
🌐 Dapp Page Load Benchmarks

Current Commit: 3e23c47 | Date: 3/11/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±75ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 752ms (±72ms) 🟢 | historical mean value: 742ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 81ms (±14ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 75ms 1.02s 1.38s 1.28s 1.38s
domContentLoaded 752ms 72ms 715ms 1.05s 957ms 1.05s
firstPaint 81ms 14ms 64ms 212ms 92ms 212ms
firstContentfulPaint 81ms 14ms 64ms 212ms 92ms 212ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 5.17 MiB (100%)
  • ui: 8.3 MiB (100%)
  • common: 11.06 MiB (100%)

wenfix added 3 commits March 12, 2026 10:30
homepage.headerNavbar.openPermissionsPage() does not exist on HeaderNavbar.
The correct utility is openPermissionsPageFlow() from permissions.flow.ts,
which calls clickAllPermissionsButton() and handles the Gator (Flask) flow
by detecting and clicking 'Sites' when needed.
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 12, 2026

Builds ready [d1d48c6]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account33426648783357487
total33426648783357487
Confirm Txconfirm_tx601160066019560096019
total601160066019560096019
Bridge User Actionsbridge_load_page24519729938279299
bridge_load_asset_picker2542472606259260
bridge_search_token73670475920746759
total1280123313233212841323
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14821268184811215291708
load12311030155510412741425
domContentLoaded12241025154610412671415
domInteractive3218155262694
firstPaint167691200131206324
backgroundConnect21820127213221243
firstReactRender21125772334
initialActions108225
loadScripts1022826133610210641205
setupStore1464661725
numNetworkReqs362783173479
Power User HomeuiStartup5611223417596246264178708
load13361152257617813671628
domContentLoaded13151145257217313381582
domInteractive3420147233187
firstPaint2049351696273419
backgroundConnect196629514287214031455462
firstReactRender27195163137
initialActions109113
loadScripts1079933148111111041332
setupStore206319351933
numNetworkReqs20710338044223288
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192172212219221
srpButtonToSrpForm94949409494
confirmSrpToPwForm22212202222
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16161601616
doneButtonToHomeScreen64160169833653698
openAccountMenuToAccountListLoaded2939289929843029372984
total3907389439231239233923
Onboarding New WalletcreateWalletToSocialScreen2192182221219222
srpButtonToPwForm1111071143114114
createPwToRecoveryScreen989099
skipBackupToMetricsScreen38373913939
agreeButtonToOnboardingSuccess16161701717
doneButtonToAssetList50947854323513543
total89487891114911911
Asset DetailsassetClickToPriceChart615086156086
total615086156086
Solana Asset DetailsassetClickToPriceChart1293922769189227
total1293922769189227
Import Srp HomeloginToHomeScreen2293221123605423172360
openAccountMenuAfterLogin734311230106112
homeAfterImportWithNewWallet2399235624624024012462
total4770466048446747904844
Send TransactionsopenSendPageFromHome26242812628
selectTokenToSendFormLoaded33254263542
reviewTransactionToConfirmationPage961856109410110251094
total1029923114610511211146
SwapopenSwapPageFromHome1471401525152152
fetchAndDisplaySwapQuotes2705268927301827242730
total2848278728993928782899
🌐 Dapp Page Load Benchmarks

Current Commit: d1d48c6 | Date: 3/12/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 972ms (±71ms) 🟢 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 690ms (±80ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±118ms) 🟢 | historical mean value: 83ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 972ms 71ms 931ms 1.29s 1.18s 1.29s
domContentLoaded 690ms 80ms 651ms 1.20s 891ms 1.20s
firstPaint 87ms 118ms 64ms 1.26s 84ms 1.26s
firstContentfulPaint 87ms 118ms 64ms 1.26s 84ms 1.26s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 59 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 12, 2026

Builds ready [20bb3aa]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2742652827278282
total2742652827278282
Confirm Txconfirm_tx600859946019960126019
total600859946019960126019
Bridge User Actionsbridge_load_page2432402473247247
bridge_load_asset_picker24021127222253272
bridge_search_token7437317579745757
total1248120113073712641307
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14791242180011015291682
load1226103914909712531418
domContentLoaded1218103414569312461388
domInteractive3017119202786
firstPaint1627643582219299
backgroundConnect22019827616222256
firstReactRender21114572338
initialActions108114
loadScripts101683112529310411185
setupStore1374161523
numNetworkReqs362787173679
Power User HomeuiStartup5356225217328219564148409
load13051131180312313431590
domContentLoaded12851124178711913201566
domInteractive39202634031115
firstPaint1778451586242299
backgroundConnect176630314299203425795093
firstReactRender2819335312732
initialActions105112
loadScripts1063917155611110981316
setupStore1766291834
numNetworkReqs1748842549196242
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2162152181218218
srpButtonToSrpForm90899119091
confirmSrpToPwForm21212212222
pwFormToMetricsScreen14141501415
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen68262473044730730
openAccountMenuToAccountListLoaded2492248125071024932507
total36823475391518939063915
Onboarding New WalletcreateWalletToSocialScreen2192182211219221
srpButtonToPwForm1161141171116117
createPwToRecoveryScreen999099
skipBackupToMetricsScreen42414624346
agreeButtonToOnboardingSuccess18171801818
doneButtonToAssetList51649755925508559
total92590596524919965
Asset DetailsassetClickToPriceChart634485147085
total634485147085
Solana Asset DetailsassetClickToPriceChart903416357155163
total903416357155163
Import Srp HomeloginToHomeScreen2228217323004922432300
openAccountMenuAfterLogin69637447474
homeAfterImportWithNewWallet2298227123262023022326
total46414546484712045974847
Send TransactionsopenSendPageFromHome26193352933
selectTokenToSendFormLoaded27253022930
reviewTransactionToConfirmationPage1147862152724713301527
total1212920163726613931637
SwapopenSwapPageFromHome1066213527124135
fetchAndDisplaySwapQuotes269126892694226922694
total2775267228245728152824
🌐 Dapp Page Load Benchmarks

Current Commit: 20bb3aa | Date: 3/12/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±47ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 743ms (±65ms) 🟢 | historical mean value: 736ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 94ms (±133ms) 🟢 | historical mean value: 81ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 47ms 1.02s 1.43s 1.07s 1.43s
domContentLoaded 743ms 65ms 716ms 1.34s 759ms 1.34s
firstPaint 94ms 133ms 64ms 1.41s 92ms 1.41s
firstContentfulPaint 94ms 133ms 64ms 1.41s 92ms 1.41s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 59 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 23, 2026

Builds ready [8039ce2]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2842742967286296
total2842742967286296
Confirm Txconfirm_tx6076601361204461116120
total6076601361204461116120
Bridge User Actionsbridge_load_page25619331440278314
bridge_load_asset_picker2432392515251251
bridge_search_token75873577013769770
total1263124612881612631288
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14571213178411215101656
load1205976145910212571374
domContentLoaded1199972145410012501365
domInteractive3018115212584
firstPaint1377238168173245
backgroundConnect21920128615224253
firstReactRender20133842126
initialActions105124
loadScripts99778312329710421156
setupStore1373561624
numNetworkReqs393186163481
Power User HomeuiStartup58092198177202741661710429
load13111146200613113531529
domContentLoaded12901139195112513371518
domInteractive3620220283385
firstPaint2057645185276327
backgroundConnect237532214453258833106924
firstReactRender24153942633
initialActions105113
loadScripts1062909169811610871266
setupStore1563961827
numNetworkReqs1819938452199282
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192162222221222
srpButtonToSrpForm94929729497
confirmSrpToPwForm22222302223
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16161701617
doneButtonToHomeScreen53151254914540549
openAccountMenuToAccountListLoaded3018291431169831153116
total3911382740107739934010
Onboarding New WalletcreateWalletToSocialScreen2182162201220220
srpButtonToPwForm1111091152112115
createPwToRecoveryScreen98101910
skipBackupToMetricsScreen42394424344
agreeButtonToOnboardingSuccess17161811818
doneButtonToAssetList655487970176704970
total1060884140819211061408
Asset DetailsassetClickToPriceChart79758548085
total79758548085
Solana Asset DetailsassetClickToPriceChart953914838113148
total953914838113148
Import Srp HomeloginToHomeScreen2371229824547224322454
openAccountMenuAfterLogin685297167297
homeAfterImportWithNewWallet12783082878110623522878
total379927135757127148785757
Send TransactionsopenSendPageFromHome27233132931
selectTokenToSendFormLoaded28223353133
reviewTransactionToConfirmationPage12901171143810813481438
total13601253149410314271494
SwapopenSwapPageFromHome98911045104104
fetchAndDisplaySwapQuotes2692267927051027012705
total279627922799327992799
🌐 Dapp Page Load Benchmarks

Current Commit: 8039ce2 | Date: 3/23/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 967ms (±89ms) 🟢 | historical mean value: 1.06s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 689ms (±101ms) 🟢 | historical mean value: 748ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 88ms (±147ms) 🟢 | historical mean value: 91ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 967ms 89ms 922ms 1.60s 1.18s 1.60s
domContentLoaded 689ms 101ms 648ms 1.49s 885ms 1.49s
firstPaint 88ms 147ms 60ms 1.55s 84ms 1.55s
firstContentfulPaint 88ms 147ms 60ms 1.55s 84ms 1.55s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 59 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 24, 2026

Builds ready [f30a5d7]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2782682847284284
total2782682847284284
Confirm Txconfirm_tx604460386051560456051
total604460386051560456051
Bridge User Actionsbridge_load_page24822426816263268
bridge_load_asset_picker2552492625258262
bridge_search_token79575483834833838
total1293124613534213311353
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14881243182811015291677
load1232103614559412721401
domContentLoaded1225102914399212681394
domInteractive3016131202582
firstPaint155721271134192296
backgroundConnect22520030716232253
firstReactRender2212265252128
initialActions107123
loadScripts101783012269110611182
setupStore1464161625
numNetworkReqs393184163779
Power User HomeuiStartup4850205510346185658627911
load13831140272719614161714
domContentLoaded13591120270519413881700
domInteractive45202894837154
firstPaint20785572101295359
backgroundConnect16333207804162127574396
firstReactRender25174052733
initialActions106114
loadScripts1120898242418511441434
setupStore1664471928
numNetworkReqs2358334154273312
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182162191219219
srpButtonToSrpForm92919419294
confirmSrpToPwForm22212202222
pwFormToMetricsScreen15151601516
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen53450456927550569
openAccountMenuToAccountListLoaded3007293130997630993099
total3933384639745039703974
Onboarding New WalletcreateWalletToSocialScreen2182182190219219
srpButtonToPwForm1111101131112113
createPwToRecoveryScreen989099
skipBackupToMetricsScreen36363703637
agreeButtonToOnboardingSuccess16161711717
doneButtonToAssetList50850052210522522
total8998919118911911
Asset DetailsassetClickToPriceChart675488137688
total675488137688
Solana Asset DetailsassetClickToPriceChart45385265052
total45385265052
Import Srp HomeloginToHomeScreen24582283261012725422610
openAccountMenuAfterLogin624883126683
homeAfterImportWithNewWallet1229447242293823322422
total38552779499792749034997
Send TransactionsopenSendPageFromHome29283013030
selectTokenToSendFormLoaded30273532935
reviewTransactionToConfirmationPage997794114114211221141
total1068852120415112021204
SwapopenSwapPageFromHome823115246117152
fetchAndDisplaySwapQuotes269626842709927062709
total2778272228604928022860
🌐 Dapp Page Load Benchmarks

Current Commit: f30a5d7 | Date: 3/24/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±74ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 745ms (±72ms) 🟢 | historical mean value: 735ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±10ms) 🟢 | historical mean value: 86ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 74ms 1.01s 1.34s 1.27s 1.34s
domContentLoaded 745ms 72ms 705ms 1.03s 959ms 1.03s
firstPaint 80ms 10ms 64ms 164ms 92ms 164ms
firstContentfulPaint 80ms 10ms 64ms 164ms 92ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -296 Bytes (0%)
  • ui: 1.23 KiB (0.01%)
  • common: 2.15 KiB (0.02%)

@wenfix
Copy link
Copy Markdown
Contributor Author

wenfix commented Mar 24, 2026

hey @seaona thanks again for the feedback, I've applied your suggestions in 8039ce2 and f30a5d7.

The latter handles the Find-then-read anti-pattern you highlighted, let me know if this solution makes sense or is overkill 🙏

async selectNetworks(desiredChainIds: string[]): Promise<void> {
for (const chainId of MM_CONNECT_FEATURED_CHAIN_IDS) {
const selector = this.checkboxSelector(chainId);
const isChecked = await this.driver.readElementWithRetry(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi there 👋 I think we don't need a new driver method, we could use the existing method waitUntil which essentially achieves the same goal
Something like:

let isChecked = false;
await this.driver.waitUntil(
  async () => {
    try {
      const element = await this.driver.findElement(selector);
      isChecked = await element.isSelected();
      return true;
    } catch (error) {
      const err = error as { name?: string };
         if (err.name === 'StaleElementReferenceError') {
            return false;
         }
            throw error;
          }
        },
        { interval: 500, timeout: this.driver.timeout },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey thanks again! handled here: fa3ebcb

* @param {number} [options.timeout] - Timeout in milliseconds
* @returns {Promise<*>} Promise resolving to the read value
*/
async readElementWithRetry(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could remove that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handled here: fa3ebcb

Copy link
Copy Markdown
Member

@seaona seaona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi there 👋 thanks for the changes! Overall looks good. I added a small suggestion for simplifying a bit the approach 🙏

@wenfix
Copy link
Copy Markdown
Contributor Author

wenfix commented Mar 25, 2026

hi there 👋 thanks for the changes! Overall looks good. I added a small suggestion for simplifying a bit the approach 🙏

Thanks again for the feedback, I've addressed it 🫡

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@sonarqubecloud
Copy link
Copy Markdown

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 25, 2026

Builds ready [35ed097]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2882872901290290
total2882872901290290
Confirm Txconfirm_tx6066605060911460726091
total6066605060911460726091
Bridge User Actionsbridge_load_page21518226833236268
bridge_load_asset_picker26723130727288307
bridge_search_token75273376613761766
total123212281236312361236
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14861231186911415321702
load12281011150410212771414
domContentLoaded1220100614609712721389
domInteractive291798182682
firstPaint148711467149183227
backgroundConnect21920328314221250
firstReactRender2413339322233
initialActions106124
loadScripts101780312489710681184
setupStore1567691624
numNetworkReqs393188163478
Chrome Browserify Startup Power User HomeuiStartup55012327165932989618013142
load14241192264118914741733
domContentLoaded14021186259618314581683
domInteractive42222303737140
firstPaint22291599106298402
backgroundConnect222630713915280731199585
firstReactRender29206083149
initialActions109114
loadScripts1147953160612511981415
setupStore1975892136
numNetworkReqs26612645964316350
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192182191219219
srpButtonToSrpForm96949929799
confirmSrpToPwForm23232402324
pwFormToMetricsScreen16161701717
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen61953071582714715
openAccountMenuToAccountListLoaded3012293531198731163119
total40043861420011840264200
Onboarding New WalletcreateWalletToSocialScreen2182172191218219
srpButtonToPwForm1121071215110121
createPwToRecoveryScreen888088
skipBackupToMetricsScreen37363813738
agreeButtonToOnboardingSuccess16151601616
doneButtonToAssetList610474893161684893
total1012863134318410831343
Asset DetailsassetClickToPriceChart785198179498
total785198179498
Solana Asset DetailsassetClickToPriceChart887498109798
total887498109798
Import Srp HomeloginToHomeScreen2305223623795123132379
openAccountMenuAfterLogin443057104657
homeAfterImportWithNewWallet1536359229391722832293
total39862779515099246205150
Send TransactionsopenSendPageFromHome442484235784
selectTokenToSendFormLoaded31263633236
reviewTransactionToConfirmationPage88982095250917952
total100498210161610161016
SwapopenSwapPageFromHome1159613514125135
fetchAndDisplaySwapQuotes2692268027101227032710
total2807278028382128242838
🌐 Dapp Page Load Benchmarks

Current Commit: 35ed097 | Date: 3/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±74ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 742ms (±72ms) 🟢 | historical mean value: 740ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 86ms (±10ms) 🟢 | historical mean value: 87ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 74ms 1.00s 1.34s 1.30s 1.34s
domContentLoaded 742ms 72ms 702ms 1.02s 988ms 1.02s
firstPaint 86ms 10ms 76ms 164ms 96ms 164ms
firstContentfulPaint 86ms 10ms 76ms 164ms 96ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.55 KiB (0.02%)
  • ui: 3.46 KiB (0.04%)
  • common: 8.64 KiB (0.07%)

@wenfix wenfix dismissed a stale review March 25, 2026 12:53

not in the org, shadow-banned account

Copy link
Copy Markdown
Member

@seaona seaona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, LGTM!

@adonesky1 adonesky1 added this pull request to the merge queue Mar 26, 2026
@DDDDDanica
Copy link
Copy Markdown
Contributor

LGTM ✅

Merged via the queue into main with commit bfd4cb7 Mar 26, 2026
207 checks passed
@adonesky1 adonesky1 deleted the am/test-e2e-mm-connect-multichain branch March 26, 2026 16:06
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2026
@metamaskbot metamaskbot added the release-13.25.0 Issue or pull request that will be included in release 13.25.0 label Mar 26, 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-13.25.0 Issue or pull request that will be included in release 13.25.0 size-L team-wallet-integrations Wallet Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants