Open urugator opened 2 weeks ago
The above comment asking you to download a file is malware to steal your account; do not under any circumstances download or run it. The post needs to be removed. If you have attempted to run it please have your system cleaned and your account secured immediately.
This sounds more like a feature request than a bug report to me. Please open a feature request and include both your usecase and an actual reproduction repository.
Version
1.42.1
Steps to reproduce
Create test, where
expectScreenshot
fails, because it's unable to capture stable snapshot within a time limit. Attachments will contain 3 screenshots: actual (last screenshot taken), expected (golden snapshot) and diff. Normally, ifexpectScreenshot
fails on comparison, it creates diff between actual and expected. However, ifexpectScreenshot
fails because it's unable to capture same consecutive images (stable snapshot) within a time limit, it produces a diff between the actual and the previous (attempt): https://github.com/microsoft/playwright/blob/3f085d568935b9a4422f689185f720c1206bac84/packages/playwright-core/src/server/page.ts#L644 The problem is that previous isn't provided as an attachment and therefore you see diff that is completely unrelated to the other two screenshots. Here is the caller, which ignoresprevious
and assumes the returneddiff
is always betweenactual
andexpected
https://github.com/microsoft/playwright/blob/3f085d568935b9a4422f689185f720c1206bac84/packages/playwright/src/matchers/toMatchSnapshot.ts#L426-L439Sorry for not providing an actual test.
Expected behavior
expected attachment should be the previous screenshot or attachments should include an extra previous screenshot.
Actual behavior
Diff image is not a diff between actual and expected images when
expectScreenshot
is unable to capture stable snapshot within a time limit.Additional context
No response
Environment