qa-skills 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +168 -0
  2. package/bin/cli.js +42 -0
  3. package/dist/agents/registry.d.ts +5 -0
  4. package/dist/agents/registry.d.ts.map +1 -0
  5. package/dist/agents/registry.js +101 -0
  6. package/dist/agents/registry.js.map +1 -0
  7. package/dist/agents/types.d.ts +9 -0
  8. package/dist/agents/types.d.ts.map +1 -0
  9. package/dist/agents/types.js +2 -0
  10. package/dist/agents/types.js.map +1 -0
  11. package/dist/dependencies.d.ts +21 -0
  12. package/dist/dependencies.d.ts.map +1 -0
  13. package/dist/dependencies.js +125 -0
  14. package/dist/dependencies.js.map +1 -0
  15. package/dist/installer.d.ts +25 -0
  16. package/dist/installer.d.ts.map +1 -0
  17. package/dist/installer.js +437 -0
  18. package/dist/installer.js.map +1 -0
  19. package/dist/scaffold.d.ts +27 -0
  20. package/dist/scaffold.d.ts.map +1 -0
  21. package/dist/scaffold.js +182 -0
  22. package/dist/scaffold.js.map +1 -0
  23. package/package.json +40 -0
  24. package/skills/qa-accessibility-test-writer/SKILL.md +127 -0
  25. package/skills/qa-accessibility-test-writer/references/axe-core-patterns.md +349 -0
  26. package/skills/qa-accessibility-test-writer/references/best-practices.md +184 -0
  27. package/skills/qa-accessibility-test-writer/references/wcag-tests.md +331 -0
  28. package/skills/qa-api-contract-curator/SKILL.md +104 -0
  29. package/skills/qa-api-contract-curator/references/breaking-changes.md +363 -0
  30. package/skills/qa-api-contract-curator/references/openapi-structure.md +404 -0
  31. package/skills/qa-browser-data-collector/SKILL.md +132 -0
  32. package/skills/qa-browser-data-collector/references/data-collection-checklist.md +91 -0
  33. package/skills/qa-browser-data-collector/references/playwright-mcp-patterns.md +113 -0
  34. package/skills/qa-bug-ticket-creator/SKILL.md +148 -0
  35. package/skills/qa-bug-ticket-creator/references/bug-report-format.md +149 -0
  36. package/skills/qa-bug-ticket-creator/references/severity-guide.md +81 -0
  37. package/skills/qa-bug-ticket-creator/templates/bug-ticket-template.md +39 -0
  38. package/skills/qa-changelog-analyzer/SKILL.md +134 -0
  39. package/skills/qa-changelog-analyzer/references/git-analysis-patterns.md +138 -0
  40. package/skills/qa-changelog-analyzer/references/impact-mapping.md +120 -0
  41. package/skills/qa-clickup-integration/SKILL.md +166 -0
  42. package/skills/qa-clickup-integration/references/api-patterns.md +102 -0
  43. package/skills/qa-clickup-integration/references/field-mapping.md +71 -0
  44. package/skills/qa-codeceptjs-writer/SKILL.md +136 -0
  45. package/skills/qa-codeceptjs-writer/references/best-practices.md +207 -0
  46. package/skills/qa-codeceptjs-writer/references/config.md +255 -0
  47. package/skills/qa-codeceptjs-writer/references/patterns.md +285 -0
  48. package/skills/qa-coverage-analyzer/SKILL.md +166 -0
  49. package/skills/qa-coverage-analyzer/references/best-practices.md +142 -0
  50. package/skills/qa-coverage-analyzer/references/coverage-dimensions.md +155 -0
  51. package/skills/qa-coverage-analyzer/references/tools.md +204 -0
  52. package/skills/qa-cypress-writer/SKILL.md +134 -0
  53. package/skills/qa-cypress-writer/references/assertions.md +121 -0
  54. package/skills/qa-cypress-writer/references/best-practices.md +82 -0
  55. package/skills/qa-cypress-writer/references/config.md +121 -0
  56. package/skills/qa-cypress-writer/references/patterns.md +170 -0
  57. package/skills/qa-data-factory/SKILL.md +126 -0
  58. package/skills/qa-data-factory/references/factory-patterns.md +164 -0
  59. package/skills/qa-data-factory/references/faker-guide.md +131 -0
  60. package/skills/qa-diagram-generator/SKILL.md +125 -0
  61. package/skills/qa-diagram-generator/references/c4-model.md +53 -0
  62. package/skills/qa-diagram-generator/references/charts.md +58 -0
  63. package/skills/qa-diagram-generator/references/class-diagram.md +85 -0
  64. package/skills/qa-diagram-generator/references/er-diagram.md +69 -0
  65. package/skills/qa-diagram-generator/references/flowchart.md +92 -0
  66. package/skills/qa-diagram-generator/references/from-screenshot.md +45 -0
  67. package/skills/qa-diagram-generator/references/gantt.md +49 -0
  68. package/skills/qa-diagram-generator/references/journey.md +50 -0
  69. package/skills/qa-diagram-generator/references/mindmap.md +75 -0
  70. package/skills/qa-diagram-generator/references/sequence.md +69 -0
  71. package/skills/qa-diagram-generator/references/state-diagram.md +56 -0
  72. package/skills/qa-discovery-interview/SKILL.md +182 -0
  73. package/skills/qa-discovery-interview/references/completeness-checklist.md +53 -0
  74. package/skills/qa-discovery-interview/references/conflict-patterns.md +101 -0
  75. package/skills/qa-discovery-interview/references/qa-categories.md +147 -0
  76. package/skills/qa-discovery-interview/templates/qa-brief-template.md +168 -0
  77. package/skills/qa-environment-checker/SKILL.md +142 -0
  78. package/skills/qa-environment-checker/references/dependency-matrix.md +101 -0
  79. package/skills/qa-environment-checker/references/health-checks.md +209 -0
  80. package/skills/qa-environment-checker/templates/env-readiness-template.md +64 -0
  81. package/skills/qa-flaky-detector/SKILL.md +153 -0
  82. package/skills/qa-flaky-detector/references/ci-analysis.md +140 -0
  83. package/skills/qa-flaky-detector/references/flaky-patterns.md +247 -0
  84. package/skills/qa-github-issues-enhanced/SKILL.md +175 -0
  85. package/skills/qa-github-issues-enhanced/references/issue-templates.md +425 -0
  86. package/skills/qa-github-issues-enhanced/references/label-taxonomy.md +130 -0
  87. package/skills/qa-github-issues-enhanced/references/workflow-patterns.md +188 -0
  88. package/skills/qa-httpx-writer/SKILL.md +138 -0
  89. package/skills/qa-httpx-writer/references/assertions.md +195 -0
  90. package/skills/qa-httpx-writer/references/best-practices.md +140 -0
  91. package/skills/qa-httpx-writer/references/config.md +212 -0
  92. package/skills/qa-httpx-writer/references/patterns.md +262 -0
  93. package/skills/qa-jest-writer/SKILL.md +131 -0
  94. package/skills/qa-jest-writer/references/assertions.md +125 -0
  95. package/skills/qa-jest-writer/references/best-practices.md +136 -0
  96. package/skills/qa-jest-writer/references/config.md +134 -0
  97. package/skills/qa-jest-writer/references/patterns.md +172 -0
  98. package/skills/qa-jira-integration/SKILL.md +135 -0
  99. package/skills/qa-jira-integration/references/api-patterns.md +143 -0
  100. package/skills/qa-jira-integration/references/field-mapping.md +79 -0
  101. package/skills/qa-jira-integration/references/xray-integration.md +85 -0
  102. package/skills/qa-jmeter-writer/SKILL.md +171 -0
  103. package/skills/qa-jmeter-writer/references/best-practices.md +157 -0
  104. package/skills/qa-jmeter-writer/references/config.md +204 -0
  105. package/skills/qa-jmeter-writer/references/patterns.md +242 -0
  106. package/skills/qa-junit5-writer/SKILL.md +157 -0
  107. package/skills/qa-junit5-writer/references/assertions.md +118 -0
  108. package/skills/qa-junit5-writer/references/config.md +97 -0
  109. package/skills/qa-junit5-writer/references/patterns.md +162 -0
  110. package/skills/qa-k6-writer/SKILL.md +155 -0
  111. package/skills/qa-k6-writer/references/best-practices.md +236 -0
  112. package/skills/qa-k6-writer/references/config.md +219 -0
  113. package/skills/qa-k6-writer/references/patterns.md +304 -0
  114. package/skills/qa-linear-integration/SKILL.md +137 -0
  115. package/skills/qa-linear-integration/references/api-patterns.md +249 -0
  116. package/skills/qa-linear-integration/references/field-mapping.md +121 -0
  117. package/skills/qa-locust-writer/SKILL.md +151 -0
  118. package/skills/qa-locust-writer/references/best-practices.md +126 -0
  119. package/skills/qa-locust-writer/references/config.md +170 -0
  120. package/skills/qa-locust-writer/references/patterns.md +235 -0
  121. package/skills/qa-manual-test-designer/SKILL.md +145 -0
  122. package/skills/qa-manual-test-designer/references/exploratory-charters.md +138 -0
  123. package/skills/qa-manual-test-designer/references/personas.md +146 -0
  124. package/skills/qa-manual-test-designer/templates/exploratory-charter-template.md +47 -0
  125. package/skills/qa-manual-test-designer/templates/test-case-template.md +31 -0
  126. package/skills/qa-mobile-test-writer/SKILL.md +144 -0
  127. package/skills/qa-mobile-test-writer/references/best-practices.md +214 -0
  128. package/skills/qa-mobile-test-writer/references/config.md +309 -0
  129. package/skills/qa-mobile-test-writer/references/patterns.md +304 -0
  130. package/skills/qa-nfr-analyst/SKILL.md +177 -0
  131. package/skills/qa-nfr-analyst/references/iso-25010-model.md +159 -0
  132. package/skills/qa-nfr-analyst/references/owasp-wstg-baseline.md +202 -0
  133. package/skills/qa-nfr-analyst/references/wcag-checklist.md +184 -0
  134. package/skills/qa-nfr-analyst/templates/owasp-checklist-template.md +89 -0
  135. package/skills/qa-nfr-analyst/templates/wcag-checklist-template.md +48 -0
  136. package/skills/qa-orchestrator/SKILL.md +132 -0
  137. package/skills/qa-orchestrator/references/handoff-chains.md +105 -0
  138. package/skills/qa-orchestrator/references/pipeline-modes.md +115 -0
  139. package/skills/qa-orchestrator/references/scheduler-rules.md +84 -0
  140. package/skills/qa-pact-writer/SKILL.md +133 -0
  141. package/skills/qa-pact-writer/references/best-practices.md +100 -0
  142. package/skills/qa-pact-writer/references/config.md +135 -0
  143. package/skills/qa-pact-writer/references/patterns.md +161 -0
  144. package/skills/qa-plan-creator/SKILL.md +139 -0
  145. package/skills/qa-plan-creator/references/introduction-plan.md +43 -0
  146. package/skills/qa-plan-creator/references/migration-plan.md +44 -0
  147. package/skills/qa-plan-creator/references/onboarding-plan.md +46 -0
  148. package/skills/qa-plan-creator/references/performance-plan.md +44 -0
  149. package/skills/qa-plan-creator/references/regression-plan.md +45 -0
  150. package/skills/qa-plan-creator/references/release-plan.md +45 -0
  151. package/skills/qa-plan-creator/references/sprint-plan.md +44 -0
  152. package/skills/qa-plan-creator/references/test-plan.md +59 -0
  153. package/skills/qa-plan-creator/references/uat-plan.md +43 -0
  154. package/skills/qa-plan-creator/templates/checklist-template.md +36 -0
  155. package/skills/qa-plan-creator/templates/regression-checklist-template.md +49 -0
  156. package/skills/qa-plan-creator/templates/release-checklist-template.md +46 -0
  157. package/skills/qa-plan-creator/templates/test-plan-template.md +74 -0
  158. package/skills/qa-playwright-py-writer/SKILL.md +156 -0
  159. package/skills/qa-playwright-py-writer/references/best-practices.md +194 -0
  160. package/skills/qa-playwright-py-writer/references/config.md +195 -0
  161. package/skills/qa-playwright-py-writer/references/patterns.md +212 -0
  162. package/skills/qa-playwright-ts-writer/SKILL.md +151 -0
  163. package/skills/qa-playwright-ts-writer/references/assertions.md +109 -0
  164. package/skills/qa-playwright-ts-writer/references/best-practices.md +191 -0
  165. package/skills/qa-playwright-ts-writer/references/config.md +144 -0
  166. package/skills/qa-playwright-ts-writer/references/patterns.md +171 -0
  167. package/skills/qa-pytest-writer/SKILL.md +145 -0
  168. package/skills/qa-pytest-writer/references/assertions.md +149 -0
  169. package/skills/qa-pytest-writer/references/best-practices.md +97 -0
  170. package/skills/qa-pytest-writer/references/config.md +176 -0
  171. package/skills/qa-pytest-writer/references/patterns.md +251 -0
  172. package/skills/qa-qase-integration/SKILL.md +149 -0
  173. package/skills/qa-qase-integration/references/api-reference.md +354 -0
  174. package/skills/qa-qase-integration/references/ci-integration.md +196 -0
  175. package/skills/qa-qase-integration/references/field-mapping.md +157 -0
  176. package/skills/qa-requirements-generator/SKILL.md +152 -0
  177. package/skills/qa-requirements-generator/references/iso-29148-structure.md +153 -0
  178. package/skills/qa-requirements-generator/references/requirement-patterns.md +278 -0
  179. package/skills/qa-rest-assured-writer/SKILL.md +137 -0
  180. package/skills/qa-rest-assured-writer/references/best-practices.md +50 -0
  181. package/skills/qa-rest-assured-writer/references/config.md +124 -0
  182. package/skills/qa-rest-assured-writer/references/patterns.md +192 -0
  183. package/skills/qa-risk-analyzer/SKILL.md +158 -0
  184. package/skills/qa-risk-analyzer/references/impact-analysis.md +133 -0
  185. package/skills/qa-risk-analyzer/references/risk-factors.md +123 -0
  186. package/skills/qa-robot-framework-writer/SKILL.md +147 -0
  187. package/skills/qa-robot-framework-writer/references/best-practices.md +249 -0
  188. package/skills/qa-robot-framework-writer/references/config.md +204 -0
  189. package/skills/qa-robot-framework-writer/references/libraries.md +273 -0
  190. package/skills/qa-robot-framework-writer/references/patterns.md +216 -0
  191. package/skills/qa-security-test-writer/SKILL.md +123 -0
  192. package/skills/qa-security-test-writer/references/best-practices.md +155 -0
  193. package/skills/qa-security-test-writer/references/owasp-top10.md +331 -0
  194. package/skills/qa-security-test-writer/references/zap-config.md +258 -0
  195. package/skills/qa-selenium-java-writer/SKILL.md +143 -0
  196. package/skills/qa-selenium-java-writer/references/best-practices.md +59 -0
  197. package/skills/qa-selenium-java-writer/references/config.md +143 -0
  198. package/skills/qa-selenium-java-writer/references/patterns.md +170 -0
  199. package/skills/qa-selenium-py-writer/SKILL.md +150 -0
  200. package/skills/qa-selenium-py-writer/references/best-practices.md +175 -0
  201. package/skills/qa-selenium-py-writer/references/config.md +224 -0
  202. package/skills/qa-selenium-py-writer/references/patterns.md +255 -0
  203. package/skills/qa-shortcut-integration/SKILL.md +143 -0
  204. package/skills/qa-shortcut-integration/references/api-patterns.md +126 -0
  205. package/skills/qa-shortcut-integration/references/field-mapping.md +66 -0
  206. package/skills/qa-spec-auditor/SKILL.md +162 -0
  207. package/skills/qa-spec-auditor/references/audit-checklist.md +144 -0
  208. package/skills/qa-spec-auditor/references/drift-patterns.md +207 -0
  209. package/skills/qa-spec-writer/SKILL.md +143 -0
  210. package/skills/qa-spec-writer/references/gherkin-guide.md +253 -0
  211. package/skills/qa-spec-writer/references/specification-patterns.md +274 -0
  212. package/skills/qa-spring-test-writer/SKILL.md +170 -0
  213. package/skills/qa-spring-test-writer/references/best-practices.md +57 -0
  214. package/skills/qa-spring-test-writer/references/config.md +179 -0
  215. package/skills/qa-spring-test-writer/references/patterns.md +235 -0
  216. package/skills/qa-supertest-writer/SKILL.md +150 -0
  217. package/skills/qa-supertest-writer/references/assertions.md +192 -0
  218. package/skills/qa-supertest-writer/references/best-practices.md +102 -0
  219. package/skills/qa-supertest-writer/references/config.md +166 -0
  220. package/skills/qa-supertest-writer/references/patterns.md +242 -0
  221. package/skills/qa-task-creator/SKILL.md +142 -0
  222. package/skills/qa-task-creator/references/linking-patterns.md +127 -0
  223. package/skills/qa-task-creator/references/task-types.md +169 -0
  224. package/skills/qa-task-creator/templates/task-template.md +24 -0
  225. package/skills/qa-test-doc-compiler/SKILL.md +114 -0
  226. package/skills/qa-test-doc-compiler/references/agile-tailoring.md +220 -0
  227. package/skills/qa-test-doc-compiler/references/iso-29119-3-documents.md +302 -0
  228. package/skills/qa-test-healer/SKILL.md +101 -0
  229. package/skills/qa-test-healer/references/diagnosis-patterns.md +142 -0
  230. package/skills/qa-test-healer/references/fix-strategies.md +177 -0
  231. package/skills/qa-test-reporter/SKILL.md +130 -0
  232. package/skills/qa-test-reporter/references/best-practices.md +162 -0
  233. package/skills/qa-test-reporter/references/iso-29119-reports.md +236 -0
  234. package/skills/qa-test-reporter/references/report-formats.md +287 -0
  235. package/skills/qa-test-reviewer/SKILL.md +142 -0
  236. package/skills/qa-test-reviewer/references/anti-patterns.md +268 -0
  237. package/skills/qa-test-reviewer/references/review-checklist.md +93 -0
  238. package/skills/qa-test-strategy/SKILL.md +133 -0
  239. package/skills/qa-test-strategy/references/entry-exit-criteria.md +176 -0
  240. package/skills/qa-test-strategy/references/risk-matrix.md +102 -0
  241. package/skills/qa-test-strategy/references/testing-types.md +143 -0
  242. package/skills/qa-testcase-from-docs/SKILL.md +161 -0
  243. package/skills/qa-testcase-from-docs/references/test-case-format.md +196 -0
  244. package/skills/qa-testcase-from-docs/references/test-design-techniques.md +126 -0
  245. package/skills/qa-testcase-from-docs/templates/test-case-template.md +31 -0
  246. package/skills/qa-testcase-from-ui/SKILL.md +109 -0
  247. package/skills/qa-testcase-from-ui/references/ui-element-patterns.md +126 -0
  248. package/skills/qa-testcase-from-ui/references/visual-analysis-guide.md +146 -0
  249. package/skills/qa-testcase-from-ui/templates/test-case-template.md +31 -0
  250. package/skills/qa-visual-regression-writer/SKILL.md +175 -0
  251. package/skills/qa-visual-regression-writer/references/best-practices.md +154 -0
  252. package/skills/qa-visual-regression-writer/references/config.md +220 -0
  253. package/skills/qa-visual-regression-writer/references/patterns.md +213 -0
  254. package/skills/qa-vitest-writer/SKILL.md +141 -0
  255. package/skills/qa-vitest-writer/references/assertions.md +105 -0
  256. package/skills/qa-vitest-writer/references/best-practices.md +62 -0
  257. package/skills/qa-vitest-writer/references/config.md +127 -0
  258. package/skills/qa-vitest-writer/references/patterns.md +141 -0
  259. package/skills/qa-webdriverio-writer/SKILL.md +145 -0
  260. package/skills/qa-webdriverio-writer/references/best-practices.md +176 -0
  261. package/skills/qa-webdriverio-writer/references/config.md +240 -0
  262. package/skills/qa-webdriverio-writer/references/patterns.md +269 -0
