Back to Library
Advanced
Conditional API Mocking
Prompt
Generate Playwright test that mocks API responses dynamically based on query params and validates UI behavior.
Example Code
await page.route('**/api',route=>route.fulfill({json:{data:[]}}));Quick Actions
PRO TIP
Paste this prompt as a comment in your .spec.ts file and let Copilot generate the test.