Skip to content

Commit 42665c8

Browse files
ochafikclaude
andcommitted
Use platform-agnostic golden screenshots
- Remove -chromium-darwin suffix from snapshot filenames - Configure snapshotPathTemplate for cross-platform compatibility - Increase tolerance to 5% for rendering differences between platforms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent fd790a1 commit 42665c8

File tree

10 files changed

+4
-4
lines changed

10 files changed

+4
-4
lines changed

playwright.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export default defineConfig({
77
retries: process.env.CI ? 2 : 0,
88
workers: 1, // Single worker since we share the server
99
reporter: "html",
10-
// In CI, create missing snapshots instead of failing (for cross-platform support)
11-
updateSnapshots: process.env.CI ? "missing" : "none",
10+
// Use platform-agnostic snapshot names (no -darwin/-linux suffix)
11+
snapshotPathTemplate: "{testDir}/{testFileDir}/{testFileName}-snapshots/{arg}{ext}",
1212
use: {
1313
baseURL: "http://localhost:8080",
1414
trace: "on-first-retry",
@@ -36,8 +36,8 @@ export default defineConfig({
3636
// Snapshot configuration
3737
expect: {
3838
toHaveScreenshot: {
39-
// Allow 2% pixel difference for dynamic content (timestamps, etc.)
40-
maxDiffPixelRatio: 0.02,
39+
// Allow 5% pixel difference for cross-platform rendering differences
40+
maxDiffPixelRatio: 0.05,
4141
// Animation stabilization
4242
animations: "disabled",
4343
},

tests/e2e/servers.spec.ts-snapshots/basic-react-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/basic-react.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/basic-vanillajs-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/basic-vanillajs.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/budget-allocator-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/budget-allocator.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/cohort-heatmap-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/cohort-heatmap.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/customer-segmentation-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/customer-segmentation.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/host-initial-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/host-initial.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/scenario-modeler-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/scenario-modeler.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/system-monitor-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/system-monitor.png

File renamed without changes.

tests/e2e/servers.spec.ts-snapshots/threejs-chromium-darwin.png renamed to tests/e2e/servers.spec.ts-snapshots/threejs.png

File renamed without changes.

0 commit comments

Comments
 (0)