27 lines
856 B
TypeScript
27 lines
856 B
TypeScript
import { defineConfig } from '@playwright/test'
|
|
|
|
// Playwright config runs in Node.js — declare `process` for TypeScript here to avoid needing @types/node
|
|
declare const process: any;
|
|
|
|
export default defineConfig({
|
|
testDir: './tests',
|
|
timeout: 30_000,
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: {
|
|
browserName: 'chromium',
|
|
// If PW_WS_ENDPOINT is provided, connect to the remote Playwright server instead of launching a local browser
|
|
...(process.env.PW_WS_ENDPOINT
|
|
? { connectOptions: { wsEndpoint: (process.env.PW_WS_ENDPOINT as string) } }
|
|
: {}),
|
|
},
|
|
},
|
|
],
|
|
use: {
|
|
headless: true,
|
|
// allow overriding the target base URL via PW_BASE_URL env var (useful when vite chooses a different port)
|
|
baseURL: (process.env.PW_BASE_URL as string) || 'http://localhost:5173',
|
|
},
|
|
})
|