Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import { appServerReady } from '@tanstack/router-e2e-utils'
3β
4const distDir = process.env.E2E_DIST_DIR ?? 'dist'
5β
6export const PORT = Number(process.env.E2E_APP_PORT ?? 0)
7const baseURL = `http://localhost:${PORT}`
8β
9/**
10 * See https://playwright.dev/docs/test-configuration.
11 */
12export default defineConfig({
13 testDir: './tests',
14 testIgnore: /rsbuild-cache\.spec\.ts/,
15 workers: 1,
16β
17 reporter: [['line']],
18β
19 use: {
20 /* Base URL to use in actions like `await page.goto('/')`. */
21 baseURL,
22 },
23β
24 webServer: {
25 command: `PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
26 wait: appServerReady,
27 reuseExistingServer: false,
28 stdout: 'pipe',
29 env: {
30 PORT: String(PORT),
31 VITE_SERVER_PORT: String(PORT),
32 E2E_DIST_DIR: distDir,
33 },
34 },
35β
36 projects: [
37 {
38 name: 'chromium',
39 use: { ...devices['Desktop Chrome'] },
40 },
41 ],
42})