-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
77 lines (73 loc) · 2.04 KB
/
Copy pathplaywright.config.js
File metadata and controls
77 lines (73 loc) · 2.04 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { defineConfig } from "@playwright/test";
import {
fixtureApplicationPaths,
fixtureContract,
} from "./e2e/support/environment.js";
const startServers = process.env.DEBUG_UI_START_SERVERS === "1";
const executablePath = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE;
const applicationPaths = fixtureApplicationPaths();
const webServer = startServers
? fixtureContract.apps.map((app, index) => {
const url = new URL(app.baseURL);
return {
command: `php -S ${url.hostname}:${url.port} -t public public/router.php`,
cwd: applicationPaths[index],
url: app.baseURL,
reuseExistingServer: true,
timeout: 30_000,
stdout: "pipe",
stderr: "pipe",
};
})
: undefined;
export default defineConfig({
testDir: "./e2e",
testMatch: /.*\.spec\.js/,
globalSetup: "./e2e/global-setup.js",
outputDir: "./artifacts/playwright/results",
snapshotPathTemplate: "{testDir}/snapshots/{projectName}/{arg}{ext}",
fullyParallel: false,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 2 : 4,
timeout: 45_000,
expect: {
timeout: 7_500,
toHaveScreenshot: {
animations: "disabled",
caret: "hide",
maxDiffPixelRatio: 0.003,
scale: "css",
},
},
reporter: [
["list"],
["html", { outputFolder: "artifacts/playwright/report", open: "never" }],
],
use: {
browserName: "chromium",
colorScheme: "light",
locale: "en-US",
timezoneId: "UTC",
reducedMotion: "reduce",
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: executablePath ? "off" : "retain-on-failure",
launchOptions: executablePath ? { executablePath } : {},
},
projects: [
{
name: "desktop-1440",
use: { viewport: { width: 1440, height: 900 } },
},
{
name: "tablet-1024",
use: { viewport: { width: 1024, height: 768 } },
},
{
name: "mobile-390",
use: { viewport: { width: 390, height: 844 }, isMobile: true },
},
],
webServer,
});