Skip to content

test: Migrate page objects to the new framework (perf/Predict)#27642

Merged
cortisiko merged 8 commits into
mainfrom
MMQA-1562
Mar 19, 2026
Merged

test: Migrate page objects to the new framework (perf/Predict)#27642
cortisiko merged 8 commits into
mainfrom
MMQA-1562

Conversation

@cortisiko
Copy link
Copy Markdown
Member

@cortisiko cortisiko commented Mar 18, 2026

Description

Migrates several E2E page objects (Predict flows and TransactionPayConfirmation) from Detox-only elements/gestures to the new unified encapsulated element model with UnifiedGestures, adding Appium/Playwright locators and framework-conditional actions via encapsulatedAction.

Extends selectors by introducing PredictBalanceSelectorsText.AVAILABLE_BALANCE (sourced from enContent) and updates Predict market list/details interactions to use category-label mapping, outcome-button ancestor/XPath matching, and additional visibility/assertion helpers. Also adds a TabBarComponent.tapBrowser() helper and tightens tapWallet() validation to assert WalletView.totalBalance visibility.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

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

Medium Risk
Moderate risk because it refactors E2E test page objects and gesture plumbing to a new cross-framework abstraction; failures will surface as flaky/broken tests across Detox/Appium rather than runtime app issues.

Overview
Migrates several E2E page objects (Predict market list/details and TransactionPayConfirmation) from Detox-only elements/gestures to the unified encapsulated element model, adding Appium/Playwright locators and using UnifiedGestures plus encapsulatedAction where Detox-specific delays/scrolling are needed.

Extends Predict selectors with PredictBalanceSelectorsText.AVAILABLE_BALANCE and updates Predict interactions to use category label mapping, ancestor/XPath outcome targeting, and new visibility/assertion helpers (e.g., tab content checks, volume label).

Enhances the gesture abstraction by allowing UnifiedGestureOptions to pass Detox-only scrollToElement parameters (direction, scrollAmount), and adds a TabBarComponent.tapBrowser() convenience method.

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

@cortisiko cortisiko requested review from a team as code owners March 18, 2026 18:10
@metamaskbot metamaskbot added the team-qa QA team label Mar 18, 2026
@cortisiko cortisiko added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run and removed size-L labels Mar 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk risk-high Extensive testing required · High bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk size-L and removed risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
Comment thread tests/page-objects/Predict/PredictDetailsPage.ts
Comment thread tests/page-objects/Predict/PredictMarketList.ts
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
Comment thread tests/page-objects/wallet/TabBarComponent.ts
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
Comment thread tests/page-objects/Confirmation/TransactionPayConfirmation.ts
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
await Assertions.expectElementToBeVisible(this.container, {
description: 'Predict market details screen',
timeout: 15000,
});
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.

New visibility assertions incompatible with Appium framework context

Medium Severity

Several newly added methods (waitForScreenToDisplay, isAboutTabContentDisplayed, isOutcomesTabContentDisplayed, verifyVolumeTextDisplayed, hasOutcomesTab, isAmountEntryVisible, isPayWithTokenListVisible, verifyTransactionFeeVisible) pass EncapsulatedElementType directly to the Detox-only Assertions.expectElementToBeVisible. In Appium context, the element resolves to a PlaywrightElement, but Assertions internally calls Detox globals like device.getPlatform() and waitFor, which will crash. Unlike expectText or tapOpenPosition, these methods lack encapsulatedAction dispatch.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

valid point Cursor. I opened a task where we can handle this in a separate PR

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.33%. Comparing base (bb5bfa8) to head (0415dda).
⚠️ Report is 74 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27642      +/-   ##
==========================================
+ Coverage   82.19%   82.33%   +0.14%     
==========================================
  Files        4788     4785       -3     
  Lines      123512   123611      +99     
  Branches    27364    27507     +143     
==========================================
+ Hits       101516   101777     +261     
+ Misses      14962    14788     -174     
- Partials     7034     7046      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

jvbriones
jvbriones previously approved these changes Mar 19, 2026
hjetpoluru
hjetpoluru previously approved these changes Mar 19, 2026
@cortisiko cortisiko dismissed stale reviews from hjetpoluru and jvbriones via 0415dda March 19, 2026 15:31
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 19, 2026
Copy link
Copy Markdown
Contributor

@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 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

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.

Comment thread tests/page-objects/Confirmation/TransactionPayConfirmation.ts
@hjetpoluru hjetpoluru self-requested a review March 19, 2026 16:23
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@cortisiko cortisiko enabled auto-merge March 19, 2026 18:20
@github-actions
Copy link
Copy Markdown
Contributor

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

@cortisiko cortisiko added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit ace5c7c Mar 19, 2026
108 of 109 checks passed
@cortisiko cortisiko deleted the MMQA-1562 branch March 19, 2026 19:12
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 19, 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.72.0 Issue or pull request that will be included in release 7.72.0 risk-high Extensive testing required · High bug introduction risk size-L skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants