{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "idavidov13-agentic-playwright--api-contract-tests-with-zod",
 "repo": "idavidov13/agentic-playwright",
 "repo_url": "https://github.com/idavidov13/agentic-playwright",
 "repo_slug": "idavidov13-agentic-playwright",
 "title": "Add API contract tests with Zod validation and fixtures",
 "page_title": "How to add API contract tests with Zod validation and fixtures with Agentic Playwright",
 "summary": "Write API tests using the apiRequest fixture, Zod schema checks, and setup and teardown helper fixtures.",
 "who": "A backend or QA engineer who needs to check that API responses match an expected contract as part of the same test suite.",
 "problem": "API checks written by hand often lack schema validation and cleanup, so tests leave data behind or pass with malformed responses.",
 "outcome": "API tests that call endpoints through the apiRequest fixture, validate responses with Zod schemas, and use helper fixtures for setup and teardown.",
 "steps": [
  "Scaffold the project with `npm create agentic-playwright . -- --demo` if you have not already.",
  "Read the API Testing section of the README to see how the apiRequest fixture and helper fixtures are used.",
  "Ask the assistant to write an API test for <api-endpoint> using the apiRequest fixture and a Zod schema.",
  "Run `npm test` and confirm the API test passes against your environment."
 ],
 "agent_prompt": "In the agentic-playwright repo, write an API test for <api-endpoint> using the apiRequest fixture and a Zod schema, with setup and teardown fixtures. Expected output: a passing API spec that validates the response shape. Verify that the schema is defined with Zod and that `npm test` passes.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README gives the fixture names but not endpoint details, so you must supply the real API URL and environment values in the env files.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Node.js v22.x or later",
  "npm v10.x or later",
  "An empty directory or empty git repo for the test project",
  "A web application URL to test, or the --demo option to try the bundled demo app"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/idavidov13-agentic-playwright/api-contract-tests-with-zod/",
 "md": "https://dedupedai.com/use-cases/idavidov13-agentic-playwright/api-contract-tests-with-zod/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/idavidov13-agentic-playwright--api-contract-tests-with-zod.json",
 "api_version": "v1"
}
