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β
5export const PORT = await getTestServerPort(packageJson.name)
6const baseURL = `http://localhost:${PORT}`
7β
8/**
9 * See https://playwright.dev/docs/test-configuration.
10 */
11export default defineConfig({
12 testDir: './tests',
13 workers: 1,
14β
15 reporter: [['line']],
16β
17 use: {
18 /* Base URL to use in actions like `await page.goto('/')`. */
19 baseURL,
20 },
21β
22 webServer: {
23 command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
24 url: baseURL,
25 reuseExistingServer: !process.env.CI,
26 stdout: 'pipe',
27 },
28β
29 projects: [
30 {
31 name: 'chromium',
32 use: { ...devices['Desktop Chrome'] },
33 },
34 ],
35})