forked from ethereum/ethereum-org-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.visual.config.ts
More file actions
46 lines (40 loc) · 1.42 KB
/
playwright.visual.config.ts
File metadata and controls
46 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import type { ChromaticConfig } from "@chromatic-com/playwright"
import { defineConfig } from "@playwright/test"
import baseConfig from "./playwright.config"
const visualUse: ChromaticConfig = {
disableAutoSnapshot: true,
assetDomains: ["s3-dcl1.ethquokkaops.io"],
}
// Append "Chromatic" to the default UA so `isChromatic()` returns true client-side.
// Several components (QuizWidget, Simulator) use this signal to skip randomization.
const userAgent =
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Chromatic"
export default defineConfig<ChromaticConfig>({
...baseConfig,
projects: [
{
name: "chromatic-desktop",
testDir: "./tests/visual",
outputDir: "./test-results",
// 1024 (Tailwind `lg`) keeps full-page snapshots under Chromatic's 25M pixel limit on our longest pages.
use: { ...visualUse, userAgent, viewport: { width: 1024, height: 720 } },
},
{
name: "chromatic-tablet",
testDir: "./tests/visual",
outputDir: "./test-results",
use: { ...visualUse, userAgent, viewport: { width: 768, height: 1024 } },
},
{
name: "chromatic-mobile",
testDir: "./tests/visual",
outputDir: "./test-results",
use: { ...visualUse, userAgent, viewport: { width: 375, height: 812 } },
},
],
webServer: {
command: "pnpm start",
port: 3000,
reuseExistingServer: true,
},
})