You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(e2e): speed up Appium smoke login flow (#32821)
## **Description**
Ports the **login performance fixes** from
`MMQA-1995-networks-appium-migration` into a focused branch so Appium
smoke tests unlock faster without pulling in the full networks
migration.
**Why:** Appium smoke specs spend ~20s per test probing the developer
menu even when the login screen is already visible after fixture
bootstrap. That adds up across large smoke shards and slows local/CI
feedback.
**What changed:**
- Skip redundant dev-menu waits when the login screen is already visible
- Tighter timeouts for dev-menu probes, login view assertions, and
login-button settle time
- Extract `wallet-home-readiness.ts` and use iOS-specific wallet
detection in `waitForAppReady` for faster session-persisted fast paths
- Improve push-notification sheet dismissal after login (tap "Not now"
instead of confirm)
- Harden Playwright assertions for missing elements during
login/dev-menu flows
**Files touched:**
- `tests/flows/general.flow.ts`
- `tests/flows/wallet.flow.ts`
- `tests/flows/wallet-home-readiness.ts` (new)
- `tests/flows/general.flow.test.ts`
- `tests/page-objects/wallet/LoginView.ts`
- `tests/framework/PlaywrightAdapter.ts`
- `tests/framework/PlaywrightAssertions.ts`
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Refs: MMQA-1995 — Appium smoke login performance (split from networks
Appium migration work)
## **Manual testing steps**
```gherkin
Feature: Appium smoke login performance
Scenario: login unlock completes without redundant dev-menu waits
Given an Appium smoke test that uses loginToAppPlaywright with fixture bootstrap
And the app restarts with a persisted session that lands on the login screen
When the login flow runs on Android or iOS
Then the developer menu is not probed when the login screen is already visible
And the wallet home is reached with reduced settle and assertion timeouts
```
- [x] `yarn jest tests/flows/general.flow.test.ts`
- [ ] Appium smoke login path validated on Android (local emulator)
- [ ] Appium smoke login path validated on iOS (when available)
## **Screenshots/Recordings**
N/A — E2E test infrastructure only; no end-user UI changes. CI
performance/login job output can be used as validation evidence.
### **Before**
N/A
### **After**
N/A
## **Pre-merge author checklist**
- [x] 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).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
#### Performance checks (if applicable)
- [x] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **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]
> **Low Risk**
> Changes are limited to E2E test infrastructure and timeouts; no
production app logic, with modest risk of flakiness if timeouts are too
aggressive on slow CI devices.
>
> **Overview**
> **Speeds up Appium smoke login** by cutting redundant waits and
tightening probes when the app is already on login or wallet home.
>
> `loginToAppPlaywright` now tries a **2s wallet-home fast path** first,
**skips developer-menu dismissal** when the login screen is visible
(avoiding ~20s of absent Continue/xmark probes), uses **shorter login
view assertions**, and runs **post-login modal dismissal after** wallet
home is ready. Dev-menu Playwright flows use a shared **800ms probe**
and **2s** close assertions; unit expectations were updated accordingly.
>
> **iOS wallet readiness** moves into new `wallet-home-readiness.ts` and
is reused in `waitForAppReady` (Appium iOS) and
`waitForWalletHomePlaywright`, replacing duplicated logic removed from
`wallet.flow.ts`.
>
> **Push notification existing-user sheet** dismissal now waits for the
sheet, taps **Not now** (id or text), and asserts the sheet closes
instead of tapping confirm.
>
> **Framework hardening:** `PlaywrightAdapter.waitForDisplayed` no-ops
on missing elements when `reverse` is set; `expectElementToNotBeVisible`
treats non-existent elements and certain `TypeError`s as success.
**Login** Appium tap uses **10s** timeout, fewer enabled-stable reads,
and **300ms** post-enable settle.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f57da7a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
0 commit comments