ci: 优化 Playwright 测试工作流
This commit is contained in:
5
.github/workflows/playwright.yaml
vendored
5
.github/workflows/playwright.yaml
vendored
@@ -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
|
||||
|
@@ -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,
|
||||
},
|
||||
|
Reference in New Issue
Block a user