So, you’ve finally arrived at the place where you must write an end-to-end test suite for your React project. You’ve probably looked at things like Selenium or even just Chrome headless, but aren’t sure if you’re willing to buy in to them. You should know that you aren’t alone, and that many developers face a difficult choice as well.

Before we start exploring what I’m about to prescribe, I’d like to outline the current reasons why I’m dissatisfied with the ecosystem. These are likely the same points that lead you here.

1. Expensive and complex setup

Lots and lots of libraries out there are incredibly bulky and complex to setup. Mature libraries, especially, are victim of this due to the high amount of use-cases they have to support, plus the general lack of tools that were available on the onset (Selenium especially). Many issue their own DSL or some other opaque medium for interacting with the browser. If you you’re driving a headless unit with lots of $ or xml then something isn’t right.

2. General sluggishness and hard to scale

End-to-end tests are already painful to write, but why do they have to be so doggone slow? Obviously there’s costs to starting up and driving a web browser, but new technologies like headless-chrome should help expedite execution. Clearly there’s room for improvement here.

3. Painful API with no way to compose workflows

What do you do if, before anything else, you have to login to an application before doing any test what so ever? Right now, at least as far as I’m aware, it’s either difficult or impossible to compose tests with various behaviors. I, personally, would love to define a library of user-interactions and compose them on-the-fly at test time.

It was these challenges (and a few more) that lead me to develop Navalia, which is an open-source project for painlessly driving, scaling, and automating headless browsers. As of this writing it only supports Google Chrome, but I will slowly be adding more browsers over time.

Let’s take a look at how this tool can help us with tests.