@keber/qa-framework 1.2.0-0 → 1.4.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.
- package/agent-instructions/00-module-analysis.md +3 -0
- package/agent-instructions/01-spec-generation.md +3 -0
- package/agent-instructions/02-test-plan-generation.md +3 -0
- package/agent-instructions/03-test-case-generation.md +3 -0
- package/agent-instructions/04-automation-generation.md +3 -0
- package/agent-instructions/04b-test-stabilization.md +3 -0
- package/agent-instructions/05-ado-integration.md +3 -0
- package/agent-instructions/06-maintenance.md +3 -0
- package/docs/folder-structure-guide.md +19 -18
- package/docs/skills-architecture.md +136 -0
- package/package.json +2 -1
- package/scripts/cli.js +5 -0
- package/scripts/init.js +39 -31
- package/scripts/upgrade.js +187 -0
- package/skills/qa-ado-integration/SKILL.md +103 -0
- package/skills/qa-ado-integration/references/scripts-and-config.md +201 -0
- package/skills/qa-automation/SKILL.md +101 -0
- package/skills/qa-automation/references/config-checklist.md +79 -0
- package/skills/qa-automation/references/patterns.md +180 -0
- package/skills/qa-maintenance/SKILL.md +110 -0
- package/skills/qa-maintenance/references/update-rules.md +118 -0
- package/skills/qa-module-analysis/SKILL.md +95 -0
- package/skills/qa-module-analysis/references/exploration-checklist.md +121 -0
- package/skills/qa-module-analysis/references/spec-file-formats.md +219 -0
- package/skills/qa-spec-generation/SKILL.md +93 -0
- package/skills/qa-test-cases/SKILL.md +89 -0
- package/skills/qa-test-cases/references/test-case-template.md +142 -0
- package/skills/qa-test-plan/SKILL.md +81 -0
- package/skills/qa-test-plan/references/priority-and-feasibility.md +159 -0
- package/skills/qa-test-stabilization/SKILL.md +123 -0
- package/skills/qa-test-stabilization/references/classification-protocol.md +142 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-maintenance
|
|
3
|
+
description: >
|
|
4
|
+
Stage 6 of the QA pipeline. Updates QA artifacts after application changes.
|
|
5
|
+
Keeps specs, test cases, and automation in sync with the product.
|
|
6
|
+
Use when asked to update specs after a change, maintain tests after a feature
|
|
7
|
+
change, sync QA with a new release, update a spec after a bug fix, or
|
|
8
|
+
perform QA maintenance after a sprint.
|
|
9
|
+
Requires a delivered application change to be the trigger.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# QA Skill: Maintenance (Stage 6 of 6)
|
|
13
|
+
|
|
14
|
+
**Stage**: 6 — Maintenance
|
|
15
|
+
**Prerequisite**: An application change (bug fix, feature change, new requirement) has been delivered
|
|
16
|
+
**Output**: Updated specs, TCs, and automation aligned with the new application behavior
|
|
17
|
+
**Cycle**: Returns to Stage 2 (spec update) → Stage 4 (TC update) → Stage 5 (automation update) as needed
|
|
18
|
+
|
|
19
|
+
> **Rule**: Never update specs to match an incorrect application behavior. Specs define correct behavior; automation reflects specs. If the app is wrong, file a defect, don't update the spec.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Inputs Required
|
|
24
|
+
|
|
25
|
+
1. Description of the change — which submodule, what changed, and why
|
|
26
|
+
2. `qa/01-specifications/{module}/` — specs affected by the change
|
|
27
|
+
3. `qa/07-automation/e2e/{module}/` — automation affected by the change
|
|
28
|
+
4. Optionally: ADO work item or defect report describing the change
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Process
|
|
33
|
+
|
|
34
|
+
### Step 1 — Identify affected artifacts
|
|
35
|
+
|
|
36
|
+
For the delivered change, identify:
|
|
37
|
+
- Which spec files reference the changed behavior (search for affected term/field/flow)
|
|
38
|
+
- Which TCs exercise that behavior
|
|
39
|
+
- Which automation files implement those TCs
|
|
40
|
+
- Whether any test data in `04-test-data.md` is affected
|
|
41
|
+
|
|
42
|
+
### Step 2 — Update specs first
|
|
43
|
+
|
|
44
|
+
Update spec files before touching automation. Spec update rules:
|
|
45
|
+
|
|
46
|
+
| Situation | Action |
|
|
47
|
+
|---|---|
|
|
48
|
+
| UI label changed | Update `02-workflows.md` step text |
|
|
49
|
+
| Business rule changed | Update `01-business-rules.md` rule + affected scenarios in `05-test-scenarios.md` |
|
|
50
|
+
| New required field added | Update `02-workflows.md` + `04-test-data.md` + `05-test-scenarios.md` |
|
|
51
|
+
| Field removed | Mark TC as `OBSOLETE-SCENARIO` in `05-test-scenarios.md`, delete corresponding TC file |
|
|
52
|
+
| Permission change | Update `03-roles-permissions.md` |
|
|
53
|
+
| Flow reordered | Update `02-workflows.md` with new step sequence |
|
|
54
|
+
|
|
55
|
+
Detailed rules: `references/update-rules.md`
|
|
56
|
+
|
|
57
|
+
### Step 3 — Update TCs
|
|
58
|
+
|
|
59
|
+
After specs are updated:
|
|
60
|
+
- Update step text in affected `TC-*.md` files
|
|
61
|
+
- If a TC no longer applies: mark as `[OBSOLETE]` in the index, do not delete the file
|
|
62
|
+
- If a new scenario added to specs: generate new TC following Stage 4
|
|
63
|
+
|
|
64
|
+
### Step 4 — Update automation
|
|
65
|
+
|
|
66
|
+
After TCs are updated:
|
|
67
|
+
- Update locators for changed UI elements
|
|
68
|
+
- Update assertions for changed business rules
|
|
69
|
+
- Remove or skip automation for `OBSOLETE-SCENARIO` TCs
|
|
70
|
+
- Run updated spec file locally to confirm passing before committing
|
|
71
|
+
|
|
72
|
+
Automation update rules: `references/update-rules.md`
|
|
73
|
+
|
|
74
|
+
### Step 5 — Bump spec version and log change
|
|
75
|
+
|
|
76
|
+
In the spec file's YAML frontmatter (or header block):
|
|
77
|
+
```
|
|
78
|
+
version: {incremented}
|
|
79
|
+
last-updated: {date}
|
|
80
|
+
change-summary: {one-line description of what changed}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Step 6 — Update README and close session
|
|
84
|
+
|
|
85
|
+
- Update `qa/README.md` module row (spec version, TC count if changed, automation status)
|
|
86
|
+
- Update `AGENT-NEXT-STEPS.md`:
|
|
87
|
+
- Remove completed items from the active sprint checklist
|
|
88
|
+
- If all TCs passing: trigger Module Completion Ritual (move sprint to history, trim file)
|
|
89
|
+
- Generate session summary in `qa/memory/` if significant changes were made
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Key Rules
|
|
94
|
+
|
|
95
|
+
| Rule | Correct | Wrong |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| Spec is ground truth | Update spec first, then tests | Fix test to match wrong behavior |
|
|
98
|
+
| Obsolete TCs | Mark as OBSOLETE, keep file | Delete TC files |
|
|
99
|
+
| Scope discipline | Only touch artifacts linked to the change | Rewrite unrelated specs "while you're there" |
|
|
100
|
+
| Version tracking | Bump version + log change summary | Silently update spec content |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Outputs
|
|
105
|
+
|
|
106
|
+
- Updated `qa/01-specifications/{module}/*.md` files
|
|
107
|
+
- Updated `qa/03-test-cases/automated/TC-*.md` files
|
|
108
|
+
- Updated `qa/07-automation/e2e/{module}/*.spec.ts`
|
|
109
|
+
- Updated `qa/README.md`
|
|
110
|
+
- Updated `AGENT-NEXT-STEPS.md` (or sprint moved to history if complete)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Reference: Spec and Automation Update Rules
|
|
2
|
+
|
|
3
|
+
> Loaded by `skills/qa-maintenance/` when performing post-change spec and automation updates.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Spec Update Rules by Change Type
|
|
8
|
+
|
|
9
|
+
### New field added to a form
|
|
10
|
+
|
|
11
|
+
1. Add field row to `00-inventory.md` UI Elements table
|
|
12
|
+
2. Add business rule to `01-business-rules.md` if the field has validation: `RN-{MODULE}-{next-number}`
|
|
13
|
+
3. Add TCs to `05-test-scenarios.md`:
|
|
14
|
+
- Happy path TC with new field populated
|
|
15
|
+
- Required validation TC (if the field is required)
|
|
16
|
+
- Any new business rule violation TC
|
|
17
|
+
|
|
18
|
+
### Field removed from UI
|
|
19
|
+
|
|
20
|
+
1. Mark row in `00-inventory.md` as `[REMOVED - {YYYY-MM-DD}]` — do NOT delete the row
|
|
21
|
+
2. Mark the related business rule in `01-business-rules.md` as `[DEPRECATED - {YYYY-MM-DD}]`
|
|
22
|
+
3. Mark related TCs in `05-test-scenarios.md` as `[DEPRECATED]` for traceability
|
|
23
|
+
4. Update or skip automation tests that reference the removed element's selector
|
|
24
|
+
|
|
25
|
+
### Workflow changed
|
|
26
|
+
|
|
27
|
+
1. Update `02-workflows.md` with the new flow diagram
|
|
28
|
+
2. Mark the old version as `[PREVIOUS - {YYYY-MM-DD}]` inside the same file (keep for reference)
|
|
29
|
+
3. Review all TCs that test the affected steps — update expected results in `05-test-scenarios.md`
|
|
30
|
+
|
|
31
|
+
### New submodule added
|
|
32
|
+
|
|
33
|
+
Follow the full module analysis process: `skills/qa-module-analysis/`.
|
|
34
|
+
|
|
35
|
+
### Defect resolved
|
|
36
|
+
|
|
37
|
+
1. Find all `test.skip()` calls that reference the DEF-ID or ADO WI number
|
|
38
|
+
2. Remove the `test.skip()` wrapper
|
|
39
|
+
3. If the spec assertion was adapted to document the bug (e.g., `toBeFalsy()` for a wrong default), restore the correct assertion
|
|
40
|
+
4. Run the test at least 2 times with different `EXEC_IDX` values to confirm stability
|
|
41
|
+
5. Update `qa/06-defects/open/DEF-{NNN}.md` status to Resolved; move file to `06-defects/resolved/`
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Automation Update Rules
|
|
46
|
+
|
|
47
|
+
### Selectors changed (redesign or framework update)
|
|
48
|
+
|
|
49
|
+
1. Locate the spec file or page object containing the old selector
|
|
50
|
+
2. Update the selector — prefer `getByRole`, `getByLabel`, `getByTestId`
|
|
51
|
+
3. Run the affected test 2+ times to confirm stability
|
|
52
|
+
4. Add an entry to the correction log at top of the spec file:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
/* CORRECTIONS
|
|
56
|
+
* YYYY-MM-DD: Updated selector for {element} from '#old-id' to getByRole('button', { name: '...' })
|
|
57
|
+
*/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### New test suite needed
|
|
61
|
+
|
|
62
|
+
Follow `skills/qa-automation/` for the new suite.
|
|
63
|
+
Update `COVERAGE-MAPPING.md` with new TC rows.
|
|
64
|
+
|
|
65
|
+
### Test became flaky after app update
|
|
66
|
+
|
|
67
|
+
5-layer debugging methodology:
|
|
68
|
+
1. **Environment**: is QA env stable? Can you log in manually?
|
|
69
|
+
2. **Timeout**: did an operation become slower? Increase `actionTimeout` if justified
|
|
70
|
+
3. **Data**: did a seed or precondition change? Review `beforeAll` provisioning
|
|
71
|
+
4. **Selector**: did the element structure change? Inspect with Playwright UI mode
|
|
72
|
+
5. **System**: is this a real defect? File with DEF reference and skip the test
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Spec Version Changelog Block
|
|
77
|
+
|
|
78
|
+
Add to the bottom of each updated spec file:
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
## Changelog
|
|
82
|
+
|
|
83
|
+
| Version | Date | Description |
|
|
84
|
+
|---------|------|-------------|
|
|
85
|
+
| 1.0 | YYYY-MM-DD | Initial creation |
|
|
86
|
+
| 1.1 | YYYY-MM-DD | Added RN-{MODULE}-{NNN}: {rule title}. TC count: N → M |
|
|
87
|
+
| 1.2 | YYYY-MM-DD | Removed field {name} (deprecated) |
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Session Summary Template
|
|
93
|
+
|
|
94
|
+
Create at: `qa/SESSION-SUMMARY-{YYYY-MM-DD}-maintenance.md`
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
# Maintenance Session — {YYYY-MM-DD}
|
|
98
|
+
|
|
99
|
+
## Change trigger
|
|
100
|
+
{Brief description of the application change that triggered this session}
|
|
101
|
+
|
|
102
|
+
## Artifacts updated
|
|
103
|
+
| File | Type of change |
|
|
104
|
+
|------|---------------|
|
|
105
|
+
| qa/01-specifications/{module}/{submodule}/00-inventory.md | Added field {name} |
|
|
106
|
+
| qa/01-specifications/{module}/{submodule}/05-test-scenarios.md | Added TCs {IDs} |
|
|
107
|
+
|
|
108
|
+
## TC changes
|
|
109
|
+
- New TCs: {IDs} (+N total)
|
|
110
|
+
- Deprecated TCs: {IDs} (-N total)
|
|
111
|
+
- Net TC count: {module} → {N}
|
|
112
|
+
|
|
113
|
+
## Tests reactivated
|
|
114
|
+
- {TC-ID}: removed test.skip() — DEF-{NNN} resolved
|
|
115
|
+
|
|
116
|
+
## Tests newly skipped
|
|
117
|
+
- {TC-ID}: test.skip() added — DEF-{NNN} filed for {bug description}
|
|
118
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-module-analysis
|
|
3
|
+
description: >
|
|
4
|
+
Stage 1 of the QA pipeline. Analyzes an application module using browser automation
|
|
5
|
+
to produce the 6-file specification set (inventory, business rules, workflows,
|
|
6
|
+
roles, test data, test scenarios). Use when asked to analyze a module, explore a
|
|
7
|
+
feature, document an application area, or start QA coverage for a new module.
|
|
8
|
+
Prerequisite for all subsequent QA stages.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# QA Skill: Module Analysis (Stage 1 of 6)
|
|
12
|
+
|
|
13
|
+
**Stage**: 1 — Module Analysis
|
|
14
|
+
**Prerequisite**: None — this is the first stage
|
|
15
|
+
**Output**: `qa/01-specifications/module-{name}/submodule-{name}/` with 6 spec files
|
|
16
|
+
**Next stage**: Stage 2 — Specification Generation (`qa-spec-generation`)
|
|
17
|
+
|
|
18
|
+
> **Pipeline rule**: This stage must be completed before any spec generation, test planning,
|
|
19
|
+
> or automation can begin. Do not skip to a later stage.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
Before starting:
|
|
26
|
+
|
|
27
|
+
1. `qa/qa-framework.config.json` exists and contains `project.qaBaseUrl`
|
|
28
|
+
2. `qa/00-standards/naming-conventions.md` is available to check existing module codes
|
|
29
|
+
3. Browser automation (Playwright MCP or equivalent) is available
|
|
30
|
+
4. Ask the user for: module name, URL/route prefix, submodules in scope (or discover from UI)
|
|
31
|
+
|
|
32
|
+
**Security**: Never write credentials to any file. Use `<PLACEHOLDER>` for any credential value.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Phase 1 — Preparation
|
|
37
|
+
|
|
38
|
+
1. Check if `qa/01-specifications/module-{name}/` already exists
|
|
39
|
+
- **Exists**: read all existing files; only re-analyze what changed
|
|
40
|
+
- **New**: create the directory and plan submodules
|
|
41
|
+
2. Allocate a unique 2–6 letter uppercase module code (check naming-conventions.md for conflicts)
|
|
42
|
+
3. Create `qa/01-specifications/module-{name}/README.md` listing all planned submodules before analysis begins
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 2 — Exploration (one pass per submodule)
|
|
47
|
+
|
|
48
|
+
For each submodule, use browser automation to collect:
|
|
49
|
+
|
|
50
|
+
1. **Navigation** — URLs, page titles, breadcrumbs
|
|
51
|
+
2. **UI inventory** — all inputs (type, required, validation), dropdowns (options), buttons, tables, modals, badges
|
|
52
|
+
3. **API endpoints** — observe network requests during create/read/update/delete; record method, path, payload shape
|
|
53
|
+
4. **Role access** — log in as each configured role; record `can access / cannot access / permission error`
|
|
54
|
+
5. **Workflow** — execute the primary happy path; record steps, branch points, state transitions
|
|
55
|
+
6. **Business rules** — attempt invalid inputs and boundary conditions; record validation messages exactly
|
|
56
|
+
|
|
57
|
+
Detailed exploration checklist: `references/exploration-checklist.md`
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Phase 3 — Documentation (6-file output)
|
|
62
|
+
|
|
63
|
+
Produce 6 files per submodule. File formats and templates: `references/spec-file-formats.md`
|
|
64
|
+
|
|
65
|
+
| File | Contents |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `00-inventory.md` | Module/submodule header, UI element table, API endpoint table |
|
|
68
|
+
| `01-business-rules.md` | `RN-{MODULE}-{NNN}` rules with type, trigger, error message |
|
|
69
|
+
| `02-workflows.md` | `FL-{MODULE}-{NNN}` flows with ASCII/Mermaid diagrams |
|
|
70
|
+
| `03-roles-permissions.md` | Role × feature access matrix; env var references for test users |
|
|
71
|
+
| `04-test-data.md` | Prerequisites, data shapes per scenario, EXEC_IDX pattern |
|
|
72
|
+
| `05-test-scenarios.md` | TC table: 50–85 TCs per submodule, all mandatory coverage categories |
|
|
73
|
+
|
|
74
|
+
TC target: **50–85 per submodule**. Mark origin as `UI-OBSERVED`, `PENDING-CODE`, or `BLOCKED-PERMISSIONS`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Phase 4 — Review
|
|
79
|
+
|
|
80
|
+
Completeness checklist before closing the stage:
|
|
81
|
+
|
|
82
|
+
- [ ] All menu items in the module have a submodule folder
|
|
83
|
+
- [ ] All `UI-OBSERVED` TCs were actually observed in this session
|
|
84
|
+
- [ ] No credentials appear in any file
|
|
85
|
+
- [ ] All TC IDs are unique across the module
|
|
86
|
+
- [ ] Module README updated with submodule table and TC counts
|
|
87
|
+
- [ ] `qa/README.md` module status row updated
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Outputs
|
|
92
|
+
|
|
93
|
+
- `qa/01-specifications/module-{name}/` — fully populated spec tree
|
|
94
|
+
- `qa/01-specifications/module-{name}/README.md` — updated with submodule table
|
|
95
|
+
- `qa/README.md` — module status row updated
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Reference: Module Exploration Checklist
|
|
2
|
+
|
|
3
|
+
> Loaded by `skills/qa-module-analysis/` when performing Phase 2 exploration.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 2.1 Navigation and Route Mapping
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Navigate to {{QA_BASE_URL}} and log in with the appropriate role
|
|
11
|
+
Navigate to the submodule URL
|
|
12
|
+
Record:
|
|
13
|
+
- Full URL of each page/view
|
|
14
|
+
- Page title
|
|
15
|
+
- Navigation breadcrumb
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2.2 UI Inventory
|
|
21
|
+
|
|
22
|
+
For each screen in the submodule:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Record all:
|
|
26
|
+
- Input fields (name, type, required/optional, validation rules visible in UI)
|
|
27
|
+
- Dropdowns (static or dynamic/AJAX; enumerate options if static)
|
|
28
|
+
- Buttons (action label + what they trigger)
|
|
29
|
+
- Tables/grids (columns, default sorting, pagination behavior)
|
|
30
|
+
- Modals (trigger condition, fields, confirmation button behavior)
|
|
31
|
+
- Status indicators / badges / alerts
|
|
32
|
+
- File upload / download controls
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 2.3 API Endpoint Discovery
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Observe network requests during key interactions (create, read, update, delete)
|
|
41
|
+
Record:
|
|
42
|
+
- Endpoint path (e.g., /api/GetUsers, /api/CreateUser)
|
|
43
|
+
- HTTP method (GET, POST, PUT, DELETE)
|
|
44
|
+
- Request payload shape (field names)
|
|
45
|
+
- Response shape (key fields returned)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 2.4 Role-Based Access Testing
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
For each configured test user role:
|
|
54
|
+
Log in as that role
|
|
55
|
+
Navigate to the submodule
|
|
56
|
+
Record: can access? (YES / NO / PERMISSION_ERROR)
|
|
57
|
+
Record: which actions are available vs hidden/disabled
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 2.5 Workflow Discovery
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Execute the primary happy path with appropriate test data
|
|
66
|
+
Record each step (clickable element → navigation result → system state change)
|
|
67
|
+
Identify branch points (e.g., approve vs reject)
|
|
68
|
+
Record state transitions (pending → approved → rejected)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 2.6 Business Rule Discovery
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
For each input field and business action:
|
|
77
|
+
Attempt invalid inputs: empty, too long, wrong format, duplicate, out of range
|
|
78
|
+
Record: validation message exact text
|
|
79
|
+
Record: which field shows the error
|
|
80
|
+
Record: system behavior (block submission / inline error / toast / redirect)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Phase 4 Completeness Checklist
|
|
86
|
+
|
|
87
|
+
After completing all submodule files:
|
|
88
|
+
|
|
89
|
+
- [ ] All menu items in the module have a corresponding submodule folder
|
|
90
|
+
- [ ] All TCs marked `UI-OBSERVED` were actually observed in this session
|
|
91
|
+
- [ ] `01-business-rules.md` covers all visible validation behaviors
|
|
92
|
+
- [ ] `03-roles-permissions.md` reflects the access observed for each role
|
|
93
|
+
- [ ] No credentials appear in any file
|
|
94
|
+
- [ ] All TC IDs are unique across the module
|
|
95
|
+
- [ ] Module README lists all submodules with their codes and TC counts
|
|
96
|
+
- [ ] Session summary created at `qa/SESSION-SUMMARY-{date}.md`
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Session Summary Template
|
|
101
|
+
|
|
102
|
+
```markdown
|
|
103
|
+
# Session Summary — {YYYY-MM-DD}
|
|
104
|
+
|
|
105
|
+
## Module analyzed
|
|
106
|
+
{module-name} ({module-code})
|
|
107
|
+
|
|
108
|
+
## Submodules documented
|
|
109
|
+
| Submodule | Code | TC count | Notes |
|
|
110
|
+
|-----------|------|----------|-------|
|
|
111
|
+
| {name} | {code} | {N} | {any notable blocking issues} |
|
|
112
|
+
|
|
113
|
+
## Files created
|
|
114
|
+
- {path/to/file.md}
|
|
115
|
+
|
|
116
|
+
## Blockers
|
|
117
|
+
- {any features marked PENDING-CODE or BLOCKED-PERMISSIONS}
|
|
118
|
+
|
|
119
|
+
## Next steps
|
|
120
|
+
- {what remains before automation can begin}
|
|
121
|
+
```
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Reference: Specification File Formats
|
|
2
|
+
|
|
3
|
+
> Shared by `skills/qa-module-analysis/` and `skills/qa-spec-generation/`.
|
|
4
|
+
> Contains the exact format templates for all 6 spec files.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## `00-inventory.md`
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
# MODULE: {Module Display Name} — Submodule: {Submodule Display Name}
|
|
12
|
+
|
|
13
|
+
| Field | Value |
|
|
14
|
+
|-------|-------|
|
|
15
|
+
| Module code | {MODULE_CODE} |
|
|
16
|
+
| Submodule code | {SUBMODULE_CODE} |
|
|
17
|
+
| Primary URL | {{QA_BASE_URL}}/path/to/submodule |
|
|
18
|
+
| Status | Active / Deprecated / In Development |
|
|
19
|
+
| Last updated | YYYY-MM-DD |
|
|
20
|
+
|
|
21
|
+
## UI Elements
|
|
22
|
+
|
|
23
|
+
| Element | Type | Required | Notes |
|
|
24
|
+
|---------|------|----------|-------|
|
|
25
|
+
| {field-name} | text / select / checkbox / date | Yes/No | {validation rule} |
|
|
26
|
+
|
|
27
|
+
## API Endpoints
|
|
28
|
+
|
|
29
|
+
| Method | Path | Purpose |
|
|
30
|
+
|--------|------|---------|
|
|
31
|
+
| GET | /api/{endpoint} | {description} |
|
|
32
|
+
| POST | /api/{endpoint} | {description} |
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## `01-business-rules.md`
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
### RN-{MODULE}-{NNN}: {Rule Title}
|
|
41
|
+
|
|
42
|
+
- **Type**: Validation / Access Control / State Machine / Calculation / Integration
|
|
43
|
+
- **Trigger**: {What user action triggers this rule}
|
|
44
|
+
- **Behavior**: {What the system does when the rule is evaluated}
|
|
45
|
+
- **Error message** (if validation): "{exact text as shown in UI}"
|
|
46
|
+
- **Notes**: {any special circumstances}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Rule identification tips**:
|
|
50
|
+
- Every required field → at least 1 RN
|
|
51
|
+
- Every unique constraint → 1 RN (duplicate not allowed)
|
|
52
|
+
- Every state transition → 1 RN (can only approve if status=pending)
|
|
53
|
+
- Every role restriction → 1 RN
|
|
54
|
+
- Every auto-calculated field → 1 RN
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## `02-workflows.md`
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
### FL-{MODULE}-{NNN}: {Workflow Title}
|
|
62
|
+
|
|
63
|
+
**Actor**: {Role who performs this workflow}
|
|
64
|
+
**Trigger**: {What initiates the workflow}
|
|
65
|
+
**Precondition**: {What must be true before this starts}
|
|
66
|
+
|
|
67
|
+
**Flow**:
|
|
68
|
+
```
|
|
69
|
+
[Start]
|
|
70
|
+
│
|
|
71
|
+
▼
|
|
72
|
+
[Step 1: action]
|
|
73
|
+
│
|
|
74
|
+
├─ [Alternative: condition] ──► [Alternative path]
|
|
75
|
+
│
|
|
76
|
+
▼
|
|
77
|
+
[Step 2: action]
|
|
78
|
+
│
|
|
79
|
+
▼
|
|
80
|
+
[End: outcome]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Postcondition**: {State of the system after the workflow completes}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## `03-roles-permissions.md`
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
# Roles and Permissions — {Submodule}
|
|
92
|
+
|
|
93
|
+
## Access Matrix
|
|
94
|
+
|
|
95
|
+
| Feature / Action | {Role 1} | {Role 2} | {Role 3} |
|
|
96
|
+
|-----------------|---------|---------|---------|
|
|
97
|
+
| View list | ✅ | ✅ | ❌ |
|
|
98
|
+
| Create new | ✅ | ❌ | ❌ |
|
|
99
|
+
| Edit | ✅ | ❌ | ❌ |
|
|
100
|
+
| Delete | ✅ | ❌ | ❌ |
|
|
101
|
+
| Approve | ❌ | ✅ | ❌ |
|
|
102
|
+
| Export | ✅ | ✅ | ❌ |
|
|
103
|
+
|
|
104
|
+
## Test User Reference
|
|
105
|
+
|
|
106
|
+
| Role | Env var (email) | Env var (password) |
|
|
107
|
+
|------|----------------|-------------------|
|
|
108
|
+
| {Role 1} | `QA_USER_{ROLE}_EMAIL` | `QA_USER_{ROLE}_PASSWORD` |
|
|
109
|
+
|
|
110
|
+
**Notes**: {conditional access rules}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## `04-test-data.md`
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
# Test Data — {Submodule}
|
|
119
|
+
|
|
120
|
+
## Prerequisites
|
|
121
|
+
|
|
122
|
+
| Item | Description | Source |
|
|
123
|
+
|------|-------------|--------|
|
|
124
|
+
| {entity} | {description} | QA seed / pre-existing |
|
|
125
|
+
|
|
126
|
+
## Data shapes for key scenarios
|
|
127
|
+
|
|
128
|
+
### Scenario: {happy path}
|
|
129
|
+
- Field A: {value type}
|
|
130
|
+
- User: role `{ROLE_NAME}`, credentials from `QA_USER_{ROLE}_EMAIL` env var
|
|
131
|
+
|
|
132
|
+
### Scenario: {negative — duplicate}
|
|
133
|
+
- Precondition: {entity} with the same key already exists
|
|
134
|
+
- Field A: {same value as existing record}
|
|
135
|
+
- Expected: {system rejection behavior}
|
|
136
|
+
|
|
137
|
+
## Dynamic data generation (EXEC_IDX pattern)
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
const EXEC_IDX = process.env.EXEC_IDX ?? String(Math.floor(Date.now() / 60_000) % 100_000);
|
|
141
|
+
const uniqueTitle = `Test-${EXEC_IDX}`;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Data isolation rules
|
|
145
|
+
|
|
146
|
+
1. Each test operates on its own data (no shared mutable state between TCs)
|
|
147
|
+
2. Tests requiring pre-existing data provision it in `beforeAll`
|
|
148
|
+
3. EXEC_IDX-named data does not require cleanup
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## `05-test-scenarios.md`
|
|
154
|
+
|
|
155
|
+
```markdown
|
|
156
|
+
# Test Scenarios — {Module}: {Submodule}
|
|
157
|
+
|
|
158
|
+
**Module code**: {MODULE_CODE}
|
|
159
|
+
**Submodule code**: {SUBMODULE_CODE}
|
|
160
|
+
**Last updated**: YYYY-MM-DD
|
|
161
|
+
|
|
162
|
+
## Summary
|
|
163
|
+
|
|
164
|
+
| Priority | Count | Automated | Manual |
|
|
165
|
+
|----------|-------|-----------|--------|
|
|
166
|
+
| P0 | {N} | {N} | {N} |
|
|
167
|
+
| P1 | {N} | {N} | {N} |
|
|
168
|
+
| P2 | {N} | {N} | {N} |
|
|
169
|
+
| P3 | {N} | {N} | {N} |
|
|
170
|
+
| **Total** | **{N}** | **{N}** | **{N}** |
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### TC-{MODULE}-{SUBMODULE}-{NNN}: {TC Title}
|
|
175
|
+
|
|
176
|
+
| Field | Value |
|
|
177
|
+
|-------|-------|
|
|
178
|
+
| Priority | P0 / P1 / P2 / P3 |
|
|
179
|
+
| Type | Functional / Negative / Regression / Security / Integration |
|
|
180
|
+
| Origin | UI-OBSERVED / PENDING-CODE / BLOCKED-PERMISSIONS |
|
|
181
|
+
| Automation | Yes / Partial / No |
|
|
182
|
+
| Playwright | (fill after automation is written) |
|
|
183
|
+
|
|
184
|
+
**Preconditions**:
|
|
185
|
+
- {precondition 1}
|
|
186
|
+
|
|
187
|
+
**Steps**:
|
|
188
|
+
1. {step 1}
|
|
189
|
+
2. {step 2}
|
|
190
|
+
3. {step 3}
|
|
191
|
+
|
|
192
|
+
**Expected result**: {observable, measurable outcome}
|
|
193
|
+
|
|
194
|
+
**Notes**: {DEF references, skip conditions, edge cases}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Mandatory coverage checklist
|
|
198
|
+
|
|
199
|
+
- [ ] Access: unauthenticated user redirected to login
|
|
200
|
+
- [ ] Access: role without permission receives error or empty page
|
|
201
|
+
- [ ] Happy path: primary workflow with valid data succeeds
|
|
202
|
+
- [ ] Negative: required field missing → validation error shown
|
|
203
|
+
- [ ] Negative: duplicate record → system rejects with error message
|
|
204
|
+
- [ ] Negative: invalid format → format error shown
|
|
205
|
+
- [ ] State transition: state changes correctly on action
|
|
206
|
+
- [ ] Export/download: file is generated (if feature exists)
|
|
207
|
+
- [ ] Pagination/search: filtering works correctly (if feature exists)
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Common Anti-Patterns
|
|
212
|
+
|
|
213
|
+
| Anti-pattern | Why it's wrong | Correct approach |
|
|
214
|
+
|---|---|---|
|
|
215
|
+
| TC for a feature not in QA env | Invalid test expectations | Mark as `PENDING-CODE` |
|
|
216
|
+
| Real user data in steps | Security issue | Use env var reference |
|
|
217
|
+
| "click the X button" without observed element | Assumes UI | Verify element exists first |
|
|
218
|
+
| 100+ TCs by copy-pasting variations | Bloats spec | Merge near-identical cases |
|
|
219
|
+
| "verify system works correctly" | Untestable | Write observable expected result |
|