Commit 8b2a848
test: use performance fixture in mm-connect tests (#26604)
## **Description**
The mm-connect tests (EVM, Wagmi, Multichain) were importing `test`
directly from `appwright`, bypassing the shared performance fixture used
by all other tests under `tests/performance/`. This meant they had no
performance tracking, metric attachment, quality gate validation, or
session data capture.
This PR:
1. Switches the import in all three mm-connect test files from
`appwright` to `../../framework/fixtures/performance`, aligning them
with the rest of the performance test suite
2. Adds `TimerHelper` performance measurements to capture timing data
for key user-facing flows — connection, signing, chain switching,
browser refresh reconnection, and post-disconnect reconnection
### Timers Added
**connection-multichain.spec.js** (1 timer):
| Timer | Threshold (iOS / Android) |
|---|---|
| Connect → Multichain connected state | 20s / 30s |
**connection-evm.spec.js** (5 timers):
| Timer | Threshold (iOS / Android) |
|---|---|
| Connect (Legacy) → EVM connected state | 20s / 30s |
| Personal Sign → signature response displayed | 12s / 18s |
| Switch to Polygon → chain ID 0x89 confirmed | 12s / 18s |
| Browser refresh → still connected | 8s / 12s |
| Reconnect after disconnect → connected confirmed | 20s / 30s |
**connection-wagmi.spec.js** (5 timers):
| Timer | Threshold (iOS / Android) |
|---|---|
| Connect (Wagmi) → Wagmi connected state | 20s / 30s |
| Wagmi Sign Message → signature result displayed | 12s / 18s |
| Switch to OP Mainnet → chain ID 10 confirmed | 12s / 18s |
| Browser refresh → Wagmi still connected | 8s / 12s |
| Reconnect after disconnect → connected confirmed | 20s / 30s |
Thresholds are intentionally generous (no baseline data yet). The 10%
margin is added automatically by `TimerHelper`.
## **Related issues**
[MMQA-1517](https://consensyssoftware.atlassian.net/browse/MMQA-1517)
## **Manual testing steps**
```gherkin
Feature: mm-connect performance fixture integration
Scenario: user runs mm-connect EVM test
Given the mm-connect EVM test suite is configured
When user runs the connection-evm.spec.js test
Then the test executes successfully with the performance fixture
And performance metrics are attached to the test report
And 5 timers are recorded: connect, sign, switch chain, refresh reconnect, reconnect
Scenario: user runs mm-connect Wagmi test
Given the mm-connect Wagmi test suite is configured
When user runs the connection-wagmi.spec.js test
Then the test executes successfully with the performance fixture
And performance metrics are attached to the test report
And 5 timers are recorded: connect, sign, switch chain, refresh reconnect, reconnect
Scenario: user runs mm-connect Multichain test
Given the mm-connect Multichain test suite is configured
When user runs the connection-multichain.spec.js test
Then the test executes successfully with the performance fixture
And performance metrics are attached to the test report
And 1 timer is recorded: connect
```
## **Screenshots/Recordings**
browserstack test
[run](https://app-automate.browserstack.com/dashboard/v2/public-build/TDVTSjZHQk56UE9qZnN0WnZMaWM1b1NnVmpXOHpxRmFoZXI1NGpaWUF6S3c1UnVpYWh3SFp4dVZzWTFqdWxDL216K0xLWXlUUEIzWjJqUzZ6bXdsRkE9PS0tbkNreVRNaGswN0dxaE5ueU1KWlpoZz09--7ed9ade707feff3fee54734f86f3d746ff20f0e7)
## **Changelog**
CHANGELOG entry: null
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [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
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed)
- [x] I confirm that this PR addresses all acceptance criteria described
in the linked issue and target all platforms that should be supported
[MMQA-1517]:
https://consensyssoftware.atlassian.net/browse/MMQA-1517?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches only performance test code, but introduces thresholded
`TimerHelper` measurements and quality-gated tracking that could make
mm-connect perf runs fail/flaky if timings regress or the timers are
mis-scoped.
>
> **Overview**
> Switches the three `mm-connect` performance specs (EVM legacy, Wagmi,
Multichain) to use the shared `../../framework/fixtures/performance`
test fixture so runs now capture/attach performance metrics and session
artifacts.
>
> Adds `TimerHelper` instrumentation around key user flows and registers
these timers via `performanceTracker.addTimers(...)` (connect, sign,
chain switch, refresh reconnection, and post-disconnect reconnection;
Multichain adds connect-only), with platform-specific thresholds for
iOS/Android.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7c9d4ee. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 269782c commit 8b2a848
3 files changed
Lines changed: 107 additions & 3 deletions
File tree
- tests/performance/mm-connect
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
83 | 111 | | |
84 | 112 | | |
85 | 113 | | |
| |||
90 | 118 | | |
91 | 119 | | |
92 | 120 | | |
| 121 | + | |
93 | 122 | | |
94 | 123 | | |
95 | 124 | | |
| |||
112 | 141 | | |
113 | 142 | | |
114 | 143 | | |
| 144 | + | |
115 | 145 | | |
116 | 146 | | |
| 147 | + | |
117 | 148 | | |
118 | 149 | | |
119 | 150 | | |
| |||
135 | 166 | | |
136 | 167 | | |
137 | 168 | | |
| 169 | + | |
138 | 170 | | |
139 | 171 | | |
140 | 172 | | |
| |||
155 | 187 | | |
156 | 188 | | |
157 | 189 | | |
| 190 | + | |
158 | 191 | | |
159 | 192 | | |
160 | 193 | | |
| |||
174 | 207 | | |
175 | 208 | | |
176 | 209 | | |
| 210 | + | |
177 | 211 | | |
178 | 212 | | |
179 | 213 | | |
| |||
227 | 261 | | |
228 | 262 | | |
229 | 263 | | |
| 264 | + | |
230 | 265 | | |
231 | 266 | | |
232 | 267 | | |
| |||
235 | 270 | | |
236 | 271 | | |
237 | 272 | | |
| 273 | + | |
238 | 274 | | |
239 | 275 | | |
240 | 276 | | |
| |||
264 | 300 | | |
265 | 301 | | |
266 | 302 | | |
| 303 | + | |
267 | 304 | | |
268 | 305 | | |
269 | 306 | | |
| |||
282 | 319 | | |
283 | 320 | | |
284 | 321 | | |
| 322 | + | |
285 | 323 | | |
286 | 324 | | |
287 | 325 | | |
| |||
366 | 404 | | |
367 | 405 | | |
368 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
369 | 415 | | |
370 | 416 | | |
371 | 417 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
| |||
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| 126 | + | |
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| 134 | + | |
| 135 | + | |
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
85 | 113 | | |
86 | 114 | | |
87 | 115 | | |
| |||
101 | 129 | | |
102 | 130 | | |
103 | 131 | | |
| 132 | + | |
104 | 133 | | |
105 | 134 | | |
106 | 135 | | |
| |||
134 | 163 | | |
135 | 164 | | |
136 | 165 | | |
| 166 | + | |
137 | 167 | | |
138 | 168 | | |
139 | 169 | | |
140 | 170 | | |
| 171 | + | |
141 | 172 | | |
142 | 173 | | |
143 | 174 | | |
| |||
160 | 191 | | |
161 | 192 | | |
162 | 193 | | |
| 194 | + | |
163 | 195 | | |
164 | 196 | | |
165 | 197 | | |
| |||
188 | 220 | | |
189 | 221 | | |
190 | 222 | | |
| 223 | + | |
191 | 224 | | |
192 | 225 | | |
193 | 226 | | |
| |||
207 | 240 | | |
208 | 241 | | |
209 | 242 | | |
| 243 | + | |
210 | 244 | | |
211 | 245 | | |
212 | 246 | | |
| |||
281 | 315 | | |
282 | 316 | | |
283 | 317 | | |
| 318 | + | |
284 | 319 | | |
285 | 320 | | |
286 | 321 | | |
| |||
289 | 324 | | |
290 | 325 | | |
291 | 326 | | |
| 327 | + | |
292 | 328 | | |
293 | 329 | | |
294 | 330 | | |
| |||
316 | 352 | | |
317 | 353 | | |
318 | 354 | | |
| 355 | + | |
319 | 356 | | |
320 | 357 | | |
321 | 358 | | |
| |||
334 | 371 | | |
335 | 372 | | |
336 | 373 | | |
| 374 | + | |
337 | 375 | | |
338 | 376 | | |
339 | 377 | | |
| |||
398 | 436 | | |
399 | 437 | | |
400 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
401 | 447 | | |
402 | 448 | | |
403 | 449 | | |
| |||
0 commit comments