From 6cbcf6fae3e5df53d710ba580412df83748663a1 Mon Sep 17 00:00:00 2001 From: vmomenv <51269338+vmomenv@users.noreply.github.com> Date: Thu, 12 Mar 2026 07:06:28 +0000 Subject: [PATCH] test: fix playwright e2e connection refused error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The e2e test was hardcoded to navigate to `http://127.0.0.1:3344` instead of using the configured `baseURL` in `playwright.config.ts` which points to the Vite dev server (`http://localhost:5173`). This caused tests to fail with `net::ERR_CONNECTION_REFUSED`. This commit replaces the hardcoded URL with `/` so that Playwright correctly uses the `baseURL` setting. It also updates the title assertion to include "星火应用商店". --- e2e/basic.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/basic.spec.ts b/e2e/basic.spec.ts index 606bb457..187931fc 100644 --- a/e2e/basic.spec.ts +++ b/e2e/basic.spec.ts @@ -2,11 +2,11 @@ import { test, expect } from "@playwright/test"; test.describe("应用基本功能", () => { test.beforeEach(async ({ page }) => { - await page.goto("http://127.0.0.1:3344"); + await page.goto("/"); }); test("页面应该正常加载", async ({ page }) => { - await expect(page).toHaveTitle(/APM 应用商店|Spark Store/); + await expect(page).toHaveTitle(/星火应用商店|APM 应用商店|Spark Store/); }); test("应该显示应用列表", async ({ page }) => {