Local difference compared to pipeline using image (fonts seem incorrect)
Opened this issue · 5 comments
Currently I have made a few tests that run smoothly locally. All good there. Now once I deploy this to Git (Bitbucket in this case), all tests fail because it seems like it can not find "the default browser font"? And if I use custom fonts and it actually does find the font, it doesn't seem as crisp (anti aliasing)? I've attached a failed pipeline screenshot and a correct visual.
In my bitbucket pipelines I use the recommended image -> image: mcr.microsoft.com/playwright:bionic
Not sure where things go wrong here. Any suggestions or configs I am missing here?
Are you using the same Docker image when you run these tests locally? Screenshot testing requires matching environments at the very least...
Locally I am not running this in a docker container. This is mainly because on my machine I have everything at my disposal. You're saying I actually should be using Docker locally for this, there is no other way around this then?
I also have default Playwright tests running locally (not the visual ones), which work like a charm without Docker. I didn't want to add extra overhead, because I am not the only one which will have to be running these tests. But if I absolutely have to...
Sadly, pixel tests require exact set of fonts and platform-specific layout logic...
Yeah, just went with the Docker approach then. Not ideal, but it'll do the trick.
I had the same issue and I take the same approach, run snapshot tests inside docker image. If I need to update snapshots then I have to mount the folders where the snapshot live.