Skip to content

fix: Smoke e2e tests flakiness#31177

Merged
davibroc merged 5 commits into
mainfrom
fix/stake-e2e-tests
Jun 8, 2026
Merged

fix: Smoke e2e tests flakiness#31177
davibroc merged 5 commits into
mainfrom
fix/stake-e2e-tests

Conversation

@davibroc

@davibroc davibroc commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

gasless-swap.spec.ts

  • Fixed and re-enabled skipped E2E swap test.
  • Added mocks to match the actual Sentinel API URLs used by the app, and added relay endpoint mocks for the EIP-7702 gasless swap flow, which uses a different transaction submission path than the standard Smart Transactions flow.

bridge-action-smoke.spec.ts

  • Moved dismissKeypad() to after the network fee label assertion (instead of before)
  • The fee label needs time to appear (60s timeout) while the quote is fetched; dismissing the keypad first could interfere with quote loading or obscure the assertion
  • Waiting for the fee label first, then dismissing the keypad, matches the correct user flow

TestSnaps.ts

  • Removed checkStability: true from date-time picker, date picker, and time picker OK button taps
  • On iOS, calendar/time picker animations prevent Detox’s stability check from passing, causing the interactive UI snap test to time out
  • The OK button is stationary; the calendar view above it is what animates

onramp-unified-buy.spec.ts

  • Fixed a flaky test caused by a race with remote feature flag loading:
    1. Seeded V1/V2 flags into RemoteFeatureFlagController initial state via .withRampsUnifiedBuyRemoteFlagsSeededForE2E(), so flags are available on first render without waiting for the mock server
    2. Switched mock server flags from remoteFeatureFlagRampsUnifiedEnabled (minimumVersion: '7.63.0') to remoteFeatureFlagRampsUnifiedMatrixForE2E(true, true) ('0.0.0'), keeping consistency with seeded state if the controller refreshes mid-test

stake-action-smoke.spec.ts

  • Increased the Earn button visibility timeout from 45s → 60s
  • The Earn button depends on balance loading from fixture state, which can take longer on Android / slower CI machines

Changelog

CHANGELOG entry:

Related issues

Fixes: test falkiness on stake and bridge tests

Manual testing steps

N/A

Screenshots/Recordings

Before

test.mp4

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Low Risk
Changes are limited to E2E tests and mock helpers; production wallet code is untouched.

Overview
Stabilizes smoke E2E by tightening waits, mocks, and test ordering—no production app behavior changes.

Swap / STX mocks: Sentinel URL matchers now accept versioned *.api.cx.metamask.io paths (not only transaction.api…). New mocks cover the EIP-7702 gasless relay path (eth_sendRelayTransaction + relay polling), with a dummy Anvil tx so receipts resolve. Gasless swap specs are re-enabled (removed it.skip).

Bridge smoke: dismissKeypad() runs after waiting for the network fee label (60s), so quote loading isn’t disrupted.

Onramp unified buy: Fixtures seed unified-buy remote flags via .withRampsUnifiedBuyRemoteFlagsSeededForE2E() and mocks use remoteFeatureFlagRampsUnifiedMatrixForE2E to avoid flag-load races.

Detox / timing: waitForAppReady default 60s; stake Earn button wait 60s; TestSnaps picker OK taps drop checkStability on iOS where calendar animation blocks stability checks.

Reviewed by Cursor Bugbot for commit 297372c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 5, 2026

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.

@mm-token-exchange-service mm-token-exchange-service Bot added team-qa QA team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 5, 2026
@davibroc davibroc added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 5, 2026
@mm-token-exchange-service mm-token-exchange-service Bot added INVALID-PR-TEMPLATE PR's body doesn't match template and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 5, 2026
@davibroc davibroc requested a review from a team as a code owner June 6, 2026 01:58
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jun 6, 2026
@davibroc davibroc changed the title fix: stake e2e tests fix: Smoke e2e tests flakiness Jun 6, 2026
sleepytanya
sleepytanya previously approved these changes Jun 6, 2026
jvbriones
jvbriones previously approved these changes Jun 6, 2026
@davibroc davibroc dismissed stale reviews from jvbriones and sleepytanya via 6cf97a8 June 8, 2026 14:45
@davibroc davibroc force-pushed the fix/stake-e2e-tests branch from 7c3b1a5 to 6cf97a8 Compare June 8, 2026 14:45
@davibroc davibroc requested a review from a team as a code owner June 8, 2026 14:45
@davibroc davibroc force-pushed the fix/stake-e2e-tests branch from 04e58a0 to e304362 Compare June 8, 2026 18:57
hjetpoluru
hjetpoluru previously approved these changes Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeIdentity, SmokeWalletPlatform, SmokeBrowser, SmokeStake, SmokeNetworkAbstractions, SmokeMoney, SmokeAccounts, SmokeSwap, SmokeNetworkExpansion, SmokePredictions, SmokePerps, SmokeConfirmations, SmokeSnaps
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
Shared test infra changed (tests/flows/general.flow.ts, tests/page-objects/Browser/TestSnaps.ts). Found 144 affected spec file(s). Running tags: SmokeIdentity, SmokeWalletPlatform, SmokeBrowser, SmokeStake, SmokeNetworkAbstractions, SmokeMoney, SmokeAccounts, SmokeSwap, SmokeNetworkExpansion, SmokePredictions, SmokePerps, SmokeConfirmations, SmokeSnaps

Performance Test Selection:
No performance impact from shared test infra changes

View GitHub Actions results

@davibroc davibroc enabled auto-merge June 8, 2026 20:38
@hjetpoluru hjetpoluru self-requested a review June 8, 2026 20:40
@davibroc davibroc added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main with commit e5effac Jun 8, 2026
119 checks passed
@davibroc davibroc deleted the fix/stake-e2e-tests branch June 8, 2026 21:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 8, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.82.0 Issue or pull request that will be included in release 7.82.0 label Jun 8, 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.82.0 Issue or pull request that will be included in release 7.82.0 risk:low AI analysis: low risk size-M team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants