lecture 4 of 150 completed

Talking to the API directly

cy.request skips the browser entirely. It makes setup fast, and it lets you check the server without a screen.

What you'll learn

  • How cy.request skips the browser entirely
  • How to arrange test state in milliseconds
  • Why you should still assert through the screen

Your delete test needs a contact to exist. Creating it through the form takes eight seconds: load the page, open the dialog, fill four fields, save, wait for the toast.

Multiply that by forty tests and your suite spends most of its life filling in forms it is not testing.

cy.request sends an HTTP request straight to the server, with no browser involved:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →