1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-06-14 22:27:33 +02:00
cheatsheets/playwright.config.ts
2024-03-28 19:59:22 +11:00

21 lines
477 B
TypeScript

import { defineConfig } from '@playwright/test'
const port = process.env.PORT ?? 4321
const isCI = Boolean(process.env.CI)
export default defineConfig({
testMatch: /.*\.e2e\.[^.]*/,
webServer: {
command: `npm run dev -- --port ${port}`,
url: `http://localhost:${port}/`,
reuseExistingServer: !isCI /* Spawn dev server on CI */
},
expect: {
timeout: isCI ? 5000 : 2500 /* default: 5000 */
},
use: {
baseURL: `http://localhost:${port}/`
}
})