@keber/qa-framework 1.5.2 → 1.6.2

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.
@@ -1,281 +0,0 @@
1
- # Agent Instructions: Specification Generation
2
-
3
- > ⚠️ **DEPRECATED**: This file is superseded by `.github/skills/qa-spec-generation/SKILL.md`.
4
- > Kept as reference during the transition period. Do not update this file.
5
-
6
- **File**: `agent-instructions/01-spec-generation.md`
7
- **Purpose**: Detailed instructions for generating the 6-file submodule specification set from a completed module analysis or from existing source material (UI observation, requirements docs, developer input).
8
-
9
- ---
10
-
11
- ## When to use
12
-
13
- - After Phase 2 (Exploration) of module analysis is complete
14
- - When updating specs after a code change
15
- - When a spec file is missing or incomplete
16
-
17
- ---
18
-
19
- ## Inputs Required
20
-
21
- Before generating specs, gather:
22
-
23
- 1. **Module exploration notes** — from the analysis session
24
- 2. **Module code** — from `qa/00-standards/naming-conventions.md` or allocate a new one
25
- 3. **Submodule name** and its kebab-case directory name
26
- 4. **QA environment observations** — what you actually saw in the UI
27
-
28
- ---
29
-
30
- ## File-by-File Generation Rules
31
-
32
- ### `00-inventory.md` — UI and API Inventory
33
-
34
- **Header block** (always required):
35
-
36
- ```markdown
37
- # MODULE: {Module Display Name} — Submodule: {Submodule Display Name}
38
-
39
- | Field | Value |
40
- |-------|-------|
41
- | Module code | {MODULE_CODE} |
42
- | Submodule code | {SUBMODULE_CODE} |
43
- | Primary URL | {{QA_BASE_URL}}/path/to/submodule |
44
- | Status | Active / Deprecated / In Development |
45
- | Last updated | YYYY-MM-DD |
46
- ```
47
-
48
- **UI element table**:
49
-
50
- ```markdown
51
- ## UI Elements
52
-
53
- | Element | Type | Required | Notes |
54
- |---------|------|----------|-------|
55
- | {field-name} | text / select / checkbox / date | Yes/No | {validation rule} |
56
- ```
57
-
58
- **API endpoints table**:
59
-
60
- ```markdown
61
- ## API Endpoints
62
-
63
- | Method | Path | Purpose |
64
- |--------|------|---------|
65
- | GET | /api/{endpoint} | {description} |
66
- | POST | /api/{endpoint} | {description} |
67
- ```
68
-
69
- **Do NOT include**: credentials, personal data, real user IDs.
70
-
71
- ---
72
-
73
- ### `01-business-rules.md` — Business Rules
74
-
75
- **Format for each rule**:
76
-
77
- ```markdown
78
- ### RN-{MODULE}-{NNN}: {Rule Title}
79
-
80
- - **Type**: Validation / Access Control / State Machine / Calculation / Integration
81
- - **Trigger**: {What user action triggers this rule}
82
- - **Behavior**: {What the system does when the rule is evaluated}
83
- - **Error message** (if validation): "{exact text as shown in UI}"
84
- - **Notes**: {any special circumstances}
85
- ```
86
-
87
- **Rule identification tips**:
88
- - Every required field → at least 1 RN (field is required)
89
- - Every unique constraint → 1 RN (duplicate not allowed)
90
- - Every state transition → 1 RN (can only approve if status=pending)
91
- - Every role restriction → 1 RN (only role X can see this)
92
- - Every auto-calculated field → 1 RN (total = quantity × price)
93
-
94
- **Minimum**: 5 rules per submodule. **Typical**: 8–15.
95
-
96
- ---
97
-
98
- ### `02-workflows.md` — User Workflows
99
-
100
- **Format for each workflow**:
101
-
102
- ```markdown
103
- ### FL-{MODULE}-{NNN}: {Workflow Title}
104
-
105
- **Actor**: {Role who performs this workflow}
106
- **Trigger**: {What initiates the workflow}
107
- **Precondition**: {What must be true before this starts}
108
-
109
- **Flow**:
110
- ```
111
- [Start]
112
- │
113
- ▼
114
- [Step 1: action]
115
- │
116
- ├─ [Alternative: condition] ──► [Alternative path]
117
- │
118
- ▼
119
- [Step 2: action]
120
- │
121
- ▼
122
- [End: outcome]
123
- ```
124
-
125
- **Postcondition**: {State of the system after the workflow completes}
126
- ```
127
-
128
- Cover at minimum:
129
- - Primary happy path (end-to-end main scenario)
130
- - Rejection / cancellation path (if applicable)
131
- - Error path (validation failure, system error)
132
-
133
- ---
134
-
135
- ### `03-roles-permissions.md` — Role Matrix
136
-
137
- **Format**:
138
-
139
- ```markdown
140
- # Roles and Permissions — {Submodule}
141
-
142
- ## Access Matrix
143
-
144
- | Feature / Action | {Role 1} | {Role 2} | {Role 3} |
145
- |-----------------|---------|---------|---------|
146
- | View list | ✅ | ✅ | ❌ |
147
- | Create new | ✅ | ❌ | ❌ |
148
- | Edit | ✅ | ❌ | ❌ |
149
- | Delete | ✅ | ❌ | ❌ |
150
- | Approve | ❌ | ✅ | ❌ |
151
- | Export | ✅ | ✅ | ❌ |
152
-
153
- ## Test User Reference
154
-
155
- | Role | Env var (email) | Env var (password) |
156
- |------|----------------|-------------------|
157
- | {Role 1} | `QA_USER_{ROLE}_EMAIL` | `QA_USER_{ROLE}_PASSWORD` |
158
-
159
- **Notes**: {any conditional access rules, e.g., "Admin can only edit own records"}
160
- ```
161
-
162
- **Do NOT include**: actual email addresses, passwords, or personal identifiers.
163
-
164
- ---
165
-
166
- ### `04-test-data.md` — Test Data Requirements
167
-
168
- **Format**:
169
-
170
- ```markdown
171
- # Test Data — {Submodule}
172
-
173
- ## Prerequisites
174
-
175
- The following data must exist in the QA environment before tests run:
176
-
177
- | Item | Description | Source |
178
- |------|-------------|--------|
179
- | {entity} | {description} | QA seed / pre-existing |
180
-
181
- ## Data shapes for key scenarios
182
-
183
- ### Scenario: {happy path}
184
- - Field A: {value type, e.g., "any valid text, max 100 chars"}
185
- - Field B: {value type}
186
- - User: role `{ROLE_NAME}`, credentials from `QA_USER_{ROLE}_EMAIL` env var
187
-
188
- ### Scenario: {negative — duplicate}
189
- - Precondition: {entity} with the same key already exists
190
- - Field A: {same value as existing record}
191
- - Expected: {system rejection behavior}
192
-
193
- ## Dynamic data generation
194
-
195
- For tests that create new records, use the EXEC_IDX pattern to avoid collisions:
196
-
197
- ```typescript
198
- const EXEC_IDX = Math.floor(Date.now() / 60_000) % 100_000;
199
- const uniqueTitle = `Test-${EXEC_IDX}`;
200
- ```
201
-
202
- ## Data isolation rules
203
-
204
- 1. Each test must operate on its own data (no shared mutable state between tests)
205
- 2. Tests that require pre-existing data must provision it in `beforeAll`
206
- 3. Provisioned data does not need to be cleaned up if EXEC_IDX-based names are used
207
- ```
208
-
209
- ---
210
-
211
- ### `05-test-scenarios.md` — Test Cases
212
-
213
- **Header block** (always required):
214
-
215
- ```markdown
216
- # Test Scenarios — {Module}: {Submodule}
217
-
218
- **Module code**: {MODULE_CODE}
219
- **Submodule code**: {SUBMODULE_CODE}
220
- **Last updated**: YYYY-MM-DD
221
-
222
- ## Summary
223
-
224
- | Priority | Count | Automated | Manual |
225
- |----------|-------|-----------|--------|
226
- | P0 | {N} | {N} | {N} |
227
- | P1 | {N} | {N} | {N} |
228
- | P2 | {N} | {N} | {N} |
229
- | P3 | {N} | {N} | {N} |
230
- | **Total** | **{N}** | **{N}** | **{N}** |
231
- ```
232
-
233
- **Format for each test case**:
234
-
235
- ```markdown
236
- ### TC-{MODULE}-{SUBMODULE}-{NNN}: {TC Title}
237
-
238
- | Field | Value |
239
- |-------|-------|
240
- | Priority | P0 / P1 / P2 / P3 |
241
- | Type | Functional / Negative / Regression / Security / Integration |
242
- | Origin | UI-OBSERVED / PENDING-CODE / BLOCKED-PERMISSIONS |
243
- | Automation | Yes / Partial / No |
244
- | Playwright | (leave blank until automation is written; then: `tests/{module}/file.spec.ts`) |
245
-
246
- **Preconditions**:
247
- - {precondition 1}
248
-
249
- **Steps**:
250
- 1. {step 1}
251
- 2. {step 2}
252
- 3. {step 3}
253
-
254
- **Expected result**: {what should happen}
255
-
256
- **Notes**: {any special considerations, DEF references, skip conditions}
257
- ```
258
-
259
- **Mandatory coverage categories** (must have at least 1 TC per category where applicable):
260
-
261
- - [ ] Access: unauthenticated user redirected to login
262
- - [ ] Access: role without permission receives error / empty page
263
- - [ ] Happy path: primary workflow with valid data succeeds
264
- - [ ] Negative: required field missing → validation error shown
265
- - [ ] Negative: duplicate record → system rejects with error message
266
- - [ ] Negative: invalid format → system rejects with format error
267
- - [ ] State transition: state changes correctly on action
268
- - [ ] Export / download: if feature exists, file is generated
269
- - [ ] Pagination / search: if feature exists, filtering works correctly
270
-
271
- ---
272
-
273
- ## Common Anti-Patterns to Avoid
274
-
275
- | Anti-pattern | Why it's wrong | Correct approach |
276
- |---|---|---|
277
- | TC for a feature not in QA env | Creates invalid test expectations | Mark as `PENDING-CODE`, don't write test steps |
278
- | TC with a real user's DNI in steps | Security issue | Use env var reference |
279
- | TC with "click the X button" without knowing the element exists | Assumes UI without observation | Verify element exists first |
280
- | 100+ TCs per submodule by copy-pasting variations | Bloats the spec without value | Merge near-identical cases, use parameterization |
281
- | TC with "verify system works correctly" as expected result | Untestable | Write observable, measurable expected result |
@@ -1,205 +0,0 @@
1
- # Agent Instructions: Test Plan Generation
2
-
3
- > ⚠️ **DEPRECATED**: This file is superseded by `.github/skills/qa-test-plan/SKILL.md`.
4
- > Kept as reference during the transition period. Do not update this file.
5
-
6
- **File**: `agent-instructions/02-test-plan-generation.md`
7
- **Purpose**: Instructions for generating a test plan document for a module, after its spec set is complete.
8
-
9
- ---
10
-
11
- ## When to use
12
-
13
- - After all submodule specs (`05-test-scenarios.md`) are written and reviewed
14
- - When preparing for a sprint or release
15
- - When deciding which TCs to automate vs test manually
16
-
17
- ---
18
-
19
- ## Inputs Required
20
-
21
- 1. `qa/01-specifications/module-{name}/` — all submodule specs
22
- 2. Scope definition: which submodules are in this test plan
23
- 3. Priority guidance (from the team or implied by sprint scope)
24
-
25
- ---
26
-
27
- ## Test Plan Document Structure
28
-
29
- Create: `qa/02-test-plans/automated/{module}-test-plan.md`
30
-
31
- ```markdown
32
- # Test Plan: {Module Display Name}
33
-
34
- | Field | Value |
35
- |-------|-------|
36
- | Version | 1.0 |
37
- | Date | YYYY-MM-DD |
38
- | Module | {module-code} |
39
- | Test plan type | Automated / Manual / Combined |
40
- | Author | {agent or human name} |
41
- | Status | Draft / Approved / Active |
42
-
43
- ---
44
-
45
- ## 1. Objective
46
-
47
- {1-2 sentences: what this test plan covers and why}
48
-
49
- ---
50
-
51
- ## 2. Scope
52
-
53
- ### In scope
54
- - {submodule 1}: {what is being tested}
55
- - {submodule 2}: {what is being tested}
56
-
57
- ### Out of scope
58
- - {what is explicitly excluded and why}
59
-
60
- ---
61
-
62
- ## 3. Automation Feasibility Analysis
63
-
64
- | Submodule | Total TCs | Fully automatable | Partially | Not automatable | Reason for exclusions |
65
- |-----------|-----------|------------------|-----------|-----------------|----------------------|
66
- | {name} | {N} | {N} ({%}) | {N} ({%}) | {N} ({%}) | {brief reason} |
67
-
68
- **Definition**:
69
- - **Fully automatable**: deterministic, observable, no external dependencies
70
- - **Partially automatable**: some steps can be automated, others require manual verification
71
- - **Not automatable**: requires human judgment, external system access, or is too risky to automate in QA
72
-
73
- ---
74
-
75
- ## 4. Priority Distribution
76
-
77
- | Priority | TCs selected | Automated | Manual |
78
- |----------|-------------|-----------|--------|
79
- | P0 (Critical — must run every build) | {N} | {N} | {N} |
80
- | P1 (High — must run before release) | {N} | {N} | {N} |
81
- | P2 (Medium — periodic regression) | {N} | {N} | {N} |
82
- | P3 (Low — manual only) | {N} | 0 | {N} |
83
-
84
- ---
85
-
86
- ## 5. TC Selection and Automation Plan
87
-
88
- ### P0 Suite — {suite name}
89
-
90
- | TC ID | Title | Type | Automation status |
91
- |-------|-------|------|------------------|
92
- | TC-{M}-{S}-001 | {title} | Functional | Queued |
93
- | TC-{M}-{S}-002 | {title} | Negative | Queued |
94
-
95
- ### P1 Suite — {suite name}
96
-
97
- | TC ID | Title | Type | Automation status |
98
- |-------|-------|------|------------------|
99
- | TC-{M}-{S}-010 | {title} | Functional | Queued |
100
-
101
- ---
102
-
103
- ## 6. Azure DevOps Test Plan (if enabled)
104
-
105
- | Item | Value |
106
- |------|-------|
107
- | ADO Plan ID | (populate after creation) |
108
- | ADO Suite IDs | (populate after creation) |
109
- | Reporter | @alex_neo/playwright-azure-reporter |
110
- | Sync script | qa/08-azure-integration/scripts/inject-ado-ids.ps1 |
111
-
112
- ---
113
-
114
- ## 7. Test Environment
115
-
116
- | Item | Value |
117
- |------|-------|
118
- | QA URL | {{QA_BASE_URL}} |
119
- | Browser | Chromium (Playwright) |
120
- | Workers (local) | {N from config} |
121
- | Workers (CI) | {N from config} |
122
- | Parallel sessions supported | Yes / No |
123
-
124
- ---
125
-
126
- ## 8. Risks and Assumptions
127
-
128
- | Risk | Likelihood | Impact | Mitigation |
129
- |------|-----------|--------|------------|
130
- | Unstable QA data | Medium | High | Use EXEC_IDX-generated data |
131
- | External service (email, etc.) not available | High | Medium | Use 3-layer validation strategy |
132
- | QA env down-time | Low | High | Retry with 2h buffer in CI |
133
-
134
- ---
135
-
136
- ## 9. Excluded TCs
137
-
138
- | TC ID | Reason for exclusion |
139
- |-------|---------------------|
140
- | TC-{M}-{S}-NNN | `BLOCKED-PERMISSIONS`: QA user cannot access |
141
- | TC-{M}-{S}-NNN | `PENDING-CODE`: feature not yet deployed |
142
- | TC-{M}-{S}-NNN | Not automatable: requires visual inspection / external access |
143
-
144
- ---
145
-
146
- ## 10. Execution Schedule
147
-
148
- | Suite | Trigger | Frequency |
149
- |-------|---------|-----------|
150
- | P0 smoke | Every CI build | On push to main / PR |
151
- | P1 regression | Scheduled | Nightly |
152
- | P2 full regression | Manual trigger | Before each release |
153
-
154
- ---
155
-
156
- ## Changelog
157
-
158
- | Version | Date | Description |
159
- |---------|------|-------------|
160
- | 1.0 | YYYY-MM-DD | Initial creation |
161
- ```
162
-
163
- ---
164
-
165
- ## Rules for Priority Assignment
166
-
167
- Use this decision tree for each TC:
168
-
169
- ```
170
- Is this the primary happy path of the feature?
171
- ├── YES → P0
172
-
173
- Is a bug here a show-stopper or critical data corruption risk?
174
- ├── YES → P0
175
- ├── NO →
176
- Is this a common negative scenario (empty required field, duplicate)?
177
- ├── YES → P1
178
- Is this a cross-module dependency or state machine transition?
179
- ├── YES → P1
180
- Is this a secondary feature (export, pagination, search)?
181
- ├── YES → P2
182
- Is this an edge case, cosmetic, or low-frequency scenario?
183
- ├── YES → P3
184
- ```
185
-
186
- ---
187
-
188
- ## Automation Feasibility Decision Criteria
189
-
190
- **Mark as fully automatable** when:
191
- - All interactions are observable via browser automation
192
- - The result is deterministic (same input → same output)
193
- - No external systems are involved (live email server, payment gateway)
194
- - Data can be set up programmatically
195
-
196
- **Mark as partially automatable** when:
197
- - Some result requires human visual inspection
198
- - An external system is involved but can be mocked (email intercept, API stub)
199
- - Data setup requires a manual step first
200
-
201
- **Mark as not automatable** when:
202
- - Requires physical access or real hardware
203
- - Result is inherently non-deterministic (performance, visual design)
204
- - Test would create irreversible side effects in QA environment (live invoice, real payment)
205
- - The feature is blocked by permissions that cannot be granted to QA users
@@ -1,150 +0,0 @@
1
- # Agent Instructions: Test Case Generation
2
-
3
- > ⚠️ **DEPRECATED**: This file is superseded by `.github/skills/qa-test-cases/SKILL.md`.
4
- > Kept as reference during the transition period. Do not update this file.
5
-
6
- **File**: `agent-instructions/03-test-case-generation.md`
7
- **Purpose**: Instructions for writing detailed, standalone test case documents from approved spec scenarios.
8
-
9
- ---
10
-
11
- ## When to use
12
-
13
- - When a TC from `05-test-scenarios.md` needs more detail than the table row provides
14
- - When writing complex multi-step TCs that require dedicated documentation
15
- - When preparing TCs for manual testers who need step-by-step instructions
16
-
17
- ---
18
-
19
- ## Test Case Template
20
-
21
- ```markdown
22
- # TC-{MODULE}-{SUBMODULE}-{NNN}: {TC Title}
23
-
24
- | Field | Value |
25
- |-------|-------|
26
- | TC ID | TC-{MODULE}-{SUBMODULE}-{NNN} |
27
- | Module | {Module display name} |
28
- | Submodule | {Submodule display name} |
29
- | Priority | P0 / P1 / P2 / P3 |
30
- | Type | Functional / Negative / Regression / Security / Integration |
31
- | Origin | UI-OBSERVED / PENDING-CODE / BLOCKED-PERMISSIONS |
32
- | Observation date | YYYY-MM-DD |
33
- | Automatable | Yes / Partial / No |
34
- | Playwright file | (fill when automation is written) |
35
- | Status | Draft / Approved / Automated / Deprecated |
36
-
37
- ---
38
-
39
- ## Objective
40
-
41
- {1-2 sentences: what this test case verifies and why it matters}
42
-
43
- ---
44
-
45
- ## Preconditions
46
-
47
- 1. User is logged in as **{role}**
48
- 2. The following data exists in the QA environment:
49
- - {item 1}: {description}
50
- - {item 2}: {description}
51
- 3. {any other system state requirement}
52
-
53
- ---
54
-
55
- ## Test Data
56
-
57
- | Field | Value |
58
- |-------|-------|
59
- | {field name} | {value or generation rule} |
60
- | {field name} | Use `EXEC_IDX`-generated value for uniqueness |
61
- | User | Credentials from `QA_USER_{ROLE}_EMAIL` env var |
62
-
63
- ---
64
-
65
- ## Steps
66
-
67
- | Step | Action | Expected result |
68
- |------|--------|----------------|
69
- | 1 | Navigate to {URL} | {page loads, specific element visible} |
70
- | 2 | Click {element description} | {modal opens / form appears / etc.} |
71
- | 3 | Fill {field} with {value} | {field accepts input} |
72
- | 4 | Click {submit/save/confirm button} | {success message / redirect / state change} |
73
- | 5 | Verify {observable outcome} | {specific text, element, state} |
74
-
75
- ---
76
-
77
- ## Expected Results
78
-
79
- **Final state**: {what the system should look like after all steps are complete}
80
-
81
- **Verification points**:
82
- - [ ] {verification 1}: {element} should {state}
83
- - [ ] {verification 2}: {element} should contain {text}
84
- - [ ] {verification 3}: page/modal should transition to {expected state}
85
-
86
- ---
87
-
88
- ## Known Issues / Related Defects
89
-
90
- | Issue | DEF-ID / ADO WI | Status | Impact on this TC |
91
- |-------|----------------|--------|------------------|
92
- | {description} | DEF-NNN | Open | TC skipped until resolved |
93
-
94
- ---
95
-
96
- ## Evidence
97
-
98
- {Link to screenshot or video from execution, if available}
99
-
100
- ---
101
-
102
- ## Automation Notes
103
-
104
- ```typescript
105
- // Playwright selector for key element (discovered during implementation)
106
- // page.locator('{selector}')
107
-
108
- // Key assertion
109
- // await expect(page.locator('{selector}')).toHaveText('{expected text}');
110
- ```
111
-
112
- ---
113
-
114
- ## Changelog
115
-
116
- | Version | Date | Author | Description |
117
- |---------|------|--------|-------------|
118
- | 1.0 | YYYY-MM-DD | {author} | Initial creation |
119
- ```
120
-
121
- ---
122
-
123
- ## Rules for TC Content Quality
124
-
125
- ### Write measurable expected results
126
-
127
- ❌ BAD: "The system should work correctly"
128
- ✅ GOOD: "A success toast message 'Record saved' appears and the datatable row count increases by 1"
129
-
130
- ❌ BAD: "The form validates the input"
131
- ✅ GOOD: "A red validation message 'This field is required' appears below the Name field"
132
-
133
- ### Write observable steps
134
-
135
- ❌ BAD: "Add a new record with valid data"
136
- ✅ GOOD: "Click the 'New' button. Fill 'Name' with 'Test-{EXEC_IDX}'. Click 'Save'."
137
-
138
- ### Link to defects explicitly
139
-
140
- If a TC is skipped due to a bug:
141
- ✅ GOOD: "Step 4 — SKIPPED: DEF-001 (ADO #21944). The switch defaults to OFF when it should be ON. Reactivate after fix."
142
-
143
- ### Priority guidelines recap
144
-
145
- | Priority | Use when |
146
- |---|---|
147
- | P0 | Core feature is unusable without this working |
148
- | P1 | Major functionality gap if this fails |
149
- | P2 | Minor functionality gap, workaround exists |
150
- | P3 | Edge case, cosmetic, or rare scenario |