Skip to content
Latchkey

Playwright Video Artifacts Missing - video:on-first-retry Not Captured

When a Playwright test fails you want the video/screenshot to debug it, but the artifacts are easy to lose: a capture mode that records nothing (retries 0 with on-first-retry), the wrong outputDir uploaded, or an upload step skipped because the test step failed.

What this error means

A failed Playwright job has no video or screenshot to download. The artifact is empty or missing because nothing was recorded, the upload path was wrong, or the upload did not run after the test step failed.

CI log
Warning: No files were found with the provided path: test-results/.
No artifacts will be uploaded.

# config: video: 'on-first-retry' with retries: 0 -> no video recorded

Common causes

Capture mode records nothing

video: "on-first-retry" only records on a retry; with retries: 0 no video is ever produced. screenshot: "only-on-failure" similarly yields nothing if the assertion path does not actually fail.

Wrong outputDir or upload skipped

Videos/screenshots land under outputDir (default test-results/). Uploading a different path, or skipping the upload after a failed test step (no if: always()), leaves no artifacts.

How to fix it

Record on failure and always upload

playwright.config.ts
// playwright.config.ts
export default defineConfig({
  retries: process.env.CI ? 1 : 0,
  use: { video: 'retain-on-failure', screenshot: 'only-on-failure' },
  outputDir: 'test-results',
});

Upload the results directory unconditionally

.github/workflows/ci.yml
# .github/workflows/ci.yml
- run: npx playwright test
- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: playwright-artifacts
    path: test-results/

How to prevent it

  • Pick a video/screenshot mode that records on failure.
  • Match the upload path to Playwright’s outputDir.
  • Add if: always() so uploads run after failures.

Frequently asked questions

What causes "Video/screenshot not saved"?
video: "on-first-retry" only records on a retry; with retries: 0 no video is ever produced. screenshot: "only-on-failure" similarly yields nothing if the assertion path does not actually fail.
How do I fix Video/screenshot not saved?
Record on failure and always upload

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card