How to test and monitor your APIs with Playwright

Поділитися
Вставка
  • Опубліковано 23 лип 2024
  • 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!
    Playwright API testing docs: playwright.dev/docs/api-testing
    Checkly Multistep Check docs: www.checklyhq.com/docs/multis...
    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
  • Наука та технологія

КОМЕНТАРІ • 12

  • @_unreal_engineer
    @_unreal_engineer 3 місяці тому +2

    i love checkly

  • @uvitalkumar
    @uvitalkumar 3 місяці тому

    Hope more videos on GraphQL API testing using Playwright

    • @ChecklyHQ
      @ChecklyHQ  2 місяці тому

      Let's see what we can do. :) Do you have any specific topics in mind?

    • @epicgamers1998
      @epicgamers1998 16 днів тому

      Graphql api automation using bdd

  • @tiagosutter8821
    @tiagosutter8821 2 місяці тому +1

    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

    • @ChecklyHQ
      @ChecklyHQ  2 місяці тому

      I'm pretty sure `request` doesn't spin up a browser. :)

  • @_unreal_engineer
    @_unreal_engineer 3 місяці тому +1

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

    • @ChecklyHQ
      @ChecklyHQ  3 місяці тому +1

      It's Github's Copilot. :)

  • @Matkotech
    @Matkotech 3 місяці тому +1

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

    • @ChecklyHQ
      @ChecklyHQ  3 місяці тому +1

      Let's check if I understand correctly: you would like to watch a video that shows how to login via HTTP and then pass the session data to a browser session to save time?

    • @carldmitch
      @carldmitch 3 місяці тому +1

      @@ChecklyHQ perhaps Matko wants to see how to use global-setup where you can login and save the storageState.json, then load the storageStage before all the tests thus bypassing subsequent login flows.

    • @Matkotech
      @Matkotech 3 місяці тому

      @@ChecklyHQ Yeah, to perform auth via API post req and then use that session in test to save time