-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
59 lines (56 loc) ยท 1.85 KB
/
playwright.config.ts
File metadata and controls
59 lines (56 loc) ยท 1.85 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
import { defineConfig, devices } from "@playwright/test";
import { AUTH_FILE, BACKEND_URL, FRONTEND_URL } from "./e2e/constants";
const WEBSERVER_TIMEOUT_MS = 3 * 60 * 1000;
const isCI = !!process.env.CI;
export default defineConfig({
testDir: "./e2e",
outputDir: "./test-results",
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 2 : 0,
workers: isCI ? 2 : 4,
reporter: isCI
? [["blob"], ["html", { open: "never", outputFolder: "playwright-report" }]]
: [["html", { open: "never", outputFolder: "playwright-report" }]],
use: {
baseURL: FRONTEND_URL,
trace: isCI ? "on-first-retry" : "on",
screenshot: isCI ? "only-on-failure" : "on",
video: isCI ? "retain-on-failure" : "on",
},
projects: [
{
name: "setup",
testMatch: /.*\.setup\.ts/,
},
{
name: "chromium",
dependencies: ["setup"],
testMatch: /.*\.auth\.spec\.ts/,
use: {
...devices["Desktop Chrome"],
storageState: AUTH_FILE,
},
},
{
name: "chromium-no-auth",
testIgnore: /.*\.auth\.spec\.ts/,
use: { ...devices["Desktop Chrome"] },
},
],
webServer: [
{
command:
'cd src/backend && DATABASE_URL="postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" PRISMA_CLIENT_ENGINE_TYPE=binary PORT=3001 NODE_ENV=development GOOGLE_CLIENT_ID=dummy GOOGLE_CLIENT_SECRET=dummy DISCORD_CLIENT_ID=dummy DISCORD_CLIENT_SECRET=dummy KAKAO_CLIENT_ID=dummy KAKAO_CLIENT_SECRET=dummy DISCORD_GOLD_EXCHANGE_RATE_WEBHOOK_URL=https://discord.com/api/webhooks/dummy pnpm start:dev',
url: `${BACKEND_URL}/graphql`,
reuseExistingServer: !isCI,
timeout: WEBSERVER_TIMEOUT_MS,
},
{
command: "cd src/frontend && PLAYWRIGHT=1 pnpm dev",
url: FRONTEND_URL,
reuseExistingServer: !isCI,
timeout: WEBSERVER_TIMEOUT_MS,
},
],
});