whynot-design/playwright.config.mjs

32 lines
825 B
JavaScript
Raw Normal View History

2026-05-23 16:34:14 +02:00
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests/visual",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 0,
reporter: [["html", { open: "never" }], ["list"]],
use: {
baseURL: "http://localhost:4321",
2026-05-23 16:34:14 +02:00
headless: true,
viewport: { width: 1280, height: 800 },
deviceScaleFactor: 2,
},
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
],
webServer: {
2026-05-25 19:32:22 +02:00
// Serve the entire repo root so showcase + UI kit + assets all resolve via relative URLs.
command: "npx --yes serve -l 4321 .",
2026-05-23 16:34:14 +02:00
url: "http://localhost:4321",
reuseExistingServer: !process.env.CI,
stdout: "ignore",
stderr: "pipe",
},
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.005,
},
},
});