Skip to main content

Playwright Smart Reporter - Python

Python integration for Playwright Smart Reporter - writes the Smart Reporter HTML report for your pytest test suites.

Features

  • HTML report - the same single-page report as the Node.js reporter
  • Test results - status, duration, error and keywords (as tags) for each pytest test
  • Modern Dashboard - Interactive sidebar navigation, light/dark themes

Limits

The bridge converts the results of one pytest run. It keeps no history and calls no AI provider, so these Node.js reporter features are not available:

  • AI failure analysis and the AI suite summary
  • Trend charts across runs (the report shows the current run only)
  • Flakiness detection, performance regression alerts and stability grades
  • Failure clustering

Prerequisites

  • Python 3.9+
  • Node.js 18+ (runtime only - no npm install needed)

Installation

pip install playwright-smart-reporter-python

The package is self-contained. The compiled JavaScript report generator is bundled in the wheel - Node.js is only needed at runtime to execute it.

Quick Start

Option 1: Pytest Plugin (Automatic)

Run your tests with the --smart-reporter flag:

pytest --json-report --smart-reporter

Report automatically generated at smart-report.html.

Option 2: Manual Generation

from playwright_smart_reporter_python import SmartReporterBridge

bridge = SmartReporterBridge()
bridge.generate_report(
    pytest_json_path=".pytest-report.json",
    output_html="smart-report.html"
)

Configuration

pytest.ini / pyproject.toml

[pytest]
addopts =
    --json-report
    --json-report-file=.pytest-report.json
    --smart-reporter
    --smart-reporter-output=test-reports/smart-report.html

Usage with Playwright for Python

# test_example.py
from playwright.sync_api import Page

def test_homepage(page: Page):
    page.goto("https://playwright.dev")
    assert page.title() == "Fast and reliable end-to-end testing"
pytest --headed --smart-reporter

How It Works

  1. pytest runs your tests with JSON reporting enabled
  2. Converter transforms pytest JSON to Playwright Smart Reporter format
  3. Node.js bridge calls the bundled HTML generator
  4. Output interactive HTML report

Development

This is part of a monorepo. The Python package lives in python/ and can use either the bundled JS dist (PyPI install) or the monorepo dist/ (local development).

# From repository root
npm run build                      # Compile TypeScript
cd python
python scripts/bundle_dist.py      # Bundle JS into package
pip install -e ".[dev]"            # Editable install
pytest tests/ -v                   # Run tests

Troubleshooting

Node.js not found

The package needs Node.js at runtime to execute the report generator:

# macOS
brew install node

# Linux
sudo apt install nodejs

# Windows
# Download from https://nodejs.org

License

MIT - See LICENSE.

Metadata

Release files for playwright-smart-reporter-python 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for playwright-smart-reporter-python 1.1.0
File Size Uploaded Provenance
playwright_smart_reporter_python-1.1.0.tar.gz 203.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for playwright-smart-reporter-python 1.1.0
File Interpreter ABI Platform
playwright_smart_reporter_python-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 412.7 kB

Release files / playwright_smart_reporter_python-1.1.0.tar.gz

Download URL playwright_smart_reporter_python-1.1.0.tar.gz
Size 203.4 kB
Tags Source
SHA-256 checksum
How to use checksums
10306ea4711dea0e18931d2e3fbab158e79beb62df95e945613eb3df568ce734
BLAKE2b-256 checksum
How to use checksums
42ba9ebb975ee09cb222d752b69cf8f2f62e9f2d84a503ad2ea685f39d36785f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / playwright_smart_reporter_python-1.1.0-py3-none-any.whl

Download URL playwright_smart_reporter_python-1.1.0-py3-none-any.whl
Size 209.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c87903185e5fe007296f0f6ca1f271ab023b6d2991441a6a08feabfbdd26bf72
BLAKE2b-256 checksum
How to use checksums
8ca916daf753646bc38e508c663f9a3e5f384739e09c085328a45c621d17a992
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for playwright-smart-reporter-python 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for playwright_smart_reporter_python-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page