blob: 9b5ce7dc5f1429108b40ee7adfd29fb5a583ff1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Gallery CDP probes
Behavioral verification for docs/prototypes/panel-widget-gallery.html — headless Chrome
driven over the DevTools protocol (Node global WebSocket/fetch, no playwright).
- probe.mjs — full regression: card count, size toggle, drag + click behavior under zoom,
zero-exception gate. Run: `node probe.mjs [--shot out.png]`. Update the card-count
assertion when cards are added.
- probe-fams.mjs — screen-color families: default fallbacks pixel-identical, chip clicks
recolor ink/face/trace, dynamic fills stay var-based.
Both exit nonzero on failure. The gallery's componentization work (widgets.js extraction)
uses a green run of these as its no-regression gate per batch.
## Traps when writing new checks
- Dispatch clicks on the element that owns the listener, not an ancestor; drive drags
with in-page synthetic PointerEvents (setPointerCapture stubbed).
- A `find()` by textContent that matches nothing returns undefined, and the dispatch
no-ops silently — the check then fails looking like a widget bug. Match glyphs
exactly against the builder source (e.g. the transport stop button is '⏹' U+23F9,
not '■' U+25A0), and prefer asserting the find() hit before dispatching.
- Reduced-motion emulation must be set before Page.navigate (launch on about:blank,
Emulation.setEmulatedMedia, then navigate) or the page's matchMedia snapshot misses it.
- Kill stale headless Chromes after a crashed run; bracket the pkill pattern
(`pkill -f 'remote-debugging-port=934[5]'`) so it can't match its own command line.
|