Skip to content

fix(browser): take test-end trace snapshot before afterEach - #11654

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

hi-ogawa wants to merge 6 commits into
vitest-dev:mainfrom
hi-ogawa:fix/issue-11615

Conversation

@hi-ogawa

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

Copy link
Copy Markdown
Collaborator

Browser traces (browser.traceView and browser.trace) snapshot the end of a test after afterEach, so a page cleaned up there shows as empty. This PR takes the trace snapshot before afterEach, which aligns with the failure screenshot.

📸 Example

before

image

after

image

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 84bae5c
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6ad70bb5f2193c15dad6f350
😎 Deploy Preview https://deploy-preview-11654--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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hi-ogawa hi-ogawa changed the title fix(browser): take test-end trace snapshot before afterEach fix(browser): take test-end trace snapshot before afterEach Oct 20, 2026

@sheremet-va sheremet-va left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we take both?

@hi-ogawa

Copy link
Copy Markdown
Collaborator Author

Should we take both?

I don't think so for now. It's just my guess that taking before afterEach is good enough practically. I didn't personally intend anything specific when I put those in onAfterRetryTask.

@sheremet-va

Copy link
Copy Markdown
Member

Should we take both?

I don't think so for now. It's just my guess that taking before afterEach is good enough practically. I didn't personally intend anything specific when I put those in onAfterRetryTask.

I'm just thinking logically something could happen in afterEach that deserves the attention

@hi-ogawa

Copy link
Copy Markdown
Collaborator Author

Should we take both?

I don't think so for now. It's just my guess that taking before afterEach is good enough practically. I didn't personally intend anything specific when I put those in onAfterRetryTask.

I'm just thinking logically something could happen in afterEach that deserves the attention

Well, this indeed lost trace when afterEach fails. We should still collect and surface that, so I'm putting back, but that should be enough.

hi-ogawa and others added 4 commits October 20, 2026 17:49
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

Copy link
Copy Markdown
Collaborator Author

It worked out with test.result?.teardownErrorsStart ugliness. I'm not sure I like it 🙃

@hi-ogawa

Copy link
Copy Markdown
Collaborator Author

I think I like the current behavior's simplicity to just capture onAfterRetryTask. This doesn't actually affect "failure-only" mode #11612 nor terminal timeline output, so I'll defer and close this for now.

@hi-ogawa hi-ogawa closed this Oct 21, 2026
@hi-ogawa
hi-ogawa deleted the fix/issue-11615 branch October 21, 2026 06:29
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 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.

Test-end browser trace snapshots are taken after afterEach cleanup

2 participants