You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

atdd-checklist-template.md 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. ---
  2. stepsCompleted: []
  3. lastStep: ''
  4. lastSaved: ''
  5. workflowType: 'testarch-atdd'
  6. storyId: '{story_id}'
  7. storyKey: '{story_key}'
  8. storyFile: '{story_file}'
  9. atddChecklistPath: '{test_artifacts}/atdd-checklist-{story_key}.md'
  10. generatedTestFiles:
  11. - '{api_test_file_path}'
  12. - '{e2e_test_file_path}'
  13. - '{component_test_file_path}'
  14. inputDocuments: []
  15. ---
  16. # ATDD Checklist - Epic {epic_num}, Story {story_num}: {story_title}
  17. **Date:** {date}
  18. **Author:** {user_name}
  19. **Primary Test Level:** {primary_level}
  20. ---
  21. ## Story Summary
  22. {Brief 2-3 sentence summary of the user story}
  23. **As a** {user_role}
  24. **I want** {feature_description}
  25. **So that** {business_value}
  26. ---
  27. ## Acceptance Criteria
  28. {List all testable acceptance criteria from the story}
  29. 1. {Acceptance criterion 1}
  30. 2. {Acceptance criterion 2}
  31. 3. {Acceptance criterion 3}
  32. ---
  33. ## Story Integration Metadata
  34. - **Story ID:** `{story_id}`
  35. - **Story Key:** `{story_key}`
  36. - **Story File:** `{story_file}`
  37. - **Checklist Path:** `{test_artifacts}/atdd-checklist-{story_key}.md`
  38. - **Generated Test Files:** `{e2e_test_file_path}`, `{api_test_file_path}`, `{component_test_file_path}`
  39. If this story came from BMM `create-story`, mirror these artifact paths into the story's `Dev Notes` so `dev-story` can discover and activate the red-phase scaffolds.
  40. ---
  41. ## Red-Phase Test Scaffolds Created
  42. ### E2E Tests ({e2e_test_count} tests)
  43. **File:** `{e2e_test_file_path}` ({line_count} lines)
  44. {List each E2E test with its current status and expected failure reason}
  45. - ✅ **Test:** {test_name}
  46. - **Status:** RED - {failure_reason}
  47. - **Verifies:** {what_this_test_validates}
  48. ### API Tests ({api_test_count} tests)
  49. **File:** `{api_test_file_path}` ({line_count} lines)
  50. {List each API test with its current status and expected failure reason}
  51. - ✅ **Test:** {test_name}
  52. - **Status:** RED - {failure_reason}
  53. - **Verifies:** {what_this_test_validates}
  54. ### Component Tests ({component_test_count} tests)
  55. **File:** `{component_test_file_path}` ({line_count} lines)
  56. {List each component test with its current status and expected failure reason}
  57. - ✅ **Test:** {test_name}
  58. - **Status:** RED - {failure_reason}
  59. - **Verifies:** {what_this_test_validates}
  60. ---
  61. ## Data Factories Created
  62. {List all data factory files created with their exports}
  63. ### {Entity} Factory
  64. **File:** `tests/support/factories/{entity}.factory.ts`
  65. **Exports:**
  66. - `create{Entity}(overrides?)` - Create single entity with optional overrides
  67. - `create{Entity}s(count)` - Create array of entities
  68. **Example Usage:**
  69. ```typescript
  70. const user = createUser({ email: 'specific@example.com' });
  71. const users = createUsers(5); // Generate 5 random users
  72. ```
  73. ---
  74. ## Fixtures Created
  75. {List all test fixture files created with their fixture names and descriptions}
  76. ### {Feature} Fixtures
  77. **File:** `tests/support/fixtures/{feature}.fixture.ts`
  78. **Fixtures:**
  79. - `{fixtureName}` - {description_of_what_fixture_provides}
  80. - **Setup:** {what_setup_does}
  81. - **Provides:** {what_test_receives}
  82. - **Cleanup:** {what_cleanup_does}
  83. **Example Usage:**
  84. ```typescript
  85. import { test } from './fixtures/{feature}.fixture';
  86. test('should do something', async ({ {fixtureName} }) => {
  87. // {fixtureName} is ready to use with auto-cleanup
  88. });
  89. ```
  90. ---
  91. ## Mock Requirements
  92. {Document external services that need mocking and their requirements}
  93. ### {Service Name} Mock
  94. **Endpoint:** `{HTTP_METHOD} {endpoint_url}`
  95. **Success Response:**
  96. ```json
  97. {
  98. {success_response_example}
  99. }
  100. ```
  101. **Failure Response:**
  102. ```json
  103. {
  104. {failure_response_example}
  105. }
  106. ```
  107. **Notes:** {any_special_mock_requirements}
  108. ---
  109. ## Required data-testid Attributes
  110. {List all data-testid attributes required in UI implementation for test stability}
  111. ### {Page or Component Name}
  112. - `{data-testid-name}` - {description_of_element}
  113. - `{data-testid-name}` - {description_of_element}
  114. **Implementation Example:**
  115. ```tsx
  116. <button data-testid="login-button">Log In</button>
  117. <input data-testid="email-input" type="email" />
  118. <div data-testid="error-message">{errorText}</div>
  119. ```
  120. ---
  121. ## Implementation Checklist
  122. {Map each scaffolded test to concrete implementation tasks that will make it pass}
  123. ### Test: {test_name_1}
  124. **File:** `{test_file_path}`
  125. **Tasks to make this test pass:**
  126. - [ ] {Implementation task 1}
  127. - [ ] {Implementation task 2}
  128. - [ ] {Implementation task 3}
  129. - [ ] Add required data-testid attributes: {list_of_testids}
  130. - [ ] Run test: `{test_execution_command}`
  131. - [ ] ✅ Test passes (green phase)
  132. **Estimated Effort:** {effort_estimate} hours
  133. ---
  134. ### Test: {test_name_2}
  135. **File:** `{test_file_path}`
  136. **Tasks to make this test pass:**
  137. - [ ] {Implementation task 1}
  138. - [ ] {Implementation task 2}
  139. - [ ] {Implementation task 3}
  140. - [ ] Add required data-testid attributes: {list_of_testids}
  141. - [ ] Run test: `{test_execution_command}`
  142. - [ ] ✅ Test passes (green phase)
  143. **Estimated Effort:** {effort_estimate} hours
  144. ---
  145. ## Running Tests
  146. ```bash
  147. # Run all activated tests for this story
  148. {test_command_all}
  149. # Run specific test file
  150. {test_command_specific_file}
  151. # Run tests in headed mode (see browser)
  152. {test_command_headed}
  153. # Debug specific test
  154. {test_command_debug}
  155. # Run tests with coverage
  156. {test_command_coverage}
  157. ```
  158. ---
  159. ## Red-Green-Refactor Workflow
  160. ### RED Phase (Complete) ✅
  161. **TEA Agent Responsibilities:**
  162. - ✅ All tests written as red-phase scaffolds with `test.skip()`
  163. - ✅ Fixtures and factories created with auto-cleanup
  164. - ✅ Mock requirements documented
  165. - ✅ data-testid requirements listed
  166. - ✅ Implementation checklist created
  167. **Verification:**
  168. - All generated tests are present and marked with `test.skip()`
  169. - Activation guidance is clear and actionable
  170. - Any activated test fails due to missing implementation, not test bugs
  171. ---
  172. ### GREEN Phase (DEV Team - Next Steps)
  173. **DEV Agent Responsibilities:**
  174. 1. **Pick one scaffolded test** from implementation checklist (start with highest priority)
  175. 2. **Remove `test.skip()`** for that test and confirm it fails first
  176. 3. **Read the test** to understand expected behavior
  177. 4. **Implement minimal code** to make that specific test pass
  178. 5. **Run the test** to verify it now passes (green)
  179. 6. **Check off the task** in implementation checklist
  180. 7. **Move to next test** and repeat
  181. **Key Principles:**
  182. - One test at a time (don't try to fix all at once)
  183. - Minimal implementation (don't over-engineer)
  184. - Run tests frequently (immediate feedback)
  185. - Use implementation checklist as roadmap
  186. **Progress Tracking:**
  187. - Check off tasks as you complete them
  188. - Share progress in daily standup
  189. ---
  190. ### REFACTOR Phase (DEV Team - After All Tests Pass)
  191. **DEV Agent Responsibilities:**
  192. 1. **Verify all tests pass** (green phase complete)
  193. 2. **Review code for quality** (readability, maintainability, performance)
  194. 3. **Extract duplications** (DRY principle)
  195. 4. **Optimize performance** (if needed)
  196. 5. **Ensure tests still pass** after each refactor
  197. 6. **Update documentation** (if API contracts change)
  198. **Key Principles:**
  199. - Tests provide safety net (refactor with confidence)
  200. - Make small refactors (easier to debug if tests fail)
  201. - Run tests after each change
  202. - Don't change test behavior (only implementation)
  203. **Completion:**
  204. - All tests pass
  205. - Code quality meets team standards
  206. - No duplications or code smells
  207. - Ready for code review and story approval
  208. ---
  209. ## Next Steps
  210. 1. **Link this checklist and generated tests** into the story file `Dev Notes` / `ATDD Artifacts` section when a writable story file is available
  211. 2. **If the story file cannot be updated automatically**, share this checklist and generated tests with the dev workflow as a manual handoff
  212. 3. **Review this checklist** with team in standup or planning
  213. 4. **Begin implementation** using implementation checklist as guide
  214. 5. **Activate one scaffold at a time** by removing `test.skip()` for the current task, then confirm it fails before implementing
  215. 6. **Work one activated test at a time** (red → green for each)
  216. 7. **Share progress** in daily standup
  217. 8. **When all activated tests pass**, refactor code for quality
  218. 9. **When refactoring complete**, manually update story status to 'done' in sprint-status.yaml
  219. ---
  220. ## Knowledge Base References Applied
  221. This ATDD workflow consulted the following knowledge fragments:
  222. - **fixture-architecture.md** - Test fixture patterns with setup/teardown and auto-cleanup using Playwright's `test.extend()`
  223. - **data-factories.md** - Factory patterns using `@faker-js/faker` for random test data generation with overrides support
  224. - **component-tdd.md** - Component test strategies using Playwright Component Testing
  225. - **network-first.md** - Route interception patterns (intercept BEFORE navigation to prevent race conditions)
  226. - **test-quality.md** - Test design principles (Given-When-Then, one assertion per test, determinism, isolation)
  227. - **test-levels-framework.md** - Test level selection framework (E2E vs API vs Component vs Unit)
  228. See `tea-index.csv` for complete knowledge fragment mapping.
  229. ---
  230. ## Test Execution Evidence
  231. ### Initial Scaffold Review / RED Verification
  232. **Command:** `{test_command_all}` (or a narrower command after removing `test.skip()` for the current task)
  233. **Results:**
  234. ```
  235. {paste_test_run_output_showing_scaffolds_skipped_or_activated_tests_failing}
  236. ```
  237. **Summary:**
  238. - Total tests: {total_test_count}
  239. - Skipped: {total_test_count} (expected before activation)
  240. - Activated RED tests: {activated_test_count} (expected after activation, before implementation)
  241. - Passing: 0 before implementation (expected for activated tests)
  242. - Status: ✅ Red-phase scaffolds verified
  243. **Expected Failure Messages:**
  244. {list_expected_skip_or_failure_states_for_each_test}
  245. ---
  246. ## Notes
  247. {Any additional notes, context, or special considerations for this story}
  248. - {Note 1}
  249. - {Note 2}
  250. - {Note 3}
  251. ---
  252. ## Contact
  253. **Questions or Issues?**
  254. - Ask in team standup
  255. - Tag @{tea_agent_username} in Slack/Discord
  256. - Refer to `./bmm/docs/tea-README.md` for workflow documentation
  257. - Consult `./resources/knowledge` for testing best practices
  258. ---
  259. **Generated by BMad TEA Agent** - {date}