Skip to content

Conversation

@davibroc
Copy link
Contributor

@davibroc davibroc commented Dec 3, 2025

Description

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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

Overhauls e2e suite for BIP44 Stage 2 by updating page objects/selectors, feature flags, mocks/fixtures, and tests (accounts, tokens, sessions, hardware, Solana), with new helpers and skipped flaky cases.

  • E2E/Flows:
    • Migrate tests to multichain accounts UI (addMultichainAccount, wallet import, account menu/navigation) and BIP44 Stage 2 defaults.
    • Update confirmation/activity assertions to .transaction-status-label--confirmed.
    • Adjust wallet_createSession/sessionChanged/revokeSession to new "add account" and connect flows.
    • Revise send/bridge/swap/metrics/onboarding/privacy/notifications/permissions tests to new balances and flows; add websocket tests.
    • Skip/adjust flaky or unsupported cases (e.g., some Solana, snaps, watch account).
  • Page Objects:
    • Header/Account list/Assets/Send/Activity/Address list/Multichain account details: new selectors, actions (e.g., network addresses link, waitUntilSyncingIsCompleted, addMultichainWallet), and helper methods; remove deprecated paths.
  • Mocks/Fixtures:
    • Introduce BIP44_STAGE_TWO feature flag; default forceBip44Version true; extend price API mocks; bridge and confirmations now include BIP44 flags.
    • FixtureBuilder: preferences helpers (showNativeTokenAsMainBalance), token data tweaks.
  • Solana/Bitcoin/Hardware:
    • Update Solana helpers (network setup, price mocks) and tests; adjust BTC setup; refactor Ledger/Trezor/QR tests to new account details removal and address checks.
  • Constants/Helpers:
    • Use MOCK_META_METRICS_ID; balance formatting updates; unlock/login flow tweaks; helper waits for banners and syncing.
  • General:
    • Replace legacy selectors and flows across suite; broaden network enablement in fixtures; numerous minor test expectation updates.

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

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

This PR turns BIP44 by default and make changes to the fixtures so that
Solana account is already created when the Extension starts

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/37365?quickstart=1)

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

Fixes:

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Enables BIP-44 state 2 by default across e2e, adds multichain/Solana
defaults to fixtures, and updates page objects and tests to the new
multichain flows and feature-flag mocks.
>
> - **E2E Framework**:
> - Default `withFixtures` now enables BIP-44 stage 2 via feature flag
(boolean `forceBip44Version`, true by default) and applies only state-2
mocks when enabled.
> - Updated selectors and flows in benchmarks (use
`HeaderNavbar`/`AccountListPage`; activity selector for confirmed tx).
> - **Fixtures & Mocks**:
> - `default-fixture` seeds `AccountTreeController` with a multichain
wallet (Ethereum + Solana account) and updates `AccountsController`
metadata; enables Solana in network enablement.
> - Introduces `BIP44_STAGE_TWO` and injects it into feature-flag
responses; various bridge fixtures/mocks include it.
> - **Page Objects**:
> - `AccountListPage.checkPageIsLoaded` simplified to multichain UI
(always expects "Create account" and options menu; removes state arg);
ensures "Syncing" not shown.
>   - `HeaderNavbar` adds `clickNetworkAddresses`.
> - **Bridge Tests**:
> - Adjusted expectations to ETH balances/units; explicitly disable
BIP-44 where needed; minor skips added; hardforks normalized; duplicate
mocks removed.
> - **Multichain Accounts Tests**:
> - Updated to new `checkPageIsLoaded()` signature and multichain flows;
remove per-test state flags; minor assertions streamlined.
> - Unskips and simplifies wallet details scenario (validate presence in
account list).
> - **Solana Test Utilities**:
> - Add native price mock; tweak enabled networks and initial navigation
(network filter steps); remove per-account creation loop.
> - **Misc**:
> - Numerous tests now pass `forceBip44Version: false` where legacy
behavior is required; balance constants adjusted.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f8bb587. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/37406?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Hardcodes local-node balance to 24.998 in homepage tests and enables
the sendRedesign feature flag in multichain accounts mocks.
> 
> - **E2E Tests**:
> - **Homepage balance check**
(`test/e2e/page-objects/pages/home/homepage.ts`):
> - For local nodes, replace dynamic balance fetch with fixed `"24.998"`
in `checkLocalNodeBalanceIsDisplayed`.
> - **Feature flags**
(`test/e2e/tests/multichain-accounts/feature-flag-mocks.ts`):
>     - Set `sendRedesign.enabled` to `true` in `BIP44_STAGE_TWO`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
aea2615. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@davibroc davibroc requested review from a team as code owners December 3, 2025 12:33
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

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-qa QA team label Dec 3, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (11 files, +189 -153)
  • 📁 test/
    • 📁 e2e/
      • 📁 page-objects/
        • 📁 flows/
          • 📄 snap-permission.flow.ts +8 -2
        • 📁 pages/
          • 📁 dialog/
            • 📄 edit-connected-accounts-modal.ts +18 -18
          • 📁 home/
            • 📄 activity-list.ts +13 -0
            • 📄 asset-list.ts +34 -26
            • 📄 bitcoin-homepage.ts +5 -5
            • 📄 homepage.ts +11 -1
            • 📄 non-evm-homepage.ts +9 -7
          • 📁 multichain/
            • 📄 address-list-modal.ts +11 -0
            • 📄 account-list-page.ts +56 -72
            • 📄 header-navbar.ts +13 -6
        • 📄 helpers.js +11 -16

