mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
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:
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user