Skip to content

test(homepage): add E2E smoke tests for homepage sections network filter#27477

Open
vinnyhoward wants to merge 8 commits intomainfrom
fix-tmcu-546-update-e2e-tests-for-network-switcher
Open

test(homepage): add E2E smoke tests for homepage sections network filter#27477
vinnyhoward wants to merge 8 commits intomainfrom
fix-tmcu-546-update-e2e-tests-for-network-switcher

Conversation

@vinnyhoward
Copy link
Copy Markdown
Contributor

@vinnyhoward vinnyhoward commented Mar 16, 2026

Description

The new homepage sections UI (homepageSectionsV1) introduces a sectioned layout that replaces the old tabs view. Each section (Tokens, NFTs, DeFi, etc.) is tappable and navigates the user to a dedicated full-screen view. These full-screen views (e.g. TokensFullView) include a network filter (the NetworkManager bottom sheet) that lets users filter assets by network.

This PR adds E2E smoke tests to verify:

  • Navigation from the homepage Tokens section to TokensFullView works correctly and the network filter button is present.
  • Selecting a network in the TokensFullView network manager correctly filters the token list to that network.
  • The network filter applied in TokensFullView is scoped to the full-screen view only — navigating back to the homepage shows all tokens regardless of the filter applied in the full-screen view.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-546

Manual testing steps

Feature: Homepage Sections Network Filter

  Scenario: User navigates from homepage Tokens section to full view
    Given the user is on the homepage with homepageSectionsV1 enabled
    When user taps the Tokens section header
    Then the TokensFullView opens with a back button and network filter button visible

  Scenario: User filters tokens by network in the full view
    Given the user is in the TokensFullView
    When user opens the network manager and selects Ethereum
    Then only Ethereum tokens are shown in the full view
    And tokens from other networks (e.g. BNB, AVAX) are not visible

  Scenario: Network filter in full view does not affect homepage
    Given the user has applied a Linea-only network filter in TokensFullView
    When user taps the back button to return to the homepage
    Then the homepage Tokens section still shows all tokens (e.g. ETH, SOL) unaffected by the filter

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

Low Risk
Low risk since changes are test-only (new Detox page object + smoke spec) and do not modify production logic; main risk is potential flakiness due to UI timing/fixture assumptions.

Overview
Adds new E2E smoke coverage for the homepageSectionsV1 tokens section, validating navigation from the homepage into the tokens full-screen view and presence of the network filter control.

Introduces a small TokensFullView page object and a new smoke spec that verifies network-based token filtering in the full view (e.g., Ethereum-only) and that any filter applied there does not affect the homepage token section after navigating back (using fixtures + mocked remote feature flag).

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

@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-mobile-ux Mobile UX team label Mar 16, 2026
@github-actions github-actions bot added size-M and removed size-L labels Mar 30, 2026
@vinnyhoward vinnyhoward changed the title feat: network switcher e2e tests WIP test(homepage): add E2E smoke tests for homepage sections network filter Apr 1, 2026
@vinnyhoward vinnyhoward marked this pull request as ready for review April 1, 2026 21:50
@vinnyhoward vinnyhoward requested a review from a team as a code owner April 1, 2026 21:50
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 2 potential issues.

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.


// Homepage tokens section shows ALL tokens regardless of the Linea-only filter
await NetworkManager.checkTokenIsVisible('ETH');
await NetworkManager.checkTokenIsVisible('SOL');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SOL token assertion fails—never seeded in fixture

High Severity

The test asserts NetworkManager.checkTokenIsVisible('SOL') on the homepage after navigating back, but no SOL token is ever seeded in the fixture. withTokensForAllPopularNetworks only seeds EVM chains (Ethereum, Polygon, BSC, etc.) — it does not include Solana. Combined with withNetworkEnabledMap({ eip155: { '0x1': true } }) restricting to Ethereum only, the homepage will show at most ETH and USDC. This assertion will always fail, making the test broken on every run.

Additional Locations (1)
Fix in Cursor Fix in Web

jest.setTimeout(170000);
});

it('should navigate from homepage tokens section to tokens full view', async () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test names use prohibited "should" prefix

Low Severity

All three test names start with 'should ...', which violates the E2E testing guidelines rule: "DON'T: Use the prefix 'should'." Test names need to use action-oriented descriptions (e.g., 'navigates from homepage tokens section to tokens full view' instead of 'should navigate ...').

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: MetaMask Mobile E2E Testing Guidelines

@github-actions github-actions bot added the risk-low Low testing needed · Low bug introduction risk label Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeWalletPlatform, SmokeNetworkAbstractions
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
Both changed files are brand-new additions to the E2E test suite — no app source code is modified.

  1. tests/page-objects/wallet/HomeSections.ts: A new page object (TokensFullView) exposing the back button and network filter button for the tokens full view screen. It uses WalletViewSelectorsIDs.BACK_BUTTON and WalletViewSelectorsIDs.TOKEN_NETWORK_FILTER.

  2. tests/smoke/networks/homepage-sections-network-filter.spec.ts: A new smoke spec explicitly tagged with SmokeWalletPlatform. It tests:

    • Navigation from the homepage tokens section to the tokens full view
    • Network filtering within the tokens full view (selecting Ethereum, Linea)
    • Verifying the homepage shows all tokens regardless of the filter applied in the full view

The spec directly uses SmokeWalletPlatform tag and exercises network selection/filtering via NetworkManager, which is the domain of SmokeNetworkAbstractions. Including SmokeNetworkAbstractions ensures the network manager and chain filtering interactions are validated.

No performance-impacting code changes are present — these are purely test infrastructure additions.

Performance Test Selection:
No app source code was changed — only new E2E test files were added. There is no performance impact to measure.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-low Low testing needed · Low bug introduction risk size-M team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants