-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
40 lines (37 loc) · 1.05 KB
/
playwright.config.ts
File metadata and controls
40 lines (37 loc) · 1.05 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
36
37
38
39
40
import path from "node:path";
import { defineConfig } from "@playwright/test";
import { loadCrawlConfig } from "./src/viewport-config.ts";
const { config, configDir } = await loadCrawlConfig();
const snapshotsDir = path.resolve(
configDir,
config.outputDir || ".visual-regression/screenshots/baseline",
);
export default defineConfig({
testDir: "./src",
testMatch: "*.spec.ts",
testIgnore: ["**/generation.spec.ts"],
timeout: 30000,
expect: {
timeout: 10000,
toHaveScreenshot: {
maxDiffPixelRatio: config.maxDiffPixelRatio,
animations: "disabled",
},
},
retries: 0,
reporter: [
["./reporters/custom-reporter.ts"],
["html", { outputFolder: ".visual-regression/report", open: "never" }],
],
use: {
baseURL: process.env.BASE_URL || "https://localhost",
ignoreHTTPSErrors: true,
screenshot: "only-on-failure",
trace: "retain-on-failure",
viewport: null,
},
projects: [{ name: "chromium", use: {} }],
snapshotDir: snapshotsDir,
snapshotPathTemplate: "{snapshotDir}/{arg}{ext}",
outputDir: ".visual-regression/screenshots/regression",
});