mirror of
https://github.com/actualbudget/actual.git
synced 2026-05-21 14:42:14 -05:00
[AI] Apply VRT threshold to electron config and drop redundant local override
- Remove `maxDiffPixels: 5` from `toMatchThemeScreenshots` — it duplicates the global config and obscured the fact that per-call options would override the global threshold if added there too. - Mirror the threshold in desktop-electron's playwright config so its VRT screenshots are subject to the same sensitivity. - Tighten the threshold comment: drop the PR/task reference per AGENTS.md and the worked-example numbers; keep the formula and the low-alpha rationale.
This commit is contained in:
@@ -63,7 +63,6 @@ export const expect = baseExpect.extend({
|
||||
|
||||
const config = {
|
||||
mask: [target.locator('[data-vrt-mask="true"]')],
|
||||
maxDiffPixels: 5,
|
||||
};
|
||||
|
||||
const page: Page = 'page' in target ? target.page() : target;
|
||||
|
||||
@@ -26,13 +26,12 @@ export default defineConfig({
|
||||
// until layout provides width/height, and that can take >5s. Bumping
|
||||
// to 10s lets those assertions settle without per-test overrides.
|
||||
timeout: 10_000,
|
||||
// `threshold` is pixelmatch's per-pixel YIQ-delta cutoff: a pixel only
|
||||
// counts toward `maxDiffPixels` if its delta exceeds 35215 * threshold².
|
||||
// Playwright's default (0.2 → cutoff 1408) silently swallows faint
|
||||
// overlays — e.g. striping the transactions table with rgba(…, .15)
|
||||
// produces deltas of ~270–320, so VRT reported 0 diff pixels and passed
|
||||
// (PR #7841). Drop to 0.05 (cutoff ~88) so low-alpha tints are flagged
|
||||
// while still leaving headroom for anti-aliasing noise.
|
||||
// `threshold` is pixelmatch's per-pixel YIQ-delta cutoff — a pixel
|
||||
// counts toward `maxDiffPixels` only if its delta exceeds
|
||||
// 35215 * threshold². Playwright's 0.2 default lets faint color
|
||||
// overlays (e.g. rgba(…, .15) row striping) slip through with 0
|
||||
// reported diff pixels; 0.05 catches them while staying above
|
||||
// anti-aliasing noise.
|
||||
toHaveScreenshot: { maxDiffPixels: 5, threshold: 0.05 },
|
||||
},
|
||||
webServer: process.env.E2E_START_URL
|
||||
|
||||
@@ -16,7 +16,8 @@ export default defineConfig({
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
expect: {
|
||||
toHaveScreenshot: { maxDiffPixels: 5 },
|
||||
// See desktop-client playwright.config.ts for the threshold rationale.
|
||||
toHaveScreenshot: { maxDiffPixels: 5, threshold: 0.05 },
|
||||
timeout: 60000, // 60 seconds
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user