45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { defineConfig } from '@playwright/test';
|
|
|
|
const host = process.env.PLAYWRIGHT_HOST ?? '127.0.0.1';
|
|
const port = Number(process.env.PLAYWRIGHT_PORT ?? '3400');
|
|
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://${host}:${port}`;
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: Boolean(process.env.CI),
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
timeout: 30_000,
|
|
expect: {
|
|
timeout: 10_000
|
|
},
|
|
reporter: [
|
|
['list'],
|
|
['html', { open: 'never', outputFolder: 'output/playwright/report' }]
|
|
],
|
|
outputDir: 'output/playwright/test-results',
|
|
use: {
|
|
baseURL,
|
|
browserName: 'chromium',
|
|
trace: 'retain-on-failure',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
viewport: {
|
|
width: 1440,
|
|
height: 960
|
|
}
|
|
},
|
|
webServer: {
|
|
command: 'bun run e2e:webserver',
|
|
url: baseURL,
|
|
reuseExistingServer: false,
|
|
timeout: 120_000,
|
|
env: {
|
|
PLAYWRIGHT_BASE_URL: baseURL,
|
|
PLAYWRIGHT_HOST: host,
|
|
PLAYWRIGHT_PORT: String(port)
|
|
}
|
|
}
|
|
});
|