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
I had to write a script to clean up empty folders after Playwright runs for this reason. In CI it doesn’t really matter too much, but locally it can be hard to find the snapshot diffs with all the empty folders.
Context:
Code Snippet
Describe the bug
When using
toHaveScreenshot
, Playwright creates an empty directory for the test undertest-results
, even if the test succeeds.The cause is probably this line:
https://github.com/microsoft/playwright/blob/main/packages/playwright-test/src/testInfo.ts#L240
SnapshotHelper.constructor
callsoutputPath
:https://github.com/microsoft/playwright/blob/main/packages/playwright-test/src/matchers/toMatchSnapshot.ts#L129
See also: https://en.wikipedia.org/wiki/Command%E2%80%93query_separation
The text was updated successfully, but these errors were encountered: