Skip to main content

reportforge-playwright-pdf

Designed PDF reports for Playwright pytest runs. Three templates cover three audiences: minimal for PR checks, detailed for QA deep dives, executive for stakeholder reviews.

Same product as the npm reporter @reportforge/playwright-pdf, the .NET logger ReportForge.Playwright.Pdf, and the Cypress plugin @reportforge/cypress-pdf. One subscription issues a key for each runner, so Python gets its own RFPY-… key and its own allowance of 25 machines, separate from the ones your other suites use.


Install

pip install reportforge-playwright-pdf
python -m playwright install chromium

Requires Python 3.10 or later and playwright. The plugin reuses the Node runtime and the Chromium that Playwright for Python already installs, so there is no npm install and no second browser download.

Quick start

export RF_LICENSE_KEY=RFPY-XXXX-XXXX-XXXX-XXXX
pytest --pdf

The PDF lands at playwright-report/{date}-report.pdf by default, and the path is printed in the terminal summary when it is written.

Your tests always run in full. A licensing problem, a missing browser, or an engine error never fails your suite: the plugin logs one warning and skips the PDF. The pytest exit code is decided by your tests alone.

The plugin is inert until you switch it on

Installing the package changes nothing about a plain pytest run. It activates on any one of:

How Use it for
pytest --pdf One-off local runs
RF_PDF=1 pytest CI, without touching the command
enabled = true under [tool.reportforge] Project default, every run

Configuration

Options use the reporter's camelCase names, unchanged. They are passed to the report engine and validated there by the same schema the npm reporter uses, so the two ecosystems cannot drift on what an option means.

Precedence

Lowest to highest, so a CLI flag always wins:

  1. --pdf-options FILE.json: the full options object
  2. [tool.reportforge] in pyproject.toml: your project defaults
  3. Individual --pdf-* flags: this run only

Flags

Flag Effect
--pdf Generate the report after the run
--pdf-output PATH Output path; {date}, {branch}, {status} tokens are expanded
--pdf-template ID[,ID] minimal, detailed, or executive; pass several to emit several reports
--pdf-options JSON_PATH JSON file holding the full options object
--pdf-engine JS_PATH Point at a different engine build (development and CI; also RF_ENGINE_PATH)
pytest --pdf --pdf-template=executive --pdf-output="reports/{date}-report.pdf"

Project defaults

[tool.reportforge]
enabled = true
template = "detailed"
outputFile = "reports/{date}-{branch}-report.pdf"
projectName = "Checkout suite"
slowTestThreshold = 5000

[tool.reportforge.capture]
evidence = true

[tool.reportforge.live]
enabled = true

[tool.reportforge.notify.slack]
webhookUrl = "https://hooks.slack.com/services/..."

Full option reference: reportforge.org/docs/configuration. Python specifics: reportforge.org/docs/python.

Add .reportforge/ to your .gitignore. The plugin writes your resolved options there to hand them to the report engine, so a licenseKey set in pyproject.toml rather than the environment would land in a file inside your project. The same applies to pdfPassword.

How your results are reported

pytest has more outcomes than a pass/fail report implies. Each is mapped deliberately rather than flattened:

pytest outcome Report status Notes
pass passed
fail failed
setup or teardown error failed annotated as a setup/teardown error, so it is not read as a test defect
skip skipped
xfail that failed failed annotated xfail; the expected outcome, not a regression
xpass passed annotated xpass; passing when it was expected to fail is worth seeing
rerun then pass flaky with the full attempt history (pytest-rerunfailures)
reruns exhausted failed every attempt recorded
pytest-timeout kill timed out matched on the framework's own wording

Markers become tags. @pytest.mark.smoke shows as @smoke in the report. pytest's own structural markers (parametrize, usefixtures, skipif, skip, xfail, asyncio) are excluded, since they describe the harness rather than the test.

pytest-xdist is supported. Results are accumulated on the controller, so a -n auto run produces one report rather than one per worker.

What you get

  • Pass, fail, flaky, timeout and skip KPIs, suite breakdown, charts, and a release recommendation
  • Failure deep dive with error text, on-device ML failure clustering that groups failures by likely root cause, and screenshots from --screenshot=only-on-failure
  • Trace archives and videos from --tracing / --video feed the defect log's evidence links; pair with evidenceUrlTemplate for clickable CI links
  • Run history trend and a run-over-run diff showing what newly failed, what was fixed, and what is still failing
  • Notifications to Slack, Teams, Discord, or email after the run
  • Display redaction and AES-256 PDF encryption when you need them
  • Passing --browser more than once splits the report into one project per browser and unlocks the cross-browser comparison section

Live runs

Set [tool.reportforge.live] enabled = true and the run streams to a shareable watch page as tests finish, the same page the Node.js reporter produces. The watch URL is printed at the start of the run and repeated in the terminal summary.

Streaming is best-effort by design: if the relay is unreachable the run continues and the PDF renders exactly as it would have. Step trees stay Node.js-only today.

CI

- run: pip install reportforge-playwright-pdf
- run: python -m playwright install --with-deps chromium
- run: pytest --pdf
  env:
    RF_LICENSE_KEY: ${{ secrets.RF_LICENSE_KEY_PYTHON }}

Store the RFPY-… key as a secret. Every CI machine that runs the suite takes one of the licence's 25 machine slots; a slot frees itself automatically after 30 days without a run, so ephemeral runners recycle on their own.

Troubleshooting

No PDF and one warning about the licence. Expected behaviour when the key is missing, wrong for this runner, or the subscription is inactive. Check that RF_LICENSE_KEY holds the RFPY-… key: a key for another runner is refused with a message naming both sides.

"No such option: --pdf". The plugin did not load. Confirm the install landed in the same environment pytest runs from.

Nothing happens on a plain pytest. By design. See the activation table above.

Chromium or Node cannot be found. The plugin looks where Playwright for Python puts them. Override with PLAYWRIGHT_BROWSERS_PATH, PUPPETEER_EXECUTABLE_PATH, or RF_NODE_PATH if your environment relocates them.

License

Elastic License 2.0. A paid subscription is required to generate PDFs: reportforge.org/pricing.

Release files for reportforge-playwright-pdf 0.33.2

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

Source distribution (sdist)

Source distribution for reportforge-playwright-pdf 0.33.2
File Size Uploaded
reportforge_playwright_pdf-0.33.2.tar.gz 993.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reportforge-playwright-pdf 0.33.2
File Interpreter ABI Platform
reportforge_playwright_pdf-0.33.2-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / reportforge_playwright_pdf-0.33.2.tar.gz

Download URL reportforge_playwright_pdf-0.33.2.tar.gz
Size 993.0 kB
Tags Source
SHA-256 checksum
How to use checksums
128eef7cfd0643633a6fb3a57d987e5d41f62b784a23ab2700ebbc428877319f
BLAKE2b-256 checksum
How to use checksums
b138b6174ce6cadba3c4283494e930fec0cf1e9d705a7a709ddb83ec471d5d34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / reportforge_playwright_pdf-0.33.2-py3-none-any.whl

Download URL reportforge_playwright_pdf-0.33.2-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e90891822ddc2141f59560baeac263dd593e050049eda13b79139c3674f69553
BLAKE2b-256 checksum
How to use checksums
72f22af5f2210a966a7401afffb104cea1c9470cd1e3c097fbd62d0157727c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.33.2 This release

2 release files

0.33.1

2 release files

0.33.0

2 release files

0.31.0

1 release file

0.30.0

1 release file

0.29.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

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