@@ -0,0 +1,97 @@
1
+ # Pytest Best Practices
2
+
3
+ ## Fixture Scope
4
+
5
+ | Scope | When to Use |
6
+ | ----- | ----------- |
7
+ | `function` | Default; mutable data, per-test isolation |
8
+ | `class` | Shared setup for a group of related tests |
9
+ | `module` | Expensive setup (DB, server) used by many tests |
10
+ | `session` | Global resources (config, connections) for entire run |
11
+
12
+ **Avoid:** Session/module scope for mutable state that tests modify. Prefer function scope for isolation.
13
+
14
+ ## Naming Conventions
15
+
16
+ - **Test files:** `test_{module}.py` (e.g., `test_calculator.py`)
17
+ - **Test functions:** `test_{behavior}` (e.g., `test_add_returns_sum`)
18
+ - **Test classes:** `Test{Feature}` (e.g., `TestCalculator`)
19
+ - **Fixtures:** Descriptive names (e.g., `sample_user`, `db_connection`)
20
+
21
+ ## Test Organization
22
+
23
+ 1. **One assert focus per test** — Easier to pinpoint failures
24
+ 2. **Arrange-Act-Assert** — Setup, execute, verify
25
+ 3. **Descriptive names** — `test_returns_404_when_user_not_found` not `test_api`
26
+ 4. **Group related tests** — Use classes or modules
27
+
28
+ ## Test Isolation
29
+
30
+ - Each test should be independent; order should not matter
31
+ - Use `function`-scoped fixtures for mutable data
32
+ - Reset mocks in fixtures or `autouse` teardown
33
+ - Avoid global state; prefer dependency injection via fixtures
34
+
35
+ ## Parametrize vs Multiple Tests
36
+
37
+ Use `@pytest.mark.parametrize` when:
38
+ - Same logic, different inputs/outputs
39
+ - Boundary values, edge cases
40
+ - Table-driven scenarios
41
+
42
+ Use separate tests when:
43
+ - Different setup or behavior
44
+ - Different assertions or error paths
45
+
46
+ ## Mocking Best Practices
47
+
48
+ 1. **Patch where used** — `patch("mymodule.api.call")` not `patch("api.call")`
49
+ 2. **Prefer pytest-mock** — Cleaner lifecycle; auto-restore
50
+ 3. **Mock at boundaries** — External APIs, DB, file I/O
51
+ 4. **Avoid over-mocking** — Test real behavior when practical
52
+
53
+ ## Coverage
54
+
55
+ - Use `pytest-cov` for coverage reports
56
+ - Aim for meaningful coverage; 100% is not always practical
57
+ - Focus on critical paths, error handling, edge cases
58
+ - Run `pytest --cov --cov-report=html` for detailed reports
59
+
60
+ ## Async Tests
61
+
62
+ - Use `pytest-asyncio` with `asyncio_mode = "auto"`
63
+ - Mark async tests: `@pytest.mark.asyncio`
64
+ - Avoid mixing sync and async in same test file without care
65
+
66
+ ## Conftest Hierarchy
67
+
68
+ ```
69
+ project/
70
+ conftest.py # Project-wide fixtures
71
+ tests/
72
+ conftest.py # Test package fixtures
73
+ unit/
74
+ conftest.py # Unit-test-specific
75
+ integration/
76
+ conftest.py # Integration-specific (DB, API)
77
+ ```
78
+
79
+ Place fixtures at the lowest level that needs them.
80
+
81
+ ## Performance
82
+
83
+ - Use `-n auto` (pytest-xdist) for parallel runs
84
+ - Mark slow tests: `@pytest.mark.slow`; exclude with `-m "not slow"`
85
+ - Use module/session fixtures for expensive setup when safe
86
+ - Mock external calls to avoid network/DB latency
87
+
88
+ ## Anti-Patterns to Avoid
89
+
90
+ | Anti-Pattern | Better Approach |
91
+ | ------------ | --------------- |
92
+ | Shared mutable state across tests | Function-scoped fixtures |
93
+ | Asserting implementation details | Assert outcomes and behavior |
94
+ | One giant test with many asserts | Split into focused tests |
95
+ | Hardcoded test data in production paths | Use fixtures, env vars |
96
+ | Skipping tests without reason | Fix or xfail with ticket reference |
97
+ | Patch at definition site | Patch at use site |
@@ -0,0 +1,176 @@
1
+ # Pytest Configuration
2
+
3
+ ## pyproject.toml (Preferred)
4
+
5
+ Modern Python projects use `pyproject.toml`:
6
+
7
+ ```toml
8
+ [tool.pytest.ini_options]
9
+ minversion = "7.0"
10
+ testpaths = ["tests"]
11
+ pythonpath = ["."]
12
+ addopts = "-v --tb=short"
13
+ asyncio_mode = "auto"
14
+ filterwarnings = [
15
+ "ignore::DeprecationWarning",
16
+ "ignore::UserWarning",
17
+ ]
18
+ markers = [
19
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
20
+ "integration: marks integration tests",
21
+ ]
22
+ ```
23
+
24
+ ## pytest.ini (Legacy)
25
+
26
+ ```ini
27
+ [pytest]
28
+ minversion = 7.0
29
+ testpaths = tests
30
+ pythonpath = .
31
+ addopts = -v --tb=short
32
+ markers =
33
+ slow: marks tests as slow
34
+ integration: marks integration tests
35
+ filterwarnings =
36
+ ignore::DeprecationWarning
37
+ ```
38
+
39
+ ## conftest.py
40
+
41
+ Use for fixtures, hooks, and plugin-like behavior. No pytest.ini options here; use for code.
42
+
43
+ ```python
44
+ # conftest.py
45
+ import pytest
46
+
47
+ def pytest_configure(config):
48
+ config.addinivalue_line("markers", "slow: marks tests as slow")
49
+
50
+ @pytest.fixture(scope="session")
51
+ def app():
52
+ from myapp import create_app
53
+ return create_app()
54
+ ```
55
+
56
+ ## Key Options
57
+
58
+ | Option | Description |
59
+ | ------ | ----------- |
60
+ | `testpaths` | Directories to search for tests |
61
+ | `pythonpath` | Paths to add to PYTHONPATH |
62
+ | `addopts` | Default command-line options |
63
+ | `minversion` | Minimum pytest version |
64
+ | `asyncio_mode` | `auto` or `strict` for pytest-asyncio |
65
+ | `filterwarnings` | Suppress or promote warnings |
66
+ | `markers` | Register custom markers |
67
+
68
+ ## Markers
69
+
70
+ ### Registering Markers
71
+
72
+ In pyproject.toml:
73
+
74
+ ```toml
75
+ [tool.pytest.ini_options]
76
+ markers = [
77
+ "slow: marks tests as slow",
78
+ "integration: marks integration tests",
79
+ "unit: marks unit tests",
80
+ ]
81
+ ```
82
+
83
+ ### Using Markers
84
+
85
+ ```python
86
+ @pytest.mark.slow
87
+ def test_heavy():
88
+ pass
89
+
90
+ @pytest.mark.integration
91
+ def test_api():
92
+ pass
93
+ ```
94
+
95
+ ### Running by Marker
96
+
97
+ ```bash
98
+ pytest -m "not slow"
99
+ pytest -m integration
100
+ pytest -m "slow and integration"
101
+ ```
102
+
103
+ ## Plugins
104
+
105
+ ### pytest-cov (Coverage)
106
+
107
+ ```bash
108
+ pip install pytest-cov
109
+ pytest --cov=src --cov-report=html
110
+ ```
111
+
112
+ In config:
113
+
114
+ ```toml
115
+ [tool.pytest.ini_options]
116
+ addopts = "--cov=src --cov-report=term-missing"
117
+ ```
118
+
119
+ ### pytest-xdist (Parallel)
120
+
121
+ ```bash
122
+ pip install pytest-xdist
123
+ pytest -n auto
124
+ ```
125
+
126
+ ### pytest-asyncio
127
+
128
+ ```bash
129
+ pip install pytest-asyncio
130
+ ```
131
+
132
+ ```toml
133
+ [tool.pytest.ini_options]
134
+ asyncio_mode = "auto"
135
+ ```
136
+
137
+ ### pytest-html (Reports)
138
+
139
+ ```bash
140
+ pip install pytest-html
141
+ pytest --html=report.html
142
+ ```
143
+
144
+ ### pytest-factoryboy
145
+
146
+ ```bash
147
+ pip install pytest-factoryboy
148
+ ```
149
+
150
+ Integrates Factory Boy with pytest fixtures for test data factories.
151
+
152
+ ## Hooks (conftest.py)
153
+
154
+ ```python
155
+ def pytest_collection_modifyitems(config, items):
156
+ """Add markers based on path."""
157
+ for item in items:
158
+ if "integration" in str(item.fspath):
159
+ item.add_marker(pytest.mark.integration)
160
+
161
+ def pytest_configure(config):
162
+ """Register markers."""
163
+ config.addinivalue_line("markers", "slow: slow tests")
164
+ ```
165
+
166
+ ## Environment Variables
167
+
168
+ Set in conftest.py or shell:
169
+
170
+ ```python
171
+ # conftest.py
172
+ import os
173
+ os.environ["TESTING"] = "1"
174
+ ```
175
+
176
+ Or use `pytest-env` plugin or `.env` with `python-dotenv`.
@@ -0,0 +1,251 @@
1
+ # Pytest Patterns
2
+
3
+ ## Fixtures
4
+
5
+ ### Basic Fixture
6
+
7
+ ```python
8
+ import pytest
9
+
10
+ @pytest.fixture
11
+ def sample_data():
12
+ return {"key": "value"}
13
+
14
+ def test_with_fixture(sample_data):
15
+ assert sample_data["key"] == "value"
16
+ ```
17
+
18
+ ### Fixture Scopes
19
+
20
+ | Scope | Lifecycle |
21
+ | ----- | --------- |
22
+ | `function` | Default; one per test |
23
+ | `class` | One per test class |
24
+ | `module` | One per test module |
25
+ | `session` | One per test session |
26
+
27
+ ```python
28
+ @pytest.fixture(scope="module")
29
+ def shared_resource():
30
+ resource = create_resource()
31
+ yield resource
32
+ resource.cleanup()
33
+ ```
34
+
35
+ ### autouse Fixtures
36
+
37
+ Run automatically without being requested as a parameter:
38
+
39
+ ```python
40
+ @pytest.fixture(autouse=True)
41
+ def reset_state():
42
+ # Setup
43
+ yield
44
+ # Teardown
45
+ ```
46
+
47
+ ### Fixture with Teardown (yield)
48
+
49
+ ```python
50
+ @pytest.fixture
51
+ def db_connection():
52
+ conn = connect_to_db()
53
+ yield conn
54
+ conn.close()
55
+ ```
56
+
57
+ ### Fixture Composition
58
+
59
+ Fixtures can depend on other fixtures:
60
+
61
+ ```python
62
+ @pytest.fixture
63
+ def base_url():
64
+ return "https://api.example.com"
65
+
66
+ @pytest.fixture
67
+ def api_client(base_url):
68
+ return ApiClient(base_url)
69
+ ```
70
+
71
+ ## Parametrize
72
+
73
+ ### Basic Parametrize
74
+
75
+ ```python
76
+ @pytest.mark.parametrize("a,b,expected", [
77
+ (1, 2, 3),
78
+ (0, 0, 0),
79
+ (-1, 1, 0),
80
+ ])
81
+ def test_add(a, b, expected):
82
+ assert a + b == expected
83
+ ```
84
+
85
+ ### Parametrize with IDs
86
+
87
+ ```python
88
+ @pytest.mark.parametrize("input,expected", [
89
+ ("hello", "HELLO"),
90
+ ("world", "WORLD"),
91
+ ], ids=["uppercase_hello", "uppercase_world"])
92
+ def test_uppercase(input, expected):
93
+ assert input.upper() == expected
94
+ ```
95
+
96
+ ### Parametrize with Fixtures
97
+
98
+ ```python
99
+ @pytest.fixture
100
+ def calculator():
101
+ return Calculator()
102
+
103
+ @pytest.mark.parametrize("a,b,expected", [(1, 2, 3), (4, 5, 9)])
104
+ def test_add(calculator, a, b, expected):
105
+ assert calculator.add(a, b) == expected
106
+ ```
107
+
108
+ ## conftest.py
109
+
110
+ Shared fixtures and configuration. Place in test directory or package:
111
+
112
+ ```
113
+ tests/
114
+ conftest.py # Shared by all tests in tests/
115
+ unit/
116
+ conftest.py # Shared by unit tests only
117
+ test_foo.py
118
+ integration/
119
+ conftest.py
120
+ test_api.py
121
+ ```
122
+
123
+ ```python
124
+ # tests/conftest.py
125
+ import pytest
126
+
127
+ @pytest.fixture
128
+ def app_config():
129
+ return {"env": "test", "debug": True}
130
+ ```
131
+
132
+ ## Markers
133
+
134
+ ### Built-in Markers
135
+
136
+ ```python
137
+ @pytest.mark.skip(reason="Not implemented yet")
138
+ def test_future_feature():
139
+ pass
140
+
141
+ @pytest.mark.skipif(sys.platform == "win32", reason="Unix only")
142
+ def test_unix_only():
143
+ pass
144
+
145
+ @pytest.mark.xfail(reason="Known bug #123")
146
+ def test_known_bug():
147
+ assert False
148
+ ```
149
+
150
+ ### Custom Markers
151
+
152
+ Register in pytest.ini or pyproject.toml:
153
+
154
+ ```ini
155
+ [pytest]
156
+ markers =
157
+ slow: marks tests as slow
158
+ integration: marks integration tests
159
+ ```
160
+
161
+ ```python
162
+ @pytest.mark.slow
163
+ def test_heavy_computation():
164
+ pass
165
+
166
+ @pytest.mark.integration
167
+ def test_api_endpoint():
168
+ pass
169
+ ```
170
+
171
+ ## Async Testing (pytest-asyncio)
172
+
173
+ ```python
174
+ import pytest
175
+
176
+ @pytest.mark.asyncio
177
+ async def test_async_function():
178
+ result = await async_operation()
179
+ assert result == expected
180
+ ```
181
+
182
+ Configure in pyproject.toml:
183
+
184
+ ```toml
185
+ [tool.pytest.ini_options]
186
+ asyncio_mode = "auto"
187
+ ```
188
+
189
+ ## Mocking
190
+
191
+ ### unittest.mock (patch)
192
+
193
+ ```python
194
+ from unittest.mock import patch, MagicMock
195
+
196
+ @patch("mymodule.external_api")
197
+ def test_with_mock(mock_api):
198
+ mock_api.return_value = {"status": "ok"}
199
+ result = mymodule.fetch_data()
200
+ assert result["status"] == "ok"
201
+ mock_api.assert_called_once()
202
+ ```
203
+
204
+ ### pytest-mock (mocker fixture)
205
+
206
+ ```python
207
+ def test_with_mocker(mocker):
208
+ mock_api = mocker.patch("mymodule.external_api", return_value={"status": "ok"})
209
+ result = mymodule.fetch_data()
210
+ assert result["status"] == "ok"
211
+ mock_api.assert_called_once()
212
+ ```
213
+
214
+ ### monkeypatch
215
+
216
+ ```python
217
+ def test_env_var(monkeypatch):
218
+ monkeypatch.setenv("API_KEY", "test-key")
219
+ assert os.environ["API_KEY"] == "test-key"
220
+ # Automatically restored after test
221
+ ```
222
+
223
+ ## tmp_path
224
+
225
+ Built-in fixture for temporary directories:
226
+
227
+ ```python
228
+ def test_write_file(tmp_path):
229
+ file_path = tmp_path / "output.txt"
230
+ file_path.write_text("hello")
231
+ assert file_path.read_text() == "hello"
232
+ ```
233
+
234
+ ## Test Organization
235
+
236
+ ### Test Classes
237
+
238
+ ```python
239
+ class TestCalculator:
240
+ def test_add(self):
241
+ assert 1 + 2 == 3
242
+
243
+ def test_subtract(self):
244
+ assert 5 - 3 == 2
245
+ ```
246
+
247
+ ### Naming Convention
248
+
249
+ - Test files: `test_*.py` or `*_test.py`
250
+ - Test functions: `test_*`
251
+ - Test classes: `Test*` (optional)
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: qa-qase-integration
3
+ description: Qase.io TMS integration for syncing test cases, pushing test run results, and pulling test case updates between local QA workflow and Qase.io projects via REST API.
4
+ dependencies:
5
+ recommended:
6
+ - qa-testcase-from-docs
7
+ - qa-test-reporter
8
+ ---
9
+
10
+ # QA Qase Integration
11
+
12
+ ## Purpose
13
+
14
+ Integrate the QA Skills ecosystem with Qase.io Test Management System. Sync test cases from Phase 2 outputs to Qase.io projects, push test execution results from CI/CD (JUnit XML → Qase runs), and pull test case updates back into local markdown/JSON for bidirectional traceability.
15
+
16
+ ## Features
17
+
18
+ | Feature | Description |
19
+ | ------- | ----------- |
20
+ | **Sync test cases** | Push Phase 2 test case outputs (from qa-testcase-from-docs, qa-testcase-from-ui) to Qase.io projects |
21
+ | **Push test results** | Map JUnit XML (and similar) to Qase test runs; create runs and post results |
22
+ | **Pull updates** | Fetch test case changes from Qase.io into local markdown/JSON |
23
+ | **Manage suites** | Create/update test suites and organize cases |
24
+ | **Manage runs** | Create test runs, post results, track execution status |
25
+ | **Manage defects** | Create defects from failed results; link to test cases |
26
+
27
+ ## API Configuration
28
+
29
+ | Setting | Value |
30
+ | ------- | ----- |
31
+ | **Base URL** | `https://api.qase.io/v1` |
32
+ | **Authentication** | `Token: {QASE_API_TOKEN}` header |
33
+ | **Token source** | `.env` file — never hardcode |
34
+ | **Rate limits** | 1,000 req/min per user; 3,000 req/min per IP |
35
+
36
+ See `references/api-reference.md` for full endpoint details.
37
+
38
+ ## Key Endpoints
39
+
40
+ | Resource | Method | Path |
41
+ | -------- | ------ | ---- |
42
+ | Projects | GET, POST | `/project` |
43
+ | Test Suites | GET, POST | `/suite/{code}` |
44
+ | Test Cases | GET, POST, PATCH | `/case/{code}` |
45
+ | Test Runs | GET, POST | `/run/{code}` |
46
+ | Test Results | POST | `/result/{code}/{run_id}` |
47
+ | Defects | GET, POST | `/defect/{code}` |
48
+
49
+ `{code}` = project code (2–10 chars).
50
+
51
+ ## Workflow
52
+
53
+ ```
54
+ Generate test cases (Phase 2) → Sync to Qase.io → Run tests → Push results → Track defects
55
+ ```
56
+
57
+ 1. **Generate** — Use qa-testcase-from-docs, qa-testcase-from-ui, or qa-manual-test-designer to produce test cases.
58
+ 2. **Sync** — Map local format to Qase.io fields; create/update suites and cases.
59
+ 3. **Run** — Execute tests in CI/CD (Jest, pytest, Playwright, etc.).
60
+ 4. **Push** — Parse JUnit XML (or qase-api reporter output); create run; post results.
61
+ 5. **Track** — Create defects from failures; link to cases and runs.
62
+
63
+ See `references/field-mapping.md` for local → Qase field mapping.
64
+
65
+ ## Field Mapping Summary
66
+
67
+ | Local Field | Qase.io Field |
68
+ | ----------- | ------------- |
69
+ | title | title |
70
+ | description | description |
71
+ | preconditions | preconditions |
72
+ | steps (Action \| Expected) | steps[].action, steps[].expected_result |
73
+ | priority | priority (enum) |
74
+ | severity | severity (enum) |
75
+ | type | type (enum) |
76
+ | automation status | automation (enum) |
77
+
78
+ Full mapping and enums in `references/field-mapping.md`.
79
+
80
+ ## Integrations
81
+
82
+ | Skill | Use |
83
+ | ----- | --- |
84
+ | **qa-testcase-from-docs** | Source of test cases to sync |
85
+ | **qa-testcase-from-ui** | Source of test cases to sync |
86
+ | **qa-manual-test-designer** | Source of manual test cases |
87
+ | **qa-test-reporter** | JUnit XML parsing, report aggregation |
88
+ | **qa-bug-ticket-creator** | Defect creation patterns; optionally link Qase defects to GitHub |
89
+ | **qa-orchestrator** | Pipeline coordination (docs → cases → sync → run → report) |
90
+
91
+ ## Trigger Phrases
92
+
93
+ - "Sync test cases to Qase.io"
94
+ - "Push JUnit results to Qase"
95
+ - "Create Qase run from test output"
96
+ - "Pull test cases from Qase.io"
97
+ - "Map local test cases to Qase format"
98
+ - "Create defect in Qase from failed test"
99
+
100
+ ## Scope
101
+
102
+ **Can do (autonomous):**
103
+ - Sync test cases from local markdown/JSON to Qase.io
104
+ - Create/update test suites and test cases
105
+ - Create test runs and post results from JUnit XML
106
+ - Map local format to Qase fields per `references/field-mapping.md`
107
+ - Create defects from failed results
108
+ - Pull test case updates into local format
109
+
110
+ **Cannot do (requires confirmation):**
111
+ - Modify Qase.io project settings (roles, custom fields, integrations)
112
+ - Bulk delete test cases or suites
113
+ - Change project code or workspace
114
+
115
+ **Will not do (out of scope):**
116
+ - Delete Qase.io projects
117
+ - Modify billing or subscription
118
+ - Access Qase.io UI or perform manual actions
119
+
120
+ ## Quality Checklist
121
+
122
+ Before syncing or pushing:
123
+
124
+ - [ ] `QASE_API_TOKEN` present in `.env`; never in code
125
+ - [ ] Project code valid (2–10 chars, matches target project)
126
+ - [ ] Local test case format matches mapping in `references/field-mapping.md`
127
+ - [ ] JUnit XML (or equivalent) parseable; test names mappable to Qase cases
128
+ - [ ] Rate limits considered for bulk operations (batch if needed)
129
+ - [ ] Idempotency: check for existing case/run before create where appropriate
130
+
131
+ ## Troubleshooting
132
+
133
+ | Symptom | Likely Cause | Fix |
134
+ | ------- | ------------ | --- |
135
+ | 401 Unauthorized | Missing or invalid token | Verify `QASE_API_TOKEN` in `.env`; check token at app.qase.io/user/api/token |
136
+ | 403 Forbidden | Insufficient permissions | Verify role has required access; see Qase RBAC docs |
137
+ | 404 Not Found | Invalid project code or ID | Confirm project code (2–10 chars); verify run/case/suite IDs exist |
138
+ | 422 Unprocessable | Invalid field values | Check `references/field-mapping.md` for valid enums; validate request body |
139
+ | 429 Too Many Requests | Rate limit exceeded | Implement backoff; batch requests; respect Retry-After header |
140
+ | Case not found when pushing results | Case ID mismatch | Map JUnit test name to Qase case_id; use case title matching or external IDs |
141
+ | Duplicate cases on sync | No deduplication | Match by title+suite or custom ID; update existing instead of create |
142
+
143
+ ## References
144
+
145
+ | Topic | File |
146
+ | ----- | ---- |
147
+ | API endpoints, request/response examples | `references/api-reference.md` |
148
+ | Local ↔ Qase field mapping, enums | `references/field-mapping.md` |
149
+ | CI/CD integration (GitHub Actions, qase-api) | `references/ci-integration.md` |