Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
62 lines (60 loc) · 1.72 KB
/
Copy pathplaywright.config.ts
File metadata and controls
62 lines (60 loc) · 1.72 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
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
testMatch: /.*\.pw\.spec\.ts$/,
fullyParallel: true,
forbidOnly: !!process.env.CI,
timeout: 30 * 1000,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', { open: 'never' }]],
webServer: {
command: 'pnpm dev',
port: 3000,
reuseExistingServer: !process.env.CI,
},
use: {
channel: 'chrome',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
headless: false, // 개발 중에는 false로 설정
ignoreHTTPSErrors: true, // 개발 중에는 true로 설정
},
projects: [
// --- 로컬용: dev 서버를 이 프로젝트에서만 띄움 ---
{
name: 'setup-local',
testMatch: /auth\.setup\.ts/,
use: { ...devices['Desktop Chrome'], baseURL: 'http://localhost:3000' },
// setup만 돌릴 때 dev 서버가 필요하면 여기에 webServer 둬도 됨
},
{
name: 'local-chromium',
dependencies: ['setup-local'],
use: {
...devices['Desktop Chrome'],
baseURL: 'http://localhost:3000',
storageState: 'storageState.json',
},
},
// --- 배포(스테이징/프리뷰)용: dev 서버 없음 ---
{
name: 'setup-staging',
testMatch: /auth\.setup\.ts/,
use: {
...devices['Desktop Chrome'],
baseURL: process.env.PLAYWRIGHT_BASE_URL!,
},
},
{
name: 'staging-chromium',
dependencies: ['setup-staging'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.PLAYWRIGHT_BASE_URL!,
storageState: 'storageState.json',
},
},
],
});