Post

TIL when running Vitest browser mode (or plain Playwright) on Github Actions on Ubuntu, you can skip the slow "playwright install chromium" step completely by providing channel option. This makes Playwright use the pre-installed Chrome. So many projects out there that could speed their CIs with this

9 reposts114 likes

I do this in some places too. Definitely a good one to document! Though also there are some differences between the built in one, and the bundled one 👀

Yes! Apparently Ubuntu has had it pre-installed for a while. I've wasted so much CI time and energy installing chromium over and over again.

This means you’re using a different version of Chrome though. Depending on the nature of the tests and the changes made between those versions, the results may be different.

Yes definitely. For projects that don't target specific browser versions it should be enough. If you are testing how some specific browser version works, a typical "playwright install chromium" might not be good option either.

Exactly. I was mainly thinking of screenshot tests. Screenshots are rarely pixel perfect. They tend to be slighly different between different OSes, browsers, and even browser versions.

Yeah it might cause unexpected changes in visual testing. Though same issue will happen with the "playwright install chromium" too. I've had so bad experience trying to setup stable visual testing infra myself that I just gave up on that approach many years ago. Now I'd recommend Chromatic+Vitest 🤝

Chromatic@chromatic.com

Get first access to our @vitest.dev plugin, which adds Chromatic’s visual testing and review to your browser tests. It’s built by @ariperkkio.dev, a Vitest core maintainer. It’s free to use while in beta and requires no changes to your test files. Read on for more info 🧵