-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
85 lines (80 loc) · 2.09 KB
/
playwright.config.ts
File metadata and controls
85 lines (80 loc) · 2.09 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
import { defineConfig, devices } from "@playwright/test";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = dirname(fileURLToPath(import.meta.url));
const cli = resolve(__dirname, "packages/catmint-cli/bin/catmint.js");
/**
* Playwright configuration for Catmint E2E tests.
*
* Three projects correspond to the three app modes (fullstack, backend, frontend).
* Each project starts its own dev server from the corresponding fixture directory.
*
* Run all: pnpm playwright test
* Run one: pnpm playwright test --project=fullstack
*/
export default defineConfig({
testDir: "./tests/e2e",
timeout: 30_000,
retries: process.env.CI ? 2 : 0,
workers: 1, // Serial execution — tests share dev servers
reporter: process.env.CI ? "github" : "list",
use: {
headless: true,
screenshot: "only-on-failure",
trace: "on-first-retry",
},
webServer: [
{
command: `node ${cli} dev`,
cwd: "./tests/fixtures/fullstack-app",
port: 6468,
reuseExistingServer: !process.env.CI,
},
{
command: `node ${cli} dev`,
cwd: "./tests/fixtures/backend-app",
port: 3001,
reuseExistingServer: !process.env.CI,
},
{
command: `node ${cli} dev`,
cwd: "./tests/fixtures/frontend-app",
port: 3002,
reuseExistingServer: !process.env.CI,
},
],
projects: [
{
name: "fullstack",
testMatch: [
"navigation.test.ts",
"forms.test.ts",
"ssr.test.ts",
"dev-server.test.ts",
"modes.test.ts",
"page-params.test.ts",
"request-context.test.ts",
],
use: {
...devices["Desktop Chrome"],
baseURL: "http://localhost:6468",
},
},
{
name: "backend",
testMatch: ["modes.test.ts"],
use: {
...devices["Desktop Chrome"],
baseURL: "http://localhost:3001",
},
},
{
name: "frontend",
testMatch: ["modes.test.ts"],
use: {
...devices["Desktop Chrome"],
baseURL: "http://localhost:3002",
},
},
],
});