Skip to content

Capture Playwright artifacts

When using pytest-playwright, retain artifacts for failed tests:

Terminal window
pytest \
--tracing=retain-on-failure \
--video=retain-on-failure \
--screenshot=only-on-failure \
--output=test-results

This keeps successful runs lightweight while attaching useful browser evidence to failures.