Skip to content

Commit e58a921

Browse files
alswlcursoragent
andcommitted
fix(ci): 保证 E2E 生成 playwright-report 并容错上传
- playwright.config: CI 下在 reporter 中加入 list,保留 html 以生成 playwright-report - test.yml: 去掉 --reporter=list,改用 config;上传报告步骤加 continue-on-error Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fb76211 commit e58a921

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ jobs:
7272
run: npx playwright install --with-deps chromium
7373

7474
- name: Run E2E tests
75-
run: npm run test:e2e -- --project=chromium --reporter=list
75+
run: npm run test:e2e -- --project=chromium
7676

7777
- name: Upload test results
7878
if: always()
79+
continue-on-error: true
7980
uses: actions/upload-artifact@v4
8081
with:
8182
name: playwright-report

playwright.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ export default defineConfig({
1616
/* CI 环境禁用并行 */
1717
workers: process.env.CI ? 1 : undefined,
1818

19-
/* 测试报告配置 */
19+
/* 测试报告配置:CI 下加 list 便于日志,同时保留 html 以生成 playwright-report 供上传 */
2020
reporter: [
21+
...(process.env.CI ? [['list']] : []),
2122
['html', { outputFolder: 'playwright-report' }],
2223
['json', { outputFile: 'test-results/results.json' }],
2324
['junit', { outputFile: 'test-results/junit.xml' }],

0 commit comments

Comments
 (0)