Skip to content

test: migrates page objects for MM-Connect along with required functions#27436

Merged
christopherferreira9 merged 10 commits into
mainfrom
cferreira/migrate-page-objects-mm-connect
Mar 12, 2026
Merged

test: migrates page objects for MM-Connect along with required functions#27436
christopherferreira9 merged 10 commits into
mainfrom
cferreira/migrate-page-objects-mm-connect

Conversation

@christopherferreira9

@christopherferreira9 christopherferreira9 commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Description

This PR migrates the page objects used by mm-connect in the performance tests to the new unified framework.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-1564

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

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
Moderate risk because it refactors shared E2E/performance test infrastructure (driver utilities, visibility/wait options, and context switching), which can cause widespread test flakiness if selector semantics or WebView switching behavior differs.

Overview
Migrates MM-Connect performance test coverage off the legacy wdio/screen-objects page objects into new TypeScript page objects under tests/page-objects/MMConnect, built on the unified EncapsulatedElement + UnifiedGestures APIs.

Refactors Playwright/WebdriverIO test utilities by extracting boxedStep/getDriver into PlaywrightUtilities, expanding PlaywrightElement.isVisible/waitForDisplayed to accept WebdriverIO isDisplayed options, and adding a custom expect.toBeVisible matcher in the performance fixture.

Adds PlaywrightContextHelpers to make WebView context switching more robust (URL matching with a LavaMoat-scuttling fallback) and introduces shared MMConnectDappTestIds plus updated Snap footer selector IDs; @wdio/protocols is added to support typed context APIs.

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

@christopherferreira9 christopherferreira9 requested a review from a team as a code owner March 12, 2026 15:12
@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-qa QA team label Mar 12, 2026
Comment thread tests/framework/fixtures/performance/performance-fixture.ts Outdated
Comment thread tests/framework/PlaywrightMatchers.ts Outdated
Comment thread tests/framework/PlaywrightAdapter.ts
Comment thread tests/page-objects/MMConnect/BrowserPlaygroundDapp.ts
Comment thread tests/page-objects/MMConnect/BrowserPlaygroundDapp.ts
Comment thread tests/page-objects/MMConnect/BrowserPlaygroundDapp.ts
Comment thread tests/framework/Utilities.ts
@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Mar 12, 2026
Comment thread tests/page-objects/MMConnect/RNPlaygroundDapp.ts Outdated
Comment thread tests/framework/PlaywrightContextHelpers.ts
Comment thread tests/framework/PlaywrightContextHelpers.ts Outdated
Comment thread tests/framework/PlaywrightContextHelpers.ts
Comment thread tests/page-objects/MMConnect/RNPlaygroundDapp.ts
@socket-security

socket-security Bot commented Mar 12, 2026

Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​wdio/​protocols@​9.24.01001009094100

View full report

Comment thread tests/page-objects/MMConnect/SnapSignModal.ts
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
All changes are within E2E test infrastructure and automation layers: Playwright adapters, context helpers, gestures, matchers, utilities, performance fixtures, MMConnect page objects (AddChainModal, DappConnectionModal, SignModal, SnapSignModal, SwitchChainModal, RN/Browser playground dapps), selectors, and related WDIO screen objects. These components are shared across nearly all Detox E2E flows: dApp connections, chain switching, signature requests, transaction confirmations, snaps interactions, and multi-chain flows. Because these are foundational abstractions used by multiple tags (Confirmations, NetworkAbstractions, NetworkExpansion, MultiChainAPI, Trade, Card, Perps, Predictions, Snaps), regressions could impact any vertical. No app production code changed, but the testing harness itself changed significantly. Therefore, a full E2E sweep is required to safely validate that the refactored framework and page objects still drive the app correctly across all domains. This is a high-risk infrastructure change rather than a feature change.

Performance Test Selection:
The performance test fixture (tests/framework/fixtures/performance/performance-fixture.ts) and shared framework utilities were modified. Although no production performance-sensitive code changed, the performance test harness itself was altered. Running all performance tags ensures that the updated fixture, setup/teardown, and shared helpers still correctly measure and execute performance scenarios without regression or false readings.

View GitHub Actions results

@cursor cursor Bot 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.

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

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

WAGMI_SIGNATURE_RESULT: 'wagmi-signature-result',
WAGMI_SEND_TX_TO_ADDRESS_INPUT: 'wagmi-send-tx-to-address-input',
WAGMI_SEND_TX_AMOUNT_INPUT: 'wagmi-send-tx-amount-input',
WAGMI_SEND_TRANSACTION_BUTTON: 'wagmi-send-transaction-button',

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.

Redundant test ID constants with conflicting string values

Medium Severity

The MMConnectDappTestIds object contains two sets of constants for the same logical Wagmi elements but with different string values. For example, WAGMI_SIGN_MESSAGE_INPUT maps to 'wagmi-sign-message-input' while WAGMI_INPUT_MESSAGE maps to 'wagmi-input-message'. Similarly for the sign button, send tx inputs, and send tx button. The page objects only use the second set (e.g., WAGMI_INPUT_MESSAGE, WAGMI_BUTTON_SIGN_MESSAGE), leaving the first set unused. Having two constants for the same element with different ID strings is error-prone — a future developer may pick the wrong constant and produce a test that silently fails to find the element.

Additional Locations (1)
Fix in Cursor Fix in Web

@github-actions

Copy link
Copy Markdown
Contributor

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

@sonarqubecloud

Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 3251d01 Mar 12, 2026
110 of 111 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/migrate-page-objects-mm-connect branch March 12, 2026 23:03
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 12, 2026
@metamaskbot metamaskbot added the release-7.71.0 Issue or pull request that will be included in release 7.71.0 label Mar 12, 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-7.71.0 Issue or pull request that will be included in release 7.71.0 size-XL team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants