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:
Viktor Vaczi 2026-07-07 11:35:39 +02:00
commit c1eb08108b
16 changed files with 47 additions and 23 deletions

View file

@ -170,6 +170,7 @@ test.describe('Eeschema WASM', () => {
expect(viewport![3]).toBe(glCanvas.height);
await hideCursor(page);
await stableShot(page, 'eeschema-loaded-css.png');
await stableShot(page, 'eeschema-loaded.png');
const canvasCount = await page.locator('canvas').count();
@ -203,6 +204,8 @@ test.describe('Eeschema WASM', () => {
expect(isToolChecked(drawWiresTool)).toBe(false);
const baselineErrorCount = testLogger.errors.length;
await stableShot(page, 'eeschema-draw-wires-00-before-tool-click.png');
// Select the tool and confirm it latches checked.
expect(await clickByTooltip(page, 'Draw Wires', { elementType: 'tool' })).toBe(true);
await expect.poll(async () => isToolChecked(await findByTooltip(page, 'Draw Wires', { elementType: 'tool' })), {
@ -242,7 +245,7 @@ test.describe('Eeschema WASM', () => {
// crosshair IS a visible change, so this settle is deterministic.
await page.mouse.move(640, 360);
await waitForCanvasStable(page, glSel);
const afterToolClick = await page.screenshot({ scale: 'css' });
const afterToolClick = await page.screenshot({ path: 'test-results/eeschema-draw-wires-01-after-click.png', scale: 'css' });
// Draw a wire: click a start vertex, then an end vertex. These two waits are the
// ONE place in the converted suite that still uses a fixed delay: a wire vertex
@ -258,7 +261,7 @@ test.describe('Eeschema WASM', () => {
await page.mouse.click(endPoint.x, endPoint.y);
await page.waitForTimeout(750); // eslint-disable-line -- see comment above
const afterDrawing = await page.screenshot({ scale: 'css' });
const afterDrawing = await page.screenshot({ path: 'test-results/eeschema-draw-wires-02-after-drawing.png', scale: 'css' });
const diffRegion: DiffRegion = {
x: Math.max(0, Math.min(startPoint.x, endPoint.x) - 24),