~/talk

Mastering Mocking in Playwright: Simplify API Test Automation

Talkat TestFlix 2024 · 2024-10-19..10-20· [testing, web-platform]
links:none on file
slides:none on file

Live demo shows Playwright’s built-in mocking replacing external tools like WireMock or Mockito and working end-to-end: tests redirects requests to a different endpoint so calling demo.playwright.dev/api/mocking returns only “strawberry” instead of the full fruit list, tests modifies JSON responses at runtime to inject a new item, and examples add a synthetic item with id:100; covers stubs vs spies, three concrete patterns, and runnable code that executes successfully.

AI-written summary · about

  1. 0:00Introduction to mocking
  2. 1:11What is API testing
  3. 3:40Why mocking is needed
  4. 5:02Stub vs spy explained
  5. 5:45Playwright mocking benefits
  6. 6:47Mock API request demo
  7. 10:41Modify API response demo
  8. 14:11Additional resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.