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:
--pdf-options FILE.json: the full options object[tool.reportforge]inpyproject.toml: your project defaults- 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 alicenseKeyset inpyproject.tomlrather than the environment would land in a file inside your project. The same applies topdfPassword.
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/--videofeed the defect log's evidence links; pair withevidenceUrlTemplatefor 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
--browsermore 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| reportforge_playwright_pdf-0.33.1.tar.gz | 943.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| reportforge_playwright_pdf-0.33.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / reportforge_playwright_pdf-0.33.1.tar.gz
| Download URL | reportforge_playwright_pdf-0.33.1.tar.gz |
|---|---|
| Size | 943.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73fabe6ac09e38b146ce8408745a2c654225daa43b58f9cf48c3af65a06b1b1a
|
|
BLAKE2b-256 checksum How to use checksums |
34eee44f82303dc64df9cc501c1122f9d4161f8ea8d1a840cdba05953362fd73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Release files / reportforge_playwright_pdf-0.33.1-py3-none-any.whl
| Download URL | reportforge_playwright_pdf-0.33.1-py3-none-any.whl |
|---|---|
| Size | 953.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e87d2413636af57da49f6566af8c935d15c3621064a1aa2fd419eaffb9cd703a
|
|
BLAKE2b-256 checksum How to use checksums |
f57aff160bd3ee3557e38efe6010d96b618427d3ece9a2d3bf48fc279c813d6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|