Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. ---
  2. name: 'step-02-discover-tests'
  3. description: 'Find and parse test files'
  4. nextStepFile: '{skill-root}/steps-c/step-03-quality-evaluation.md'
  5. outputFile: '{test_artifacts}/test-review.md'
  6. ---
  7. # Step 2: Discover & Parse Tests
  8. ## STEP GOAL
  9. Collect test files in scope and parse structure/metadata.
  10. ## MANDATORY EXECUTION RULES
  11. - 📖 Read the entire step file before acting
  12. - ✅ Speak in `{communication_language}`
  13. ---
  14. ## EXECUTION PROTOCOLS:
  15. - 🎯 Follow the MANDATORY SEQUENCE exactly
  16. - 💾 Record outputs before proceeding
  17. - 📖 Load the next step only when instructed
  18. ## CONTEXT BOUNDARIES:
  19. - Available context: config, loaded artifacts, and knowledge fragments
  20. - Focus: this step's goal only
  21. - Limits: do not execute future steps
  22. - Dependencies: prior steps' outputs (if any)
  23. ## MANDATORY SEQUENCE
  24. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
  25. ## 1. Discover Test Files
  26. - **single**: use provided file path
  27. - **directory**: glob under `{test_dir}` or selected folder
  28. - **suite**: glob all tests in repo
  29. Halt if no tests are found.
  30. ---
  31. ## 2. Parse Metadata (per file)
  32. Collect:
  33. - File size and line count
  34. - Test framework detected
  35. - Describe/test block counts
  36. - Test IDs and priority markers
  37. - Imports, fixtures, factories, network interception
  38. - Waits/timeouts and control flow (if/try/catch)
  39. ---
  40. ## 3. Evidence Collection (if `tea_browser_automation` is `cli` or `auto`)
  41. > **Fallback:** If CLI is not installed, fall back to MCP (if available) or skip evidence collection.
  42. **CLI Evidence Collection:**
  43. All commands use the same named session to target the correct browser:
  44. 1. `playwright-cli -s=tea-review open <target_url>`
  45. 2. `playwright-cli -s=tea-review tracing-start`
  46. 3. Execute the flow under review (using `-s=tea-review` on each command)
  47. 4. `playwright-cli -s=tea-review tracing-stop` → saves trace.zip
  48. 5. `playwright-cli -s=tea-review screenshot --filename={test_artifacts}/review-evidence.png`
  49. 6. `playwright-cli -s=tea-review network` → capture network request log
  50. 7. `playwright-cli -s=tea-review close`
  51. After capturing `trace.zip`, prefer Playwright's newer trace CLI for local or downloaded artifact analysis:
  52. - `npx playwright trace open <trace.zip>` to start a trace session
  53. - `npx playwright trace actions --grep="expect"` to jump to the failing assertion
  54. - `npx playwright trace action <n>` / `trace snapshot <n> --name after` for root-cause details
  55. - `npx playwright trace close` when done
  56. > **Session Hygiene:** Always close sessions using `playwright-cli -s=tea-review close`. Do NOT use `close-all` — it kills every session on the machine and breaks parallel execution.
  57. ---
  58. ## 4. Save Progress
  59. **Save this step's accumulated work to `{outputFile}`.**
  60. - **If `{outputFile}` does not exist** (first save), create it using the workflow template (if available) with YAML frontmatter:
  61. ```yaml
  62. ---
  63. stepsCompleted: ['step-02-discover-tests']
  64. lastStep: 'step-02-discover-tests'
  65. lastSaved: '{date}'
  66. ---
  67. ```
  68. Then write this step's output below the frontmatter.
  69. - **If `{outputFile}` already exists**, update:
  70. - Add `'step-02-discover-tests'` to `stepsCompleted` array (only if not already present)
  71. - Set `lastStep: 'step-02-discover-tests'`
  72. - Set `lastSaved: '{date}'`
  73. - Append this step's output to the appropriate section of the document.
  74. Load next step: `{nextStepFile}`
  75. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS:
  76. ### ✅ SUCCESS:
  77. - Step completed in full with required outputs
  78. ### ❌ SYSTEM FAILURE:
  79. - Skipped sequence steps or missing outputs
  80. **Master Rule:** Skipping steps is FORBIDDEN.