Skip to content

Add custom test reporter and improve HTML report configuration#19

Merged
gander merged 7 commits intomainfrom
claude/disable-auto-report-open-lmXmT
Feb 10, 2026
Merged

Add custom test reporter and improve HTML report configuration#19
gander merged 7 commits intomainfrom
claude/disable-auto-report-open-lmXmT

Conversation

@gander
Copy link
Member

@gander gander commented Feb 10, 2026

Summary

Enhanced the Playwright test reporting setup by introducing a custom reporter that provides user-friendly test completion feedback and updating the HTML reporter configuration.

Key Changes

  • Updated HTML reporter configuration: Added open: "never" option to prevent automatic browser opening of reports
  • Created custom reporter (reporters/custom-reporter.ts): Implements a new reporter that displays formatted test completion summary including:
    • Test status
    • Total execution duration
    • Instructions for viewing the HTML report via npm run cli report
  • Modified reporter array in playwright.config.ts: Replaced the list reporter with the new custom reporter while keeping the HTML reporter

Implementation Details

  • The custom reporter implements Playwright's Reporter interface with onEnd() hook to capture final test results
  • printsToStdio() returns false to prevent duplicate output
  • Output is formatted with visual separators for better readability
  • Messages are in Polish, matching the project's localization

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r

Replace the default list reporter with custom reporters:
- HTML reporter now has open: "never" to prevent auto-opening
- custom-reporter.ts shows a summary with status and duration
- database-reporter.ts collects structured test results

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r
The custom-reporter.ts already displays the report command,
so the hardcoded message in run-visual-tests.ts is redundant.

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r
Reorder reporters so custom-reporter runs first in onEnd,
then filter out the HTML reporter's console message about
opening the report with npx playwright show-report.

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r
Playwright's HTML reporter writes the "To open last HTML report"
message via process.stdout.write (gated by process.stdin.isTTY),
not console.log. Switch to intercepting stdout.write to properly
suppress the message.

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r
- generate-visual-baseline.ts: crawling shows inline counter,
  screenshot generation shows progress bar per viewport,
  discovery listing removed (only summary kept)
- custom-reporter.ts: printsToStdio=true suppresses Playwright's
  default list reporter; shows progress bar during tests and
  only failed tests at the end

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r
Instead of dumping the full Playwright error with Call log,
extract just the viewport name, page path and pixel diff ratio.

https://claude.ai/code/session_016kXYDGQ53w5Ek4e3W5oZ7r
@gander gander merged commit 41182e9 into main Feb 10, 2026
7 checks passed
@gander gander deleted the claude/disable-auto-report-open-lmXmT branch February 10, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants