Commit 7f0ffc3
authored
test: setup full ramps e2e flow using ramps provider (MetaMask#26951)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
The purpose of this PR is to add E2E smoke test coverage for the Unified
Buy V2 flow, validating both routing paths a user can take when
purchasing crypto through the ramps experience.
- Two smoke test scenarios: new user (no prior completed orders) routes
through the native Transak deposit flow (KYC/OTP + bank transfer);
returning user (prior non-Transak aggregator order) routes through the
aggregator WebView buy flow
- New page objects: KYCScreen, OrderDetailsView, ActivitiesView,
ToastModal, extended BuildQuoteView
- Full Transak native flow mocking: auth/login, auth/verify, quotes,
user details, KYC requirements, user limits, create order
- Ramps mock infrastructure refactor: introduced setupDepositOnRampMocks
and setupBuyOnRampMocks as single-purpose helpers;
-
setupRegionAwareOnRampMocks retained as the base for build-quote-only
tests; default providerType corrected from native to aggregator
- TestID additions: crypto/fiat amount testIDs moved to
DisplayOrderListItem (the actually-rendered component), testIDs added to
EnterEmail, OtpCode, VerifyIdentity, and ActivitiesView; removed dead
OrdersListTestIds aggregate export
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
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**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Mostly E2E test, selector, and mock refactors, but it substantially
changes the on-ramp mocking setup and fixtures used across ramps smoke
tests, which could cause test flakiness or broken flows if assumptions
drift.
>
> **Overview**
> Adds end-to-end smoke coverage for Unified Buy V2 across both routing
paths: **new users** go through the native Transak KYC/OTP deposit flow,
while **returning users** go through the aggregator (widget/WebView) buy
flow, including verification of the resulting order in the Activity
transfers list and basic analytics assertions.
>
> Refactors ramps API mocking to provide dedicated helpers
(`setupDepositOnRampMocks`, `setupBuyOnRampMocks`) and expands mocked
endpoints for the native Transak flow (auth, quotes, user/KYC/limits,
order creation, translation, and stateful order polling), while
splitting buy vs deposit order-status mocking.
>
> Improves Detox automation by adding/centralizing `testID` selectors
for ramps screens (`EnterEmail`, `OtpCode`, `VerifyIdentity`,
`OrderDetails`) and for `OrdersList` rows/amounts, plus new page objects
(`KYCScreen`, `OrderDetailsView`) and enhanced page object actions
(e.g., wait-for-enabled Continue).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0b768fe. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 2ffae0c commit 7f0ffc3
36 files changed
Lines changed: 1023 additions & 111 deletions
File tree
- app/components
- UI/Ramp
- Aggregator/Views/OrdersList
- __snapshots__
- Views
- NativeFlow
- __snapshots__
- OrderDetails
- __snapshots__
- Views/ActivityView
- tests
- api-mocking/mock-responses/ramps
- responses
- transak
- framework/fixtures
- page-objects
- Ramps
- Transactions
- smoke/ramps
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 38 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
96 | 114 | | |
97 | 115 | | |
98 | 116 | | |
99 | 117 | | |
100 | 118 | | |
| 119 | + | |
101 | 120 | | |
102 | 121 | | |
103 | 122 | | |
| |||
128 | 147 | | |
129 | 148 | | |
130 | 149 | | |
131 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
132 | 154 | | |
133 | 155 | | |
134 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
135 | 161 | | |
136 | 162 | | |
137 | 163 | | |
| |||
256 | 282 | | |
257 | 283 | | |
258 | 284 | | |
259 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
260 | 292 | | |
| 293 | + | |
261 | 294 | | |
262 | 295 | | |
263 | 296 | | |
264 | 297 | | |
265 | 298 | | |
266 | 299 | | |
267 | 300 | | |
268 | | - | |
| 301 | + | |
269 | 302 | | |
270 | 303 | | |
271 | 304 | | |
| |||
0 commit comments