37. Comprehensive Test Reporting & CI Execution Summaries

Generating Rich HTML Reports

# Generate clean HTML report:
pytest --html=reports/test_report.html --self-contained-html

Recording Videos on Failure

context = browser.new_context(record_video_dir="videos/")
page = context.new_page()
# Run test...
context.close() # Video is flushed and finalized on context close
print("Video saved:", page.video.path())

Task

  • Implement calculate_pass_percentage(passed, total):
  • 1. If total <= 0, return 0.0.
  • 2. Return (passed / total) * 100.0.
πŸ’‘Common doubts
Did you like the problem?
Lesson 37 of 37
Python
Loading code editor…