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,74 +0,0 @@
1
- # Test Plan — {Project/Release Name}
2
-
3
- **Document ID:** {TP-XXX}
4
- **Version:** {1.0}
5
- **Date:** {YYYY-MM-DD}
6
- **Author:** {name}
7
-
8
- ---
9
-
10
- ## 1. Introduction
11
-
12
- ### 1.1 Purpose
13
- {Purpose of this test plan and intended audience}
14
-
15
- ### 1.2 Scope
16
- {In-scope and out-of-scope items}
17
-
18
- ### 1.3 References
19
- - {Standard or document reference}
20
- - {Requirements document}
21
- - {Design specification}
22
-
23
- ---
24
-
25
- ## 2. Test Items
26
- {List of software items/features under test}
27
-
28
- ## 3. Features to Test
29
- {Features and functionality included in test scope}
30
-
31
- ## 4. Features NOT to Test
32
- {Explicitly excluded features with rationale}
33
-
34
- ## 5. Test Approach
35
- {Test strategy, techniques, tools, and coverage approach}
36
-
37
- ## 6. Entry Criteria
38
- - {Criterion 1}
39
- - {Criterion 2}
40
-
41
- ## 7. Exit Criteria
42
- - {Criterion 1}
43
- - {Criterion 2}
44
-
45
- ## 8. Test Environment
46
- {Environment description, hardware, software, test data}
47
-
48
- ## 9. Schedule
49
- | Phase | Start | End | Deliverable |
50
- |-------|-------|-----|-------------|
51
- | {Phase 1} | {date} | {date} | {deliverable} |
52
- | {Phase 2} | {date} | {date} | {deliverable} |
53
-
54
- *Gantt: [Insert Gantt diagram placeholder]*
55
-
56
- ## 10. Resources
57
- | Role | Name | Responsibility |
58
- |------|------|----------------|
59
- | {Role} | {Name} | {Responsibility} |
60
-
61
- ## 11. Risks and Mitigations
62
- | Risk | Impact | Mitigation |
63
- |------|--------|------------|
64
- | {Risk} | {High/Med/Low} | {Mitigation} |
65
-
66
- ## 12. Deliverables
67
- - {Test specifications}
68
- - {Test execution logs}
69
- - {Test completion report}
70
-
71
- ## 13. Approval
72
- | Role | Name | Date | Signature |
73
- |------|------|------|-----------|
74
- | {Approver} | {Name} | {date} | |
@@ -1,156 +0,0 @@
1
- ---
2
- name: qa-playwright-py-writer
3
- description: Generate Playwright E2E tests for Python with async/sync API, pytest-playwright integration, POM pattern, and live browser record mode via Playwright MCP.
4
- output_dir: tests/e2e
5
- ---
6
-
7
- # QA Playwright Python Writer
8
-
9
- ## Purpose
10
-
11
- Write Playwright E2E tests for Python from test case specifications. Transform structured test cases into executable Playwright Python test files with pytest-playwright, Page Object Model, auto-waiting, multi-browser support, and optional live browser record mode.
12
-
13
- ## Trigger Phrases
14
-
15
- - "Write Playwright Python tests for [feature/flow]"
16
- - "Generate Playwright E2E tests in Python"
17
- - "Create pytest-playwright tests"
18
- - "Add Playwright tests with record mode (Python)"
19
- - "Playwright Python tests for [URL/flow]"
20
- - "POM-based Playwright tests in Python"
21
- - "pytest-playwright tests for [page]"
22
- - "Heal my failing Playwright Python tests"
23
-
24
- ## Three Modes
25
-
26
- | Mode | When to Use | Behavior |
27
- |------|-------------|----------|
28
- | **Record Mode** | User wants live browser capture | Use Playwright MCP (e.g., cursor-ide-browser) → navigate, interact, capture interactions → generate Python test code from recorded steps |
29
- | **Generate Mode** | Default; from test case specs | Read test cases (from qa-testcase-from-docs, qa-testcase-from-ui, qa-manual-test-designer) → generate Playwright Python code |
30
- | **Heal Mode** | Tests fail after changes | Delegate to **qa-test-healer** to auto-fix broken selectors, assertions, waits; mark unfixable as `pytest.mark.skip` |
31
-
32
- ## Key Features
33
-
34
- | Feature | Description |
35
- |---------|-------------|
36
- | **Sync/Async API** | Default sync API; async via `playwright_pytest_asyncio = True` in pytest config |
37
- | **pytest-playwright** | Fixtures: `page`, `browser`, `context`, `playwright`; integrates with pytest |
38
- | **POM pattern** | Base page classes, page-specific classes, component objects |
39
- | **Auto-wait** | Playwright auto-waits for elements; avoid `page.wait_for_timeout` |
40
- | **Multi-browser** | Chromium, Firefox, WebKit via pytest-playwright browser options |
41
- | **Network interception** | `page.route` for API mocking, request/response handling |
42
-
43
- ## Workflow
44
-
45
- 1. **Read test cases** — From specs, requirements, or manual test designs
46
- 2. **Analyze app** — Inspect pages, flows, selectors (or use Record Mode)
47
- 3. **Generate tests** — Produce `test_{feature}.py` with POM where appropriate
48
- 4. **Configure** — Add/update `conftest.py`, `pytest.ini` or `pyproject.toml`
49
- 5. **Run** — User runs `pytest` to execute tests
50
-
51
- ## E2E Testing
52
-
53
- - **Navigation:** `page.goto()`, `page.go_back()`, `page.reload()`
54
- - **Interactions:** `click()`, `fill()`, `select_option()`, `check()`, `hover()`, `press()`
55
- - **Assertions:** `expect(locator).to_be_visible()`, `to_have_text()`, `to_have_url()`, etc.
56
- - **Network:** `page.route()` for API mocking, request/response interception
57
- - **Auto-wait:** Playwright auto-waits; avoid `page.wait_for_timeout()`
58
-
59
- See `references/patterns.md` for navigation, forms, auth, file upload, drag-drop, iframes, multi-tab, API mocking, visual comparison.
60
-
61
- ## Page Object Model (POM)
62
-
63
- - **Base page:** Shared selectors, navigation helpers, common actions
64
- - **Page-specific:** Extend base; encapsulate page-specific locators and methods
65
- - **Component objects:** Reusable components (header, modal, form) as classes
66
-
67
- See `references/best-practices.md` for POM structure.
68
-
69
- ## Key Patterns
70
-
71
- - **Structure:** `def test_*()` functions; `pytest.mark` for grouping; `conftest.py` for fixtures
72
- - **Locators:** `get_by_role` > `get_by_test_id` > `get_by_text` > `get_by_label` > CSS selector
73
- - **Assertions:** `expect(locator).to_be_visible()`, `to_have_text()`, `to_have_url()`, `to_have_count()`, etc.
74
- - **Network:** `page.route(url, handler)` for mocking; `page.unroute()` to clear
75
- - **Fixtures:** `page`, `browser`, `context`, `playwright` from pytest-playwright; custom fixtures in conftest.py
76
-
77
- See `references/patterns.md` for full pattern reference.
78
-
79
- ## Locator Priority
80
-
81
- 1. **get_by_role** — Accessibility-based; most resilient
82
- 2. **get_by_test_id** — `data-testid`; explicit, stable
83
- 3. **get_by_text** — Visible text; use for unique labels
84
- 4. **get_by_label** — Form labels; good for inputs
85
- 5. **CSS selector** — Last resort; brittle for dynamic content
86
-
87
- ## File Naming
88
-
89
- - **Tests:** `test_{feature}.py` (e.g., `test_login.py`, `test_checkout.py`)
90
- - **Fixtures:** `conftest.py` in test directory or package root
91
- - **Page objects:** `pages/` or `page_objects/` directory
92
-
93
- ## Configuration
94
-
95
- - **pytest.ini** / **pyproject.toml** — pytest options, markers, playwright settings
96
- - **conftest.py** — Shared fixtures, base URL, browser options
97
- - **pytest-playwright** — Provides `page`, `browser`, `context` fixtures
98
-
99
- See `references/config.md` for full config guide.
100
-
101
- ## MCP Integration
102
-
103
- - **Context7 MCP** — Fetch Playwright Python documentation when needed
104
- - **Playwright MCP** (cursor-ide-browser, @playwright/mcp) — Record mode: navigate, snapshot, click, type; capture interactions → generate Python test code
105
-
106
- ## Scope
107
-
108
- **Can do (autonomous):**
109
- - Generate Playwright E2E tests in Python from test case specs
110
- - Use Record Mode with Playwright MCP to capture and generate tests
111
- - Apply POM pattern, stable locators, auto-wait
112
- - Configure conftest.py, pytest.ini, pyproject.toml for pytest-playwright
113
- - Use `page.route()` for API mocking
114
- - Delegate to qa-test-healer when tests fail (Heal Mode)
115
- - Use Context7 MCP for Playwright Python docs
116
-
117
- **Cannot do (requires confirmation):**
118
- - Change production code structure
119
- - Add dependencies not in requirements.txt / pyproject.toml
120
- - Override project pytest/playwright config without approval
121
- - Navigate to URLs not provided (Record Mode)
122
-
123
- **Will not do (out of scope):**
124
- - Execute tests (user runs `pytest`)
125
- - Write pytest unit tests without Playwright (use qa-pytest-writer)
126
- - Modify CI/CD pipelines
127
- - Bypass security or access restricted areas
128
-
129
- ## References
130
-
131
- - `references/patterns.md` — Sync vs async, pytest fixtures, POM, network mocking
132
- - `references/config.md` — pytest-playwright, conftest.py, pytest.ini, browser config
133
- - `references/best-practices.md` — POM, locators, async patterns, test isolation
134
-
135
- ## Quality Checklist
136
-
137
- - [ ] Auto-wait used; no `page.wait_for_timeout` (use `expect` with timeout or `wait_for`)
138
- - [ ] No hardcoded waits; prefer `expect` auto-retry
139
- - [ ] POM pattern applied for page-specific logic
140
- - [ ] Stable locators (get_by_role, get_by_test_id preferred)
141
- - [ ] Tests independent (no shared state, order-independent)
142
- - [ ] Proper teardown (fixtures, conftest if needed)
143
- - [ ] Traceability to test case IDs where applicable
144
- - [ ] No hardcoded secrets (use env vars)
145
-
146
- ## Troubleshooting
147
-
148
- | Symptom | Likely Cause | Fix |
149
- |---------|--------------|-----|
150
- | Element not found | Selector too specific, dynamic content | Use get_by_role/get_by_test_id; add data-testid if needed |
151
- | Timeout | Element not ready, slow network | Increase expect timeout; use wait_for; check for overlays |
152
- | Flaky tests | Race conditions, shared state | Ensure test isolation; use auto-wait; avoid fixed delays |
153
- | Record mode empty | MCP not capturing steps | Verify Playwright MCP active; lock browser before actions |
154
- | Sync/async conflict | Mixing sync and async fixtures | Use one mode per file; set playwright_pytest_asyncio consistently |
155
- | API mock not applied | Route registered after request | Call page.route before page.goto |
156
- | Fixture not found | conftest.py not in path | Ensure conftest.py in test directory or parent |
@@ -1,194 +0,0 @@
1
- # Playwright Python Best Practices
2
-
3
- Guidelines for maintainable, stable Playwright tests in Python.
4
-
5
- ## Page Object Model (POM)
6
-
7
- ### Structure
8
-
9
- ```
10
- pages/
11
- __init__.py
12
- base_page.py # Shared navigation, common helpers
13
- login_page.py # Login-specific locators and methods
14
- dashboard_page.py # Dashboard-specific
15
- components/
16
- __init__.py
17
- header.py # Reusable header component
18
- modal.py # Reusable modal
19
- ```
20
-
21
- ### Base Page
22
-
23
- ```python
24
- # pages/base_page.py
25
- from playwright.sync_api import Page
26
-
27
- class BasePage:
28
- def __init__(self, page: Page, base_url: str):
29
- self.page = page
30
- self.base_url = base_url
31
-
32
- def goto(self, path: str):
33
- self.page.goto(f"{self.base_url}{path}")
34
-
35
- def get_by_test_id(self, test_id: str):
36
- return self.page.get_by_test_id(test_id)
37
- ```
38
-
39
- ### Page-Specific Class
40
-
41
- ```python
42
- # pages/login_page.py
43
- from playwright.sync_api import Page
44
- from .base_page import BasePage
45
-
46
- class LoginPage(BasePage):
47
- def __init__(self, page: Page, base_url: str):
48
- super().__init__(page, base_url)
49
-
50
- def login(self, email: str, password: str):
51
- self.page.get_by_label("Email").fill(email)
52
- self.page.get_by_label("Password").fill(password)
53
- self.page.get_by_role("button", name="Sign in").click()
54
-
55
- @property
56
- def error_message(self):
57
- return self.page.get_by_role("alert")
58
- ```
59
-
60
- ### Usage in Tests
61
-
62
- ```python
63
- # tests/e2e/test_login.py
64
- def test_login_flow(page: Page, base_url: str):
65
- login_page = LoginPage(page, base_url)
66
- login_page.goto("/login")
67
- login_page.login("user@example.com", "secret")
68
- expect(login_page.error_message).not_to_be_visible()
69
- ```
70
-
71
- ## Locator Priority
72
-
73
- 1. **get_by_role** — Accessibility-based; most resilient
74
- 2. **get_by_test_id** — `data-testid`; explicit, stable
75
- 3. **get_by_text** — Visible text; use for unique labels
76
- 4. **get_by_label** — Form labels; good for inputs
77
- 5. **locator** / CSS — Last resort; brittle for dynamic content
78
-
79
- ### Examples
80
-
81
- ```python
82
- # Prefer
83
- page.get_by_role("button", name="Submit")
84
- page.get_by_test_id("submit-btn")
85
- page.get_by_label("Email address")
86
- page.get_by_text("Welcome back")
87
-
88
- # Avoid when possible
89
- page.locator(".btn-primary")
90
- page.locator("#submit")
91
- page.locator("div > span:nth-child(2)")
92
- ```
93
-
94
- ## Async Patterns
95
-
96
- When using async mode (`playwright_pytest_asyncio = True`):
97
-
98
- - Use `async def` for test functions
99
- - Use `await` for all Playwright calls
100
- - Do not mix sync and async in the same file
101
- - Use `@pytest.mark.asyncio` if not using `asyncio_mode = "auto"`
102
-
103
- ```python
104
- @pytest.mark.asyncio
105
- async def test_async_login(page: Page):
106
- await page.goto("/login")
107
- await page.get_by_label("Email").fill("user@example.com")
108
- await page.get_by_role("button", name="Sign in").click()
109
- await expect(page).to_have_url(re.compile(r".*dashboard"))
110
- ```
111
-
112
- ## Test Isolation
113
-
114
- - Each test gets a fresh `page` and `context` (function scope)
115
- - No shared cookies, localStorage, or session between tests
116
- - Use `storage_state` for auth when needed (via project or fixture)
117
- - Clean up test data in `teardown` if tests create DB records
118
-
119
- ## Avoiding Flakiness
120
-
121
- | Practice | Description |
122
- |----------|-------------|
123
- | **Auto-wait** | Playwright auto-waits; avoid `page.wait_for_timeout()` |
124
- | **Assert before act** | Use `expect` to wait for readiness before clicking |
125
- | **Stable selectors** | Prefer role/testid over CSS |
126
- | **Isolation** | Each test gets fresh context |
127
- | **Deterministic data** | Use fixtures, mocks; avoid time-dependent data |
128
- | **No fixed delays** | Use `expect` with timeout or `wait_for_*` instead |
129
-
130
- ### Anti-Patterns
131
-
132
- ```python
133
- # BAD: Fixed delay
134
- page.wait_for_timeout(3000)
135
-
136
- # GOOD: Wait for element
137
- expect(page.get_by_role("heading")).to_be_visible()
138
-
139
- # BAD: Brittle CSS
140
- page.locator("div.container > div:nth-child(2) button").click()
141
-
142
- # GOOD: Role or testid
143
- page.get_by_role("button", name="Save").click()
144
- ```
145
-
146
- ## File Naming
147
-
148
- | Convention | Example |
149
- |------------|---------|
150
- | Test files | `test_{feature}.py` (e.g., `test_login.py`, `test_dashboard.py`) |
151
- | Page objects | `{page_name}_page.py` (e.g., `login_page.py`) |
152
- | Fixtures | `conftest.py` (pytest discovers automatically) |
153
-
154
- ## Debugging
155
-
156
- | Tool | Use |
157
- |------|-----|
158
- | `--headed` | Run with visible browser |
159
- | `--slowmo 1000` | Slow down actions (ms) |
160
- | `page.pause()` | Breakpoint; opens Playwright Inspector |
161
- | `PWDEBUG=1 pytest` | Run in debug mode |
162
- | `--screenshot=on-failure` | Capture screenshot on failure (via plugin options) |
163
-
164
- ## Fixtures for Common Setup
165
-
166
- ```python
167
- # conftest.py
168
- @pytest.fixture
169
- def login_page(page: Page, base_url: str):
170
- from pages.login_page import LoginPage
171
- return LoginPage(page, base_url)
172
-
173
- @pytest.fixture
174
- def logged_in_user(page: Page, base_url: str):
175
- """Navigate to app and log in; return page."""
176
- page.goto(f"{base_url}/login")
177
- page.get_by_label("Email").fill("test@example.com")
178
- page.get_by_label("Password").fill("secret")
179
- page.get_by_role("button", name="Sign in").click()
180
- page.wait_for_url(re.compile(r".*dashboard"))
181
- return page
182
- ```
183
-
184
- ## Traceability
185
-
186
- Link tests to test case IDs when applicable:
187
-
188
- ```python
189
- @pytest.mark.tc_id("TC-001")
190
- def test_login_with_valid_credentials(page: Page):
191
- ...
192
- ```
193
-
194
- Use markers or docstrings for traceability to requirements/specs.
@@ -1,195 +0,0 @@
1
- # Playwright Python Configuration
2
-
3
- Setup for pytest-playwright and Playwright Python.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pip install pytest-playwright
9
- playwright install
10
- ```
11
-
12
- Optional: install only specific browsers:
13
-
14
- ```bash
15
- playwright install chromium
16
- playwright install chromium firefox webkit
17
- ```
18
-
19
- ## pytest-playwright Plugin
20
-
21
- The plugin provides fixtures automatically when installed. No explicit registration needed.
22
-
23
- | Fixture | Description |
24
- |---------|-------------|
25
- | `playwright` | Playwright instance (session scope) |
26
- | `browser_type` | Browser type launcher |
27
- | `browser` | Browser instance |
28
- | `context` | Browser context |
29
- | `page` | Page (tab) |
30
-
31
- ## conftest.py
32
-
33
- Use `conftest.py` for shared fixtures and Playwright configuration.
34
-
35
- ```python
36
- # conftest.py
37
- import pytest
38
- from playwright.sync_api import Page
39
-
40
- @pytest.fixture(scope="session")
41
- def base_url():
42
- return "http://localhost:3000"
43
-
44
- @pytest.fixture
45
- def authenticated_page(page: Page, base_url: str):
46
- """Page with pre-authenticated session."""
47
- page.goto(f"{base_url}/login")
48
- page.get_by_label("Email").fill("test@example.com")
49
- page.get_by_label("Password").fill("secret")
50
- page.get_by_role("button", name="Sign in").click()
51
- page.wait_for_url(re.compile(r".*dashboard"))
52
- return page
53
- ```
54
-
55
- ## pytest.ini / pyproject.toml
56
-
57
- ### Basic pytest.ini
58
-
59
- ```ini
60
- [pytest]
61
- testpaths = tests
62
- addopts = -v --tb=short
63
- markers =
64
- e2e: end-to-end browser tests
65
- slow: slow tests
66
- ```
67
-
68
- ### pyproject.toml (Preferred)
69
-
70
- ```toml
71
- [tool.pytest.ini_options]
72
- testpaths = ["tests", "e2e"]
73
- addopts = "-v --tb=short"
74
- markers = [
75
- "e2e: end-to-end browser tests",
76
- "slow: marks tests as slow",
77
- ]
78
- ```
79
-
80
- ### Async Mode (Optional)
81
-
82
- To use async Playwright API with pytest-playwright:
83
-
84
- ```ini
85
- # pytest.ini
86
- [pytest]
87
- playwright_pytest_asyncio = True
88
- ```
89
-
90
- Or in pyproject.toml:
91
-
92
- ```toml
93
- [tool.pytest.ini_options]
94
- playwright_pytest_asyncio = true
95
- ```
96
-
97
- Note: Sync and async fixtures cannot be mixed in the same test file.
98
-
99
- ## Browser Configuration
100
-
101
- ### Run Specific Browsers
102
-
103
- ```bash
104
- pytest --browser chromium
105
- pytest --browser firefox
106
- pytest --browser webkit
107
- pytest --browser chromium --browser firefox
108
- ```
109
-
110
- ### Headed Mode (Visible Browser)
111
-
112
- ```bash
113
- pytest --headed
114
- ```
115
-
116
- ### Slow Motion
117
-
118
- ```bash
119
- pytest --slowmo 1000
120
- ```
121
-
122
- ### Video / Screenshot
123
-
124
- Configure via `browser_context_args` fixture:
125
-
126
- ```python
127
- # conftest.py
128
- @pytest.fixture(scope="session")
129
- def browser_context_args(browser_context_args):
130
- return {
131
- **browser_context_args,
132
- "record_video_dir": "videos/",
133
- "record_video_size": {"width": 1280, "height": 720},
134
- }
135
- ```
136
-
137
- ## Base URL
138
-
139
- ```python
140
- # conftest.py
141
- @pytest.fixture(scope="session")
142
- def base_url():
143
- import os
144
- return os.environ.get("BASE_URL", "http://localhost:3000")
145
-
146
- # In tests
147
- def test_homepage(page: Page, base_url: str):
148
- page.goto(base_url)
149
- ```
150
-
151
- ## Environment Variables
152
-
153
- | Variable | Description |
154
- |----------|-------------|
155
- | `BASE_URL` | Application under test |
156
- | `HEADED` | Set to `1` for visible browser |
157
- | `SLOWMO` | Milliseconds delay between actions |
158
- | `BROWSER` | `chromium`, `firefox`, or `webkit` |
159
-
160
- ## Project Structure
161
-
162
- ```
163
- project/
164
- ├── conftest.py # Shared fixtures
165
- ├── pytest.ini # or pyproject.toml
166
- ├── tests/
167
- │ ├── e2e/
168
- │ │ ├── test_login.py
169
- │ │ ├── test_dashboard.py
170
- │ │ └── conftest.py # E2E-specific fixtures
171
- │ └── ...
172
- ├── pages/ # Page Object Model
173
- │ ├── base_page.py
174
- │ ├── login_page.py
175
- │ └── dashboard_page.py
176
- └── fixtures/ # Test data, upload files
177
- └── sample.pdf
178
- ```
179
-
180
- ## Playwright Config (Optional)
181
-
182
- For advanced configuration, create `playwright.config.py`:
183
-
184
- ```python
185
- # playwright.config.py
186
- from playwright.sync_api import sync_playwright
187
-
188
- def get_browser_context_args():
189
- return {
190
- "viewport": {"width": 1280, "height": 720},
191
- "ignore_https_errors": True,
192
- }
193
- ```
194
-
195
- pytest-playwright uses its own defaults; override via `browser_context_args` fixture in conftest.py.