qa-skills 3.0.0 → 3.1.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 +20 -149
  2. package/bin/cli.js +1 -40
  3. package/package.json +23 -26
  4. package/dist/agents/registry.d.ts +0 -5
  5. package/dist/agents/registry.d.ts.map +0 -1
  6. package/dist/agents/registry.js +0 -101
  7. package/dist/agents/registry.js.map +0 -1
  8. package/dist/agents/types.d.ts +0 -9
  9. package/dist/agents/types.d.ts.map +0 -1
  10. package/dist/agents/types.js +0 -2
  11. package/dist/agents/types.js.map +0 -1
  12. package/dist/dependencies.d.ts +0 -21
  13. package/dist/dependencies.d.ts.map +0 -1
  14. package/dist/dependencies.js +0 -125
  15. package/dist/dependencies.js.map +0 -1
  16. package/dist/installer.d.ts +0 -25
  17. package/dist/installer.d.ts.map +0 -1
  18. package/dist/installer.js +0 -437
  19. package/dist/installer.js.map +0 -1
  20. package/dist/scaffold.d.ts +0 -27
  21. package/dist/scaffold.d.ts.map +0 -1
  22. package/dist/scaffold.js +0 -182
  23. package/dist/scaffold.js.map +0 -1
  24. package/skills/qa-accessibility-test-writer/SKILL.md +0 -127
  25. package/skills/qa-accessibility-test-writer/references/axe-core-patterns.md +0 -349
  26. package/skills/qa-accessibility-test-writer/references/best-practices.md +0 -184
  27. package/skills/qa-accessibility-test-writer/references/wcag-tests.md +0 -331
  28. package/skills/qa-api-contract-curator/SKILL.md +0 -104
  29. package/skills/qa-api-contract-curator/references/breaking-changes.md +0 -363
  30. package/skills/qa-api-contract-curator/references/openapi-structure.md +0 -404
  31. package/skills/qa-browser-data-collector/SKILL.md +0 -132
  32. package/skills/qa-browser-data-collector/references/data-collection-checklist.md +0 -91
  33. package/skills/qa-browser-data-collector/references/playwright-mcp-patterns.md +0 -113
  34. package/skills/qa-bug-ticket-creator/SKILL.md +0 -148
  35. package/skills/qa-bug-ticket-creator/references/bug-report-format.md +0 -149
  36. package/skills/qa-bug-ticket-creator/references/severity-guide.md +0 -81
  37. package/skills/qa-bug-ticket-creator/templates/bug-ticket-template.md +0 -39
  38. package/skills/qa-changelog-analyzer/SKILL.md +0 -134
  39. package/skills/qa-changelog-analyzer/references/git-analysis-patterns.md +0 -138
  40. package/skills/qa-changelog-analyzer/references/impact-mapping.md +0 -120
  41. package/skills/qa-clickup-integration/SKILL.md +0 -166
  42. package/skills/qa-clickup-integration/references/api-patterns.md +0 -102
  43. package/skills/qa-clickup-integration/references/field-mapping.md +0 -71
  44. package/skills/qa-codeceptjs-writer/SKILL.md +0 -136
  45. package/skills/qa-codeceptjs-writer/references/best-practices.md +0 -207
  46. package/skills/qa-codeceptjs-writer/references/config.md +0 -255
  47. package/skills/qa-codeceptjs-writer/references/patterns.md +0 -285
  48. package/skills/qa-coverage-analyzer/SKILL.md +0 -166
  49. package/skills/qa-coverage-analyzer/references/best-practices.md +0 -142
  50. package/skills/qa-coverage-analyzer/references/coverage-dimensions.md +0 -155
  51. package/skills/qa-coverage-analyzer/references/tools.md +0 -204
  52. package/skills/qa-cypress-writer/SKILL.md +0 -134
  53. package/skills/qa-cypress-writer/references/assertions.md +0 -121
  54. package/skills/qa-cypress-writer/references/best-practices.md +0 -82
  55. package/skills/qa-cypress-writer/references/config.md +0 -121
  56. package/skills/qa-cypress-writer/references/patterns.md +0 -170
  57. package/skills/qa-data-factory/SKILL.md +0 -126
  58. package/skills/qa-data-factory/references/factory-patterns.md +0 -164
  59. package/skills/qa-data-factory/references/faker-guide.md +0 -131
  60. package/skills/qa-diagram-generator/SKILL.md +0 -125
  61. package/skills/qa-diagram-generator/references/c4-model.md +0 -53
  62. package/skills/qa-diagram-generator/references/charts.md +0 -58
  63. package/skills/qa-diagram-generator/references/class-diagram.md +0 -85
  64. package/skills/qa-diagram-generator/references/er-diagram.md +0 -69
  65. package/skills/qa-diagram-generator/references/flowchart.md +0 -92
  66. package/skills/qa-diagram-generator/references/from-screenshot.md +0 -45
  67. package/skills/qa-diagram-generator/references/gantt.md +0 -49
  68. package/skills/qa-diagram-generator/references/journey.md +0 -50
  69. package/skills/qa-diagram-generator/references/mindmap.md +0 -75
  70. package/skills/qa-diagram-generator/references/sequence.md +0 -69
  71. package/skills/qa-diagram-generator/references/state-diagram.md +0 -56
  72. package/skills/qa-discovery-interview/SKILL.md +0 -182
  73. package/skills/qa-discovery-interview/references/completeness-checklist.md +0 -53
  74. package/skills/qa-discovery-interview/references/conflict-patterns.md +0 -101
  75. package/skills/qa-discovery-interview/references/qa-categories.md +0 -147
  76. package/skills/qa-discovery-interview/templates/qa-brief-template.md +0 -168
  77. package/skills/qa-environment-checker/SKILL.md +0 -142
  78. package/skills/qa-environment-checker/references/dependency-matrix.md +0 -101
  79. package/skills/qa-environment-checker/references/health-checks.md +0 -209
  80. package/skills/qa-environment-checker/templates/env-readiness-template.md +0 -64
  81. package/skills/qa-flaky-detector/SKILL.md +0 -153
  82. package/skills/qa-flaky-detector/references/ci-analysis.md +0 -140
  83. package/skills/qa-flaky-detector/references/flaky-patterns.md +0 -247
  84. package/skills/qa-github-issues-enhanced/SKILL.md +0 -175
  85. package/skills/qa-github-issues-enhanced/references/issue-templates.md +0 -425
  86. package/skills/qa-github-issues-enhanced/references/label-taxonomy.md +0 -130
  87. package/skills/qa-github-issues-enhanced/references/workflow-patterns.md +0 -188
  88. package/skills/qa-httpx-writer/SKILL.md +0 -138
  89. package/skills/qa-httpx-writer/references/assertions.md +0 -195
  90. package/skills/qa-httpx-writer/references/best-practices.md +0 -140
  91. package/skills/qa-httpx-writer/references/config.md +0 -212
  92. package/skills/qa-httpx-writer/references/patterns.md +0 -262
  93. package/skills/qa-jest-writer/SKILL.md +0 -131
  94. package/skills/qa-jest-writer/references/assertions.md +0 -125
  95. package/skills/qa-jest-writer/references/best-practices.md +0 -136
  96. package/skills/qa-jest-writer/references/config.md +0 -134
  97. package/skills/qa-jest-writer/references/patterns.md +0 -172
  98. package/skills/qa-jira-integration/SKILL.md +0 -135
  99. package/skills/qa-jira-integration/references/api-patterns.md +0 -143
  100. package/skills/qa-jira-integration/references/field-mapping.md +0 -79
  101. package/skills/qa-jira-integration/references/xray-integration.md +0 -85
  102. package/skills/qa-jmeter-writer/SKILL.md +0 -171
  103. package/skills/qa-jmeter-writer/references/best-practices.md +0 -157
  104. package/skills/qa-jmeter-writer/references/config.md +0 -204
  105. package/skills/qa-jmeter-writer/references/patterns.md +0 -242
  106. package/skills/qa-junit5-writer/SKILL.md +0 -157
  107. package/skills/qa-junit5-writer/references/assertions.md +0 -118
  108. package/skills/qa-junit5-writer/references/config.md +0 -97
  109. package/skills/qa-junit5-writer/references/patterns.md +0 -162
  110. package/skills/qa-k6-writer/SKILL.md +0 -155
  111. package/skills/qa-k6-writer/references/best-practices.md +0 -236
  112. package/skills/qa-k6-writer/references/config.md +0 -219
  113. package/skills/qa-k6-writer/references/patterns.md +0 -304
  114. package/skills/qa-linear-integration/SKILL.md +0 -137
  115. package/skills/qa-linear-integration/references/api-patterns.md +0 -249
  116. package/skills/qa-linear-integration/references/field-mapping.md +0 -121
  117. package/skills/qa-locust-writer/SKILL.md +0 -151
  118. package/skills/qa-locust-writer/references/best-practices.md +0 -126
  119. package/skills/qa-locust-writer/references/config.md +0 -170
  120. package/skills/qa-locust-writer/references/patterns.md +0 -235
  121. package/skills/qa-manual-test-designer/SKILL.md +0 -145
  122. package/skills/qa-manual-test-designer/references/exploratory-charters.md +0 -138
  123. package/skills/qa-manual-test-designer/references/personas.md +0 -146
  124. package/skills/qa-manual-test-designer/templates/exploratory-charter-template.md +0 -47
  125. package/skills/qa-manual-test-designer/templates/test-case-template.md +0 -31
  126. package/skills/qa-mobile-test-writer/SKILL.md +0 -144
  127. package/skills/qa-mobile-test-writer/references/best-practices.md +0 -214
  128. package/skills/qa-mobile-test-writer/references/config.md +0 -309
  129. package/skills/qa-mobile-test-writer/references/patterns.md +0 -304
  130. package/skills/qa-nfr-analyst/SKILL.md +0 -177
  131. package/skills/qa-nfr-analyst/references/iso-25010-model.md +0 -159
  132. package/skills/qa-nfr-analyst/references/owasp-wstg-baseline.md +0 -202
  133. package/skills/qa-nfr-analyst/references/wcag-checklist.md +0 -184
  134. package/skills/qa-nfr-analyst/templates/owasp-checklist-template.md +0 -89
  135. package/skills/qa-nfr-analyst/templates/wcag-checklist-template.md +0 -48
  136. package/skills/qa-orchestrator/SKILL.md +0 -132
  137. package/skills/qa-orchestrator/references/handoff-chains.md +0 -105
  138. package/skills/qa-orchestrator/references/pipeline-modes.md +0 -115
  139. package/skills/qa-orchestrator/references/scheduler-rules.md +0 -84
  140. package/skills/qa-pact-writer/SKILL.md +0 -133
  141. package/skills/qa-pact-writer/references/best-practices.md +0 -100
  142. package/skills/qa-pact-writer/references/config.md +0 -135
  143. package/skills/qa-pact-writer/references/patterns.md +0 -161
  144. package/skills/qa-plan-creator/SKILL.md +0 -139
  145. package/skills/qa-plan-creator/references/introduction-plan.md +0 -43
  146. package/skills/qa-plan-creator/references/migration-plan.md +0 -44
  147. package/skills/qa-plan-creator/references/onboarding-plan.md +0 -46
  148. package/skills/qa-plan-creator/references/performance-plan.md +0 -44
  149. package/skills/qa-plan-creator/references/regression-plan.md +0 -45
  150. package/skills/qa-plan-creator/references/release-plan.md +0 -45
  151. package/skills/qa-plan-creator/references/sprint-plan.md +0 -44
  152. package/skills/qa-plan-creator/references/test-plan.md +0 -59
  153. package/skills/qa-plan-creator/references/uat-plan.md +0 -43
  154. package/skills/qa-plan-creator/templates/checklist-template.md +0 -36
  155. package/skills/qa-plan-creator/templates/regression-checklist-template.md +0 -49
  156. package/skills/qa-plan-creator/templates/release-checklist-template.md +0 -46
  157. package/skills/qa-plan-creator/templates/test-plan-template.md +0 -74
  158. package/skills/qa-playwright-py-writer/SKILL.md +0 -156
  159. package/skills/qa-playwright-py-writer/references/best-practices.md +0 -194
  160. package/skills/qa-playwright-py-writer/references/config.md +0 -195
  161. package/skills/qa-playwright-py-writer/references/patterns.md +0 -212
  162. package/skills/qa-playwright-ts-writer/SKILL.md +0 -151
  163. package/skills/qa-playwright-ts-writer/references/assertions.md +0 -109
  164. package/skills/qa-playwright-ts-writer/references/best-practices.md +0 -191
  165. package/skills/qa-playwright-ts-writer/references/config.md +0 -144
  166. package/skills/qa-playwright-ts-writer/references/patterns.md +0 -171
  167. package/skills/qa-pytest-writer/SKILL.md +0 -145
  168. package/skills/qa-pytest-writer/references/assertions.md +0 -149
  169. package/skills/qa-pytest-writer/references/best-practices.md +0 -97
  170. package/skills/qa-pytest-writer/references/config.md +0 -176
  171. package/skills/qa-pytest-writer/references/patterns.md +0 -251
  172. package/skills/qa-qase-integration/SKILL.md +0 -149
  173. package/skills/qa-qase-integration/references/api-reference.md +0 -354
  174. package/skills/qa-qase-integration/references/ci-integration.md +0 -196
  175. package/skills/qa-qase-integration/references/field-mapping.md +0 -157
  176. package/skills/qa-requirements-generator/SKILL.md +0 -152
  177. package/skills/qa-requirements-generator/references/iso-29148-structure.md +0 -153
  178. package/skills/qa-requirements-generator/references/requirement-patterns.md +0 -278
  179. package/skills/qa-rest-assured-writer/SKILL.md +0 -137
  180. package/skills/qa-rest-assured-writer/references/best-practices.md +0 -50
  181. package/skills/qa-rest-assured-writer/references/config.md +0 -124
  182. package/skills/qa-rest-assured-writer/references/patterns.md +0 -192
  183. package/skills/qa-risk-analyzer/SKILL.md +0 -158
  184. package/skills/qa-risk-analyzer/references/impact-analysis.md +0 -133
  185. package/skills/qa-risk-analyzer/references/risk-factors.md +0 -123
  186. package/skills/qa-robot-framework-writer/SKILL.md +0 -147
  187. package/skills/qa-robot-framework-writer/references/best-practices.md +0 -249
  188. package/skills/qa-robot-framework-writer/references/config.md +0 -204
  189. package/skills/qa-robot-framework-writer/references/libraries.md +0 -273
  190. package/skills/qa-robot-framework-writer/references/patterns.md +0 -216
  191. package/skills/qa-security-test-writer/SKILL.md +0 -123
  192. package/skills/qa-security-test-writer/references/best-practices.md +0 -155
  193. package/skills/qa-security-test-writer/references/owasp-top10.md +0 -331
  194. package/skills/qa-security-test-writer/references/zap-config.md +0 -258
  195. package/skills/qa-selenium-java-writer/SKILL.md +0 -143
  196. package/skills/qa-selenium-java-writer/references/best-practices.md +0 -59
  197. package/skills/qa-selenium-java-writer/references/config.md +0 -143
  198. package/skills/qa-selenium-java-writer/references/patterns.md +0 -170
  199. package/skills/qa-selenium-py-writer/SKILL.md +0 -150
  200. package/skills/qa-selenium-py-writer/references/best-practices.md +0 -175
  201. package/skills/qa-selenium-py-writer/references/config.md +0 -224
  202. package/skills/qa-selenium-py-writer/references/patterns.md +0 -255
  203. package/skills/qa-shortcut-integration/SKILL.md +0 -143
  204. package/skills/qa-shortcut-integration/references/api-patterns.md +0 -126
  205. package/skills/qa-shortcut-integration/references/field-mapping.md +0 -66
  206. package/skills/qa-spec-auditor/SKILL.md +0 -162
  207. package/skills/qa-spec-auditor/references/audit-checklist.md +0 -144
  208. package/skills/qa-spec-auditor/references/drift-patterns.md +0 -207
  209. package/skills/qa-spec-writer/SKILL.md +0 -143
  210. package/skills/qa-spec-writer/references/gherkin-guide.md +0 -253
  211. package/skills/qa-spec-writer/references/specification-patterns.md +0 -274
  212. package/skills/qa-spring-test-writer/SKILL.md +0 -170
  213. package/skills/qa-spring-test-writer/references/best-practices.md +0 -57
  214. package/skills/qa-spring-test-writer/references/config.md +0 -179
  215. package/skills/qa-spring-test-writer/references/patterns.md +0 -235
  216. package/skills/qa-supertest-writer/SKILL.md +0 -150
  217. package/skills/qa-supertest-writer/references/assertions.md +0 -192
  218. package/skills/qa-supertest-writer/references/best-practices.md +0 -102
  219. package/skills/qa-supertest-writer/references/config.md +0 -166
  220. package/skills/qa-supertest-writer/references/patterns.md +0 -242
  221. package/skills/qa-task-creator/SKILL.md +0 -142
  222. package/skills/qa-task-creator/references/linking-patterns.md +0 -127
  223. package/skills/qa-task-creator/references/task-types.md +0 -169
  224. package/skills/qa-task-creator/templates/task-template.md +0 -24
  225. package/skills/qa-test-doc-compiler/SKILL.md +0 -114
  226. package/skills/qa-test-doc-compiler/references/agile-tailoring.md +0 -220
  227. package/skills/qa-test-doc-compiler/references/iso-29119-3-documents.md +0 -302
  228. package/skills/qa-test-healer/SKILL.md +0 -101
  229. package/skills/qa-test-healer/references/diagnosis-patterns.md +0 -142
  230. package/skills/qa-test-healer/references/fix-strategies.md +0 -177
  231. package/skills/qa-test-reporter/SKILL.md +0 -130
  232. package/skills/qa-test-reporter/references/best-practices.md +0 -162
  233. package/skills/qa-test-reporter/references/iso-29119-reports.md +0 -236
  234. package/skills/qa-test-reporter/references/report-formats.md +0 -287
  235. package/skills/qa-test-reviewer/SKILL.md +0 -142
  236. package/skills/qa-test-reviewer/references/anti-patterns.md +0 -268
  237. package/skills/qa-test-reviewer/references/review-checklist.md +0 -93
  238. package/skills/qa-test-strategy/SKILL.md +0 -133
  239. package/skills/qa-test-strategy/references/entry-exit-criteria.md +0 -176
  240. package/skills/qa-test-strategy/references/risk-matrix.md +0 -102
  241. package/skills/qa-test-strategy/references/testing-types.md +0 -143
  242. package/skills/qa-testcase-from-docs/SKILL.md +0 -161
  243. package/skills/qa-testcase-from-docs/references/test-case-format.md +0 -196
  244. package/skills/qa-testcase-from-docs/references/test-design-techniques.md +0 -126
  245. package/skills/qa-testcase-from-docs/templates/test-case-template.md +0 -31
  246. package/skills/qa-testcase-from-ui/SKILL.md +0 -109
  247. package/skills/qa-testcase-from-ui/references/ui-element-patterns.md +0 -126
  248. package/skills/qa-testcase-from-ui/references/visual-analysis-guide.md +0 -146
  249. package/skills/qa-testcase-from-ui/templates/test-case-template.md +0 -31
  250. package/skills/qa-visual-regression-writer/SKILL.md +0 -175
  251. package/skills/qa-visual-regression-writer/references/best-practices.md +0 -154
  252. package/skills/qa-visual-regression-writer/references/config.md +0 -220
  253. package/skills/qa-visual-regression-writer/references/patterns.md +0 -213
  254. package/skills/qa-vitest-writer/SKILL.md +0 -141
  255. package/skills/qa-vitest-writer/references/assertions.md +0 -105
  256. package/skills/qa-vitest-writer/references/best-practices.md +0 -62
  257. package/skills/qa-vitest-writer/references/config.md +0 -127
  258. package/skills/qa-vitest-writer/references/patterns.md +0 -141
  259. package/skills/qa-webdriverio-writer/SKILL.md +0 -145
  260. package/skills/qa-webdriverio-writer/references/best-practices.md +0 -176
  261. package/skills/qa-webdriverio-writer/references/config.md +0 -240
  262. package/skills/qa-webdriverio-writer/references/patterns.md +0 -269
@@ -1,97 +0,0 @@
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 |
@@ -1,176 +0,0 @@
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`.
@@ -1,251 +0,0 @@
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)
@@ -1,149 +0,0 @@
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` |