qaa-agent 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.claude/commands/create-test.md +40 -0
  2. package/.claude/commands/qa-analyze.md +60 -0
  3. package/.claude/commands/qa-audit.md +37 -0
  4. package/.claude/commands/qa-blueprint.md +54 -0
  5. package/.claude/commands/qa-fix.md +36 -0
  6. package/.claude/commands/qa-from-ticket.md +88 -0
  7. package/.claude/commands/qa-gap.md +54 -0
  8. package/.claude/commands/qa-pom.md +36 -0
  9. package/.claude/commands/qa-pyramid.md +37 -0
  10. package/.claude/commands/qa-report.md +38 -0
  11. package/.claude/commands/qa-start.md +33 -0
  12. package/.claude/commands/qa-testid.md +54 -0
  13. package/.claude/commands/qa-validate.md +54 -0
  14. package/.claude/commands/update-test.md +58 -0
  15. package/.claude/settings.json +19 -0
  16. package/.claude/skills/qa-bug-detective/SKILL.md +122 -0
  17. package/.claude/skills/qa-repo-analyzer/SKILL.md +88 -0
  18. package/.claude/skills/qa-self-validator/SKILL.md +109 -0
  19. package/.claude/skills/qa-template-engine/SKILL.md +113 -0
  20. package/.claude/skills/qa-testid-injector/SKILL.md +93 -0
  21. package/.claude/skills/qa-workflow-documenter/SKILL.md +87 -0
  22. package/CLAUDE.md +543 -0
  23. package/README.md +418 -0
  24. package/agents/qa-pipeline-orchestrator.md +1217 -0
  25. package/agents/qaa-analyzer.md +508 -0
  26. package/agents/qaa-bug-detective.md +444 -0
  27. package/agents/qaa-executor.md +618 -0
  28. package/agents/qaa-planner.md +374 -0
  29. package/agents/qaa-scanner.md +422 -0
  30. package/agents/qaa-testid-injector.md +583 -0
  31. package/agents/qaa-validator.md +450 -0
  32. package/bin/install.cjs +176 -0
  33. package/bin/lib/commands.cjs +709 -0
  34. package/bin/lib/config.cjs +307 -0
  35. package/bin/lib/core.cjs +497 -0
  36. package/bin/lib/frontmatter.cjs +299 -0
  37. package/bin/lib/init.cjs +989 -0
  38. package/bin/lib/milestone.cjs +241 -0
  39. package/bin/lib/model-profiles.cjs +60 -0
  40. package/bin/lib/phase.cjs +911 -0
  41. package/bin/lib/roadmap.cjs +306 -0
  42. package/bin/lib/state.cjs +748 -0
  43. package/bin/lib/template.cjs +222 -0
  44. package/bin/lib/verify.cjs +842 -0
  45. package/bin/qaa-tools.cjs +607 -0
  46. package/package.json +34 -0
  47. package/templates/failure-classification.md +391 -0
  48. package/templates/gap-analysis.md +409 -0
  49. package/templates/pr-template.md +48 -0
  50. package/templates/qa-analysis.md +381 -0
  51. package/templates/qa-audit-report.md +465 -0
  52. package/templates/qa-repo-blueprint.md +636 -0
  53. package/templates/scan-manifest.md +312 -0
  54. package/templates/test-inventory.md +582 -0
  55. package/templates/testid-audit-report.md +354 -0
  56. package/templates/validation-report.md +243 -0
