-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathplaywright.visual.config.js
More file actions
44 lines (41 loc) · 1.14 KB
/
Copy pathplaywright.visual.config.js
File metadata and controls
44 lines (41 loc) · 1.14 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
41
42
43
44
const { defineConfig } = require("@playwright/test");
const manifest = require("./tests/playwright/visual-scenes.json");
const baseURL = process.env.PLAYWRIGHT_BASE_URL || "http://host.docker.internal:8080";
const secureOrigin = new URL(baseURL).origin;
const projects = manifest.viewports.map((viewport) => ({
name: viewport.id,
use: {
viewport: {
width: viewport.width,
height: viewport.height,
},
isMobile: viewport.isMobile === true,
hasTouch: viewport.hasTouch === true,
deviceScaleFactor: viewport.deviceScaleFactor || 1,
},
}));
module.exports = defineConfig({
testDir: "./tests/playwright",
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
timeout: process.env.CI ? 60_000 : 30_000,
reporter: [
["list"],
["html", { open: "never" }],
],
outputDir: "test-results/playwright-visual",
use: {
baseURL,
browserName: "chromium",
locale: "en-US",
timezoneId: "UTC",
launchOptions: {
args: [
"--font-render-hinting=none",
`--unsafely-treat-insecure-origin-as-secure=${secureOrigin}`,
],
},
},
projects,
});