-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
93 lines (91 loc) · 2.94 KB
/
playwright.config.ts
File metadata and controls
93 lines (91 loc) · 2.94 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { defineConfig, devices } from "@playwright/test";
const isCI = !!process.env.CI;
const useDevServer = process.env.PW_USE_DEV_SERVER === "1";
const chromeChannelUse =
process.env.PW_USE_CHROME === "1" ? { channel: "chrome" as const } : {};
const edgeChannelUse =
process.env.PW_USE_EDGE === "1" ? { channel: "msedge" as const } : {};
/**
* Playwright config for Phuzzle E2E tests.
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: "./src/app",
testMatch: "**/*.e2e.spec.ts",
timeout: 60_000,
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 2 : 1,
workers: 4,
reporter: isCI ? "github" : "list",
use: {
baseURL: "http://127.0.0.1:4173",
navigationTimeout: 60_000,
trace: "on-first-retry",
},
projects: [
{ name: "chrome", use: { ...devices["Desktop Chrome"], ...chromeChannelUse } },
{
name: "chrome-tz-la",
use: {
...devices["Desktop Chrome"],
...chromeChannelUse,
timezoneId: "America/Los_Angeles",
},
},
{
name: "chrome-tz-auckland",
use: {
...devices["Desktop Chrome"],
...chromeChannelUse,
timezoneId: "Pacific/Auckland",
},
},
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
{ name: "safari", use: { ...devices["Desktop Safari"] } },
/** Microsoft Edge-compatible desktop coverage. Set PW_USE_EDGE=1 to force the local Edge channel. */
{
name: "edge",
use: { ...devices["Desktop Edge"], ...edgeChannelUse },
},
{
name: "safari-iphone-responsive",
testMatch: "**/*.responsive.e2e.spec.ts",
use: { ...devices["iPhone 13"], browserName: "webkit" },
},
{
name: "safari-ipad-responsive",
testMatch: "**/*.responsive.e2e.spec.ts",
use: { ...devices["iPad Pro 11"], browserName: "webkit" },
},
{
name: "chrome-android-responsive",
testMatch: "**/*.responsive.e2e.spec.ts",
use: { ...devices["Pixel 7"], ...chromeChannelUse },
},
{
name: "chrome-android-tablet-responsive",
testMatch: "**/*.responsive.e2e.spec.ts",
use: {
browserName: "chromium",
...chromeChannelUse,
viewport: { width: 820, height: 1180 },
hasTouch: true,
isMobile: true,
},
},
],
webServer: {
command: useDevServer
? "PWA_DISABLE=1 npm run dev -- --host 127.0.0.1 --port 4173 --strictPort"
: process.env.PW_USE_EXISTING_BUILD === "1"
? "PWA_DISABLE=1 npm run preview -- --host 127.0.0.1 --port 4173 --strictPort"
: "PWA_DISABLE=1 npm run build && npm run preview -- --host 127.0.0.1 --port 4173 --strictPort",
url: "http://127.0.0.1:4173",
// In local development, reuse an already running Phuzzle server if one exists
// so Playwright can still run while we iterate in parallel. CI still launches
// a clean server for isolation.
reuseExistingServer: !isCI,
timeout: 300000,
},
});