Skip to content

test(e2e): add bitcoin assets network filter cases - #47587

Merged
Battambang merged 1 commit into
mainfrom
test/bitcoin-assets-e2e
Nov 3, 2026
Merged

Battambang merged 1 commit into
mainfrom
test/bitcoin-assets-e2e

Conversation

@Battambang

@Battambang Battambang commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Context

Bitcoin is a Snap-backed network in the extension: its account readiness, asset metadata, and balances flow through the Bitcoin Snap, the unified asset state, and the network-filter modal before anything renders in the homepage asset list.
This PR closes a coverage gap in the Bitcoin E2E assets suite by mirroring what the Tron assets suite already does in test/e2e/tests/assets/tron.spec.ts.

Problem

test/e2e/tests/btc/assets.spec.ts verified the asset list for an empty account and the asset list plus native BTC details for a funded account, but it never exercised the network filter. Nothing asserted that:

  • selecting All networks surfaces other chains' assets alongside Bitcoin, or
  • the Bitcoin-only current-network filter renders only Bitcoin assets and hides assets from other chains.

A regression in network-scoped filtering of unified asset state would therefore reach users unnoticed, because the existing cases only ever ran with Bitcoin selected.

Solution

Add a Networks filter describe block to test/e2e/tests/btc/assets.spec.ts
with one isolated browser fixture per case:

  • All networks filter shows other chains alongside Bitcoin — logs in, switches to Bitcoin, waits for the Bitcoin row, selects All networks, then asserts both Bitcoin and Ethereum are in the list.
  • Current network filter shows only Bitcoin assets — logs in, switches to Bitcoin, then asserts the exact list is ['Bitcoin'] and that Ethereum is absent.

Implementation notes for reviewers:

  • Reuses the existing mockBtcAssetsFunded static mocks and the existing FixtureBuilderV2 setup; only selectAllNetworksFromNetworkSelect and HOMEPAGE_BALANCE_ASSERTION_TIMEOUT_MS are newly imported. No new fixture wrapper, flow, page-object API, mock, or page-object selector was added.
  • No Bitcoin local node/seeder is started for these cases. Network filtering is read-only and fully deterministic from the existing Esplora, token metadata, price, and default Ethereum fixture data — this matches the Tron filter tests, which run with localNode: false. withFixtures defaults to an Anvil node, so the default Ethereum account is funded and its row appears under All networks.
  • Spec stays POM-clean: existing flows and page-object check* methods only, no selectors or direct driver UI calls in the spec, no local UI helper, no hardcoded delay, and no try/catch.

Changelog

CHANGELOG entry: null

Related issues

Fixes: expand send E2E coverage

Manual testing steps

  1. Run the extension and get to an unlocked wallet that has a Bitcoin (Snap) account.
  2. Go to the homepage asset list.
  3. Open the network filter in the header and select All networks.
  4. Verify Bitcoin is listed alongside assets from other chains (e.g. Ethereum).
  5. Open the network filter again and select Bitcoin (current network only).
  6. Verify only the Bitcoin asset is listed.
  7. Verify Ethereum is not visible anywhere in the asset list while Bitcoin is the current network.

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

Low Risk
Test-only changes with no production code, security, or data-handling impact.

Overview
Adds network filter coverage to the Bitcoin assets E2E suite, aligned with the existing Tron assets pattern in tron.spec.ts.

A new Networks filter block in test/e2e/tests/btc/assets.spec.ts introduces two cases on top of the existing mockBtcAssetsFunded setup: one selects All networks and expects Bitcoin and Ethereum in the token list; the other keeps Bitcoin as the current network and asserts the list is Bitcoin-only with Ethereum absent. Both reuse selectAllNetworksFromNetworkSelect, HOMEPAGE_BALANCE_ASSERTION_TIMEOUT_MS, and existing TokensTab checks—no new mocks, fixtures, or page-object APIs.

Reviewed by Cursor Bugbot for commit 884ae15. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Nov 3, 2026

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.

@github-actions github-actions Bot added the size-S label Nov 3, 2026
@metamask-ci metamask-ci Bot added the team-networks PRs from the Networks team label Nov 3, 2026
@metamask-ci

metamask-ci Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor
Builds ready [884ae15] [reused from e231b08]
⚡ Performance Benchmarks (Total: 🟢 3 pass · 🟡 1 warn · 🔴 1 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 41649738045 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 1 failure)

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, firefox/webpack/startupStandardHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↓ onboardingImportWallet/srpButtonToSrpForm: -18%
  • ↓ onboardingImportWallet/pwFormToMetricsScreen: -14%
  • ↓ onboardingImportWallet/metricsToWalletReadyScreen: -26%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -94%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -75%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -89%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +12%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -82%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -78%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -54%
  • ↓ dappPageLoad/firstPaint: -32%
  • ↓ dappPageLoad/firstContentfulPaint: -32%
Bundle Size Diffs
Status Bundle Total Diff Change
✅ background 15.26 MiB 0 Bytes 0.00%
✅ ui 19.33 MiB 0 Bytes 0.00%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB 0 Bytes 0.00%
✅ content scripts 3.23 MiB 0 Bytes 0.00%
✅ unzipped 79.89 MiB 0 Bytes 0.00%
✅ zip 24.07 MiB 0 Bytes 0.00%

@github-project-automation github-project-automation Bot moved this to Needs dev review in PR review queue Nov 3, 2026
@Battambang
Battambang requested review from a team and a balanced review from Copilot November 3, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the test-only Bitcoin network-filter coverage changes.

No open issues 🎉

What changed in this PR

Adds network-filter coverage to the Bitcoin assets E2E suite, following the existing Tron test pattern. Changes are test-only.

Changes:

  • Adds an All networks case that verifies Bitcoin and Ethereum appear together.
  • Adds a Bitcoin-only case that checks the exact asset list and confirms Ethereum is absent.
  • Reuses existing fixtures, funded Bitcoin mocks, network flows, and page-object assertions.
File Description
test/​e2e/​tests/​btc/​assets.spec.ts Adds two isolated network-filter tests and imports the existing selection flow and balance assertion timeout.

Review effort: Balanced

@taran-a taran-a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Battambang
Battambang requested a review from a team November 3, 2026 21:05
@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Nov 3, 2026
@Battambang
Battambang added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit feb5d41 Nov 3, 2026
303 of 308 checks passed
@Battambang
Battambang deleted the test/bitcoin-assets-e2e branch November 3, 2026 23:38
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Nov 3, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
@metamaskbot metamaskbot added the release-13.57.0 Issue or pull request that will be included in release 13.57.0 label Nov 9, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.57.0 on PR, as PR was added to branch 13.57.0 when release was cut.

This branch was previously deployed

1 inactive deployment
pr-comment — 884ae15d Deployed Nov 3, 2026 by Battambang via Publish prerelease / Publish prerelease #172402
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.57.0 Issue or pull request that will be included in release 13.57.0 size-S team-networks PRs from the Networks team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants