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, },