Files
zeekayandHanzo Dev e75d231b0c Wait for the page before timing the tests
Playwright was told a port, so it started the suite as soon as the socket
opened and turbopack compiled the route inside the first test. A test's
time also covers its hooks, so that first test paid for launching chromium
on top of the two dev-server navigations every test makes.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 13:03:39 -07:00

26 lines
865 B
TypeScript

import { defineConfig } from '@playwright/test'
export default defineConfig({
testDir: './tests',
testMatch: /\.integration\.test\.ts$/,
// a test's time covers its hooks, so the first one also pays to launch
// chromium. each test then loads the page twice - once to reach an origin it
// can clear storage on, once to read the theme that follows - and a dev
// server serves every module unbundled.
timeout: 90000,
use: {
baseURL: process.env.BASE_URL || 'http://localhost:3456',
headless: true,
},
webServer: process.env.BASE_URL
? undefined
: {
command: 'bun run dev',
// wait for the route to answer rather than for the socket to open:
// turbopack compiles the page on its first request.
url: 'http://localhost:3456',
reuseExistingServer: true,
timeout: 120000,
},
})