fix: correct JSON reporter syntax for Playwright tests

- Use proper syntax for JSON reporter with outputFile option
- Run separate commands for HTML and JSON report merging
- Specify output path directly in reporter configuration
- Ensures report.json is created in playwright-report directory

This fixes the "No such file or directory" error when trying to move
report.json file, as it wasn't being created in the first place.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-09-10 00:28:58 +00:00
parent e8e30030a5
commit 605d7cc1e2

View File

@@ -229,10 +229,11 @@ jobs:
- name: Run Playwright tests (${{ matrix.browser }})
id: playwright
run: npx playwright test --project=${{ matrix.browser }} --reporter=html --reporter=json
run: |
npx playwright test --project=${{ matrix.browser }} \
--reporter=html \
--reporter='json:{"outputFile":"playwright-report/report.json"}'
working-directory: ComfyUI_frontend
env:
PLAYWRIGHT_JSON_OUTPUT_NAME: playwright-report/report.json
- uses: actions/upload-artifact@v4
if: always()
@@ -278,12 +279,10 @@ jobs:
- name: Merge into HTML Report
run: |
npx playwright merge-reports --reporter html --reporter json ./all-blob-reports
# Move JSON report to the HTML report directory for easier access
[ -f "report.json" ] && mv report.json playwright-report/report.json
# Generate both HTML and JSON reports
npx playwright merge-reports --reporter html ./all-blob-reports
npx playwright merge-reports --reporter 'json:{"outputFile":"playwright-report/report.json"}' ./all-blob-reports
working-directory: ComfyUI_frontend
env:
PLAYWRIGHT_JSON_OUTPUT_NAME: report.json
- name: Upload HTML report
uses: actions/upload-artifact@v4