-
Notifications
You must be signed in to change notification settings - Fork 1
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
Playwright screenshots on MacOS creates different file names #1030
Comments
@marcellmueller nice exploration of the issue! To me, it seems |
For your consideration: I've been trying for awhile and having lots of issues with the docker command, looks like it needs additional setup to communicate with my backend. At this point it seems like it will be faster and simpler to use a virtual machine with Ubuntu Multipass or else set this project up on my Thinkpad which runs Linux and update screenshots from there. As a Mac user none of these options sound very appealing and just too much hassle to update simple snapshot diffs. Personally I would prefer at least trying to remove the OS suffix as it is by far the easiest and no need to deal with docker or virtual machines. |
Valid points about the hassle for snapshots update and a potential simpler Although, perhaps a DevOpsy view point could provide further input on the Docker command as this seems the most stable solution. This is the command I have so far- seems close?
|
I've put some thought and effort into this over the past couple days and really am starting to think that this is not something that developers should have to commit from their local machines for a few reasons:
Comparing screenshot diffs in CI would work around this and ensure an identical setup each time. Personally I really enjoyed using Happo which we have an issue for #192. We did run into some issues with it but I believe most of them were due to Cypress dom rendering and some of our own flakey tests. It was nice being able to view details and compare diffs right from GitHub and approve them if there was a failure due to intentional changes. Though if you believe that Playwright screenshots are superior maybe there is a way we could cache the screenshots in CI and test against those when we run e2e in CI. Anyways thanks for reading my thoughts on this and I would love hear what you think and discuss it further. https://docs.happo.io/docs/playwright Edit: Not sure if you have been on a project with Happo but I found a failing example on |
@marcellmueller |
POC CI Snapshots
How to Run Snapshot Tests in CI/CD with Playwright Related: |
Nice I just noticed your PR, thanks for playing with this idea. My questions that I didn't consider when I brought up caching the screenshots are how will we approve intentional diffs on failure? It looks like it generates an html report so I think we can view the diffs? |
Hi @marcellmueller and @shon-button I'm running into this issue as well! I updated the screenshots using docker but the diffs are still relatively significant (338 pixels, a ratio 0.01 of all image pixels are different). Relevant PR is here I will update you when I figure this out. Say hi to CAS for me 👋 |
Hey @tmastrom! Thanks for this. After some discussion we decided that developers shouldn't have to commit snapshots locally and that it should be handled entirely in CI. Shon did some exploration with caching Playwright screenshots in CI though ran into some issues and we ended up going with Happo again. |
Thanks for the update! I'm looking at chromatic as an alternative to happo but the playwright integration is still in beta so I'm going to hold off for now |
Describe the Bug:
Generating Playwright snapshots on MacOS appends a different OS name:
A couple possible solutions are:
Removing the os suffix is likely the easiest for everyone though there is the possibility we will get diffs at some point in the future.
Probability (how likely the bug is to happen, scored from 1-5): 2
(For example, probability of 5 is something like "it happens to all users every time they log in."
Probability of 1 "only happens to certain users when a really specific and unlikely path is followed.")
Effect (how bad the bug is when it does happen, scored from 1-5): 4
(For example, effect of 5 is "the entire app crashes and makes it unusable for all users" or "the bug causes the wrong data to be saved, with critical information (e.g. payment) being affected."
Effect of 1 is "It makes some styling look a little bit weird.")
Steps to reproduce the behaviour:
Screenshots:
Additional information:
The text was updated successfully, but these errors were encountered: