Commit 62c6f6e
feat(browserstack-service): stamp hook_run_uuid on App A11y scans in the v9 CLI runtime path [APPA11Y-5542]
The earlier commits fixed accessibility-handler.ts (the classic/non-CLI
path), but v9 App Automate runs through the CLI observer runtime
(cli/modules/accessibilityModule.ts), where the hook-scan change was
inert. This ports the same contract into the active v9 path.
- Register hook-lifecycle observers (BEFORE_ALL / BEFORE_EACH /
AFTER_EACH / AFTER_ALL, PRE + POST). PRE (onHookStart) captures the
hook's run uuid from KEY_HOOK_ID — the same uuid reported to TestHub
as the hook run — and opens the scan gate for the hook window so
DOM-changing commands inside hooks trigger scans. POST (onHookEnd)
clears the uuid so subsequent test-body scans are not mis-stamped.
- Thread currentHookRunUuid through every scan entry point: the web
per-command commandWrapper and both manual performScan() patches, into
performScanCli(..., hookRunUuid) -> _getParamsForAppAccessibility,
which emits thHookRunUuid (dropped when undefined, so in-test and
lifecycle scans are unchanged). Matches SeleniumHub #14162 appAllyScan
-> hook_run_uuid.
- Add 6 unit tests for the hook-scan logic in the CLI module.
Verified end-to-end on real BrowserStack sessions (web + Android App
Automate): scans fired inside before/beforeEach/afterEach carry the
correct per-hook uuid; test-body and end-of-test lifecycle scans carry
none.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3fe6561 commit 62c6f6e
3 files changed
Lines changed: 159 additions & 6 deletions
File tree
- packages/browserstack-service
- src/cli/modules
- tests
- cli/modules
Lines changed: 52 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
45 | 57 | | |
46 | 58 | | |
47 | 59 | | |
| |||
52 | 64 | | |
53 | 65 | | |
54 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
55 | 100 | | |
56 | 101 | | |
57 | 102 | | |
| |||
116 | 161 | | |
117 | 162 | | |
118 | 163 | | |
119 | | - | |
| 164 | + | |
| 165 | + | |
120 | 166 | | |
121 | 167 | | |
122 | 168 | | |
| |||
174 | 220 | | |
175 | 221 | | |
176 | 222 | | |
177 | | - | |
| 223 | + | |
178 | 224 | | |
179 | 225 | | |
180 | 226 | | |
| |||
244 | 290 | | |
245 | 291 | | |
246 | 292 | | |
247 | | - | |
| 293 | + | |
248 | 294 | | |
249 | 295 | | |
250 | 296 | | |
| |||
387 | 433 | | |
388 | 434 | | |
389 | 435 | | |
390 | | - | |
| 436 | + | |
| 437 | + | |
391 | 438 | | |
392 | 439 | | |
393 | 440 | | |
| |||
400 | 447 | | |
401 | 448 | | |
402 | 449 | | |
403 | | - | |
| 450 | + | |
404 | 451 | | |
405 | 452 | | |
406 | 453 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
471 | 510 | | |
472 | 511 | | |
473 | 512 | | |
| |||
Lines changed: 68 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
446 | 513 | | |
0 commit comments