Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import {
3 getDummyServerPort,
4 getTestServerPort,
5} from '@tanstack/router-e2e-utils'
6import packageJson from './package.json' with { type: 'json' }
7β
8const PORT = await getTestServerPort(packageJson.name)
9const EXTERNAL_PORT = await getDummyServerPort(packageJson.name)
10β
11const baseURL = `http://localhost:${PORT}`
12β
13export default defineConfig({
14 testDir: './tests',
15 workers: 1,
16β
17 reporter: [['line']],
18β
19 globalSetup: './tests/setup/global.setup.ts',
20 globalTeardown: './tests/setup/global.teardown.ts',
21β
22 use: {
23 baseURL,
24 },
25β
26 webServer: {
27 command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
28 url: baseURL,
29 reuseExistingServer: !process.env.CI,
30 stdout: 'pipe',
31 },
32β
33 projects: [
34 {
35 name: 'chromium',
36 use: { ...devices['Desktop Chrome'] },
37 },
38 ],
39})