👨‍🔧 @MetaMask/wallet-integrations (6 files, +9 -14)
  • 📁 test/
    • 📁 e2e/
      • 📁 flask/
        • 📁 multichain-api/
          • 📁 evm/
            • 📄 wallet_createSession.spec.ts +4 -4
            • 📄 wallet_revokeSession.spec.ts +2 -2
            • 📄 wallet_sessionChanged.spec.ts +1 -1
          • 📁 non-evm/
            • 📄 wallet_createSession.spec.ts +1 -4
            • 📄 wallet_invokeMethod.spec.ts +0 -2
            • 📄 testHelpers.ts +1 -1

@davibroc davibroc changed the title Fix/wallet create session test: Fix/wallet create session Dec 3, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [b1e5e8e]
UI Startup Metrics (1265 ± 100 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12651015158610013191433
load104185912798410851198
domContentLoaded103585512738310781187
domInteractive21144262236
firstPaint50397128739110171103
backgroundConnect21419626611223231
firstReactRender433182114569
getState3715118194172
initialActions1011112
loadScripts828657105681873981
setupStore1264561227
numNetworkReqs86336628
BrowserifyPower User HomeuiStartup17951474250315518732038
load1013838129310110891171
domContentLoaded1002829128510010821162
domInteractive24167192545
firstPaint565108123939410071135
backgroundConnect246179747125213585
firstReactRender41345744351
getState19413874765208270
initialActions102112
loadScripts8136431091100893980
setupStore1384061334
numNetworkReqs68572021766101
WebpackStandard HomeuiStartup843703103262888945
load64655984557690738
domContentLoaded64155583957687733
domInteractive22164672339
firstPaint20186783136204605
backgroundConnect1163471329
firstReactRender61352383978139
getState251377113146
initialActions104112
loadScripts63855383757685731
setupStore1173541318
numNetworkReqs86317630
WebpackPower User HomeuiStartup14391121197516615511735
load711591102387776867
domContentLoaded705584101786769860
domInteractive251782112649
firstPaint240107869153241661
backgroundConnect64756112256481
firstReactRender45395934752
getState18413633540209257
initialActions102011
loadScripts702582101586760858
setupStore1574181338
numNetworkReqs6657106106695
FirefoxBrowserifyStandard HomeuiStartup12551068169812713151556
load103992314148610701190
domContentLoaded103892014148610691189
domInteractive56311342879125
firstPaint------
backgroundConnect43193303845101
firstReactRender35286183457
getState10712312920
initialActions102112
loadScripts101290913897610441132
setupStore1057681022
numNetworkReqs86255723
BrowserifyPower User HomeuiStartup26381646405261831413424
load16401002310356121872403
domContentLoaded16401002310356121862403
domInteractive129321205256741022
firstPaint------
backgroundConnect175271267232203999
firstReactRender5535119155790
getState1537131949181234
initialActions3167823
loadScripts1544986308552620642311
setupStore4343747531245
numNetworkReqs77561722876154
WebpackStandard HomeuiStartup15601342195414016381867
load1265111015208713291442
domContentLoaded1264111015208713291441
domInteractive64292113681132
firstPaint------
backgroundConnect4520217265098
firstReactRender433496104557
getState187198271554
initialActions103122
loadScripts1239109414438112991411
setupStore207172281681
numNetworkReqs86255824
WebpackPower User HomeuiStartup26411755346752130933201
load17801125250743721882377
domContentLoaded17801125250743721882376
domInteractive13030103324075930
firstPaint------
backgroundConnect126261070161161267
firstReactRender553997115888
getState1336625047171229
initialActions40397331
loadScripts17011108236041020982317
setupStore615103113143325
numNetworkReqs78581953275171
📊 Page Load Benchmark Results

Current Commit: b1e5e8e | Date: 12/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±130ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 730ms (±128ms) 🟢 | historical mean value: 726ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±106ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 130ms 1.00s 2.31s 1.07s 2.31s
domContentLoaded 730ms 128ms 695ms 1.98s 743ms 1.98s
firstPaint 87ms 106ms 56ms 1.14s 88ms 1.14s
firstContentfulPaint 87ms 106ms 56ms 1.14s 88ms 1.14s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 368 Bytes (0.01%)
  • ui: -145 Bytes (0%)
  • common: 20 Bytes (0%)

private readonly newlyCreateAccount = {
css: 'p',
text: 'Account 2',
};
Copy link

Choose a reason for hiding this comment

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

Bug: Hardcoded account name selector causes test fragility

The newlyCreateAccount selector is hardcoded to look for 'Account 2', but this assumes the newly created account will always be named "Account 2". If there are already multiple accounts in the wallet, the new account would be named differently (e.g., "Account 3", "Account 4", etc.), causing the addNewAccount() method to either fail to find the element or select the wrong existing account. This makes tests using this method fragile and dependent on the exact wallet state.

Fix in Cursor Fix in Web

return JSON.parse(await getSessionRawResult.getText());
const text = await getSessionRawResult.getText();
console.log(`Empty = ${text === ''}`);
console.log(JSON.stringify(text));
Copy link

Choose a reason for hiding this comment

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

Bug: Debug console.log statements accidentally left in code

The getSession() method contains two console.log statements that appear to be debugging code accidentally left in. The statements console.log(Empty = ${text === ''}); and console.log(JSON.stringify(text)); are typical debugging patterns used while troubleshooting and should be removed before committing. These will clutter test output with unnecessary debug information during test runs.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

Builds ready [8a3cc4e]
UI Startup Metrics (1301 ± 101 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13011076164810113671479
load107488913278811261259
domContentLoaded106788413108711181252
domInteractive23164572337
firstPaint52486131740310331173
backgroundConnect22420227313232250
firstReactRender473088145677
getState3616115174169
initialActions104112
loadScripts8526731102839021039
setupStore1272841421
numNetworkReqs86307629
BrowserifyPower User HomeuiStartup18761619255414519392074
load106890512789511361237
domContentLoaded105689712649411181226
domInteractive25175482844
firstPaint572104129041510341232
backgroundConnect263199641101243544
firstReactRender43358164558
getState19014226830215249
initialActions102112
loadScripts8446961056959051014
setupStore15105071532
numNetworkReqs69591971768107
WebpackStandard HomeuiStartup836715103667880962
load65256083368688789
domContentLoaded64755682767684782
domInteractive22154772340
firstPaint227106784162202653
backgroundConnect1153461327
firstReactRender57342013946163
getState23134792842
initialActions106111
loadScripts64455482567682780
setupStore1052841120
numNetworkReqs86306629
WebpackPower User HomeuiStartup14171099191615614791724
load687562102084729871
domContentLoaded681557100682725859
domInteractive251691142466
firstPaint291961026211264744
backgroundConnect5365417089175
firstReactRender47387564960
getState207149695108195646
initialActions104112
loadScripts678555100482720852
setupStore1483771235
numNetworkReqs68552181867100
FirefoxBrowserifyStandard HomeuiStartup12961069184915713701598
load1066917149811311191363
domContentLoaded1066911149811311191363
domInteractive5231149267095
firstPaint------
backgroundConnect3920134224396
firstReactRender35287163749
getState117115121016
initialActions103112
loadScripts1043901140410510841343
setupStore1065051014
numNetworkReqs86255724
BrowserifyPower User HomeuiStartup26291435367754430673301
load1514957253450920592343
domContentLoaded1514957253450920582343
domInteractive773210191327499
firstPaint------
backgroundConnect166271103215178941
firstReactRender5634179205996
getState147691053102161244
initialActions3139727
loadScripts1448942238248019702239
setupStore464105415122209
numNetworkReqs76531803073164
WebpackStandard HomeuiStartup15251318199113015691831
load1231108015609112771408
domContentLoaded1230108015599112771408
domInteractive61282273680133
firstPaint------
backgroundConnect45181612649103
firstReactRender463595115259
getState187170271481
initialActions103122
loadScripts1205106615358812481378
setupStore146138151328
numNetworkReqs86276725
WebpackPower User HomeuiStartup27851733460861632123474
load18761131357454223352488
domContentLoaded18761131357454223352488
domInteractive2622821794251191047
firstPaint------
backgroundConnect131241196209155300
firstReactRender5938194206194
getState1438035360175253
initialActions3041526
loadScripts17971112354552422842453
setupStore584115916330339
numNetworkReqs77501893273166
📊 Page Load Benchmark Results

Current Commit: 8a3cc4e | Date: 12/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±38ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 717ms (±36ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 38ms 1.01s 1.31s 1.06s 1.31s
domContentLoaded 717ms 36ms 697ms 982ms 744ms 982ms
firstPaint 76ms 12ms 56ms 180ms 84ms 180ms
firstContentfulPaint 76ms 12ms 56ms 180ms 84ms 180ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 25.93 KiB (0.5%)
  • ui: 2.28 KiB (0.03%)
  • common: -33.61 KiB (-0.37%)

@davibroc davibroc closed this Dec 5, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants