test: fix playwright timeout due to localhost resolution

Playwright tests were timing out on CI because the Vite dev server was
listening on `http://localhost:5173/` but `playwright.config.ts` was
configured to wait for `http://127.0.0.1:5173/`. Node 17+ resolves
`localhost` to IPv6 (`::1`), causing Playwright's strict IPv4 wait
to time out.

This commit updates `playwright.config.ts` to use `http://localhost:5173`
for both `baseURL` and the `webServer.url`.
This commit is contained in:
vmomenv
2026-03-12 07:01:40 +00:00
parent 3995d2bbc0
commit fa990cb974

View File

@@ -11,7 +11,7 @@ export default defineConfig({
["json", { outputFile: "test-results.json" }], ["json", { outputFile: "test-results.json" }],
], ],
use: { use: {
baseURL: "http://127.0.0.1:5173", baseURL: "http://localhost:5173",
trace: "on-first-retry", trace: "on-first-retry",
screenshot: "only-on-failure", screenshot: "only-on-failure",
video: "retain-on-failure", video: "retain-on-failure",
@@ -24,7 +24,7 @@ export default defineConfig({
], ],
webServer: { webServer: {
command: "npm run dev", command: "npm run dev",
url: "http://127.0.0.1:5173", url: "http://localhost:5173",
reuseExistingServer: !process.env.CI, reuseExistingServer: !process.env.CI,
timeout: 120 * 1000, timeout: 120 * 1000,
stdout: "pipe", stdout: "pipe",