-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.vrt.config.ts
More file actions
35 lines (33 loc) · 1.08 KB
/
Copy pathplaywright.vrt.config.ts
File metadata and controls
35 lines (33 loc) · 1.08 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
import { defineConfig, devices } from "@playwright/test"
const port = 6006
const staticDirectory = process.env.STORYBOOK_STATIC_DIR ?? "storybook-static"
export default defineConfig({
testDir: "./tests/storybook",
testMatch: "**/*.vrt.ts",
outputDir: "test-results/storybook-vrt",
snapshotPathTemplate: ".vrt/snapshots/{arg}{ext}",
timeout: 180_000,
fullyParallel: false,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI
? [
["github"],
["html", { open: "never", outputFolder: "playwright-report" }],
]
: [["list"], ["html", { open: "never" }]],
use: {
...devices["Desktop Chrome"],
baseURL: `http://127.0.0.1:${port}`,
colorScheme: "light",
locale: "en-US",
timezoneId: "UTC",
trace: "retain-on-failure",
},
webServer: {
command: `node_modules/.bin/vite preview --outDir ${JSON.stringify(staticDirectory)} --host 127.0.0.1 --port ${port} --strictPort`,
url: `http://127.0.0.1:${port}/index.json`,
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
})