Skip to content

fix(browser): keep failure screenshot per attempt - #11655

Closed
hi-ogawa wants to merge 25 commits into
vitest-dev:mainfrom
hi-ogawa:fix/issue-11614
Closed

hi-ogawa wants to merge 25 commits into
vitest-dev:mainfrom
hi-ogawa:fix/issue-11614

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

When a browser test failed on several retries, every attempt wrote its failure screenshot to the same file. Also the reporter output summary listed the same file under every attempt's error.

This PR changes failure screenshot path for tests with retry/repeats to <test>-<repeat>-<retry>.png like trace files. Other tests without retry/repeats are still saved in <test>.png.

For the reporter output, the errors and artifacts are grouped based on attempts index, so Failure screenshot appears next to relevant error log.


For the repro in the issue (a test with retry: 2), the failure summary changes like this (diff and code frame omitted):

Before:

 FAIL  |chromium| basic.test.ts > retried
AssertionError: expected 1 to be 10
Failure screenshot:
  - .vitest/attachments/failure-screenshots/basic.test.ts/retried.png
⎯⎯⎯[1/3]⎯
 FAIL  |chromium| basic.test.ts > retried
AssertionError: expected 2 to be 10
Failure screenshot:
  - .vitest/attachments/failure-screenshots/basic.test.ts/retried.png
⎯⎯⎯[2/3]⎯
 FAIL  |chromium| basic.test.ts > retried
AssertionError: expected 3 to be 10
Failure screenshot:
  - .vitest/attachments/failure-screenshots/basic.test.ts/retried.png
⎯⎯⎯[3/3]⎯

After:

 FAIL  |chromium| basic.test.ts > retried
AssertionError: expected 1 to be 10
Failure screenshot:
  - .vitest/attachments/failure-screenshots/basic.test.ts/retried-0-0.png  👈 
⎯⎯⎯[1/3]⎯
 FAIL  |chromium| basic.test.ts > retried
AssertionError: expected 2 to be 10
Failure screenshot:
  - .vitest/attachments/failure-screenshots/basic.test.ts/retried-0-1.png  👈 
⎯⎯⎯[2/3]⎯
 FAIL  |chromium| basic.test.ts > retried
AssertionError: expected 3 to be 10
Failure screenshot:
  - .vitest/attachments/failure-screenshots/basic.test.ts/retried-0-2.png  👈 
⎯⎯⎯[3/3]⎯

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f38f2a1
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6ad86ec51e0ca718d8926bfc
😎 Deploy Preview https://deploy-preview-11655--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

hi-ogawa and others added 18 commits October 21, 2026 17:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hi-ogawa and others added 4 commits October 21, 2026 18:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hi-ogawa
hi-ogawa marked this pull request as ready for review October 21, 2026 10:07
@hi-ogawa

Copy link
Copy Markdown
Collaborator Author

Moved to #11694 (head branch in this repo for stacking).

@hi-ogawa hi-ogawa closed this Oct 22, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure screenshot of a retried test always shows the last attempt

1 participant