Chapter 11: Exercise – Stubbing and Spying XHR Requests
Before we get started on this chapter, you need to understand why we need to stub or spy requests and methods, and to do this, you will need an understanding of Cypress requests and how to test individual methods. The previous chapters have presented extensive knowledge on how you can easily get started on Cypress, and we have covered concepts relating to network requests and functional testing. In this chapter, we will be building on the concepts that we have gained in the previous chapters with the focus being a hands-on approach by use of examples and exercises.
We will cover the following key topics in this chapter:
- Understanding XHR requests
- Understanding how to stub requests
- Understanding how to spy on methods in a test
Once you've worked through each of these topics, you will be ready to get started on visual testing with Cypress.