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,220 +0,0 @@
1
- # Visual Regression Configuration
2
-
3
- Configuration for Playwright screenshots, Percy, and BackstopJS.
4
-
5
- ## Playwright Screenshot Configuration
6
-
7
- ### playwright.config.ts
8
-
9
- ```typescript
10
- import { defineConfig } from '@playwright/test';
11
-
12
- export default defineConfig({
13
- testDir: './visual',
14
- snapshotDir: './visual/snapshots',
15
- snapshotPathTemplate: '{testDir}/{testFileDir}/__snapshots__/{arg}-{projectName}{ext}',
16
- expect: {
17
- toHaveScreenshot: {
18
- maxDiffPixels: 100,
19
- maxDiffPixelRatio: 0.01,
20
- },
21
- },
22
- use: {
23
- baseURL: 'http://localhost:3000',
24
- trace: 'retain-on-failure',
25
- },
26
- projects: [
27
- { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
28
- { name: 'mobile', use: { ...devices['iPhone 13'] } },
29
- ],
30
- });
31
- ```
32
-
33
- ### Snapshot Path Template
34
-
35
- | Variable | Description |
36
- |----------|-------------|
37
- | `{testDir}` | Test directory |
38
- | `{testFileDir}` | Directory of test file |
39
- | `{arg}` | Screenshot name |
40
- | `{projectName}` | Project (browser/viewport) |
41
- | `{ext}` | `.png` |
42
-
43
- ### Update Snapshots
44
-
45
- ```bash
46
- npx playwright test --update-snapshots
47
- npx playwright test visual/ --update-snapshots
48
- ```
49
-
50
- ### Per-Test Override
51
-
52
- ```typescript
53
- test('strict comparison', async ({ page }) => {
54
- await expect(page).toHaveScreenshot('strict.png', {
55
- maxDiffPixels: 0,
56
- maxDiffPixelRatio: 0,
57
- });
58
- });
59
- ```
60
-
61
- ## Percy Configuration
62
-
63
- ### Installation
64
-
65
- ```bash
66
- npm install @percy/cli @percy/playwright --save-dev
67
- ```
68
-
69
- ### percy.config.js
70
-
71
- ```javascript
72
- module.exports = {
73
- version: 2,
74
- static: {
75
- path: 'dist',
76
- },
77
- discovery: {
78
- allowed-hostnames: ['localhost', '127.0.0.1'],
79
- disallowed-hostnames: [],
80
- network-idle-timeout: 750,
81
- },
82
- snapshot: {
83
- widths: [1280, 375],
84
- minHeight: 1024,
85
- percyCSS: '',
86
- enableJavaScript: true,
87
- },
88
- };
89
- ```
90
-
91
- ### Playwright Integration
92
-
93
- ```typescript
94
- // playwright.config.ts
95
- import { defineConfig } from '@playwright/test';
96
-
97
- export default defineConfig({
98
- testDir: './e2e',
99
- reporter: [['list'], ['html']],
100
- });
101
- ```
102
-
103
- ```bash
104
- percy exec -- npx playwright test
105
- ```
106
-
107
- ### Snapshot in Test
108
-
109
- ```typescript
110
- import { test, expect } from '@playwright/test';
111
- import percySnapshot from '@percy/playwright';
112
-
113
- test('homepage', async ({ page }) => {
114
- await page.goto('/');
115
- await percySnapshot(page, 'Homepage');
116
- });
117
- ```
118
-
119
- ### Environment Variables
120
-
121
- | Variable | Description |
122
- |----------|-------------|
123
- | `PERCY_TOKEN` | Project token (required for upload) |
124
- | `PERCY_BRANCH` | Branch name |
125
- | `PERCY_PARTIAL_BUILD` | For parallelized runs |
126
-
127
- ## BackstopJS Configuration
128
-
129
- ### Installation
130
-
131
- ```bash
132
- npm install backstopjs --save-dev
133
- npx backstop init
134
- ```
135
-
136
- ### backstop.json
137
-
138
- ```json
139
- {
140
- "id": "visual_regression",
141
- "viewports": [
142
- { "label": "desktop", "width": 1920, "height": 1080 },
143
- { "label": "tablet", "width": 768, "height": 1024 },
144
- { "label": "mobile", "width": 375, "height": 667 }
145
- ],
146
- "scenarios": [
147
- {
148
- "label": "Homepage",
149
- "url": "http://localhost:3000/",
150
- "referenceUrl": "",
151
- "readyEvent": "",
152
- "readySelector": "",
153
- "delay": 500,
154
- "hideSelectors": [".timestamp", ".ad-banner"],
155
- "removeSelectors": [],
156
- "selectorExpansion": true,
157
- "expect": 0,
158
- "misMatchThreshold": 0.1
159
- },
160
- {
161
- "label": "Login",
162
- "url": "http://localhost:3000/login",
163
- "delay": 500,
164
- "misMatchThreshold": 0.1
165
- }
166
- ],
167
- "paths": {
168
- "bitmaps_reference": "backstop_data/bitmaps_reference",
169
- "bitmaps_test": "backstop_data/bitmaps_test",
170
- "engine_scripts": "backstop_data/engine_scripts",
171
- "html_report": "backstop_data/html_report",
172
- "ci_report": "backstop_data/ci_report"
173
- },
174
- "report": ["browser", "CI"],
175
- "engine": "playwright",
176
- "engineOptions": {
177
- "args": ["--no-sandbox"]
178
- }
179
- }
180
- ```
181
-
182
- ### Scenario Options
183
-
184
- | Option | Description |
185
- |-------|-------------|
186
- | `label` | Scenario name |
187
- | `url` | Page URL |
188
- | `delay` | Wait (ms) before capture |
189
- | `hideSelectors` | Hide but keep layout |
190
- | `removeSelectors` | Remove from DOM |
191
- | `misMatchThreshold` | Tolerance (0–1) |
192
- | `selector` | Capture specific element only |
193
-
194
- ### Commands
195
-
196
- ```bash
197
- backstop test # Run comparison
198
- backstop approve # Update reference images
199
- backstop reference # Alias for approve
200
- backstop openReport # Open HTML report
201
- ```
202
-
203
- ### Docker
204
-
205
- ```bash
206
- docker run --rm -v $(pwd):/src backstopjs/backstopjs test
207
- docker run --rm -v $(pwd):/src backstopjs/backstopjs approve
208
- ```
209
-
210
- ## Tool Comparison
211
-
212
- | Feature | Playwright | Percy | BackstopJS |
213
- |---------|------------|-------|------------|
214
- | Setup | Built-in | npm + token | npm or Docker |
215
- | Baselines | Local | Cloud | Local |
216
- | Review UI | Diff artifacts | Web dashboard | HTML report |
217
- | Viewports | Projects | Config | backstop.json |
218
- | Masking | mask option | percyCSS | hideSelectors |
219
- | CI | Native | percy exec | backstop test |
220
- | Cost | Free | Paid (free tier) | Free |
@@ -1,213 +0,0 @@
1
- # Visual Regression Patterns
2
-
3
- Screenshot strategies, masking, viewports, and threshold configuration for visual regression testing.
4
-
5
- ## Screenshot Strategies
6
-
7
- ### Full Page vs Element
8
-
9
- | Strategy | Use Case | Example |
10
- |----------|----------|---------|
11
- | **Full page** | Layout, scroll behavior, long pages | `expect(page).toHaveScreenshot({ fullPage: true })` |
12
- | **Viewport** | Above-the-fold, fixed viewport | `expect(page).toHaveScreenshot()` (default) |
13
- | **Element** | Component, modal, header | `expect(locator).toHaveScreenshot()` |
14
- | **Multiple elements** | Key sections | Capture each with unique names |
15
-
16
- ```typescript
17
- // Full page
18
- await expect(page).toHaveScreenshot('homepage-full.png', { fullPage: true });
19
-
20
- // Viewport only
21
- await expect(page).toHaveScreenshot('homepage-viewport.png');
22
-
23
- // Element
24
- await expect(page.getByRole('banner')).toHaveScreenshot('header.png');
25
- await expect(page.getByTestId('product-card')).toHaveScreenshot('product-card.png');
26
- ```
27
-
28
- ### When to Use Each
29
-
30
- - **Full page:** Marketing pages, documentation, long forms
31
- - **Viewport:** Hero sections, dashboards, fixed layouts
32
- - **Element:** Reusable components, modals, cards, headers
33
-
34
- ## Dynamic Content Masking
35
-
36
- ### Playwright Mask
37
-
38
- ```typescript
39
- await expect(page).toHaveScreenshot('dashboard.png', {
40
- mask: [
41
- page.getByTestId('user-avatar'),
42
- page.getByTestId('timestamp'),
43
- page.locator('.ad-banner'),
44
- ],
45
- maskColor: '#000000', // Optional: color for masked regions
46
- });
47
- ```
48
-
49
- ### Common Elements to Mask
50
-
51
- | Element | Reason |
52
- |---------|--------|
53
- | Timestamps | Always changing |
54
- | User avatars | User-specific |
55
- | Ads | Third-party, variable |
56
- | Charts/graphs | May use random data |
57
- | "X minutes ago" | Relative time |
58
- | Session IDs, tokens | Security, uniqueness |
59
-
60
- ### Percy Masking
61
-
62
- ```typescript
63
- await percySnapshot(page, 'Dashboard', {
64
- percyCSS: `
65
- [data-testid="timestamp"] { visibility: hidden; }
66
- .ad-banner { display: none; }
67
- `,
68
- });
69
- ```
70
-
71
- ### BackstopJS Selectors to Hide
72
-
73
- ```json
74
- {
75
- "scenarios": [{
76
- "url": "https://example.com/dashboard",
77
- "hideSelectors": [".timestamp", ".ad-banner", "[data-testid='avatar']"]
78
- }]
79
- }
80
- ```
81
-
82
- ## Viewport Variations
83
-
84
- ### Playwright Projects
85
-
86
- ```typescript
87
- // playwright.config.ts
88
- projects: [
89
- { name: 'desktop', use: { ...devices['Desktop Chrome'], viewport: { width: 1920, height: 1080 } } },
90
- { name: 'tablet', use: { ...devices['iPad Pro'] } },
91
- { name: 'mobile', use: { ...devices['iPhone 13'] } },
92
- ],
93
- ```
94
-
95
- ### Snapshot Naming with Viewport
96
-
97
- ```typescript
98
- test('homepage visual', async ({ page }, testInfo) => {
99
- await page.goto('/');
100
- const project = testInfo.project.name;
101
- await expect(page).toHaveScreenshot(`homepage-${project}.png`);
102
- });
103
- ```
104
-
105
- ### BackstopJS Viewports
106
-
107
- ```json
108
- {
109
- "viewports": [
110
- { "label": "desktop", "width": 1920, "height": 1080 },
111
- { "label": "tablet", "width": 768, "height": 1024 },
112
- { "label": "mobile", "width": 375, "height": 667 }
113
- ]
114
- }
115
- ```
116
-
117
- ### Recommended Breakpoints
118
-
119
- | Label | Width | Height | Use |
120
- |-------|-------|--------|-----|
121
- | Desktop | 1920 | 1080 | Primary desktop |
122
- | Tablet | 768 | 1024 | iPad portrait |
123
- | Mobile | 375 | 667 | iPhone SE / small phone |
124
- | Mobile large | 414 | 896 | iPhone 11+ |
125
-
126
- ## Threshold Configuration
127
-
128
- ### Playwright
129
-
130
- ```typescript
131
- await expect(page).toHaveScreenshot('page.png', {
132
- maxDiffPixels: 100, // Absolute pixel count
133
- maxDiffPixelRatio: 0.01, // 1% of pixels
134
- });
135
- ```
136
-
137
- | Option | Description | When to Use |
138
- |--------|-------------|-------------|
139
- | `maxDiffPixels` | Max differing pixels | Font/subpixel differences |
140
- | `maxDiffPixelRatio` | Max ratio (0–1) | Proportional tolerance |
141
-
142
- ### BackstopJS
143
-
144
- ```json
145
- {
146
- "scenarios": [{
147
- "misMatchThreshold": 0.1
148
- }]
149
- }
150
- ```
151
-
152
- - `0` = strict (no tolerance)
153
- - `0.1` = 0.1% tolerance
154
- - `1` = 100% (accept all)
155
-
156
- ### Percy
157
-
158
- Percy uses built-in diff engine; configure via dashboard or `percy.config.js` for ignore regions.
159
-
160
- ## Animation Disabling
161
-
162
- ### CSS Override (Playwright)
163
-
164
- ```typescript
165
- await page.addStyleTag({
166
- content: `
167
- *, *::before, *::after {
168
- animation-duration: 0s !important;
169
- animation-delay: 0s !important;
170
- transition-duration: 0s !important;
171
- }
172
- `,
173
- });
174
- await expect(page).toHaveScreenshot('static.png');
175
- ```
176
-
177
- ### prefers-reduced-motion
178
-
179
- ```typescript
180
- await page.emulateMedia({ reducedMotion: 'reduce' });
181
- await expect(page).toHaveScreenshot('reduced-motion.png');
182
- ```
183
-
184
- ### Wait for Stability
185
-
186
- ```typescript
187
- await page.waitForLoadState('networkidle');
188
- await page.waitForTimeout(500); // Allow animations to settle
189
- await expect(page).toHaveScreenshot('stable.png');
190
- ```
191
-
192
- ## Element Screenshot Patterns
193
-
194
- ### Scroll Into View
195
-
196
- ```typescript
197
- await page.getByTestId('footer').scrollIntoViewIfNeeded();
198
- await expect(page.getByTestId('footer')).toHaveScreenshot('footer.png');
199
- ```
200
-
201
- ### Modal / Overlay
202
-
203
- ```typescript
204
- await page.getByRole('button', { name: 'Open modal' }).click();
205
- await expect(page.getByRole('dialog')).toHaveScreenshot('modal.png');
206
- ```
207
-
208
- ### Hover State
209
-
210
- ```typescript
211
- await page.getByTestId('card').hover();
212
- await expect(page.getByTestId('card')).toHaveScreenshot('card-hover.png');
213
- ```
@@ -1,141 +0,0 @@
1
- ---
2
- name: qa-vitest-writer
3
- description: Generate Vitest unit and integration tests for TypeScript projects with ESM-native support, Vite integration, and Jest-compatible API.
4
- output_dir: tests/unit
5
- ---
6
-
7
- # QA Vitest Writer
8
-
9
- ## Purpose
10
-
11
- Write Vitest unit and integration tests from test case specifications. Transform structured test cases (from qa-testcase-from-docs, qa-manual-test-designer, or specs) into executable Vitest code with proper mocking, fixtures, and assertions.
12
-
13
- ## Trigger Phrases
14
-
15
- - "Write Vitest tests for [module/feature]"
16
- - "Generate Vitest unit tests from test cases"
17
- - "Create Vitest integration tests"
18
- - "Add Vitest tests for [spec/requirements]"
19
- - "Migrate Jest tests to Vitest"
20
- - "Vitest tests with mocks and fixtures"
21
- - "In-source Vitest tests for [component]"
22
- - "Parameterized Vitest tests (test.each)"
23
-
24
- ## Key Advantages
25
-
26
- | Advantage | Description |
27
- | --------- | ----------- |
28
- | **ESM-native** | No CommonJS transformation; native `import`/`export` |
29
- | **Vite integration** | Uses Vite for fast transforms, HMR, and config |
30
- | **Watch mode** | Instant re-runs on file changes |
31
- | **Jest-compatible API** | `describe`/`it`/`test`, `expect`, `vi` (like `jest`) |
32
- | **In-source testing** | Co-locate tests with source (`__tests__` or `*.test.ts`) |
33
- | **Workspace support** | Monorepo config with project-level overrides |
34
-
35
- ## Workflow
36
-
37
- 1. **Read test cases** — From specs, requirements, or manual test designs
38
- 2. **Analyze code** — Inspect module under test: exports, dependencies, types
39
- 3. **Generate tests** — Produce `describe`/`it` blocks with assertions
40
- 4. **Add mocks/fixtures** — Use `vi.mock`, `vi.fn`, `vi.spyOn`, fixtures as needed
41
- 5. **Verify** — Ensure tests run and pass; fix any config or import issues
42
-
43
- ## Context7 MCP
44
-
45
- Use **Context7 MCP** for current Vitest documentation when:
46
- - API signatures or options are uncertain
47
- - New Vitest features (e.g., `vi.hoisted`, workspace config) need verification
48
- - Migration from Jest requires up-to-date compatibility notes
49
-
50
- ## Key Patterns
51
-
52
- | Pattern | Usage |
53
- | ------- | ----- |
54
- | `describe` / `it` / `test` | Test structure (Jest-compatible) |
55
- | `vi.mock()` | Module substitution; hoisted before imports |
56
- | `vi.fn()` | Mock function with call tracking |
57
- | `vi.spyOn()` | Spy on existing method; optionally replace |
58
- | `vi.hoisted()` | Run code before imports (ESM mocking) |
59
- | In-source testing | `__tests__/` or `{module}.test.ts` / `{module}.spec.ts` |
60
- | Snapshot testing | `expect(obj).toMatchSnapshot()` |
61
- | Parameterized | `test.each([...])` / `it.each([...])` |
62
- | Concurrent | `it.concurrent` / `test.concurrent` |
63
-
64
- See `references/patterns.md` for detailed patterns.
65
-
66
- ## Configuration
67
-
68
- - **Config file:** `vitest.config.ts` or `vite.config.ts` with `test` block
69
- - **Workspace:** `vitest.workspace.ts` for monorepos
70
- - **Coverage:** `v8` or `istanbul` via `@vitest/coverage-v8` / `@vitest/coverage-istanbul`
71
-
72
- See `references/config.md` for configuration patterns.
73
-
74
- ## Migration from Jest
75
-
76
- | Jest | Vitest | Notes |
77
- | ---- | ------ | ----- |
78
- | `jest.mock()` | `vi.mock()` | Same semantics; hoisted |
79
- | `jest.fn()` | `vi.fn()` | Same API |
80
- | `jest.spyOn()` | `vi.spyOn()` | Same API |
81
- | `jest.useFakeTimers()` | `vi.useFakeTimers()` | Same API |
82
- | `beforeAll` / `afterAll` | Same | Unchanged |
83
- | `beforeEach` / `afterEach` | Same | Unchanged |
84
-
85
- ESM: Use `vi.hoisted()` when variables must be available in `vi.mock` factory. See `references/best-practices.md`.
86
-
87
- ## File Naming
88
-
89
- - `{module}.test.ts` — Preferred for unit tests
90
- - `{module}.spec.ts` — Alternative; common for integration tests
91
- - `__tests__/{module}.test.ts` — Co-located in source directory
92
-
93
- ## Scope
94
-
95
- **Can do (autonomous):**
96
- - Generate Vitest unit and integration tests from test cases
97
- - Add mocks (`vi.mock`, `vi.fn`, `vi.spyOn`), fixtures, and setup/teardown
98
- - Use `test.each` for parameterized tests; `it.concurrent` for parallel runs
99
- - Configure `vitest.config.ts` and coverage
100
- - Migrate Jest tests to Vitest (syntax and API mapping)
101
- - Call qa-diagram-generator for test flow diagrams if needed
102
-
103
- **Cannot do (requires confirmation):**
104
- - Change production code to satisfy tests
105
- - Add tests for requirements not in source documents
106
- - Override project-level Vitest/Vite config without approval
107
-
108
- **Will not do (out of scope):**
109
- - Execute tests (user runs `vitest` or `npm test`)
110
- - Write Playwright/Cypress E2E tests (use qa-playwright-ts-writer)
111
- - Modify CI/CD pipelines
112
-
113
- ## References
114
-
115
- - `references/patterns.md` — ESM mocking, in-source testing, concurrent tests, workspace
116
- - `references/assertions.md` — Vitest/Chai assertion reference
117
- - `references/config.md` — vitest.config.ts, coverage, workspace, plugins
118
- - `references/best-practices.md` — Best practices, Jest migration patterns
119
-
120
- ## Quality Checklist
121
-
122
- - [ ] Tests match test case steps and expected results
123
- - [ ] Mocks are properly scoped (per test or per describe)
124
- - [ ] No hardcoded secrets or sensitive data
125
- - [ ] Assertions are specific (avoid only `toBeTruthy` where value matters)
126
- - [ ] `beforeEach`/`afterEach` restore state; mocks reset where needed
127
- - [ ] File naming follows project convention (`*.test.ts` or `*.spec.ts`)
128
- - [ ] Imports use ESM (`import`); no `require` unless required by dependency
129
- - [ ] Coverage targets considered if specified in requirements
130
-
131
- ## Troubleshooting
132
-
133
- | Symptom | Likely Cause | Fix |
134
- | ------- | ------------ | --- |
135
- | `vi.mock` not working | ESM hoisting; variable not in scope | Use `vi.hoisted()` to define variables before imports |
136
- | Mock returns undefined | Factory not returning correct shape | Ensure factory returns object matching module exports |
137
- | Tests pass individually, fail together | Shared mutable state | Reset mocks in `beforeEach`; use `vi.clearAllMocks()` |
138
- | `import.meta.env` wrong in tests | Env not set for test | Use `vi.stubEnv()` with `unstubEnvs: true` in config |
139
- | Coverage not collected | Reporter not configured | Add `@vitest/coverage-v8`, set `coverage.reporter` |
140
- | Slow test runs | No workspace or wrong config | Use `vitest.workspace.ts`; exclude node_modules |
141
- | Type errors in mocks | Mock shape doesn't match types | Use `vi.mocked()` or type assertions; match export shape |
@@ -1,105 +0,0 @@
1
- # Vitest / Chai Assertion Reference
2
-
3
- Vitest uses the same assertion API as Jest (which is built on Chai). All assertions are available via `expect()`.
4
-
5
- ## Equality
6
-
7
- | Assertion | Description |
8
- | --------- | ----------- |
9
- | `expect(x).toBe(y)` | Strict equality (`Object.is`) |
10
- | `expect(x).toEqual(y)` | Deep equality for objects/arrays |
11
- | `expect(x).toStrictEqual(y)` | Deep equality + type checks (undefined, etc.) |
12
- | `expect(x).not.toBe(y)` | Negation |
13
-
14
- ## Truthiness
15
-
16
- | Assertion | Description |
17
- | --------- | ----------- |
18
- | `expect(x).toBeTruthy()` | Truthy value |
19
- | `expect(x).toBeFalsy()` | Falsy value |
20
- | `expect(x).toBeDefined()` | Not `undefined` |
21
- | `expect(x).toBeUndefined()` | `undefined` |
22
- | `expect(x).toBeNull()` | `null` |
23
-
24
- ## Numbers
25
-
26
- | Assertion | Description |
27
- | --------- | ----------- |
28
- | `expect(n).toBeGreaterThan(m)` | `n > m` |
29
- | `expect(n).toBeGreaterThanOrEqual(m)` | `n >= m` |
30
- | `expect(n).toBeLessThan(m)` | `n < m` |
31
- | `expect(n).toBeLessThanOrEqual(m)` | `n <= m` |
32
- | `expect(n).toBeCloseTo(m, numDigits)` | Float comparison with precision |
33
- | `expect(n).toBeNaN()` | `NaN` |
34
-
35
- ## Strings
36
-
37
- | Assertion | Description |
38
- | --------- | ----------- |
39
- | `expect(s).toMatch(/regex/)` | Matches regex |
40
- | `expect(s).toContain(substr)` | Includes substring |
41
- | `expect(s).toHaveLength(n)` | Length equals n |
42
-
43
- ## Arrays and Iterables
44
-
45
- | Assertion | Description |
46
- | --------- | ----------- |
47
- | `expect(arr).toContain(item)` | Array contains item |
48
- | `expect(arr).toContainEqual(item)` | Array contains object matching shape |
49
- | `expect(arr).toHaveLength(n)` | Array length |
50
- | `expect(arr).toEqual(expect.arrayContaining([...]))` | Array contains subset |
51
-
52
- ## Objects
53
-
54
- | Assertion | Description |
55
- | --------- | ----------- |
56
- | `expect(obj).toHaveProperty(key)` | Has property |
57
- | `expect(obj).toHaveProperty(key, value)` | Property equals value |
58
- | `expect(obj).toMatchObject(partial)` | Contains subset of properties |
59
- | `expect(obj).toHaveLength(n)` | For array-like (length property) |
60
-
61
- ## Functions and Mocks
62
-
63
- | Assertion | Description |
64
- | --------- | ----------- |
65
- | `expect(fn).toHaveBeenCalled()` | Called at least once |
66
- | `expect(fn).toHaveBeenCalledTimes(n)` | Called exactly n times |
67
- | `expect(fn).toHaveBeenCalledWith(arg1, arg2)` | Called with specific args |
68
- | `expect(fn).toHaveBeenLastCalledWith(arg1, arg2)` | Last call args |
69
- | `expect(fn).toHaveBeenNthCalledWith(n, arg1, arg2)` | Nth call args |
70
- | `expect(fn).toHaveReturned()` | Returned (did not throw) |
71
- | `expect(fn).toHaveReturnedWith(value)` | Returned specific value |
72
- | `expect(fn).toThrow()` | Threw an error |
73
- | `expect(fn).toThrow(error)` | Threw specific error type/message |
74
-
75
- ## Async
76
-
77
- | Assertion | Description |
78
- | --------- | ----------- |
79
- | `await expect(promise).resolves.toBe(value)` | Resolved value |
80
- | `await expect(promise).rejects.toThrow()` | Rejected with error |
81
-
82
- ## Snapshots
83
-
84
- | Assertion | Description |
85
- | --------- | ----------- |
86
- | `expect(obj).toMatchSnapshot()` | File snapshot |
87
- | `expect(obj).toMatchInlineSnapshot(\`...\`)` | Inline snapshot |
88
-
89
- ## Type Assertions (TypeScript)
90
-
91
- Use `expect.any(constructor)` for flexible matching:
92
-
93
- ```ts
94
- expect(fn).toHaveBeenCalledWith(expect.any(String), expect.any(Number))
95
- expect(obj).toEqual({ id: expect.any(Number), name: expect.any(String) })
96
- ```
97
-
98
- ## Negation
99
-
100
- Prefix any assertion with `.not`:
101
-
102
- ```ts
103
- expect(x).not.toBeNull()
104
- expect(arr).not.toContain(undefined)
105
- ```