Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import { getTestServerPort } from '@tanstack/router-e2e-utils'
3import packageJson from './package.json' with { type: 'json' }
4β
5const PORT = await getTestServerPort(packageJson.name)
6const baseURL = `http://localhost:${PORT}`
7/**
8 * See https://playwright.dev/docs/test-configuration.
9 */
10export default defineConfig({
11 testDir: './tests',
12 workers: 1,
13β
14 reporter: [['line']],
15β
16 use: {
17 /* Base URL to use in actions like `await page.goto('/')`. */
18 baseURL,
19 },
20β
21 webServer: {
22 command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
23 url: baseURL,
24 reuseExistingServer: !process.env.CI,
25 stdout: 'pipe',
26 },
27β
28 projects: [
29 {
30 name: 'chromium',
31 use: { ...devices['Desktop Chrome'] },
32 },
33 ],
34})