Built-in Reporters in Playwright https://playwright.dev/docs/test-reporters#built-in-reporters
Playwright comes with several built-in reporters that help you visualize, log, and analyze test results. Here's a brief overview:
List Reporter (
list
):This is the default reporter.
It provides a simple, human-readable output in the terminal, listing each test as it runs.
Shows test results (pass/fail) with clear indicators.
Dot Reporter (
dot
):Displays a minimal output where each test result is shown as a single dot.
Good for situations where you want very concise feedback.
Line Reporter (
line
):Similar to the
dot
reporter, but each test is displayed on a single line.Provides more information than
dot
but still remains compact.
JSON Reporter (
json
):Outputs test results in JSON format.
Useful for processing test results programmatically or for integrating with other tools.
JUnit Reporter (
junit
):Generates an XML report in the JUnit format.
This is often used in CI/CD pipelines for integrating with test reporting tools.
HTML Reporter (
html
):Generates a detailed HTML report.
Includes test results, screenshots, and videos (if configured).
Allows you to drill down into each test case and step.
Third-Party Reporters (
Allure, GitHub Actions, Report Portal etc.
):Third-party reporters are community-contributed plugins that extend Playwright's reporting capabilities.
These reporters often integrate with popular testing and CI/CD tools, offering additional features or customizations that aren't available in Playwright's built-in reporters.
For more details: https://playwright.dev/docs/test-reporters#introduction
Custom Reporter using Playwright API
Playwright Offers API to write custom test reports. A custom reporter is a class that implements specific methods to handle events during the test run.