lecture 5 of 180 completed

Testing the API directly

Playwright can send HTTP requests with no browser at all. That makes setup fast and lets you test the server on its own.

What you'll learn

  • How the request fixture 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. Multiply by forty tests and your suite spends most of its life filling in forms it is not testing.

Playwright has a full HTTP client built in, so you do not need a second tool.

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 →