Manuals / Playwright with Python / Chapter 35

Part 5 · CI/CD & Reporting · advanced · ~40 min · Chapter 35 of 61

26. Test Reporting

HTML report (pytest-html) pip install pytest-html pytest --html=report.html --self-contained-html pytest --html=<path> --self-contained-html What it does: Generates a single-file HTML report summarizing pass/fail/skip results after a test run. Types/params: ● --html=<path> (string, required) — output file location ● --self-contained-html (flag, optional) — embeds CSS/JS directly in the file so it'

Path progress
56%

Step 1 of 3

HTML report (pytest-html)

What it does: Generates a single-file HTML report summarizing pass/fail/skip results after a test run. Types/params: Pointers: Good baseline reporting with minimal setup. Lacks the richer history-tracking and screenshot/trace attachment support that Allure offers — reach for Allure once a team needs more than a quick pass/fail summary.

  • --html=<path> (string, required) — output file location
  • --self-contained-html (flag, optional) — embeds CSS/JS directly in the file so it's viewable standalone without needing internet access or separate asset files
HTML report (pytest-html)Drag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Page under testdrag · tap →Multi-browserdrag · tap →Automation pathdrag · tap →Tooling nodedrag · tap →

Try it

Run / study this snippet

pip install pytest-html
Was this step clear?
Chapter learning outcomes
  • HTML report (pytest-html)
  • Allure reporting setup
  • Publishing reports as CI artifacts

Clear these before you leave

Side quest

26. Test Reporting deliverable

Apply one idea from “HTML report (pytest-html)” in a small script or note.