Testing

Playwright route.fulfill

Supply a controlled response instead of sending the intercepted request to its destination.

Formal Syntax & Structure

react syntaxreact
await page.route("**/api/tickets", route => route.fulfill({status:201,json:{id:"demo"}}))

Working Example

Example Snippetreact
await page.route("**/api/tickets", route => route.fulfill({status:201,json:{id:"demo"}}))
React Reference