A test fails in CI. Now what? You cannot see the browser. You cannot hover over elements. You cannot step through the test. All you have are artifacts. Reports, traces, screenshots, videos. If you do not upload them, you are debugging blind. Artifacts are your eyes in CI.
| Artifact | Path | When to Upload | Retention | Purpose |
|---|---|---|---|---|
| HTML Report | playwright-report/ | Always | 14 days | Full interactive test report |
| Trace Files | test-results/ | On failure | 7 days | Step-by-step replay of failed tests |
| Screenshots | test-results/ | On failure | 7 days | Visual state at failure point |
| Videos | test-results/ | On failure | 3 days | Full recording of test execution |
| Blob Report | blob-report/ | Always | 1 day | Intermediate format for merging shards |
# ALWAYS upload HTML report -- even when tests pass
# This gives you a browsable test history
- name: Upload HTML report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 14
# Only upload traces on failure -- they are large
- name: Upload traces and screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: test-results/
retention-days: 7Go to the GitHub Actions run page
Scroll to the Artifacts section at the bottom
Download the playwright-report artifact (zip file)
Extract the zip to a folder
Run: npx playwright show-report ./playwright-report
Browser opens with the full interactive report
Trace files are the most powerful debugging tool for CI failures. They capture every action, network request, console log, and DOM snapshot. You can replay the entire test step by step.
# Download the test-results artifact from GitHub Actions
# Extract the zip file
# Find the trace file and open it
npx playwright show-trace ./test-results/login-test/trace.zip
# Or use the online trace viewer
# Go to trace.playwright.dev and drag-drop the trace.zip fileUse trace.playwright.dev to view trace files without installing anything. Just drag and drop the trace.zip file. Perfect for sharing with developers who do not have Playwright installed.
Artifacts eat storage. GitHub gives you 500 MB free for private repos, 2 GB for public. Be smart about retention.
If you set video: "on" for all tests, your artifact size will explode. A 30-second test video is 2-5 MB. 500 tests = 1-2.5 GB of videos per run. Use video: "on-first-retry" to only record when a test is already failing.
Q: How do you handle test artifacts in CI/CD pipelines?
A: Upload HTML reports with if: always() so they are available regardless of test outcome, with 14-day retention. Upload traces and screenshots with if: failure() to save storage, with 7-day retention. For traces, configure trace: "on-first-retry" in playwright.config.ts to capture traces only for failing tests. Download artifacts from the GitHub Actions page and view them locally using npx playwright show-report or npx playwright show-trace. For traces, you can also use the online viewer at trace.playwright.dev.
Key Point: Upload reports always, traces on failure only. Use if: always() and if: failure() conditions. Artifacts are your only debugging tool in CI.
Key Point: Artifacts are your eyes in CI. Upload HTML reports always. Upload traces and screenshots only on failure to save storage.