How to test and monitor your APIs with Playwright

preview_player
Показать описание
In today's video, we explore a lesser-known feature of Microsoft's Playwright - API Testing.

We'll illustrate how to use Playwright for testing GraphQL as an example of an HTTP-based API; RESTful APIs can be tested too. We'll explain the usage of the 'request' fixture with Playwright, parse responses and validate their correctness.

Moreover, we'll delve into executing multiple API requests in a single Playwright test case while testing their responses.

A bonus tip we'll share is how to reuse your Playwright code with Checkly's new multistep checks for efficient production monitoring.

Questions? Feel free to drop them below. See you in the next video!

00:00 Intro
00:19 GraphQL example API
01:35 The API testing test case
02:26 Making requests with the `request` fixture
03:17 Access the response body
03:43 Configuring Playwright projects
04:17 Adding assertions to your API tests
05:39 Making multiple requests in a single test case
06:06 Filter countries via GraphQL
08:23 Playwright API monitoring
09:29 Outro

#playwright #monitoring #apitesting #syntheticmonitoring #checkly
Рекомендации по теме
Комментарии
Автор

Hope more videos on GraphQL API testing using Playwright

uvitalkumar
Автор

Thanks, that is interesting, i might use Playwright to test APIs as well since i'll be already using to e2e tests. Is it using a browser under the hood while API testing though? I hope not, as i don't see the need to have a browser context for that

tiagosutter
Автор

is it possible to mock api response without installing browser ?

vladimirovodenko
Автор

Hello, which tool do you use for auto complete ? Thank for everything

_unreal_engineer
Автор

Great content! Can you make video API Authentication to bypass UI login. Ty! Cheers ☺️

Matkotech
Автор

Hi, thanks, nice tip. I just don t get, how do you send this API. You have only ulr and body, but you do not have any headers, protocol number and other API call attributes How come?. It does not look like API request I am used to see.
Thanks for your reply in advance

glebmirosnikovs