You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting a subject selector through parameters.snapshot on a Storybook story makes the auto snapshot hang until the test times out. With an explicit timeout the underlying error surfaces:
locator.screenshot: Timeout 1983ms exceeded.
Call log:
- taking element screenshot
- waiting for fonts to load...
- fonts loaded
- attempting scroll into view action
2 × waiting for element to be stable
- element is not visible
- retrying scroll into view action
...
Playwright resolves the selector to an element it considers not visible, then retries until the deadline. Without an explicit timeout the test simply burns the full 15s test timeout with no useful message.
Vitest: 4.1.11, browser mode via @vitest/browser-playwright, chromium
Notes
Reproduced identically in both testcases/sb-csf-3 (CSF 3) and testcases/sb-csf-next (CSF Next), on plain stories and on story.test() children — so this is not CSF-Next-specific.
Omitting timeout turns this into a bare "Test timed out in 15000ms" with no indication that the snapshot subject is at fault. Even once the selector resolution is fixed, failing fast with a clear "subject not visible / not found" message would help.
No Storybook testcase currently exercises parameters.snapshot.subject, which is likely why this went unnoticed. Worth adding coverage alongside the fix.
Description
Setting a
subjectselector throughparameters.snapshoton a Storybook story makes the auto snapshot hang until the test times out. With an explicittimeoutthe underlying error surfaces:Playwright resolves the selector to an element it considers not visible, then retries until the deadline. Without an explicit
timeoutthe test simply burns the full 15s test timeout with no useful message.Steps to Reproduce
subjectselector:vitest run.Expected Behavior
The snapshot captures the element matched by the selector.
Actual Behavior
The test hangs until the timeout with
element is not visible. No snapshot is produced.Environment
@storybook/addon-vitest10.4.1)@vitest/browser-playwright, chromiumNotes
testcases/sb-csf-3(CSF 3) andtestcases/sb-csf-next(CSF Next), on plain stories and onstory.test()children — so this is not CSF-Next-specific.timeoutturns this into a bare "Test timed out in 15000ms" with no indication that the snapshot subject is at fault. Even once the selector resolution is fixed, failing fast with a clear "subject not visible / not found" message would help.parameters.snapshot.subject, which is likely why this went unnoticed. Worth adding coverage alongside the fix.subjectwas ignored rather than hanging.