Files
community-rule/playwright.config.ts
T
adilallo d84abf5aa7
CI Pipeline / test (20) (pull_request) Successful in 2m17s
CI Pipeline / e2e (chromium) (pull_request) Successful in 1m53s
CI Pipeline / test (18) (pull_request) Successful in 5m10s
CI Pipeline / e2e (firefox) (pull_request) Successful in 2m22s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m17s
CI Pipeline / visual-regression (pull_request) Failing after 4m18s
CI Pipeline / seed-vr-snapshots (pull_request) Has been skipped
CI Pipeline / performance (pull_request) Successful in 3m13s
CI Pipeline / storybook (pull_request) Successful in 1m33s
CI Pipeline / lint (pull_request) Failing after 1m20s
CI Pipeline / build (pull_request) Successful in 1m23s
Fix visual regression tests
2025-09-03 13:29:30 -06:00

82 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "tests/e2e",
timeout: 60_000,
expect: {
timeout: 10_000,
toHaveScreenshot: {
animations: "disabled",
maxDiffPixelRatio: 0.03, // Increased to 3% to handle WebKit height differences
maxDiffPixels: 50000, // Increased to handle WebKit height variations (1-2px height diff × width)
},
},
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
reporter: [["list"], ["html", { open: "never" }]],
use: {
baseURL: process.env.BASE_URL || "http://localhost:3010",
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
// Deterministic rendering defaults to eliminate environment drift
colorScheme: "light",
viewport: { width: 1280, height: 800 },
timezoneId: "UTC", // Freeze timezone
locale: "en-US", // Freeze locale
headless: true,
},
// Only start webServer in non-CI environments
...(process.env.CI
? {}
: {
webServer: {
command: "npm run dev",
url: "http://localhost:3010",
reuseExistingServer: true,
timeout: 120_000,
},
}),
// Browser-specific snapshot path template (includes projectName for cross-browser support)
snapshotPathTemplate:
"{testDir}/{testFileName}-snapshots/{arg}-{projectName}.png",
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
// Let device preset own the DPR for stable anti-aliasing
launchOptions: {
args: [
"--force-color-profile=srgb",
"--disable-skia-runtime-opts",
"--font-render-hinting=none",
"--disable-lcd-text",
],
},
},
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
// Let device preset own the DPR for stable anti-aliasing
},
},
{
name: "webkit",
use: {
...devices["Desktop Safari"],
// Let device preset own the DPR for stable anti-aliasing
},
},
{
name: "mobile",
use: {
...devices["iPhone 13"],
// Let device preset own the DPR for stable anti-aliasing
},
},
],
});