Starting today, I am using Chrome to run automated browser tests. I tell Chrome to browse through my sites, click buttons, and (mis)behave like a regular human. And Chrome does so, without complaints, after every little change I make.
A normal part of creating a website is testing it. See if all the buttons work, see if nothing goes unexpectedly bad, see if everything looks okay. Testing by hand is soul-crushingly boring though. So there are scripts to help us do that.
For years I have used a mini-browser called PhantomJS. This was okay; it is based on Webkit (Safari) and things usually work as they should. But not always. PhantomJS is not a real browser, so it can do a bit less. Also, browsers change so fast these days, it’s impossible to keep up if you’re not part of a big team. So PhantomJS began showing it’s age.
Today I made the switch to Headless Chrome. This is the copy of Chrome I have on my computer, but without a visible screen. The advantage: tests run with a main stream browser that’s in the hands of millions. No more unexplained timeouts or excuses that tests cannot do some obvious thing.
chromedriver-helperto it (in group test)
That’s it! Tests were still green, and feel a little faster too.
Look at the Pull Request that made this change.