13. End-to-End Testing
Overview
In this chapter, we will look at how to create an End-to-End (E2E) test suite for a Vue.js application with Cypress. In order to write robust tests, we'll look at common pitfalls and best practices such as intercepting HTTP requests and waiting for elements to appear without timeouts.
As we proceed, you will gain an understanding of E2E testing and its use cases. You will see how Cypress can be configured to test a Vue.js application and also interact with and inspect a user interface using it. Throughout the course of the chapter, you will gain familiarity with the pitfalls of arbitrary timeouts and how to avoid them with Cypress' waiting functionality. Toward the end of the chapter, you will also learn when, why, and how to intercept HTTP requests with Cypress.