Skip to content
masterclass Buddy

Cypress · Function

cy.intercept

cy.intercept() spies on or stubs matching network requests and responses. It supports URL, method, and route-matcher rules, plus aliases for waiting and assertions.

Last updated

Syntax

cy.intercept(url)
cy.intercept(method, url)
cy.intercept(routeMatcher)
cy.intercept(url, staticResponse)
cy.intercept(method, url, staticResponse)
cy.intercept(routeMatcher, staticResponse)
cy.intercept(url, routeHandler)
cy.intercept(method, url, routeHandler)
cy.intercept(routeMatcher, routeHandler)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • cy.wait()
  • StaticResponse
  • RouteMatcher
  • req.reply()
  • req.continue()
  • URLSearchParams.getAll()

Source: cy.intercept() | Cypress API Documentation. Checked 2026-11-03.