{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "idavidov13-agentic-playwright--ai-assistant-writes-rule-following-tests",
 "repo": "idavidov13/agentic-playwright",
 "repo_url": "https://github.com/idavidov13/agentic-playwright",
 "repo_slug": "idavidov13-agentic-playwright",
 "title": "Have an AI assistant write tests that follow team rules",
 "page_title": "How to have an AI assistant write tests that follow team rules with Agentic Playwright",
 "summary": "Use the bundled rules and write-time hook so Claude Code or Cursor produces tests in the project's required style.",
 "who": "A developer or QA lead who wants AI assistant output to match team conventions without re-explaining them in every prompt.",
 "problem": "AI assistants tend to write tests with XPath, hard waits, any types, and inconsistent structure unless they are told the rules each time.",
 "outcome": "A new test file using page objects, Given/When/Then steps, and web-first assertions, with the forbidden patterns blocked by the hook.",
 "steps": [
  "Scaffold the project with `npm create agentic-playwright . -- --demo`, or use the Dev Container.",
  "Open the project in Claude Code or Cursor so the rule files for that tool load automatically.",
  "Ask the assistant for a test covering one feature of your application and let it follow the Constitution and skills.",
  "Check that the output has no waitForTimeout, XPath, or any type, and that the hook blocks those patterns if the assistant tries to write them.",
  "Run `npm test` to confirm the new test passes."
 ],
 "agent_prompt": "In the agentic-playwright repo, write a Playwright test for <feature-under-test> using the Constitution and skills under .claude/. Expected output: a spec with page objects, Given/When/Then steps, web-first assertions, and one tag. Verify the file has no waitForTimeout, XPath, or any type, and that `npm test` passes.",
 "agents": [
  "claude-code",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README says the hook covers only mechanically detectable patterns, so you still need to review AI-written tests for correctness.",
 "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.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/idavidov13-agentic-playwright/ai-assistant-writes-rule-following-tests/",
 "md": "https://dedupedai.com/use-cases/idavidov13-agentic-playwright/ai-assistant-writes-rule-following-tests/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--ai-assistant-writes-rule-following-tests.json",
 "api_version": "v1"
}
