Continuous Integration

Let's learn about continuous integration in Cypress.

Cypress has a dedicated CI page on its site with configurations for different providers. Cypress can be run with its UI (npx cypress open) or in headless mode (npx cypress run).The only thing you need to do islaunch the front-end server, and when the server is up and running, launch Cypress in headless mode.

The most used package is start-server-and-test which allows you to “Start, serve, and test.” Take a look at the test script:

"scripts": {
  "test": "start-server-and-test realworld:start http://localhost:4100 cy:run"
}

Run the realworld:start script and, when the http://localhost:4100 endpoint becomes available, launch the cy:run script.

Cypress has its own Dashboard product that allows for easy navigation between all test runs, single tests, and test results. This allows you to parallelize the test runs and host the test videos.

Get hands-on with 1200+ tech skills courses.