visual testing

This commit is contained in:
2026-04-06 03:17:30 +03:00
parent 53ba44e2f9
commit f04c39cb69
29 changed files with 2575 additions and 76 deletions

View File

@@ -6,6 +6,8 @@ export default defineConfig({
use: {
baseURL: 'http://localhost:5173',
viewport: { width: 1400, height: 900 },
// Disable HiDPI scaling for pixel-exact comparison
deviceScaleFactor: 1,
},
webServer: {
command: 'bun run dev',
@@ -18,4 +20,19 @@ export default defineConfig({
maxDiffPixelRatio: 0.01,
},
},
projects: [
{
name: 'editor',
testMatch: 'editor.spec.ts',
},
{
name: 'cross-renderer',
testMatch: 'cross-renderer.spec.ts',
use: {
// Render test page needs larger viewport for A4 at 150 DPI
// A4 = 210mm x 297mm → 1240 x 1754 px at 150 DPI
viewport: { width: 1300, height: 1800 },
},
},
],
})