Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import { appServerReady } from '@tanstack/router-e2e-utils'
3β
4const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite'
5const distDir = process.env.E2E_DIST_DIR ?? `dist-${toolchain}-ssr`
6β
7const serverEntryFile = toolchain === 'rsbuild' ? 'index.js' : 'server.js'
8const startCommand = `pnpm exec srvx --prod --dir=. -s ${distDir}/client --entry ${distDir}/server/${serverEntryFile}`
9β
10const PORT = Number(process.env.E2E_APP_PORT ?? 0)
11const baseURL = `http://localhost:${PORT}`
12β
13export default defineConfig({
14 testDir: './tests',
15 workers: 1,
16 reporter: [['line']],
17 use: { baseURL },
18 webServer: {
19 command: startCommand,
20 wait: appServerReady,
21 reuseExistingServer: false,
22 stdout: 'pipe',
23 env: {
24 E2E_DIST_DIR: distDir,
25 NODE_ENV: 'production',
26 PORT: String(PORT),
27 VITE_SERVER_PORT: String(PORT),
28 },
29 },
30 projects: [
31 {
32 name: 'chromium',
33 use: { ...devices['Desktop Chrome'] },
34 },
35 ],
36})