Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. # ATDD Workflow Validation Checklist
  2. Use this checklist to validate that the ATDD workflow has been executed correctly and all deliverables meet quality standards.
  3. ## Prerequisites
  4. Before starting this workflow, verify:
  5. - [ ] Story approved with clear acceptance criteria (AC must be testable)
  6. - [ ] Development sandbox/environment ready
  7. - [ ] Framework scaffolding exists (run `framework` workflow if missing)
  8. - [ ] Test framework configuration available (playwright.config.ts or cypress.config.ts)
  9. - [ ] Package.json has test dependencies installed (Playwright or Cypress)
  10. **Halt if missing:** Framework scaffolding or story acceptance criteria
  11. ---
  12. ## Step 1: Story Context and Requirements
  13. - [ ] Story markdown file loaded and parsed successfully
  14. - [ ] All acceptance criteria identified and extracted
  15. - [ ] Affected systems and components identified
  16. - [ ] Technical constraints documented
  17. - [ ] Framework configuration loaded (playwright.config.ts or cypress.config.ts)
  18. - [ ] Test directory structure identified from config
  19. - [ ] Existing fixture patterns reviewed for consistency
  20. - [ ] Similar test patterns searched and found in `{test_dir}`
  21. - [ ] Knowledge base fragments loaded:
  22. - [ ] `fixture-architecture.md`
  23. - [ ] `data-factories.md`
  24. - [ ] `component-tdd.md`
  25. - [ ] `network-first.md`
  26. - [ ] `test-quality.md`
  27. ---
  28. ## Step 2: Test Level Selection and Strategy
  29. - [ ] Each acceptance criterion analyzed for appropriate test level
  30. - [ ] Test level selection framework applied (E2E vs API vs Component vs Unit)
  31. - [ ] E2E tests: Critical user journeys and multi-system integration identified
  32. - [ ] API tests: Business logic and service contracts identified
  33. - [ ] Component tests: UI component behavior and interactions identified
  34. - [ ] Unit tests: Pure logic and edge cases identified (if applicable)
  35. - [ ] Duplicate coverage avoided (same behavior not tested at multiple levels unnecessarily)
  36. - [ ] Tests prioritized using P0-P3 framework (if test-design document exists)
  37. - [ ] Primary test level set in `primary_level` variable (typically E2E or API)
  38. - [ ] Test levels documented in ATDD checklist
  39. ---
  40. ## Step 3: Red-Phase Test Scaffolds Generated
  41. ### Test File Structure Created
  42. - [ ] Test files organized in appropriate directories:
  43. - [ ] `tests/e2e/` for end-to-end tests
  44. - [ ] `tests/api/` for API tests
  45. - [ ] `tests/component/` for component tests
  46. - [ ] `tests/support/` for infrastructure (fixtures, factories, helpers)
  47. ### E2E Tests (If Applicable)
  48. - [ ] E2E test files created in `tests/e2e/`
  49. - [ ] All tests follow Given-When-Then format
  50. - [ ] Tests use `data-testid` selectors (not CSS classes or fragile selectors)
  51. - [ ] One assertion per test (atomic test design)
  52. - [ ] No hard waits or sleeps (explicit waits only)
  53. - [ ] Network-first pattern applied (route interception BEFORE navigation)
  54. - [ ] Tests are generated as `test.skip()` scaffolds
  55. - [ ] Activation guidance is documented for the current task
  56. ### API Tests (If Applicable)
  57. - [ ] API test files created in `tests/api/`
  58. - [ ] Tests follow Given-When-Then format
  59. - [ ] API contracts validated (request/response structure)
  60. - [ ] HTTP status codes verified
  61. - [ ] Response body validation includes all required fields
  62. - [ ] Error cases tested (400, 401, 403, 404, 500)
  63. - [ ] Tests are generated as `test.skip()` scaffolds
  64. ### Component Tests (If Applicable)
  65. - [ ] Component test files created in `tests/component/`
  66. - [ ] Tests follow Given-When-Then format
  67. - [ ] Component mounting works correctly
  68. - [ ] Interaction testing covers user actions (click, hover, keyboard)
  69. - [ ] State management within component validated
  70. - [ ] Props and events tested
  71. - [ ] Tests are generated as `test.skip()` scaffolds
  72. ### Test Quality Validation
  73. - [ ] All tests use Given-When-Then structure with clear comments
  74. - [ ] All tests have descriptive names explaining what they test
  75. - [ ] No duplicate tests (same behavior tested multiple times)
  76. - [ ] No flaky patterns (race conditions, timing issues)
  77. - [ ] No test interdependencies (tests can run in any order)
  78. - [ ] Tests are deterministic (same input always produces same result)
  79. ---
  80. ## Step 4: Data Infrastructure Built
  81. ### Data Factories Created
  82. - [ ] Factory files created in `tests/support/factories/`
  83. - [ ] All factories use `@faker-js/faker` for random data generation (no hardcoded values)
  84. - [ ] Factories support overrides for specific test scenarios
  85. - [ ] Factories generate complete valid objects matching API contracts
  86. - [ ] Helper functions for bulk creation provided (e.g., `createUsers(count)`)
  87. - [ ] Factory exports are properly typed (TypeScript)
  88. ### Test Fixtures Created
  89. - [ ] Fixture files created in `tests/support/fixtures/`
  90. - [ ] All fixtures use Playwright's `test.extend()` pattern
  91. - [ ] Fixtures have setup phase (arrange test preconditions)
  92. - [ ] Fixtures provide data to tests via `await use(data)`
  93. - [ ] Fixtures have teardown phase with auto-cleanup (delete created data)
  94. - [ ] Fixtures are composable (can use other fixtures if needed)
  95. - [ ] Fixtures are isolated (each test gets fresh data)
  96. - [ ] Fixtures are type-safe (TypeScript types defined)
  97. ### Mock Requirements Documented
  98. - [ ] External service mocking requirements identified
  99. - [ ] Mock endpoints documented with URLs and methods
  100. - [ ] Success response examples provided
  101. - [ ] Failure response examples provided
  102. - [ ] Mock requirements documented in ATDD checklist for DEV team
  103. ### data-testid Requirements Listed
  104. - [ ] All required data-testid attributes identified from E2E tests
  105. - [ ] data-testid list organized by page or component
  106. - [ ] Each data-testid has clear description of element it targets
  107. - [ ] data-testid list included in ATDD checklist for DEV team
  108. ---
  109. ## Step 5: Implementation Checklist Created
  110. - [ ] Implementation checklist created with clear structure
  111. - [ ] Each scaffolded test mapped to concrete implementation tasks
  112. - [ ] Tasks include:
  113. - [ ] Route/component creation
  114. - [ ] Business logic implementation
  115. - [ ] API integration
  116. - [ ] data-testid attribute additions
  117. - [ ] Error handling
  118. - [ ] Test execution command
  119. - [ ] Completion checkbox
  120. - [ ] Red-Green-Refactor workflow documented in checklist
  121. - [ ] RED phase marked as complete (TEA responsibility)
  122. - [ ] GREEN phase tasks listed for DEV team
  123. - [ ] REFACTOR phase guidance provided
  124. - [ ] Execution commands provided:
  125. - [ ] Run all tests: `npm run test:e2e`
  126. - [ ] Run specific test file
  127. - [ ] Run in headed mode
  128. - [ ] Debug specific test
  129. - [ ] Estimated effort included (hours or story points)
  130. ---
  131. ## Step 6: Deliverables Generated
  132. ### ATDD Checklist Document Created
  133. - [ ] Output file created at `{test_artifacts}/atdd-checklist-{story_key}.md`
  134. - [ ] Document follows template structure from `atdd-checklist-template.md`
  135. - [ ] Document includes all required sections:
  136. - [ ] Story summary
  137. - [ ] Acceptance criteria breakdown
  138. - [ ] Red-phase test scaffolds created (paths and line counts)
  139. - [ ] Data factories created
  140. - [ ] Fixtures created
  141. - [ ] Mock requirements
  142. - [ ] Required data-testid attributes
  143. - [ ] Implementation checklist
  144. - [ ] Red-green-refactor workflow
  145. - [ ] Execution commands
  146. - [ ] Next steps for DEV team
  147. - [ ] Checklist frontmatter includes `storyId`, `storyKey`, `storyFile`, `atddChecklistPath`, and generated test file paths
  148. - [ ] If a writable story file was provided, ATDD artifacts were linked back into story context
  149. - [ ] If a story file could not be updated, manual handoff instructions are present
  150. ### Red-Phase Scaffolds Verified
  151. - [ ] All generated acceptance test scaffolds are marked with `test.skip()`
  152. - [ ] No scaffold was emitted as an active passing test before implementation
  153. - [ ] Activation guidance is documented: remove `test.skip()` for the current task, then confirm RED before implementing
  154. - [ ] Any assumptions or expected failure reasons are documented in ATDD checklist
  155. - [ ] Test run output captured for reference
  156. ### Summary Provided
  157. - [ ] Summary includes:
  158. - [ ] Story ID
  159. - [ ] Primary test level
  160. - [ ] Test counts (E2E, API, Component)
  161. - [ ] Test file paths
  162. - [ ] Factory count
  163. - [ ] Fixture count
  164. - [ ] Mock requirements count
  165. - [ ] data-testid count
  166. - [ ] Implementation task count
  167. - [ ] Estimated effort
  168. - [ ] Next steps for DEV team
  169. - [ ] Output file path
  170. - [ ] Knowledge base references applied
  171. ---
  172. ## Quality Checks
  173. ### Test Design Quality
  174. - [ ] Tests are readable (clear Given-When-Then structure)
  175. - [ ] Tests are maintainable (use factories and fixtures, not hardcoded data)
  176. - [ ] Tests are isolated (no shared state between tests)
  177. - [ ] Tests are deterministic (no race conditions or flaky patterns)
  178. - [ ] Tests are atomic (one assertion per test)
  179. - [ ] Tests are fast (no unnecessary waits or delays)
  180. ### Knowledge Base Integration
  181. - [ ] fixture-architecture.md patterns applied to all fixtures
  182. - [ ] data-factories.md patterns applied to all factories
  183. - [ ] network-first.md patterns applied to E2E tests with network requests
  184. - [ ] component-tdd.md patterns applied to component tests
  185. - [ ] test-quality.md principles applied to all test design
  186. ### Code Quality
  187. - [ ] All TypeScript types are correct and complete
  188. - [ ] No linting errors in generated test files
  189. - [ ] Consistent naming conventions followed
  190. - [ ] Imports are organized and correct
  191. - [ ] Code follows project style guide
  192. ---
  193. ## Integration Points
  194. ### With DEV Agent
  195. - [ ] ATDD checklist provides clear implementation guidance
  196. - [ ] Implementation tasks are granular and actionable
  197. - [ ] data-testid requirements are complete and clear
  198. - [ ] Mock requirements include all necessary details
  199. - [ ] Execution commands work correctly
  200. ### With Story Workflow
  201. - [ ] Story ID correctly referenced in output files
  202. - [ ] Acceptance criteria from story accurately reflected in tests
  203. - [ ] Technical constraints from story considered in test design
  204. ### With Framework Workflow
  205. - [ ] Test framework configuration correctly detected and used
  206. - [ ] Directory structure matches framework setup
  207. - [ ] Fixtures and helpers follow established patterns
  208. - [ ] Naming conventions consistent with framework standards
  209. ### With test-design Workflow (If Available)
  210. - [ ] P0 scenarios from test-design prioritized in ATDD
  211. - [ ] Risk assessment from test-design considered in test coverage
  212. - [ ] Coverage strategy from test-design aligned with ATDD tests
  213. ---
  214. ## Completion Criteria
  215. All of the following must be true before marking this workflow as complete:
  216. - [ ] **Story acceptance criteria analyzed** and mapped to appropriate test levels
  217. - [ ] **Red-phase test scaffolds created** at all appropriate levels (E2E, API, Component)
  218. - [ ] **Given-When-Then format** used consistently across all tests
  219. - [ ] **RED phase verified** by scaffold generation plus task-by-task activation guidance
  220. - [ ] **Network-first pattern** applied to E2E tests with network requests
  221. - [ ] **Data factories created** using faker (no hardcoded test data)
  222. - [ ] **Fixtures created** with auto-cleanup in teardown
  223. - [ ] **Mock requirements documented** for external services
  224. - [ ] **data-testid attributes listed** for DEV team
  225. - [ ] **Implementation checklist created** mapping tests to code tasks
  226. - [ ] **Red-green-refactor workflow documented** in ATDD checklist
  227. - [ ] **Execution commands provided** and verified to work
  228. - [ ] **ATDD checklist document created** and saved to correct location
  229. - [ ] **Output file formatted correctly** using template structure
  230. - [ ] **Knowledge base references applied** and documented in summary
  231. - [ ] **No test quality issues** (flaky patterns, race conditions, hardcoded data)
  232. ---
  233. ## Common Issues and Resolutions
  234. ### Issue: Tests pass before implementation
  235. **Problem:** A test passes even though no implementation code exists yet.
  236. **Resolution:**
  237. - Review test to ensure it's testing actual behavior, not mocked/stubbed behavior
  238. - Check if test is accidentally using existing functionality
  239. - Verify test assertions are correct and meaningful
  240. - Rewrite test to fail until implementation is complete
  241. ### Issue: Network-first pattern not applied
  242. **Problem:** Route interception happens after navigation, causing race conditions.
  243. **Resolution:**
  244. - Move `await page.route()` calls BEFORE `await page.goto()`
  245. - Review `network-first.md` knowledge fragment
  246. - Update all E2E tests to follow network-first pattern
  247. ### Issue: Hardcoded test data in tests
  248. **Problem:** Tests use hardcoded strings/numbers instead of factories.
  249. **Resolution:**
  250. - Replace all hardcoded data with factory function calls
  251. - Use `faker` for all random data generation
  252. - Update data-factories to support all required test scenarios
  253. ### Issue: Fixtures missing auto-cleanup
  254. **Problem:** Fixtures create data but don't clean it up in teardown.
  255. **Resolution:**
  256. - Add cleanup logic after `await use(data)` in fixture
  257. - Call deletion/cleanup functions in teardown
  258. - Verify cleanup works by checking database/storage after test run
  259. ### Issue: Tests have multiple assertions
  260. **Problem:** Tests verify multiple behaviors in single test (not atomic).
  261. **Resolution:**
  262. - Split into separate tests (one assertion per test)
  263. - Each test should verify exactly one behavior
  264. - Use descriptive test names to clarify what each test verifies
  265. ### Issue: Tests depend on execution order
  266. **Problem:** Tests fail when run in isolation or different order.
  267. **Resolution:**
  268. - Remove shared state between tests
  269. - Each test should create its own test data
  270. - Use fixtures for consistent setup across tests
  271. - Verify tests can run with `.only` flag
  272. ---
  273. ## Notes for TEA Agent
  274. - **Preflight halt is critical:** Do not proceed if story has no acceptance criteria or framework is missing
  275. - **RED phase verification is mandatory:** Tests must fail before sharing with DEV team
  276. - **Network-first pattern:** Route interception BEFORE navigation prevents race conditions
  277. - **One assertion per test:** Atomic tests provide clear failure diagnosis
  278. - **Auto-cleanup is non-negotiable:** Every fixture must clean up data in teardown
  279. - **Use knowledge base:** Load relevant fragments (fixture-architecture, data-factories, network-first, component-tdd, test-quality) for guidance
  280. - **Share with DEV agent:** ATDD checklist provides implementation roadmap from red to green