Running Cypress Tests from JUnit

Let's run the Cypress tests automatically by using JUnit.

To work with Cypress tests, we need to find a way to run them automatically when we build our project. The easiest way is to run them from JUnit with our other automated tests.

Testcontainers

To avoid installing Cypress for running the tests, we’ll use Testcontainers with a Docker image that contains Cypress.

Let’s start by adding two dependencies to the pom.xml:

Get hands-on with 1200+ tech skills courses.