-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
53 lines (49 loc) · 1.74 KB
/
Copy pathplaywright.config.ts
File metadata and controls
53 lines (49 loc) · 1.74 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
import { defineConfig, devices } from "@playwright/test";
const nextPort = Number(process.env.CMS_E2E_NEXT_PORT ?? "41731");
const astroPort = Number(process.env.CMS_E2E_ASTRO_PORT ?? "41732");
const frameworks = [
{ name: "next", baseURL: `http://127.0.0.1:${nextPort}` },
{ name: "astro", baseURL: `http://127.0.0.1:${astroPort}` },
] as const;
const browsers = [
{ name: "chromium", use: devices["Desktop Chrome"] },
{ name: "firefox", use: devices["Desktop Firefox"] },
{ name: "webkit", use: devices["Desktop Safari"] },
] as const;
export default defineConfig({
testDir: "./tests/e2e",
tsconfig: "./tsconfig.e2e.json",
timeout: 30_000,
expect: { timeout: 7_500 },
fullyParallel: true,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
use: {
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
reducedMotion: "reduce",
},
projects: frameworks.flatMap((framework) =>
browsers.map((browser) => ({
name: `${framework.name}-${browser.name}`,
use: { ...browser.use, baseURL: framework.baseURL },
metadata: { framework: framework.name },
})),
),
webServer: [
{
command: `pnpm --filter @git-native-cms/playground-next exec next dev --hostname 127.0.0.1 --port ${nextPort}`,
url: `http://127.0.0.1:${nextPort}`,
reuseExistingServer: false,
timeout: 120_000,
},
{
command: `ASTRO_DEV_BACKGROUND=1 pnpm --filter @git-native-cms/playground-astro exec astro dev --host 127.0.0.1 --port ${astroPort} --force`,
url: `http://127.0.0.1:${astroPort}`,
reuseExistingServer: false,
timeout: 120_000,
},
],
});