Playwright Trace/Report Artifact Upload Fails in CI
When a Playwright job fails you want the trace and HTML report to debug it, but the artifact upload is easy to misconfigure: traces captured only on retry, a wrong path, or an upload step that is skipped because the test step already failed.
What this error means
A failed Playwright job leaves no trace or report to download - the artifact is empty, missing, or the upload step did not run at all because the previous step failed and the job short-circuited.
Warning: No files were found with the provided path:
playwright-report. No artifacts will be uploaded.
# or, traces never captured:
trace: 'on-first-retry' # and retries: 0 -> no trace existsCommon causes
Upload step skipped after a failed test step
By default a later CI step does not run once an earlier step fails. Without if: always(), the artifact upload is skipped on exactly the runs you most need it.
Trace capture mode produces nothing
trace: "on-first-retry" only records on a retry; with retries: 0 no trace is ever written, so the artifact path is empty.
Wrong artifact path
A custom outputDir/report folder that does not match the upload-artifact path means the uploader finds no files.
How to fix it
Always upload, and capture traces on failure
# .github/workflows/ci.yml
- run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/Set a trace mode that records the failure
// playwright.config.ts
export default defineConfig({
retries: process.env.CI ? 2 : 0,
use: { trace: 'retain-on-failure' },
});How to prevent it
- Add
if: always()to artifact uploads so they run on failure. - Match the upload
pathto Playwright’s report/output directory. - Pick a trace mode that records when tests actually fail.