Commit 7a4f526
authored
test: MMQA - 1711 - [Mobile] Update Predict e2e tests to enable features that were disabled due to feature flag updates (#29154)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.
-->
## **Description**
Brings Predict E2E test feature flag mocks into parity with production
values.
Two remote feature flag overrides in predict smoke tests diverged from
production after a feature flag registry sync ([PR
#28444](#28444)). This
PR aligns the mocks:
- **`exploreSectionsOrder`**: Replaced the explicit section ordering
arrays with `{}` in 4 predict smoke specs. On production this flag is
empty; the app falls back to hardcoded defaults which produce the same
layout. The Homepage component does not consume this flag at all — it
only affects TrendingView/Explore, which these tests don't exercise.
- **`predictLiveSports`**: Added `'nba'` to the leagues list (now
`['nfl', 'nba']`) to match production. This causes NBA markets (Spurs
vs. Pelicans) to render via `PredictGameDetailsContent`, which uses a
different cash-out button test ID
(`predict-picks-cash-out-button-{positionId}`). Updated the
`PredictDetailsPage` page object with a new
`tapGameCashOutButton(positionId)` method and updated
`predict-cash-out.spec.ts` to use it.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
[MMQA-1711](https://consensyssoftware.atlassian.net/browse/MMQA-1711)
## **Manual testing steps**
<!-- Gherkin scenarios for this change -->
**Feature: Predict E2E prod parity**
**Scenario: Cash out on NBA game market uses correct button**
- Given the predict smoke tests use production-parity feature flag mocks
- When the predict-cash-out test runs against Spurs vs. Pelicans
- Then the test taps the game-details cash-out button (PredictPickItem
testID)
- And the cash-out flow completes successfully
**Scenario: Predict tests work without explicit exploreSectionsOrder**
- Given exploreSectionsOrder is set to `{}` in all predict smoke specs
- When any predict smoke test runs (cash-out, open-position,
geo-restriction, withdraw)
- Then the Homepage renders with the default section order
- And the test navigates to predictions by test ID without issue
## **Screenshots/Recordings**
### **Before**
N/A — test-only changes, no UI impact.
### **After**
N/A — test-only changes, no UI impact.
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
[MMQA-1711]:
https://consensyssoftware.atlassian.net/browse/MMQA-1711?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test-only changes that adjust feature-flag mocks and E2E selectors;
low product risk, but could affect Predict smoke test stability if
testIDs/position IDs drift.
>
> **Overview**
> Aligns Predict E2E remote feature-flag mocks with current production
defaults by removing the `predictLiveSports` override from
`remoteFeatureFlagPredictEnabled`.
>
> Updates Predict smoke specs to interact with the *game-details* UI:
adds a shared `SPURS_PELICANS_POSITION_ID`, introduces
`PredictDetailsPage.tapGameCashOutButton(positionId)` and
`tapGameBetYesButton()`, and switches cash-out/position-opening tests to
use the new testIDs for NBA/game markets.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f452736. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent b22424a commit 7a4f526
6 files changed
Lines changed: 50 additions & 22 deletions
File tree
- tests
- api-mocking/mock-responses
- polymarket
- page-objects/Predict
- smoke/predict
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | 135 | | |
143 | 136 | | |
144 | 137 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
17 | 24 | | |
18 | 25 | | |
19 | 26 | | |
| |||
208 | 215 | | |
209 | 216 | | |
210 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
211 | 226 | | |
212 | 227 | | |
213 | 228 | | |
| |||
246 | 261 | | |
247 | 262 | | |
248 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
249 | 278 | | |
250 | 279 | | |
251 | 280 | | |
252 | 281 | | |
253 | 282 | | |
254 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
255 | 290 | | |
256 | 291 | | |
257 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
122 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 92 | | |
105 | 93 | | |
106 | 94 | | |
| |||
0 commit comments