@@ -0,0 +1,465 @@
1
+ ---
2
+ template_name: qa-audit-report
3
+ version: "1.0"
4
+ artifact_type: audit
5
+ produces: QA_AUDIT_REPORT.md
6
+ producer_agent: qa-validator
7
+ consumer_agents:
8
+ - human-reviewer
9
+ - qa-executor
10
+ required_sections:
11
+ - executive-summary
12
+ - six-dimension-scoring
13
+ - critical-issues
14
+ - improvement-recommendations
15
+ - test-file-inventory
16
+ - detailed-findings
17
+ example_domain: shopflow
18
+ ---
19
+
20
+ # QA_AUDIT_REPORT.md Template
21
+
22
+ **Purpose:** Comprehensive quality audit of an existing test suite across 6 dimensions, producing a quantified health score and actionable improvement plan. This is the most detailed assessment artifact in the QA pipeline.
23
+
24
+ **Producer:** `qa-validator` (audit mode -- invoked via `/qa-audit` or as part of Option 2/3 workflow)
25
+ **Consumers:** `human-reviewer` (evaluates test suite quality and decides on improvements), `qa-executor` (implements recommended fixes)
26
+
27
+ ---
28
+
29
+ ## Required Sections
30
+
31
+ ### Section 1: Executive Summary
32
+
33
+ **Description:** High-level assessment with an overall health score, key strengths, weaknesses, and a pass/fail recommendation.
34
+
35
+ **Fields:**
36
+
37
+ | Field | Type | Required | Description |
38
+ |-------|------|----------|-------------|
39
+ | overall_score | integer (0-100) | YES | Weighted average across all 6 dimensions |
40
+ | letter_grade | string | YES | A (90-100), B (80-89), C (70-79), D (60-69), F (< 60) |
41
+ | assessment | string | YES | One-paragraph summary of the test suite health |
42
+ | key_strengths | list | YES | 2-3 bullet points of what the test suite does well |
43
+ | key_weaknesses | list | YES | 2-3 bullet points of the most impactful problems |
44
+ | recommendation | string | YES | `PASS -- ready for CI` or `NEEDS IMPROVEMENT -- address critical issues first` |
45
+
46
+ **Grade Scale:**
47
+
48
+ | Grade | Score Range | Meaning |
49
+ |-------|------------|---------|
50
+ | A | 90 - 100 | Excellent -- test suite is production-ready, minimal improvements needed |
51
+ | B | 80 - 89 | Good -- minor quality issues, safe for CI with improvements tracked |
52
+ | C | 70 - 79 | Acceptable -- notable quality gaps, address before scaling test suite |
53
+ | D | 60 - 69 | Below Standard -- significant issues, prioritize fixes before adding new tests |
54
+ | F | < 60 | Failing -- critical problems must be resolved before test suite is reliable |
55
+
56
+ ---
57
+
58
+ ### Section 2: 6-Dimension Scoring
59
+
60
+ **Description:** Quantified assessment across 6 quality dimensions, each with an independent score, weight, and key finding. The weighted total produces the overall health score.
61
+
62
+ **Scoring Table Columns:**
63
+
64
+ | Column | Description |
65
+ |--------|-------------|
66
+ | Dimension | Name of the quality dimension |
67
+ | Score | Independent score (0-100) for this dimension |
68
+ | Grade | Letter grade for this dimension's score |
69
+ | Weight | How much this dimension contributes to the overall score (percentages must sum to 100%) |
70
+ | Weighted Score | Score * Weight (used in overall calculation) |
71
+ | Key Finding | One-sentence summary of the most important finding for this dimension |
72
+
73
+ **The 6 Dimensions:**
74
+
75
+ #### Dimension 1: Locator Quality (Weight: 20%)
76
+
77
+ Measures how resilient test selectors are to UI changes.
78
+
79
+ | Score Range | Criteria |
80
+ |-------------|----------|
81
+ | 90-100 | > 90% Tier 1+2 locators, zero Tier 4 without TODO comments |
82
+ | 70-89 | > 70% Tier 1+2, Tier 4 locators all have TODO comments |
83
+ | 50-69 | 50-70% Tier 1+2, some Tier 4 without TODO |
84
+ | 30-49 | < 50% Tier 1+2, heavy Tier 4 usage |
85
+ | 0-29 | Almost all Tier 4 CSS/XPath selectors, no test IDs |
86
+
87
+ **Deductions:** -5 points for each Tier 4 locator without a `// TODO: Request test ID` comment.
88
+
89
+ #### Dimension 2: Assertion Specificity (Weight: 20%)
90
+
91
+ Measures how precisely tests validate expected behavior.
92
+
93
+ | Score Range | Criteria |
94
+ |-------------|----------|
95
+ | 90-100 | > 95% concrete assertions with specific expected values |
96
+ | 70-89 | 80-95% concrete, few vague assertions |
97
+ | 50-69 | 60-80% concrete, notable vague assertions |
98
+ | 30-49 | 40-60% concrete, many `toBeTruthy`/`toBeDefined`/`should('exist')` |
99
+ | 0-29 | < 40% concrete, most assertions are vague |
100
+
101
+ **Concrete examples:** `toBe(200)`, `toEqual({name: 'Test'})`, `toHaveText('Login successful')`
102
+ **Vague examples:** `toBeTruthy()`, `toBeDefined()`, `not.toBeNull()`, `should('exist')`
103
+
104
+ #### Dimension 3: POM Compliance (Weight: 15%)
105
+
106
+ Measures adherence to Page Object Model rules.
107
+
108
+ **6 POM Rules checked per page object:**
109
+ 1. One class/object per page or view
110
+ 2. No assertions in page objects (assertions belong in test specs only)
111
+ 3. Locators defined as properties (in constructor or as class fields)
112
+ 4. Actions return void or the next page (fluent chaining)
113
+ 5. State queries return data (let the test decide what to assert)
114
+ 6. Extends a shared BasePage class
115
+
116
+ | Score Range | Criteria |
117
+ |-------------|----------|
118
+ | 90-100 | All POMs pass all 6 rules |
119
+ | 70-89 | Minor violations (1-2 rules broken in 1-2 POMs) |
120
+ | 50-69 | Moderate violations (assertions in POMs, or no BasePage) |
121
+ | 30-49 | Multiple POMs break multiple rules |
122
+ | 0-29 | No POMs exist, or all POMs violate core rules |
123
+
124
+ #### Dimension 4: Test Coverage (Weight: 20%)
125
+
126
+ Measures how well the test suite covers the application, considering both pyramid distribution and module completeness.
127
+
128
+ | Score Range | Criteria |
129
+ |-------------|----------|
130
+ | 90-100 | All modules covered, pyramid distribution within 10% of recommended |
131
+ | 70-89 | Most modules covered, pyramid roughly correct |
132
+ | 50-69 | Some modules uncovered, pyramid distribution off by > 20% |
133
+ | 30-49 | Multiple critical modules uncovered |
134
+ | 0-29 | Minimal coverage, critical business logic untested |
135
+
136
+ **Sub-scores:** Pyramid distribution match (50%) + module coverage completeness (50%).
137
+
138
+ #### Dimension 5: Naming Convention (Weight: 15%)
139
+
140
+ Measures consistency of file names, test IDs, and fixture names against project standards.
141
+
142
+ | Score Range | Criteria |
143
+ |-------------|----------|
144
+ | 90-100 | > 95% of files, test IDs, and fixtures follow conventions |
145
+ | 70-89 | > 80% compliant, minor inconsistencies |
146
+ | 50-69 | 60-80% compliant, notable deviations |
147
+ | 30-49 | < 60% compliant, no consistent naming pattern |
148
+ | 0-29 | No naming convention followed |
149
+
150
+ **Conventions checked:**
151
+ - Test files: `[feature].e2e.spec.ts`, `[module].unit.spec.ts`, `[resource].api.spec.ts`
152
+ - Test IDs: `UT-MODULE-NNN`, `API-RESOURCE-NNN`, `E2E-FLOW-NNN`, `INT-MODULE-NNN`
153
+ - Page objects: `[PageName]Page.ts`
154
+ - Fixtures: `[domain]-data.ts` or `[domain]-data.json`
155
+
156
+ #### Dimension 6: Test Data Management (Weight: 10%)
157
+
158
+ Measures how test data is handled -- security, organization, and maintainability.
159
+
160
+ | Score Range | Criteria |
161
+ |-------------|----------|
162
+ | 90-100 | No hardcoded credentials, fixtures in dedicated folder, env vars with fallbacks, per-domain fixtures |
163
+ | 70-89 | Minor issues (missing .env.example, one fixture in wrong location) |
164
+ | 50-69 | Some hardcoded values, fixtures partially organized |
165
+ | 30-49 | Hardcoded credentials found, no fixture organization |
166
+ | 0-29 | Credentials in test files, no fixture strategy |
167
+
168
+ **Checks:**
169
+ - No hardcoded passwords, API keys, or tokens in test files
170
+ - Environment variables used with test fallback values
171
+ - Fixtures organized in a dedicated `fixtures/` directory
172
+ - Each business domain has its own fixture file (auth-data, product-data, etc.)
173
+ - `.env.example` or `.env.test` exists documenting required test env vars
174
+
175
+ **Overall Score Formula:**
176
+ ```
177
+ Overall Score = (Locator * 0.20) + (Assertion * 0.20) + (POM * 0.15) +
178
+ (Coverage * 0.20) + (Naming * 0.15) + (TestData * 0.10)
179
+ ```
180
+
181
+ ---
182
+
183
+ ### Section 3: Critical Issues
184
+
185
+ **Description:** Issues with BLOCKER severity that must be fixed immediately. These prevent the test suite from being reliable in CI or production use.
186
+
187
+ **Per-Issue Fields:**
188
+
189
+ | Field | Type | Required | Description |
190
+ |-------|------|----------|-------------|
191
+ | file_path | string | YES | Path to the file containing the issue |
192
+ | line_number | integer | YES | Specific line number where the issue occurs |
193
+ | issue | string | YES | Description of the problem |
194
+ | why_critical | string | YES | Why this blocks CI/delivery |
195
+ | suggested_fix | string | YES | Specific action to resolve the issue |
196
+ | dimension | string | YES | Which of the 6 dimensions this relates to |
197
+
198
+ **BLOCKER Criteria:**
199
+ - Assertions inside page objects (POM violation)
200
+ - Hardcoded real credentials in test files (security)
201
+ - Tier 4 locators on critical user flows without TODO (fragility)
202
+ - Tests that always pass regardless of application state (false positives)
203
+ - Missing error handling that masks test failures
204
+
205
+ ---
206
+
207
+ ### Section 4: Improvement Recommendations
208
+
209
+ **Description:** Prioritized improvement actions, grouped by effort level, with estimated score impact for each recommendation.
210
+
211
+ **Per-Recommendation Fields:**
212
+
213
+ | Field | Type | Required | Description |
214
+ |-------|------|----------|-------------|
215
+ | recommendation | string | YES | What to do |
216
+ | dimension | string | YES | Which quality dimension this improves |
217
+ | effort | string | YES | S (< 1 hour), M (1-4 hours), L (4+ hours) |
218
+ | score_impact | string | YES | Expected improvement (e.g., "+8 points to Locator Quality") |
219
+ | priority | integer | YES | Execution order (1 = do first) |
220
+
221
+ **Grouping:** Quick wins (S effort) first, then medium effort, then large effort.
222
+
223
+ ---
224
+
225
+ ### Section 5: Test File Inventory
226
+
227
+ **Description:** Complete inventory of all test files with counts, tiers, and status.
228
+
229
+ **Summary Statistics:**
230
+
231
+ | Field | Type | Required | Description |
232
+ |-------|------|----------|-------------|
233
+ | total_test_files | integer | YES | Count of all test files |
234
+ | total_test_cases | integer | YES | Count of all individual test cases |
235
+ | unit_count | integer | YES | Unit test count |
236
+ | integration_count | integer | YES | Integration test count |
237
+ | api_count | integer | YES | API test count |
238
+ | e2e_count | integer | YES | E2E test count |
239
+
240
+ **Per-File Table Columns:**
241
+
242
+ | Column | Description |
243
+ |--------|-------------|
244
+ | File Path | Path to the test file |
245
+ | Tier | Unit, Integration, API, or E2E |
246
+ | Test Count | Number of test cases in the file |
247
+ | Status | PASS / FAIL / ERROR |
248
+ | Last Modified | Date the file was last changed |
249
+
250
+ ---
251
+
252
+ ### Section 6: Detailed Findings
253
+
254
+ **Description:** Per-test-file breakdown of every issue found during the audit. This is the most granular section, providing line-level detail for each finding.
255
+
256
+ **Per-File Structure:**
257
+
258
+ ```markdown
259
+ #### {file_path}
260
+
261
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
262
+ |------|-------|----------|-----------|-------------|---------------|
263
+ ```
264
+
265
+ **Severity Levels:**
266
+
267
+ | Severity | Meaning | Action |
268
+ |----------|---------|--------|
269
+ | BLOCKER | Must fix immediately -- blocks CI/delivery | Also listed in Critical Issues section |
270
+ | WARNING | Should fix soon -- degrades quality | Include in improvement plan |
271
+ | INFO | Nice to improve -- minor quality enhancement | Address when convenient |
272
+
273
+ ---
274
+
275
+ ## Worked Example (ShopFlow E-Commerce API)
276
+
277
+ ### Executive Summary
278
+
279
+ **Overall Score: 62/100 (Grade: D)**
280
+
281
+ The ShopFlow test suite has a solid foundation with good API test coverage for the authentication module and reasonable assertion specificity (70% concrete). However, the test suite is held back by heavy reliance on fragile CSS selectors (60% Tier 4 locators), POM violations with assertions found in page objects, and hardcoded test credentials. Two of five business modules (Orders, Payments) have zero test coverage.
282
+
283
+ **Key Strengths:**
284
+ - Auth module has tests across unit, API, and E2E tiers -- best-covered module
285
+ - API tests use concrete assertions with specific status codes and response shapes
286
+ - Test pyramid distribution roughly follows the recommended pattern (60% unit)
287
+
288
+ **Key Weaknesses:**
289
+ - 60% of locators are Tier 4 CSS selectors -- already caused a broken E2E test
290
+ - Assertions found inside 2 of 4 page objects (LoginPage.ts, ProductPage.ts)
291
+ - Hardcoded email `admin@shopflow.com` and password `TestPass123!` found in test files
292
+
293
+ **Recommendation: NEEDS IMPROVEMENT -- address 3 critical issues (POM assertions, hardcoded credentials, fragile locators) before adding new tests or integrating into CI.**
294
+
295
+ ### 6-Dimension Scoring
296
+
297
+ | Dimension | Score | Grade | Weight | Weighted Score | Key Finding |
298
+ |-----------|-------|-------|--------|----------------|-------------|
299
+ | Locator Quality | 45 | F | 20% | 9.00 | 9 of 15 locators are Tier 4 CSS selectors with no TODO comments |
300
+ | Assertion Specificity | 70 | C | 20% | 14.00 | 5 vague assertions found (toBeTruthy, should('exist')) across 3 files |
301
+ | POM Compliance | 55 | F | 15% | 8.25 | Assertions found in LoginPage.ts and ProductPage.ts; 2 of 4 POMs lack BasePage |
302
+ | Test Coverage | 80 | B | 20% | 16.00 | Auth and Products well covered; Orders, Payments, Inventory have zero tests |
303
+ | Naming Convention | 65 | D | 15% | 9.75 | 3 files do not follow naming pattern; 4 test IDs use non-standard format |
304
+ | Test Data Management | 60 | D | 10% | 6.00 | 2 hardcoded emails found; no .env.example or .env.test file exists |
305
+
306
+ **Overall Score Calculation:**
307
+ ```
308
+ Overall = (45 * 0.20) + (70 * 0.20) + (55 * 0.15) + (80 * 0.20) + (65 * 0.15) + (60 * 0.10)
309
+ = 9.00 + 14.00 + 8.25 + 16.00 + 9.75 + 6.00
310
+ = 63.00
311
+ ```
312
+
313
+ **Rounded: 63/100 -- Grade D (Below Standard)**
314
+
315
+ *Note: The Executive Summary reports 62 due to rounding at the dimension level. The dimension-level calculation yields 63 from the rounded inputs shown above. Either value falls within Grade D.*
316
+
317
+ ### Critical Issues
318
+
319
+ | # | File Path | Line | Issue | Why Critical | Suggested Fix | Dimension |
320
+ |---|-----------|------|-------|-------------|---------------|-----------|
321
+ | 1 | `pages/LoginPage.ts` | 34 | `expect(this.errorMessage).toBeVisible()` -- assertion inside page object | Violates POM rule #2. Page objects must not contain assertions. This couples the page object to specific test expectations, making it impossible to reuse for different assertion scenarios. | Move assertion to the test spec. Replace with a state query method: `async getErrorMessage(): Promise<string>` that returns the text content. | POM Compliance |
322
+ | 2 | `tests/e2e/auth/login.e2e.spec.ts` | 15 | Hardcoded password: `const password = 'TestPass123!'` | Credentials in source code are a security risk. This file is committed to git, making the test password visible in repo history. If this matches any real password, it's a breach. | Move to `.env.test` file: `process.env.TEST_PASSWORD` with fallback. Add `.env.test` to `.gitignore`. | Test Data Management |
323
+ | 3 | `tests/e2e/auth/login.e2e.spec.ts` | 22 | `page.locator('.login-form .btn-primary')` -- Tier 4 CSS selector on critical login flow | Login is the most critical user flow. A CSS selector on this path has already broken once (see broken tests). This will break again on any UI restyling. | Replace with `page.getByTestId('login-submit-btn')` after testid-injector adds the attribute. Add `// TODO: Request test ID for this element` as interim fix. | Locator Quality |
324
+
325
+ ### Improvement Recommendations
326
+
327
+ #### Quick Wins (S effort)
328
+
329
+ | # | Recommendation | Dimension | Effort | Score Impact |
330
+ |---|---------------|-----------|--------|-------------|
331
+ | 1 | Move assertions out of LoginPage.ts (line 34) and ProductPage.ts (line 48) into their respective test specs | POM Compliance | S | +20 points to POM Compliance (55 -> 75) |
332
+ | 2 | Replace 2 hardcoded emails with `process.env.TEST_EMAIL` and add `.env.test` file | Test Data Management | S | +15 points to Test Data (60 -> 75) |
333
+ | 3 | Rename `login-test.spec.ts` to `login.e2e.spec.ts` and `product-tests.spec.ts` to `products.api.spec.ts` | Naming Convention | S | +10 points to Naming (65 -> 75) |
334
+ | 4 | Fix 4 non-standard test IDs (T-001 through T-004) to follow UT-MODULE-NNN pattern | Naming Convention | S | +5 points to Naming (75 -> 80) |
335
+
336
+ #### Medium Effort (M)
337
+
338
+ | # | Recommendation | Dimension | Effort | Score Impact |
339
+ |---|---------------|-----------|--------|-------------|
340
+ | 5 | Replace 5 vague assertions with concrete values (see Detailed Findings for each) | Assertion Specificity | M | +10 points to Assertion (70 -> 80) |
341
+ | 6 | Add BasePage class and update LoginPage.ts and OrderPage.ts to extend it | POM Compliance | M | +15 points to POM Compliance (75 -> 90) |
342
+ | 7 | Migrate 9 Tier 4 locators to Tier 1 (data-testid) -- coordinate with testid-injector | Locator Quality | M | +35 points to Locator (45 -> 80) |
343
+
344
+ #### Large Effort (L)
345
+
346
+ | # | Recommendation | Dimension | Effort | Score Impact |
347
+ |---|---------------|-----------|--------|-------------|
348
+ | 8 | Add unit and API tests for Orders and Payments modules (5+ test cases) | Test Coverage | L | +10 points to Coverage (80 -> 90) |
349
+
350
+ **Projected score after all improvements:** ~84/100 (Grade B)
351
+
352
+ ### Test File Inventory
353
+
354
+ **Summary:** 6 test files, 15 test cases
355
+
356
+ | Tier | File Count | Test Count | Percentage |
357
+ |------|-----------|------------|------------|
358
+ | Unit | 4 | 9 | 60% |
359
+ | Integration | 0 | 0 | 0% |
360
+ | API | 1 | 5 | 33% |
361
+ | E2E | 1 | 1 | 7% |
362
+ | **Total** | **6** | **15** | **100%** |
363
+
364
+ | File Path | Tier | Test Count | Status | Last Modified |
365
+ |-----------|------|------------|--------|---------------|
366
+ | `tests/unit/auth/auth.unit.spec.ts` | Unit | 3 | PASS | 2026-03-10 |
367
+ | `tests/unit/auth/tokenRefresh.unit.spec.ts` | Unit | 1 | FAIL | 2026-03-08 |
368
+ | `tests/unit/products/products.unit.spec.ts` | Unit | 2 | PASS | 2026-03-12 |
369
+ | `tests/unit/utils/validators.unit.spec.ts` | Unit | 3 | PASS | 2026-03-14 |
370
+ | `tests/api/auth/auth.api.spec.ts` | API | 3 | PASS | 2026-03-11 |
371
+ | `tests/api/products/products.api.spec.ts` | API | 2 | FAIL (1 of 2) | 2026-03-09 |
372
+ | `tests/e2e/auth/login.e2e.spec.ts` | E2E | 1 | FAIL | 2026-03-07 |
373
+
374
+ ### Detailed Findings
375
+
376
+ #### tests/unit/auth/auth.unit.spec.ts
377
+
378
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
379
+ |------|-------|----------|-----------|-------------|---------------|
380
+ | 45 | Vague assertion | WARNING | Assertion Specificity | `expect(data).toBeDefined()` -- does not check what `data` contains | Replace with `expect(data).toEqual({id: expect.any(String), email: 'test@shopflow.com'})` |
381
+ | 62 | Vague assertion | WARNING | Assertion Specificity | `expect(user).toBeTruthy()` -- does not verify user properties | Replace with `expect(user.email).toBe('test@shopflow.com')` and `expect(user.id).toMatch(/^usr_/)` |
382
+ | 15 | Hardcoded email | INFO | Test Data Management | `const email = 'admin@shopflow.com'` -- hardcoded test email | Move to fixture file or env variable with fallback |
383
+
384
+ #### tests/unit/auth/tokenRefresh.unit.spec.ts
385
+
386
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
387
+ |------|-------|----------|-----------|-------------|---------------|
388
+ | 8 | Missing env fallback | BLOCKER | Test Data Management | `process.env.JWT_SECRET` used without fallback -- test fails if env not set | Add fallback: `const secret = process.env.JWT_SECRET ?? 'test-jwt-secret-for-testing'` |
389
+ | 30 | Vague assertion | WARNING | Assertion Specificity | `expect(token).not.toBeNull()` -- does not validate token format | Replace with `expect(token).toMatch(/^eyJ/)` to verify JWT format |
390
+ | 1 | Naming convention | INFO | Naming Convention | Test ID `T-001` does not follow `UT-AUTH-NNN` convention | Rename to `UT-AUTH-003` |
391
+
392
+ #### tests/e2e/auth/login.e2e.spec.ts
393
+
394
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
395
+ |------|-------|----------|-----------|-------------|---------------|
396
+ | 15 | Hardcoded password | BLOCKER | Test Data Management | `const password = 'TestPass123!'` -- credential in source code | Move to `.env.test`: `process.env.TEST_PASSWORD ?? 'FallbackTestPass1!'` |
397
+ | 22 | Tier 4 locator | BLOCKER | Locator Quality | `page.locator('.login-form .btn-primary')` -- fragile CSS selector on critical path | Replace with `page.getByTestId('login-submit-btn')` after test ID injection |
398
+ | 28 | Tier 4 locator | WARNING | Locator Quality | `page.locator('.login-form input[name="email"]')` -- Tier 4 attribute selector | Replace with `page.getByTestId('login-email-input')` |
399
+ | 34 | Tier 4 locator | WARNING | Locator Quality | `page.locator('.login-form input[name="password"]')` -- Tier 4 attribute selector | Replace with `page.getByTestId('login-password-input')` |
400
+ | 52 | Vague assertion | WARNING | Assertion Specificity | `cy.get('.result').should('exist')` -- does not check content | Replace with `page.getByTestId('login-success-alert').toHaveText('Welcome back!')` |
401
+ | 1 | File name | INFO | Naming Convention | File could be at `tests/e2e/auth/login.e2e.spec.ts` (already correct) | No action needed |
402
+
403
+ #### tests/api/products/products.api.spec.ts
404
+
405
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
406
+ |------|-------|----------|-----------|-------------|---------------|
407
+ | 28 | Vague assertion | WARNING | Assertion Specificity | `expect(response.status).toBeTruthy()` -- any non-zero status passes | Replace with `expect(response.status).toBe(200)` |
408
+ | 35 | Hardcoded count | WARNING | Assertion Specificity | `expect(data.length).toBe(10)` -- brittle to seed data changes | Replace with `expect(data.length).toBeGreaterThan(0)` and add schema validation for each item |
409
+ | 1 | File name | INFO | Naming Convention | File name `products.api.spec.ts` follows convention | No action needed |
410
+
411
+ #### pages/LoginPage.ts
412
+
413
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
414
+ |------|-------|----------|-----------|-------------|---------------|
415
+ | 34 | Assertion in POM | BLOCKER | POM Compliance | `expect(this.errorMessage).toBeVisible()` -- page objects must not assert | Remove assertion. Add method: `async getErrorText(): Promise<string> { return this.errorMessage.textContent(); }` |
416
+ | 5 | No BasePage | WARNING | POM Compliance | Does not extend a shared BasePage class | Add `extends BasePage` and import shared base |
417
+ | 12 | Inline locator | INFO | POM Compliance | `this.page.locator('.error-message')` defined inline instead of as class property | Extract to class property: `readonly errorMessage = this.page.getByTestId('login-error-alert')` |
418
+
419
+ #### pages/ProductPage.ts
420
+
421
+ | Line | Issue | Severity | Dimension | Description | Suggested Fix |
422
+ |------|-------|----------|-----------|-------------|---------------|
423
+ | 48 | Assertion in POM | BLOCKER | POM Compliance | `expect(this.productList.count()).toBeGreaterThan(0)` -- assertion in page object | Remove assertion. Add method: `async getProductCount(): Promise<number> { return this.productList.count(); }` |
424
+ | 22 | Tier 4 locator | WARNING | Locator Quality | `this.page.locator('.product-card')` -- CSS class selector | Replace with `this.page.getByTestId('product-card')` after test ID injection |
425
+ | 30 | Tier 4 locator | WARNING | Locator Quality | `this.page.locator('.product-price')` -- CSS class selector | Replace with `this.page.getByTestId('product-price-text')` |
426
+
427
+ ---
428
+
429
+ ## Guidelines
430
+
431
+ **DO:**
432
+ - Calculate the weighted score explicitly -- show the math so reviewers can verify
433
+ - Provide exact line numbers for every finding in the Detailed Findings section
434
+ - Include specific suggested fixes, not just "improve this" -- show the replacement code or pattern
435
+ - Cross-reference Critical Issues with Detailed Findings (every BLOCKER appears in both sections)
436
+ - Show the projected score improvement for each recommendation
437
+
438
+ **DON'T:**
439
+ - Give a high score just because tests exist -- quality matters more than quantity
440
+ - Rate Locator Quality above 50 if more than half the locators are Tier 4
441
+ - Skip the formula calculation -- always show the weighted math explicitly
442
+ - List INFO-level issues as Critical -- only BLOCKER severity belongs in the Critical Issues section
443
+ - Combine findings from multiple files into one entry -- each file gets its own Detailed Findings table
444
+ - Ignore test data security -- hardcoded credentials are always BLOCKER severity
445
+
446
+ ---
447
+
448
+ ## Quality Gate
449
+
450
+ Before delivering this artifact, verify:
451
+
452
+ - [ ] Overall score matches the weighted calculation from the 6-Dimension table (show the math)
453
+ - [ ] Dimension weights sum to exactly 100% (20 + 20 + 15 + 20 + 15 + 10 = 100)
454
+ - [ ] Every BLOCKER in Detailed Findings also appears in Critical Issues section
455
+ - [ ] Every finding in Detailed Findings has a specific line number and suggested fix
456
+ - [ ] Improvement Recommendations include projected score impact for each action
457
+ - [ ] Test File Inventory matches the actual count of test files and test cases
458
+ - [ ] No real credentials, API keys, or secrets appear in the report itself
459
+ - [ ] Grade assignment matches the score range (verify against grade scale)
460
+
461
+ ---
462
+
463
+ *Template version: 1.0*
464
+ *Producer: qa-validator*
465
+ *Last updated: {date}*