~/talk

Network Requests with Cypress

Talkat TestJS Summit 2021 · 2021-11-18..11-19· [testing]
slides:none on file

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

  1. 0:00Intro
  2. 0:39Network Requests + Cypress
  3. 2:25Cypress Real World App
  4. 3:38Use cases
  5. 6:01How it works
  6. 6:47Declaring a spy with cy.intercept()
  7. 9:50Dynamic matching
  8. 13:44Network Stubbing
  9. 14:54Dynamic Stubbing
  10. 16:37Handling multiple requests
  11. 18:06Approach: Real Server Responses
  12. 19:37Approach: Stub Server Responses
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.