From 88483c26e63a1127d46add411a76f594f506dd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Tue, 9 Sep 2025 15:43:30 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BC=98=E5=8C=96=20Playwright=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/playwright.yaml | 5 +++-- playwright.config.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml index 8c35d6e..7cda6f1 100644 --- a/.github/workflows/playwright.yaml +++ b/.github/workflows/playwright.yaml @@ -18,6 +18,7 @@ jobs: uses: yanhao98/composite-actions/setup-node-environment@25eb4dc0c134cc9df2b7c569aa54140a366b45a8 # - name: 📥 安装 Playwright 浏览器 # run: pnpm exec playwright install --with-deps + - name: 📦 构建项目 + run: pnpm run build-only - name: ▶️ 运行 Playwright 测试 - run: | - npx playwright test + run: pnpm exec playwright test diff --git a/playwright.config.ts b/playwright.config.ts index 2ebaac7..17e759d 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -106,7 +106,7 @@ export default defineConfig({ * Use the preview server on CI for more realistic testing. * Playwright will re-use the local server if there is already a dev-server running. */ - command: process.env.CI ? 'npm run preview' : 'npm run dev', + command: process.env.CI ? 'pnpm run preview' : 'pnpm run dev', port: Number(new URL(baseURL).port), reuseExistingServer: !process.env.CI, },