Playwright

Wait for a specific response

Medium70 pts
  • page.waitForResponse
  • Network Timing
  • Async Assertions
Practice app · Gear Shop

A product grid loaded from a real API with search, filters, infinite scroll and a checkout that calls a payments API.

Test URL
/lab/qa-automation-wait-for-a-specific-response

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Wait for an asynchronous backend response before asserting UI state.

Your Task

  1. 1Navigate to the practice catalog at TEST_URL.
  2. 2Set up a network response listener waiting for an HTTP 200 response from the products API ('/api/practice/products').
  3. 3Trigger the network request by selecting a category in the category filter (#category-filter) or searching in the search box (#search-box).
  4. 4Wait for the response promise to resolve.
  5. 5Assert that the product grid container (#product-grid) is visible.

Validation Checks

  • Practice catalog is loaded at TEST_URL
  • Awaits HTTP 200 response from '/api/practice/products'
  • Interacts with #category-filter or #search-box
  • Product grid (#product-grid) is verified visible
  • At least 1 assertion passes

Playwright · QA Automation Practice Track · Network & mocking