Skip to content

test: add analytics e2e coverage for predictions#24538

Merged
cortisiko merged 11 commits intomainfrom
MMQA-1138-adde2e-metrics-for-predictions
Jan 16, 2026
Merged

test: add analytics e2e coverage for predictions#24538
cortisiko merged 11 commits intomainfrom
MMQA-1138-adde2e-metrics-for-predictions

Conversation

@cortisiko
Copy link
Copy Markdown
Member

@cortisiko cortisiko commented Jan 14, 2026

Description

The purpose of this task is to add analytics coverage in our current e2e tests.

Expands predictions E2E coverage to validate analytics emission and properties across core flows.

  • Adds analytics verification in predict-open-position.spec.ts, predict-cash-out.spec.ts, predict-claim-positions.spec.ts, and predict-geo-restriction.spec.ts using getEventsPayloads and SoftAssert
  • Asserts events and properties: Predict Market Details Opened (e.g., entry_point, market_details_viewed), Predict Position Viewed (open_positions_count), Predict Activity Viewed (activity_type), and Geo Blocked Triggered (country, attempted_action with predict_action, cashout, deposit)
  • Enables analytics by updating fixtures to use FixtureBuilder.withMetaMetricsOptIn()
  • Keeps existing functional checks (balances, activities, positions) while adding minor test stability tweaks (sync toggles, updated mocks)

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

Extends Predictions E2E to validate analytics emissions across core flows and aligns mocks with app analytics expectations.

  • Enables analytics in tests via FixtureBuilder.withMetaMetricsOptIn() and validates events: Predict Market Details Opened (entry_point, market_details_viewed), Predict Position Viewed (open_positions_count), Predict Activity Viewed (activity_type), and Geo Blocked Triggered (country, attempted_action including predict_action, cashout, deposit) using getEventsPayloads + SoftAssert
  • Updates Polymarket geoblock mock to return { blocked: true, country: GEO_BLOCKED_COUNTRIES[0].country } for consistency with app logic
  • Minor E2E stability tweaks and mock sequencing (e.g., synchronization toggles, balance-update mocks) while preserving existing functional checks

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

@cortisiko cortisiko self-assigned this Jan 14, 2026
@cortisiko cortisiko requested a review from a team as a code owner January 14, 2026 23:03
@metamaskbot metamaskbot added the team-qa QA team label Jan 14, 2026
@cortisiko cortisiko added skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed no changelog required No changelog entry is required for this change labels Jan 15, 2026
@cortisiko cortisiko requested a review from a team as a code owner January 15, 2026 19:57
matallui
matallui previously approved these changes Jan 15, 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

@sonarqubecloud
Copy link
Copy Markdown

@cortisiko cortisiko enabled auto-merge January 16, 2026 16:33
@cortisiko cortisiko added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 311699d Jan 16, 2026
171 of 173 checks passed
@cortisiko cortisiko deleted the MMQA-1138-adde2e-metrics-for-predictions branch January 16, 2026 19:06
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-M 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.

4 participants