May the Requests Be With You: Playwright API Magic
summary
Uses Playwright to intercept and assert live API calls (api.practice-software-testing.com/products), capturing the products response and running route.fetch and route.continue to make nine UI assertions against name and price. Shows aborting slow or unwanted calls with route.abort, modifying a fetched JSON to set a product name to "mock product", price to 10,000 and inStock false, then returning it with route.fulfill with JSON file. Includes debugger demos and a public repo with runnable examples.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 2:37Intercepting API requests
- 8:44Aborting long requests
- 10:53Modifying API responses
- 13:00Mocking from JSON files
- 15:10Final thoughts
related talks
39mHow to Use AI with Playwright for UI & API Testing
41mTesting Web Applications with Playwright
27mPlaying your tests wright
42mMichal Slezak: Creating a Framework with Playwright - How to Do It Right?
25mThe Playwright Cipher: Writing Tests Like a Rap Verse
30mBreak the API Test Data Bottleneck: Real Scenarios on Real Systems
13mHow to Use Playwright for Automating Accessibility Testing
21mNetwork Requests with Cypress
