test: add musd conversion feature e2e#25183
Conversation
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25183 +/- ##
==========================================
+ Coverage 79.96% 80.03% +0.06%
==========================================
Files 4257 4267 +10
Lines 109331 109884 +553
Branches 22889 23021 +132
==========================================
+ Hits 87429 87945 +516
- Misses 15835 15838 +3
- Partials 6067 6101 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| statusCode: 200, | ||
| json: MAINNET_MUSD_RELAY_QUOTE_MOCK, | ||
| })); | ||
| } |
There was a problem hiding this comment.
Duplicated mock functions with identical structure
Low Severity
The functions mockRelayQuote and mockRelayQuoteMainnetMusd are nearly identical, differing only in the mock data they return (RELAY_QUOTE_MOCK vs MAINNET_MUSD_RELAY_QUOTE_MOCK). Both share the same matching logic for /proxy POST requests that include api.relay.link/quote. This duplication could be refactored into a single parameterized function that accepts the mock response data as a parameter, reducing maintenance burden and ensuring consistent behavior.
Additional Locations (1)
| */ | ||
| async scrollDownToAssetOverviewMusdCta(): Promise<void> { | ||
| const assetOverviewScrollContainer = Matchers.getIdentifier( | ||
| 'transactions-container', |
There was a problem hiding this comment.
Hardcoded string instead of existing constant
Low Severity
The code uses the hardcoded string 'transactions-container' instead of the existing constant ActivitiesViewSelectorsIDs.CONTAINER from ActivitiesView.testIds.ts. Using magic strings when constants exist reduces maintainability - if the test ID changes, this code would need to be updated separately from the source of truth.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
Adds E2E tests for the mUSD conversion happy path, covering the main user flows and aligning with project E2E guidelines.
Test scenarios
Technical improvements
createMusdFixture(node, options)moved toe2e/specs/wallet/helpers/musd-fixture.ts(Mainnet, ETH/USDC/mUSD, rates, balances, geo/ramp state).e2e/specs/wallet/helpers/musd-mocks.ts; feature flag key fixed toearnMusdConversionAssetOverviewCtaEnabledfor Asset Overview CTA.scrollDownToAssetOverviewMusdCta()(scroll in Asset Overview until CTA visible, then assert);tapAssetOverviewMusdCta()withcheckStabilityand delay; token list item CTA getter/tap with stability.enterAmountAndContinue(amount)for keyboard amount + continue.verifyMusdConversionConfirmed(rowIndex)and genericverifyActivityItemWithStatus(title, status, rowIndex); usesActivitiesView.testIdsfor mUSD conversion label.tests/framework; no direct Detox in specs; noTestHelpers.delay(); proper timeouts and descriptions.mockRelayQuoteMainnetMusd(mockServer)intests/api-mocking/mock-responses/transaction-pay.tsso confirmation screen gets a valid quote (avoids “No quotes”).All three tests use local Anvil (no mainnet fork),
setupMusdMocks, and end with Activity tab verification of the confirmed mUSD conversion.Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Medium risk because it modifies shared E2E infrastructure (
FixtureBuilder, Relay quote mocks, and scrolling helpers), which could introduce flakiness or break unrelated tests despite being non-production code.Overview
Adds a new E2E suite that validates the mUSD conversion happy path across first-time, token-list, and asset-overview entry points, asserting the resulting Activity row is confirmed.
Introduces dedicated mUSD test infrastructure: a reusable
createMusdFixturehelper plusFixtureBuilder.withMusdConversion()to seed Mainnet balances/state, and a full set of API mocks (feature flags, geo/ramp, price/token APIs, Merkl rewards, Relay quote/status) backed by sharedUSDC_MAINNET/MUSD_MAINNETconstants.Extends page objects to support the flow (
WalletViewCTAs + scrolling,TransactionPayConfirmation.enterAmountAndContinue,ActivitiesView.verifyMusdConversionConfirmed) and tightensTrendingViewfeed scrolling to usescrollToElementwith configurable timeouts. Also adds a Mainnet-specific Relay quote mock (mockRelayQuoteMainnetMusd) to keep Transaction Pay confirmations from failing with missing quotes.Written by Cursor Bugbot for commit 66af719. This will update automatically on new commits. Configure here.