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:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →