Getting started
Python
The same PDF reports for pytest-playwright runs. Your subscription issues a key for each test runner, so Python gets its own key and its own allowance of machines, separate from the ones your other suites use.
Install
pip install reportforge-playwright-pdfpython -m playwright install chromiumThat is the whole setup. The plugin reuses the Node runtime and the Chromium that Playwright for Python already ships, so there is no npm install and no separate browser download.
Quick start
export RF_LICENSE_KEY=RFPY-XXXX-XXXX-XXXX-XXXXpytest --pdfThe PDF lands at reports/report.pdf. Pick a template and a path per run:
pytest --pdf --pdf-template=executive --pdf-output="reports/{date}-report.pdf"Your tests always run in full. Without an active subscription only the PDF is skipped, and the run summary says so. Failure screenshots appear in the report when you run with --screenshot only-on-failure.
Configuration
Project defaults live in pyproject.toml. Every option of the Node.js reporter is accepted with the same camelCase name, so the full options reference applies as-is:
[tool.reportforge]enabled = truetemplate = "detailed"outputFile = "reports/{date}-{branch}-report.pdf"projectName = "Checkout suite"watermark = "CONFIDENTIAL"Precedence, lowest to highest: a JSON file passed with --pdf-options, then [tool.reportforge], then individual --pdf-* flags. Set enabled = true to generate on every run without typing --pdf; CI can use RF_PDF=1 instead. Options are validated by the engine, and a bad key is reported with the exact path that is wrong.
How it works
- The plugin collects results during the run (pytest-xdist included, any worker count).
- After the last test it hands them to the bundled report engine using Playwright's own Node runtime.
- The engine validates your license, renders the PDF with Playwright's Chromium, and prints the output path in the run summary.
Overrides for unusual environments: RF_NODE_PATH (Node binary), PUPPETEER_EXECUTABLE_PATH (browser), RF_ENGINE_PATH (engine bundle). Reruns from pytest-rerunfailures show up as flaky tests with their full retry history; markers become tags and feed the requirements matrix.
Current limitations
- Live run streaming works: set [tool.reportforge.live] enabled = true with RF_LICENSE_KEY exported and the run prints a shareable watch link and streams per-test progress. The live step trail and console streaming stay Node.js-only.
- The cross-browser comparison section appears only when --browser is passed more than once — each browser becomes its own project in the report.
- Step trees inside the failure deep dive need Playwright's step events, which pytest does not emit; console output capture works.