-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
46 lines (44 loc) · 1.18 KB
/
Copy pathplaywright.config.ts
File metadata and controls
46 lines (44 loc) · 1.18 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
import { defineConfig, devices } from '@playwright/test';
import 'dotenv/config';
const baseURL = process.env.BASE_URL ?? 'http://127.0.0.1:3000';
const isCI = Boolean(process.env.CI);
const isLocal = baseURL.includes('127.0.0.1') || baseURL.includes('localhost');
export default defineConfig({
testDir: './e2e',
timeout: isCI ? 60_000 : 30_000,
expect: {
timeout: isCI ? 15_000 : 5_000,
},
workers: isCI ? 1 : 2,
reporter: isCI ? [['line'], ['github'], ['html', { open: 'never' }]] : 'line',
use: {
baseURL,
actionTimeout: isCI ? 30_000 : 15_000,
navigationTimeout: isCI ? 30_000 : 15_000,
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
userAgent: 'e2e-test',
launchOptions: {
args: isCI
? ['--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu']
: [],
},
},
},
],
outputDir: 'test-results/',
fullyParallel: true,
webServer:
isCI && isLocal
? {
command: 'bun run dev -- --host 127.0.0.1 --port 3000',
port: 3000,
reuseExistingServer: false,
timeout: 180_000,
}
: undefined,
});