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
test: added quality gates logic for performance test (MetaMask#24060)
<!--
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**
This PR:
- addresses some test refactors to simplify timers
- Added quaility gates for tests and defined threshold (10%) for Android
and iOS (once merged, we track the metrics and decide about the
thresholds)
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **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]
> Introduces platform-specific thresholds with 10% margins and quality
gates to performance tests, refactors timers/reporters, updates tests to
use measure() + thresholds, and adds aggregated HTML reporting.
>
> - **Performance framework**:
> - Add `QualityGatesValidator` with platform-specific thresholds (+10%)
and pass/fail validation.
> - Extend `TimersHelper` with threshold resolution (iOS/Android),
`measure()` helper, and `hasThreshold()`/`threshold` metadata.
> - Update fixture `fixtures/performance-test.js` to auto-attach metrics
and assert quality gates post-test.
> - Enhance `PerformanceTracker` to emit per-step thresholds/validation
and optional total validation; add `addTimers`.
> - **Reporter & outputs**:
> - Update `custom-reporter.js` to validate quality gates, embed results
in HTML/CSV, include BrowserStack video/profiling.
> - Improve per-test HTML tables (duration/threshold/status) and CSV;
include total threshold status.
> - Aggregation script now generates a polished
`aggregated-reports/performance-report.html` dashboard.
> - **Tests**:
> - Refactor performance specs to use `TimerHelper(..., { ios, android
}, device)` and `measure()`; consolidate timer adds via `addTimers`.
> - Add explicit thresholds across login, swaps, send, perps, predict,
and onboarding flows; minor skips/timeout tweaks.
> - **Docs**:
> - Overhaul `appwright/README.md` with device matrix, categories,
performance system, quality gates, reports, aggregation, and best
practices.
> - **Page objects**:
> - `WalletMainScreen.isVisible()` now uses `appwright` expect.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
35f1aa5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Curtis David <Curtis.David7@gmail.com>
0 commit comments