Network Requests with Cypress
summary
Demonstrates that cy.request sends HTTP calls from test code for API assertions and test-data setup and that cy.intercept routes all browser HTTP through a proxy so tests can spy, alias, wait for, assert on, and stub responses. Examples use the Cypress Real World App (a Venmo‑style demo), GraphQL dynamic aliasing via rec.alias, and rec.reply for programmatic stubs and overrides. The commands reliably let tests wait for requests, assert status/body, inject fixtures, and override prior stubs.
AI-written summary · about
chapters (12)
- 0:00Intro
- 0:39Network Requests + Cypress
- 2:25Cypress Real World App
- 3:38Use cases
- 6:01How it works
- 6:47Declaring a spy with cy.intercept()
- 9:50Dynamic matching
- 13:44Network Stubbing
- 14:54Dynamic Stubbing
- 16:37Handling multiple requests
- 18:06Approach: Real Server Responses
- 19:37Approach: Stub Server Responses
related talks
27mFull-Circle Testing With Cypress
52mCypress: Testing without Selenium, Part 2
35mCypress Tales: Effective E2E Testing
59mCypress.io
44mAutomation Testing Web Apps with Cypress
23mGaining Confidence with Cypress Tests
40mGaining Confidence with Cypress Tests
46mAvoiding The Suck Of Testing Using Cypress.io
