04 / 05

How do we Assert on the Request Payload?

cy.intercept() lets you:​
  1. 1

    Intercepts the POST /api/login request and assigns an alias.

  2. 2

    Submits a login form.

  3. 3

    Waits for the request and checks the request body to verify it includes the right username.

You’re testing that the frontend sends the correct data to the backend (e.g., login, form submissions, filters, etc.)