Skip to main content

reportingLabs for Python

One beautiful HTML report for pytest, Playwright, Selenium and Robot Framework. It tells you what broke, who owns it, and whether it is new. The whole report is a single self-contained HTML file: no server, no upload, no login. Open it in a browser, attach it to a CI job, or drop it in Slack.

The report is byte-for-byte the same layout as the Node.js and Java reporters, so one triage habit works across a whole company. Nothing from Node is needed at run time: the report is built entirely in Python.

Install

pip install reporting-labs

That is all. The pytest plugin turns on the moment the package is installed. For Robot Framework, add one listener flag (below).

pytest

Run your tests as you always do:

pytest
open reporting-labs/index.html        # run again to see the trend and flaky history

Add detail with a few optional helpers:

import pytest
from reporting_labs import meta, log, test_data, step, api, attach

@pytest.mark.meta(priority="P1", owner="asha", feature="checkout", story="SHOP-231")
def test_checkout(page):
    test_data({"username": "demo", "password": "S3cret"}, "Login")   # sensitive keys are masked
    log("cart total before coupons: 99.00")
    with step("Apply coupon"):
        ...
What you get How
A row per test: passed, failed, skipped (with the reason), xfail / xpass automatic
Flaky, with every attempt pytest-rerunfailures
Timed out pytest-timeout
Parallel runs merged into one report pytest-xdist (-n auto)
Priority, owner, feature charts and filters @pytest.mark.meta(...) or meta(...)
Every requests / httpx call in the API tab automatic
Captured stdout / stderr, with secrets masked automatic

Turn it off for a run with -p no:reporting_labs or --no-rl.

Playwright

Install pytest-playwright and write tests as usual. Every action, every expect() and a screenshot of the failing page land in the report with no extra code. pytest-playwright's trace and video are attached too:

pytest --tracing retain-on-failure --video retain-on-failure

The sync and async APIs both work. See examples/pytest-playwright.

Selenium

Install selenium and write tests as usual. Every driver command (open, find, click, type, run script, perform actions, Appium taps) becomes a step, with the element named by the locator that found it, and a screenshot of the browser is attached when a test fails. No wrappers. See examples/pytest-selenium.

Robot Framework

Add one listener flag:

robot --listener reporting_labs.RobotListener tests/

One row per test case, suites as the path, every keyword a step, setup and teardown as hooks, tags as filters, and the screenshots SeleniumLibrary or the Browser library embed in the log attached to the test. Options go after a colon: --listener reporting_labs.RobotListener:title=Checkout:output=reports/rl. See examples/robot-selenium.

Configuration

Every option is optional. Put them in reporting-labs.config.json next to where you run, or under [tool.reporting-labs] in pyproject.toml. Keys may be written camelCase (as in the Node reporter) or snake_case.

{
  "title": "Checkout regression",
  "project": { "name": "ShopLite", "version": "2.4.0", "team": "QA Platform" },
  "metadata": { "env": "local" },
  "logo": "logo.png",
  "palette": "lab",
  "links": { "story": "https://acme.atlassian.net/browse/{id}" },
  "maskKeys": ["otp", "pan"],
  "history": { "enabled": true, "keep": 30 }
}

Common options: title, logo, accent, theme (auto / light / dark), palette (lab / ocean / ember / mono), outputFolder, metadata, project, env, dimensions, links, maskKeys, maskValues, maskFromEnv, history, open (on-failure / always / never), pdf (true / false), pdfFile, chromePath.

report.pdf is printed by Playwright's Chromium if it is installed, otherwise by an installed Chrome, Edge or Chromium, whatever browser the tests ran on. Name one with chromePath or CHROME_PATH.

The environment chip is found for you from ENV, TEST_ENV, APP_ENV, TARGET_ENV, CI_ENVIRONMENT_NAME, or any variable ending in _ENV, so a config that says local still labels the pipeline's reports dev, qa, stage. Point it at your own variable with "envVar": "TARGET".

Runtime overrides, read from the environment and winning over the config, so CI can label a run without touching the file: REPORTING_LABS_METADATA_<KEY> sets a header chip (REPORTING_LABS_METADATA_ENV=qa), and REPORTING_LABS_TITLE, _THEME, _PALETTE, _ACCENT, _LOGO set the matching option.

Secrets are masked

Passwords, tokens, cookies, auth headers, API keys (Stripe, GitHub, AWS, Google, GitLab, npm, SendGrid), JWTs and Luhn-valid card numbers are blanked in logs, request and response bodies, error messages, test data and step titles. A value seen once as a secret (password=..., a PASSWORD env var, or maskValues) is blanked everywhere it later appears. maskKeys adds your own keys; maskFromEnv (on by default) learns the values of PASSWORD / *_TOKEN / *_SECRET environment variables.

Security & privacy

reportingLabs is a library that runs inside your own test run. There is no reportingLabs server, account, API key, telemetry or licence check.

  • Nothing is sent anywhere. The reporter makes no network requests of its own; its only traffic is the traffic your tests already make. An opened report makes no external requests either: fonts, scripts and the logo are embedded, so it works offline and behind a firewall. The only exceptions are opt-in (embedFonts: false, a logo given as an https:// URL) or need a click (CI, commit and issue links).
  • Everything stays on your machine: the report folder (reporting-labs/ by default) holds index.html, report.json, report.pdf and assets/, plus the run history reporting-labs.history.json next to your project. Nothing is written anywhere else. Whoever can read your test artifacts can read the report; deleting them deletes the data.
  • Secrets are masked before anything is written: passwords, tokens, cookies, auth headers, API keys, JWTs and card numbers in logs, API bodies and headers, test data, errors and step titles. Values typed into password fields with Playwright or Selenium are masked too (see Secrets are masked).
  • Screenshots, videos and traces are not masked. They are images and recordings of the application, so run tests against test data, or turn them off for suites that show real personal data.
  • No required dependencies; it uses the pytest, Playwright, Selenium, requests, httpx or Robot Framework your project already installs. No install or post-install scripts. MIT licensed.

Full details for security reviewers and client projects, including what is read, what is written and what to tell a client: reportinglabs.dev/security-privacy. To report a vulnerability, open an issue saying you have a security report (no details) and a private channel will be arranged.

License

MIT. The report is a file you own; nothing leaves your machine or your CI.

Metadata

Release files for reporting-labs 0.1.5

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

Source distribution (sdist)

Source distribution for reporting-labs 0.1.5
File Size Uploaded
reporting_labs-0.1.5.tar.gz 225.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reporting-labs 0.1.5
File Interpreter ABI Platform
reporting_labs-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 449.5 kB

Release files / reporting_labs-0.1.5.tar.gz

Download URL reporting_labs-0.1.5.tar.gz
Size 225.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7315d58205e088cac18de5235d99d3f180a133fcda15fdc2b613329af57de035
BLAKE2b-256 checksum
How to use checksums
cfbbba48f497f6157bdcd105a725576199868f9f395e0775d7b66f7e5261f4a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / reporting_labs-0.1.5-py3-none-any.whl

Download URL reporting_labs-0.1.5-py3-none-any.whl
Size 224.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8440728558d1be3f0d5af64beed32f3ed6692528a8513e60123200f4d9923467
BLAKE2b-256 checksum
How to use checksums
f2cc5ad1954fed50a62d619bf1de30f58a117e796660adf273a786e9b070dd37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.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