import { resolve } from "node:path"; import tailwindcss from "@tailwindcss/vite"; import { defineConfig, devices } from "@playwright/experimental-ct-react"; import react from "@vitejs/plugin-react"; import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ testDir: "./tests/component", testMatch: /.*\.ct\.tsx$/, outputDir: "test-results/component", fullyParallel: false, forbidOnly: !!process.env.CI, retries: process.env.CI ? 1 : 0, workers: 1, reporter: "list", snapshotPathTemplate: "{testDir}/__screenshots__/{arg}{ext}", expect: { toHaveScreenshot: { animations: "disabled", caret: "hide", // Self-hosted fonts keep geometry stable; 1% permits only small Chromium // rasterization differences between the Windows baseline and Linux CI. maxDiffPixelRatio: 0.01, scale: "css", }, }, use: { colorScheme: "light", locale: "de-DE", reducedMotion: "reduce", timezoneId: "Europe/Berlin", trace: "retain-on-failure", viewport: { width: 1366, height: 900 }, ctViteConfig: { publicDir: resolve("apps/web/public"), plugins: [react(), tailwindcss(), tsconfigPaths()], }, }, projects: [ { name: "chromium", use: { ...devices["Desktop Chrome"] }, }, ], });