forked from trpc/examples-next-prisma-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
28 lines (26 loc) · 872 Bytes
/
playwright.config.ts
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
import { PlaywrightTestConfig, devices } from '@playwright/test';
const opts = {
// launch headless on CI, in browser locally
headless: !!process.env.CI || !!process.env.PLAYWRIGHT_HEADLESS,
// collectCoverage: !!process.env.PLAYWRIGHT_HEADLESS
};
const config: PlaywrightTestConfig = {
testDir: './playwright',
timeout: 35e3,
outputDir: './playwright/test-results',
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
// default 'list' when running locally
reporter: process.env.CI ? 'github' : 'list',
use: {
...devices['Desktop Chrome'],
headless: opts.headless,
video: 'on',
},
retries: process.env.CI ? 3 : 0,
webServer: {
command: process.env.CI ? 'npm run start' : 'npm run dev',
reuseExistingServer: Boolean(process.env.TEST_LOCAL === '1'),
port: 3000,
},
};
export default config;