Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import { appServerReady } from '@tanstack/router-e2e-utils'
3β
4const mode = process.env.MODE ?? 'prod'
5const isDev = mode === 'dev'
6const PORT = Number(process.env.E2E_APP_PORT ?? 0)
7const baseURL = `http://localhost:${PORT}`
8β
9export default defineConfig({
10 testDir: './tests',
11 workers: 1,
12 reporter: [['line']],
13β
14 globalSetup: './tests/setup/global.setup.ts',
15β
16 use: {
17 baseURL,
18 },
19β
20 webServer: {
21 command: isDev
22 ? `pnpm dev:e2e --port 0`
23 : `pnpm build && PORT=${PORT} pnpm start`,
24 wait: appServerReady,
25 reuseExistingServer: false,
26 stdout: 'pipe',
27 env: {
28 VITE_NODE_ENV: 'test',
29 PORT: String(PORT),
30 },
31 },
32β
33 projects: [
34 {
35 name: 'chromium',
36 use: {
37 ...devices['Desktop Chrome'],
38 },
39 },
40 ],
41})