test(screenshots): restore screenshot-neutrality after the determinism refactor
The determinism conversion silently dropped/renamed screenshots vs the committed baselines, so CI flagged ~35 baselines as "removed". Restore them: - pl_editor-*: re-add the "pl_editor-" prefix the conversion dropped (5). - Buffer screenshots that lost their path: (eeschema draw-wires/loaded-css, pcbnew draw-lines/loaded-css, pcbnew-move, dark-mode, eeschema-crosshair, aui-resize) re-add path:'test-results/<name>' so they SAVE and still feed the in-test pixel-diff analysis (17). - Dropped animating/loading captures re-added via stableShot / raw screenshot: timer-03/05/06, dialogs-timer-running/started, wxgrid-02/03, 01-loading (7). Delete 5 obsolete wizard baselines (eeschema/gerbview/pl_editor/symbol_editor/ generic -wizard-00-initial): every app is now seeded to bypass the first-run setup wizard (that was the point of removing the wizard for/if loop), so those states are no longer produced — pl_editor.spec asserts "no wizard appears" instead. Net: every committed baseline has a producer again (0 "removed"); determinism guard green; affected specs pass (e2e 40, kicad 12) and emit the restored PNGs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVX1pHMvRPYHdp6ZfEawrk
This commit is contained in:
parent
4c3a4cacd4
commit
c1eb08108b
16 changed files with 47 additions and 23 deletions
|
|
@ -242,11 +242,11 @@ test.describe('wxAuiManager dock-sash resize UX (pcbjam#20)', () => {
|
|||
// intermediate frame while the button is still held.
|
||||
await page.mouse.move(sash.x - 90, sash.y, { steps: 10 });
|
||||
await page.waitForTimeout(70); // eslint-disable-line -- documented interaction dwell: let the mid-drag frame paint before capturing it for the pixel-diff
|
||||
const midShot = await page.screenshot({ scale: 'css' });
|
||||
const midShot = await page.screenshot({ path: 'test-results/aui-resize-03-mid-drag.png', scale: 'css' });
|
||||
|
||||
await page.mouse.up();
|
||||
await page.waitForTimeout(200); // eslint-disable-line -- documented interaction dwell: let the release settle before capturing the after frame for the pixel-diff
|
||||
const afterShot = await page.screenshot({ scale: 'css' });
|
||||
const afterShot = await page.screenshot({ path: 'test-results/aui-resize-04-after.png', scale: 'css' });
|
||||
|
||||
const midFrac = await stippleFraction(page, midShot, region);
|
||||
const afterFrac = await stippleFraction(page, afterShot, region);
|
||||
|
|
|
|||
|
|
@ -134,11 +134,13 @@ test.describe('Dialogs Tab Tests', () => {
|
|||
|
||||
await stableShot(page, 'dialogs-timer-initial.png', { fullPage: true });
|
||||
|
||||
// Click "Start Timer" button using element registry. No screenshot of the running
|
||||
// timer: the label increments once a second, so a running frame never holds still
|
||||
// for stableShot to stabilise and it asserted nothing (started/running dropped).
|
||||
// Click "Start Timer" button using element registry.
|
||||
await clickByLabel(page, 'Start Timer');
|
||||
|
||||
await stableShot(page, 'dialogs-timer-started.png', { fullPage: true });
|
||||
|
||||
await stableShot(page, 'dialogs-timer-running.png', { fullPage: true });
|
||||
|
||||
// Click "Stop Timer" (Start/Stop are separate always-present buttons; the queued
|
||||
// button events run in order, so no dwell is needed between them).
|
||||
await clickByLabel(page, 'Stop Timer');
|
||||
|
|
|
|||
|
|
@ -144,6 +144,8 @@ test.describe('Grid Tab Tests', () => {
|
|||
// Click on a cell (would be at ~y=175 if grid existed)
|
||||
await page.mouse.click(box.x + 180, box.y + 175);
|
||||
|
||||
await stableShot(page, 'wxgrid-02-selection.png', { fullPage: true });
|
||||
|
||||
// The click's effect is the cell-selection console event — poll for it
|
||||
// (replaces the 200ms sleep + hasGridEvent assertion).
|
||||
await expect.poll(() => testLogger.consoleLogs.some(l => l.includes('Grid cell')),
|
||||
|
|
@ -165,6 +167,8 @@ test.describe('Grid Tab Tests', () => {
|
|||
await page.keyboard.type('1.5');
|
||||
await page.keyboard.press('Enter');
|
||||
|
||||
await stableShot(page, 'wxgrid-03-editing.png', { fullPage: true });
|
||||
|
||||
// The edit's effect is the cell-changed console event — poll for it
|
||||
// (replaces the 200ms sleep + hasEditEvent assertion).
|
||||
await expect.poll(() => testLogger.consoleLogs.some(l => l.includes('Grid cell') && l.includes('changed')),
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ test.describe('wxTimer Tests', () => {
|
|||
// replaces waitForTimeout(1500)).
|
||||
await expect.poll(() => testLogger.consoleLogs.some(l => l.includes('Slow timer tick')),
|
||||
{ message: 'slow timer should tick', timeout: 8000 }).toBe(true);
|
||||
await stableShot(page, 'timer-03-ticked.png', { fullPage: true });
|
||||
|
||||
// Click Stop for the slow timer.
|
||||
const stopButton = await findByLabel(page, 'Stop', { exact: true });
|
||||
|
|
@ -57,12 +58,14 @@ test.describe('wxTimer Tests', () => {
|
|||
await clickByLabel(page, 'Start Fast');
|
||||
await expect.poll(() => testLogger.consoleLogs.some(l => l.includes('Fast timer started')),
|
||||
{ message: 'Should log fast timer started' }).toBe(true);
|
||||
await stableShot(page, 'timer-05-fast-started.png', { fullPage: true });
|
||||
|
||||
// Let the fast timer tick (deterministic). No screenshot while it runs: the fast
|
||||
// timer continuously animates the gauge, so no two frames are ever identical and
|
||||
// stableShot can't stabilize — and the original mid-run shots asserted nothing.
|
||||
// Let the fast timer tick (deterministic). The fast timer continuously animates the
|
||||
// gauge, so this mid-run frame is timing-dependent; stableShot just captures a frame
|
||||
// for the offline gate (non-asserting) rather than trying to stabilize it.
|
||||
await expect.poll(() => testLogger.consoleLogs.some(l => l.includes('Fast timer tick')),
|
||||
{ message: 'fast timer should tick', timeout: 8000 }).toBe(true);
|
||||
await stableShot(page, 'timer-06-fast-running.png', { fullPage: true });
|
||||
|
||||
await clickByLabel(page, 'Stop Fast');
|
||||
await expect.poll(() => testLogger.consoleLogs.some(l => l.includes('Fast timer stopped')),
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@ test.describe('wxWidgets WASM - Diagnostics', () => {
|
|||
|
||||
await page.goto('/minimal_test.html');
|
||||
|
||||
// Loading-state capture: raw + immediate (no settle) on purpose — this shot documents the
|
||||
// app mid-load, before the canvas is up, so it must NOT wait for the render to finish.
|
||||
await page.screenshot({ path: 'test-results/01-loading.png', fullPage: true });
|
||||
|
||||
// Deterministic app readiness: canvas visible + wx registry populated.
|
||||
// Fails loudly (replaces the try/catch waitForSelector + 1s settle).
|
||||
await waitForWxApp(page);
|
||||
|
|
|
|||
Loading…
Reference in a new issue