Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

playwright.config.ts

25 lines636 Bytes

1import { defineConfig, devices } from '@playwright/test'
2import { appServerReady } from '@tanstack/router-e2e-utils'
3​
4const PORT =
5 Number(process.env.VITE_SERVER_PORT) || Number(process.env.E2E_APP_PORT ?? 0)
6const baseURL = `http://localhost:${PORT}`
7​
8export default defineConfig({
9 testDir: './tests',
10 workers: 1,
11 reporter: [['line']],
12 use: { baseURL },
13 webServer: {
14 command: `VITE_SERVER_PORT=${PORT} pnpm dev:e2e --port ${PORT}`,
15 wait: appServerReady,
16 reuseExistingServer: false,
17 stdout: 'pipe',
18 },
19 projects: [
20 {
21 name: 'chromium',
22 use: { ...devices['Desktop Chrome'] },
23 },
24 ],
25})