-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
30 lines (28 loc) · 959 Bytes
/
playwright.config.ts
File metadata and controls
30 lines (28 loc) · 959 Bytes
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
import { defineConfig, devices } from '@playwright/test';
const PORT = process.env.PORT || '3000';
const baseURL = process.env.NEXT_PUBLIC_SITE_URL || `http://localhost:${PORT}`;
export default defineConfig({
testDir: 'tests/e2e',
timeout: 30_000,
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
reporter: [['list'], ['html', { outputFolder: 'playwright-report', open: 'never' }]],
use: {
baseURL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
ignoreHTTPSErrors: true,
},
webServer: {
command: 'bash -c "if [ -n \"$CI\" ]; then npm run start; else npm run dev; fi"',
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
],
});