New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Diff between screenshots is not present in the report #15802
Comments
@AnatoliiHanziuk Are you missing an async matchesScreenshot(
locator: Locator,
options?: LocatorScreenshotOptions,
) {
// Note the await.
await expect(locator).toHaveScreenshot({timeout: 5000, ...options});
} |
Good catch. However, the addition of the |
Thank you for the example repository. I just ran the tests, and html report shows me the images. Since the images are of a different size, the Also, you should await the |
We have to reproduce this issue locally to be able to debug it. If you can provide a full repro, please file a new issue with it, and link to this one. |
Is it possible to do something here instead of just removing the diff tab? Maybe at least keep the diff slider while aligning the actual and the expected screenshots to the top? |
@muhammad-saleh Could you please share more details about your usecase?
Playwright has a fixed viewport by default, so changing page layout should not affect the size of |
@dgozman My use case is that in our org we have a staging website and each PR gets its own environment and url. What I need is to do a visual regression test between the changes in the PR vs. the staging env. using full page screenshots. |
@muhammad-saleh Thank you for the explanation, this makes sense. So, this is happening because you use full-page screenshots. I'll reopen this issue for now. |
I am experiencing the same issue, "diff" is missing in the generated report. I am also using full page screenshots:
Based on the changes that have been done on the test pages, we expected a different screenshot size. But this shouldn't disable the "diff" tab/screenshot, in my opinion. Anything that can be done about this? Comparing pages manually by constantly switching from "actual" to "expected" and trying to catch those differences with your eyes is far from ideal and I would say it even defeats the purpose of using such a framework. |
If it helps someone, I have prepared an NPM package patch using https://www.npmjs.com/package/patch-package, that ignores difference in height but still requires the same width of snapshots.
|
… and produce the diff image (#20208) Also show sizes in the html report to easier spot the size mismatch issue. <img width="1030" alt="diff" src="https://user-images.githubusercontent.com/9881434/213327632-b8fcd69c-8d08-460c-9de1-b5f4f8c56359.png"> Fixes #15802.
When will 1.31 be released? Looking forward to this bug fix. |
Context:
Code Snippet
Playwright config:
Method that compares screenshots:
Describe the bug
I'm doing visual regression testing. I want to see the difference between screenshots in the report. However, the difference is not present there. Also, in the
test-results
folder the difference is missing too.The text was updated successfully, but these errors were encountered: