33 lines
761 B
TypeScript
33 lines
761 B
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
const PORT = Number(process.env.PLAYWRIGHT_PORT || 3100)
|
|
const BASE_URL = process.env.PLAYWRIGHT_BASE_URL || `http://127.0.0.1:${PORT}`
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
timeout: 120_000,
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 1 : 0,
|
|
reporter: [['list']],
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
trace: 'on-first-retry',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
webServer: {
|
|
command: `pnpm dev --port ${PORT}`,
|
|
url: BASE_URL,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120_000,
|
|
},
|
|
})
|
|
|