-
Notifications
You must be signed in to change notification settings - Fork 5.4k
test: Fix/wallet create session #38519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
<!-- 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 [](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? --> [](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 -->
|
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. |
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (11 files, +189 -153)
👨🔧 @MetaMask/wallet-integrations (6 files, +9 -14)
|
Builds ready [b1e5e8e]
UI Startup Metrics (1265 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| private readonly newlyCreateAccount = { | ||
| css: 'p', | ||
| text: 'Account 2', | ||
| }; |
There was a problem hiding this comment.
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.
| return JSON.parse(await getSessionRawResult.getText()); | ||
| const text = await getSessionRawResult.getText(); | ||
| console.log(`Empty = ${text === ''}`); | ||
| console.log(JSON.stringify(text)); |
There was a problem hiding this comment.
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.
Builds ready [8a3cc4e]
UI Startup Metrics (1301 ± 101 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
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.
addMultichainAccount, wallet import, account menu/navigation) and BIP44 Stage 2 defaults..transaction-status-label--confirmed.BIP44_STAGE_TWOfeature flag; defaultforceBip44Versiontrue; extend price API mocks; bridge and confirmations now include BIP44 flags.MOCK_META_METRICS_ID; balance formatting updates; unlock/login flow tweaks; helper waits for banners and syncing.Written by Cursor Bugbot for commit 8a3cc4e. This will update automatically on new commits. Configure here.