Visual baselines were generated as chromium-darwin.png on macOS; CI on Linux looked for chromium-linux.png and every test failed with "snapshot doesn't exist". Override snapshotPathTemplate to omit the platform suffix so darwin and linux share the same baseline. Pixel diffs from font hinting are an accepted trade-off — visual regression gives signal for big visual breaks, not 1-pixel differences. Existing 26 baselines renamed from *-chromium-darwin.png to *-chromium.png to match.
38 lines
1 KiB
JavaScript
38 lines
1 KiB
JavaScript
import { defineConfig } from "@playwright/test";
|
|
|
|
const PORT = process.env.PLAYWRIGHT_PORT || "3000";
|
|
const BASE_URL = `http://localhost:${PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
outputDir: "e2e/test-results",
|
|
snapshotDir: "e2e/__screenshots__",
|
|
snapshotPathTemplate: "{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}-{projectName}{ext}",
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 1 : 1,
|
|
workers: process.env.CI ? 1 : 4,
|
|
reporter: "html",
|
|
timeout: 60000,
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
trace: "on-first-retry",
|
|
navigationTimeout: 45000,
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { browserName: "chromium" },
|
|
},
|
|
],
|
|
webServer: {
|
|
command: `PORT=${PORT} npm run build && PORT=${PORT} NODE_ENV=development npm run preview`,
|
|
url: BASE_URL,
|
|
reuseExistingServer: true,
|
|
env: {
|
|
NUXT_PUBLIC_COMING_SOON: "false",
|
|
NODE_ENV: "development",
|
|
ALLOW_DEV_TEST_ENDPOINTS: "true",
|
|
},
|
|
},
|
|
});
|