Skip to content

chore: moves Tranding and Predict to tests#25219

Merged
christopherferreira9 merged 2 commits intomainfrom
cferreira/move-predict-related-files
Jan 27, 2026
Merged

chore: moves Tranding and Predict to tests#25219
christopherferreira9 merged 2 commits intomainfrom
cferreira/move-predict-related-files

Conversation

@christopherferreira9
Copy link
Copy Markdown
Contributor

@christopherferreira9 christopherferreira9 commented Jan 26, 2026

Description

Following #24313 we're looking to centralize all tools and test resources in one place.
This PR moves page objects, selectors and spec files for Trending and Predict to /tests.

Previous related PRs:

⚠️ Important note:

e2e-split-tags-shards.mjs was changed to start finding for a given tag starting from the root. This affects drastically the performance of searching for specs. Search times go from ~0.7s to ~2.5s. This is needed for a phased out transition from /e2e/specs to /tests/specs

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

Centralizes E2E assets for Trending and Predict under tests/, aligning page objects, locators, and smoke/spec files.

  • Moved Trending and Predict page objects to tests/page-objects/** and selectors to tests/locators/**; updated e2e specs/imports accordingly
  • Added/updated smoke tests under tests/smoke/predict/** and shared helpers
  • Updated e2e/jest.e2e.config.js testMatch to include tests/**/*.spec.{js,ts}
  • Changed e2e-split-tags-shards.mjs default BASE_DIR to repo root (./) to find tagged specs across both e2e/ and tests/
  • Adjusted TabBarComponent and viewHelper to reference new TrendingView paths

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

@christopherferreira9 christopherferreira9 requested review from a team as code owners January 26, 2026 19:23
@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 Jan 26, 2026
@christopherferreira9 christopherferreira9 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Jan 26, 2026
cortisiko
cortisiko previously approved these changes Jan 27, 2026
jvbriones
jvbriones previously approved these changes Jan 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeTrade, SmokeWalletPlatform, SmokeConfirmationsRedesigned
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

This PR is a test infrastructure refactoring that relocates E2E test files from e2e/ to tests/ directory structure. Key changes include:

  1. Jest config modification (e2e/jest.e2e.config.js): Added tests/**/*.spec.{js,ts} to testMatch pattern to discover tests in the new location.

  2. CI sharding script change (.github/scripts/e2e-split-tags-shards.mjs): Changed BASE_DIR from ./e2e/specs to ./ to support finding tests in both locations.

  3. File relocations with import path updates:

    • TrendingView page object and selectors moved to tests/page-objects/Trending/ and tests/locators/Trending/
    • All Predict page objects (6 files) moved to tests/page-objects/Predict/
    • All Predict spec files (7 files) moved to tests/smoke/predict/
  4. TabBarComponent import update: This critical shared component now imports TrendingView from the new location.

The affected test tags are:

  • SmokePredictions: All predict spec files (predict-api-down, predict-cash-out, predict-claim-positions, predict-existing-polymarket-balance, predict-geo-restriction, predict-open-position)
  • SmokeTrade: predict-withdraw.spec.ts uses this tag
  • SmokeWalletPlatform: trending-feed.spec.ts and trending-search.spec.ts use this tag
  • SmokeConfirmationsRedesigned: transaction-pay.spec.ts imports the relocated PredictAddFunds and PredictMarketList page objects

Running these tags will verify that:

  1. The relocated spec files are properly discovered by Jest
  2. All import paths are correctly updated
  3. The CI sharding script properly finds tests in the new structure
  4. The page objects work correctly from their new locations

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

const env = {
TEST_SUITE_TAG: process.env.TEST_SUITE_TAG,
BASE_DIR: process.env.BASE_DIR || './e2e/specs',
BASE_DIR: process.env.BASE_DIR || './',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This makes lookup on tests much slower and will be reverted as soon as all e2e is migrated to tests

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.

WIll approve, but can we leave a comment here so it's not forgotten?

Copy link
Copy Markdown
Contributor

@caieu caieu left a comment

Choose a reason for hiding this comment

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

LGTM

@christopherferreira9 christopherferreira9 added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit 9aed975 Jan 27, 2026
93 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/move-predict-related-files branch January 27, 2026 12:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2026
@metamaskbot metamaskbot added release-7.65.0 Issue or pull request that will be included in release 7.65.0 release-7.64.0 Issue or pull request that will be included in release 7.64.0 and removed release-7.65.0 Issue or pull request that will be included in release 7.65.0 labels Jan 27, 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.64.0 Issue or pull request that will be included in release 7.64.0 size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants