Using GitHub actions and Vercel for end-to-end tests
Philipp Giese
July 21, 2020
9 min read
End-to-end (E2E) tests are the tip of the test pyramid.
They are supposedly the hardest to write and take the longest to run.
But they are also valuable as they are the tests that "use" your app as your users do.
When we first started to use E2E tests at Signavio, we were able to run them after changes got merged to our master branch but not on feature branches.
That is problematic because it had already made it to our mainline and possibly to production when they uncovered a defect.
Another obstacle to not run them on each PR was that spinning up an environment was not an easy task and would take considerable time.
Since each minute the pipeline runs prolongs the feedback loop for the individual developer, we had a problem.
When GitHub launched actions we discovered that actions can run when a deployment happens.
By then, we already had set up Vercel to deploy our client on each PR.
I asked myself whether I could connect the Vercel deployments with our E2E tests.
TL;DR<"> to a Vercel deployment.
In that case, you can skip ahead to the Creating the workflow section.
If this is the first action you write, then I would recommend the full article.
If you don't have time for that, definitively read Caveats.
That might save you some time.
Vercel deployments<"> or static site generators like Gatsby.
Vercel can import and run your project without you needing to do any custom configuration.
But even if you didn't bootstrap your page like that, the configuration is straightforward.
Another reason I'm pointing at Vercel is that they already integrate with GitHub and register themselves as a deployment which is essential for the next step.