@keber/qa-framework 1.0.4
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/CHANGELOG.md +53 -0
- package/README.md +233 -0
- package/agent-instructions/00-module-analysis.md +263 -0
- package/agent-instructions/01-spec-generation.md +278 -0
- package/agent-instructions/02-test-plan-generation.md +202 -0
- package/agent-instructions/03-test-case-generation.md +147 -0
- package/agent-instructions/04-automation-generation.md +310 -0
- package/agent-instructions/04b-test-stabilization.md +306 -0
- package/agent-instructions/05-ado-integration.md +244 -0
- package/agent-instructions/06-maintenance.md +125 -0
- package/docs/architecture.md +227 -0
- package/docs/comparison-matrix.md +131 -0
- package/docs/final-report.md +279 -0
- package/docs/folder-structure-guide.md +291 -0
- package/docs/generalization-decisions.md +203 -0
- package/docs/installation.md +239 -0
- package/docs/spec-driven-philosophy.md +170 -0
- package/docs/usage-with-agent.md +203 -0
- package/examples/module-example/README.md +34 -0
- package/examples/module-example/suppliers/00-inventory.md +56 -0
- package/examples/module-example/suppliers/suppliers-create.spec.ts +148 -0
- package/integrations/ado-powershell/README.md +75 -0
- package/integrations/ado-powershell/pipelines/azure-pipeline-qa.yml +133 -0
- package/integrations/ado-powershell/scripts/create-testplan-from-mapping.ps1 +114 -0
- package/integrations/ado-powershell/scripts/inject-ado-ids.ps1 +96 -0
- package/integrations/ado-powershell/scripts/sync-ado-titles.ps1 +93 -0
- package/integrations/playwright/README.md +68 -0
- package/integrations/playwright-azure-reporter/README.md +88 -0
- package/package.json +57 -0
- package/qa-framework.config.json +87 -0
- package/scripts/cli.js +74 -0
- package/scripts/generate.js +92 -0
- package/scripts/init.js +322 -0
- package/scripts/validate.js +184 -0
- package/templates/automation-scaffold/.env.example +56 -0
- package/templates/automation-scaffold/fixtures/auth.ts +77 -0
- package/templates/automation-scaffold/fixtures/test-helpers.ts +85 -0
- package/templates/automation-scaffold/global-setup.ts +106 -0
- package/templates/automation-scaffold/package.json +24 -0
- package/templates/automation-scaffold/playwright.config.ts +85 -0
- package/templates/defect-report.md +101 -0
- package/templates/execution-report.md +116 -0
- package/templates/session-summary.md +73 -0
- package/templates/specification/00-inventory.md +81 -0
- package/templates/specification/01-business-rules.md +90 -0
- package/templates/specification/02-workflows.md +114 -0
- package/templates/specification/03-roles-permissions.md +49 -0
- package/templates/specification/04-test-data.md +104 -0
- package/templates/specification/05-test-scenarios.md +226 -0
- package/templates/test-case.md +81 -0
- package/templates/test-plan.md +130 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# docs/installation.md
|
|
2
|
+
|
|
3
|
+
## Installing `qa-framework`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js >= 18
|
|
10
|
+
- npm >= 8
|
|
11
|
+
- Git (the `qa/` directory should live inside a Git repository)
|
|
12
|
+
- PowerShell >= 5.1 (only required for Azure DevOps integration scripts)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Option A — npm install (recommended)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Install as a dev dependency
|
|
20
|
+
npm install --save-dev keber/qa-framework
|
|
21
|
+
|
|
22
|
+
# Run the init command
|
|
23
|
+
npx qa-framework init
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The `init` command will prompt you for:
|
|
27
|
+
|
|
28
|
+
1. **Project name** (used in config and directory labels)
|
|
29
|
+
2. **QA base URL** (e.g., `https://myproject-qa.example.com`)
|
|
30
|
+
3. **Login path** (e.g., `/login` or `/Seguridad/Login`)
|
|
31
|
+
4. **Number of test user roles** (1 = single role, 2+ = multi-role)
|
|
32
|
+
5. **Enable Playwright integration?** (y/n)
|
|
33
|
+
6. **Enable Azure DevOps integration?** (y/n)
|
|
34
|
+
|
|
35
|
+
After answering these, `init` creates:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
qa/
|
|
39
|
+
├── README.md ← Prefilled with your project name
|
|
40
|
+
├── QA-STRUCTURE-GUIDE.md ← Full structure guide
|
|
41
|
+
├── qa-framework.config.json ← Your project config
|
|
42
|
+
├── 00-guides/ ← Agent instructions (copied)
|
|
43
|
+
├── 00-standards/ ← Templates and naming conventions
|
|
44
|
+
├── 01-specifications/README.md
|
|
45
|
+
├── 02-test-plans/README.md
|
|
46
|
+
├── 03-test-cases/README.md
|
|
47
|
+
├── 04-test-data/README.md
|
|
48
|
+
├── 05-test-execution/README.md
|
|
49
|
+
├── 06-defects/README.md
|
|
50
|
+
├── 07-automation/README.md
|
|
51
|
+
└── 08-azure-integration/README.md ← Only if ADO enabled
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
If Playwright is enabled, it also creates:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
qa/07-automation/e2e/
|
|
58
|
+
├── package.json
|
|
59
|
+
├── playwright.config.ts
|
|
60
|
+
├── global-setup.ts
|
|
61
|
+
├── .env.example
|
|
62
|
+
└── fixtures/
|
|
63
|
+
└── auth.ts
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Option B — Clone or copy (early adoption / no npm registry)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# From your project root
|
|
72
|
+
git clone https://github.com/your-org/qa-framework.git tools/qa-framework
|
|
73
|
+
|
|
74
|
+
# Run init
|
|
75
|
+
node tools/qa-framework/scripts/cli.js init
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Option C — Manual scaffold (advanced)
|
|
81
|
+
|
|
82
|
+
If you prefer to control exactly what gets created:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Clone the package
|
|
86
|
+
git clone https://github.com/your-org/qa-framework.git tools/qa-framework
|
|
87
|
+
|
|
88
|
+
# Copy only the templates you need
|
|
89
|
+
cp -r tools/qa-framework/templates/specification qa/01-specifications/shared/
|
|
90
|
+
cp -r tools/qa-framework/agent-instructions qa/00-guides/
|
|
91
|
+
cp -r tools/qa-framework/templates/automation-scaffold qa/07-automation/e2e/
|
|
92
|
+
|
|
93
|
+
# Then manually fill in qa-framework.config.json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Post-Install Configuration
|
|
99
|
+
|
|
100
|
+
Edit `qa/qa-framework.config.json` (or `qa-framework.config.json` at project root):
|
|
101
|
+
|
|
102
|
+
### Required fields
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"project": {
|
|
107
|
+
"name": "my-project",
|
|
108
|
+
"displayName": "My Project QA",
|
|
109
|
+
"qaBaseUrl": "https://my-qa-env.example.com",
|
|
110
|
+
"loginPath": "/login"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Optional: Playwright
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"integrations": {
|
|
120
|
+
"playwright": {
|
|
121
|
+
"enabled": true,
|
|
122
|
+
"automationRoot": "qa/07-automation/e2e",
|
|
123
|
+
"workers": { "local": 2, "ci": 1 },
|
|
124
|
+
"timeout": 30000,
|
|
125
|
+
"actionTimeout": 10000
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Optional: Azure DevOps
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"integrations": {
|
|
136
|
+
"azureDevOps": {
|
|
137
|
+
"enabled": true,
|
|
138
|
+
"organization": "my-ado-org",
|
|
139
|
+
"project": "my-ado-project",
|
|
140
|
+
"variableGroup": "qa-secrets"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Never** put `testPlanId`, `suiteId`, or `ADO_PAT` in the config file directly.
|
|
147
|
+
Use environment variables:
|
|
148
|
+
|
|
149
|
+
- `ADO_PAT` — Personal Access Token
|
|
150
|
+
- `ADO_PLAN_ID` — Test Plan ID (can also go in `module-registry.json`)
|
|
151
|
+
- `ADO_SUITE_ID` — Suite ID
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Environment Variables
|
|
156
|
+
|
|
157
|
+
Create `qa/07-automation/e2e/.env` (local, **never commit**):
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Required
|
|
161
|
+
QA_BASE_URL=https://my-qa-env.example.com
|
|
162
|
+
QA_USER_EMAIL=qa-user@example.com
|
|
163
|
+
QA_USER_PASSWORD=
|
|
164
|
+
|
|
165
|
+
# Multi-role (if using multi-role auth)
|
|
166
|
+
QA_USER_ADMIN_EMAIL=qa-admin@example.com
|
|
167
|
+
QA_USER_ADMIN_PASSWORD=
|
|
168
|
+
|
|
169
|
+
# ADO (only if integration enabled)
|
|
170
|
+
ADO_PAT=<your-personal-access-token>
|
|
171
|
+
ADO_ORG=my-ado-org
|
|
172
|
+
ADO_PROJECT=my-ado-project
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Add `.env` to `.gitignore`:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
echo "qa/07-automation/e2e/.env" >> .gitignore
|
|
179
|
+
echo ".auth/" >> .gitignore
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Running the First Test
|
|
185
|
+
|
|
186
|
+
After installing and configuring:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Enter the automation directory
|
|
190
|
+
cd qa/07-automation/e2e
|
|
191
|
+
|
|
192
|
+
# Install Playwright
|
|
193
|
+
npm install
|
|
194
|
+
npx playwright install chromium
|
|
195
|
+
|
|
196
|
+
# Run all tests
|
|
197
|
+
npx playwright test
|
|
198
|
+
|
|
199
|
+
# Run a specific module
|
|
200
|
+
npx playwright test tests/my-module/
|
|
201
|
+
|
|
202
|
+
# Open the HTML report
|
|
203
|
+
npx playwright show-report
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Verifying Installation
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npx qa-framework validate
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
This checks:
|
|
215
|
+
|
|
216
|
+
- Required folders exist
|
|
217
|
+
- `qa-framework.config.json` is present and valid
|
|
218
|
+
- `.env.example` exists
|
|
219
|
+
- `.env` is gitignored
|
|
220
|
+
- Agent instruction files are in place
|
|
221
|
+
- No credentials are hardcoded in any Markdown file
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Upgrading
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
npm update keber/qa-framework
|
|
229
|
+
npx qa-framework upgrade
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The `upgrade` command:
|
|
233
|
+
|
|
234
|
+
1. Checks the current framework version in your project
|
|
235
|
+
2. Shows a diff of changed template and instruction files
|
|
236
|
+
3. Prompts before overwriting any file that has local modifications
|
|
237
|
+
4. Never touches `01-specifications/`, `02-test-plans/`, `03-test-cases/`, `04-test-data/`, `05-test-execution/`, `06-defects/` — only framework-owned files are updated
|
|
238
|
+
|
|
239
|
+
See `MIGRATION-NOTES.md` for version-specific migration instructions.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# docs/spec-driven-philosophy.md
|
|
2
|
+
|
|
3
|
+
## Spec-Driven Automated Testing — Core Philosophy
|
|
4
|
+
|
|
5
|
+
This document explains the methodology that underpins the entire `qa-framework`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The Core Principle: UI is the Source of Truth
|
|
10
|
+
|
|
11
|
+
> A test case is only valid if it describes behavior that is **visible**, **accessible**, and **observable** in the running QA environment.
|
|
12
|
+
|
|
13
|
+
Never write test cases from:
|
|
14
|
+
- Source code (a route may be implemented but hidden in the UI)
|
|
15
|
+
- Requirements documents (a requirement may not yet be deployed)
|
|
16
|
+
- Database schemas (business logic in the DB does not equal a user-facing feature)
|
|
17
|
+
|
|
18
|
+
**Always** write test cases after observing the actual QA environment behavior.
|
|
19
|
+
|
|
20
|
+
### TC Origin Classification
|
|
21
|
+
|
|
22
|
+
Every test case must declare its origin:
|
|
23
|
+
|
|
24
|
+
| Origin tag | Meaning |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `UI-OBSERVED` | The behavior was observed directly in the running QA environment |
|
|
27
|
+
| `PENDING-CODE` | The feature is planned but not yet deployed |
|
|
28
|
+
| `BLOCKED-PERMISSIONS` | The feature exists but the QA user cannot access it |
|
|
29
|
+
|
|
30
|
+
A test case with origin `PENDING-CODE` or `BLOCKED-PERMISSIONS` must be in `test.skip()` until its status changes.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## The Spec-Before-Automation Rule
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Specification exists FIRST → Automation comes second
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Automation artifacts (spec files, page objects) always reference a spec TC-ID. It is never acceptable to write a Playwright test without a corresponding TC in `05-test-scenarios.md`.
|
|
41
|
+
|
|
42
|
+
This provides:
|
|
43
|
+
- **Traceability**: every test can be traced back to a business requirement
|
|
44
|
+
- **Coverage visibility**: the spec is the source of truth for what is and isn't covered
|
|
45
|
+
- **Prioritization**: P0/P1/P2/P3 priorities are set in the spec, not in the test file
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## The 6-File Submodule Pattern
|
|
50
|
+
|
|
51
|
+
The basic unit of QA work is a **submodule**. Every submodule produces exactly 6 files:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
submodule-{name}/
|
|
55
|
+
├── 00-inventory.md What exists (UI elements, APIs, routes)
|
|
56
|
+
├── 01-business-rules.md Rules the system enforces (RN-* IDs)
|
|
57
|
+
├── 02-workflows.md User flows (FL-* flowcharts)
|
|
58
|
+
├── 03-roles-permissions.md Who can do what
|
|
59
|
+
├── 04-test-data.md What data is needed to test
|
|
60
|
+
└── 05-test-scenarios.md Test cases (TC-* IDs, priority, steps)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This pattern ensures every submodule is analyzed with the same depth, regardless of complexity.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Test Pyramid Targets
|
|
68
|
+
|
|
69
|
+
| Layer | Target |
|
|
70
|
+
|---|---|
|
|
71
|
+
| Unit tests (back-end) | ~70% of all tests |
|
|
72
|
+
| Integration tests | ~20% of all tests |
|
|
73
|
+
| E2E browser tests | ~10% of all tests |
|
|
74
|
+
|
|
75
|
+
The framework focuses on the **E2E layer** (10%), because this is where spec-driven automation adds the most value and where agents can contribute most directly.
|
|
76
|
+
|
|
77
|
+
E2E tests should cover:
|
|
78
|
+
- Critical happy paths (P0)
|
|
79
|
+
- Key negative scenarios (P1)
|
|
80
|
+
- Cross-module integration flows (P1)
|
|
81
|
+
|
|
82
|
+
E2E tests should NOT try to cover:
|
|
83
|
+
- Every edge case (that's the unit test layer)
|
|
84
|
+
- Every data validation (that's the integration test layer)
|
|
85
|
+
- Pure UI cosmetics
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Priority Levels
|
|
90
|
+
|
|
91
|
+
| Priority | Meaning | Target in automation |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| **P0** | Critical — system unusable without this | Must be automated |
|
|
94
|
+
| **P1** | High — significant impact if broken | Should be automated |
|
|
95
|
+
| **P2** | Medium — moderate impact | Automate if feasible |
|
|
96
|
+
| **P3** | Low — minor impact | Manual testing acceptable |
|
|
97
|
+
|
|
98
|
+
In the automation suite, P0 tests form the **smoke suite** that runs on every CI build.
|
|
99
|
+
P1 tests run on scheduled runs or before each release.
|
|
100
|
+
P2/P3 are candidates for manual exploratory testing.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Defect Handling in Automation
|
|
105
|
+
|
|
106
|
+
When a test fails because of a **known bug** (not a test error):
|
|
107
|
+
|
|
108
|
+
1. File a defect record (`06-defects/DEF-NNN.md` or ADO Work Item)
|
|
109
|
+
2. Add `test.skip(true, 'DEF-NNN: description. Reactivate when ADO #{WI_ID} is resolved.')` to the test
|
|
110
|
+
3. Make the test assertion document the buggy behavior: do not make it pass incorrectly
|
|
111
|
+
4. When the bug is fixed: remove the skip, verify it passes ≥2 times with different `EXEC_IDX`, then close the defect
|
|
112
|
+
|
|
113
|
+
**Never** make a test "green" by removing the assertion that catches the bug. The test should accurately describe expected behavior.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Correctness Criteria for Automation
|
|
118
|
+
|
|
119
|
+
A test is considered **stable** only when:
|
|
120
|
+
|
|
121
|
+
1. It passes ≥ 2 consecutive runs with **different `EXEC_IDX` values** (i.e., different time slots)
|
|
122
|
+
2. It does not rely on pre-existing data that could disappear
|
|
123
|
+
3. It can be run independently (not dependent on another test's side effects)
|
|
124
|
+
|
|
125
|
+
The `EXEC_IDX` pattern:
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// Changes every 60 seconds, wraps at 100,000
|
|
129
|
+
const EXEC_IDX = Math.floor(Date.now() / 60_000) % 100_000;
|
|
130
|
+
|
|
131
|
+
// Use in test data to generate unique values
|
|
132
|
+
const testDate = `${2120 + (EXEC_IDX % 10)}-01-${String((EXEC_IDX % 28) + 1).padStart(2, '0')}`;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This avoids:
|
|
136
|
+
- Database unique constraint violations (same data in back-to-back runs)
|
|
137
|
+
- Need for test teardown (different dates don't collide)
|
|
138
|
+
- Test data that expires or becomes invalid
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Credential Security Rules
|
|
143
|
+
|
|
144
|
+
1. **Never** put real credentials in any Markdown file
|
|
145
|
+
2. **Never** put real credentials in test code directly; always read from `process.env`
|
|
146
|
+
3. **Always** use `page.evaluate()` (not `page.fill()`) to input passwords, so they are excluded from Playwright traces
|
|
147
|
+
4. When writing execution reports or session summaries, replace any accidentally captured credentials with `<PLACEHOLDER>`
|
|
148
|
+
5. `.env` files are always gitignored; use `.env.example` as the committed template
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Agent-Assisted vs Human QA Work
|
|
153
|
+
|
|
154
|
+
This framework supports both:
|
|
155
|
+
|
|
156
|
+
| Task | Primary actor |
|
|
157
|
+
|---|---|
|
|
158
|
+
| Module analysis (discover UI, map routes) | Agent (using Playwright CLI) |
|
|
159
|
+
| Writing 6-file submodule specs | Agent (using module-analysis instructions) |
|
|
160
|
+
| Test case generation | Agent (guided by TC templates) |
|
|
161
|
+
| Automation code | Agent (guided by automation instructions) |
|
|
162
|
+
| Exploratory testing | Human |
|
|
163
|
+
| Bug filing and root cause | Human (agent can assist) |
|
|
164
|
+
| ADO sync | Agent (guided by ADO integration instructions) |
|
|
165
|
+
| Maintenance after code change | Agent + Human review |
|
|
166
|
+
|
|
167
|
+
The handoff between agent and human should always happen at a known checkpoint:
|
|
168
|
+
- After the spec set is produced → human reviews before automation is written
|
|
169
|
+
- After automation is written → human reviews coverage mapping
|
|
170
|
+
- After a defect is filed → human decides priority and fix approach
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# docs/usage-with-agent.md
|
|
2
|
+
|
|
3
|
+
## Using `qa-framework` with an IDE Agent (GitHub Copilot)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This framework is designed so that an IDE agent (such as GitHub Copilot in VS Code) can:
|
|
10
|
+
|
|
11
|
+
1. Understand the QA structure by reading the agent instruction files
|
|
12
|
+
2. Navigate the `qa/` directory predictably
|
|
13
|
+
3. Generate spec, plan, test case, and automation artifacts
|
|
14
|
+
4. Maintain existing artifacts after code changes
|
|
15
|
+
5. Optionally synchronize results with Azure DevOps
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Quick Reference: What to Tell the Agent
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
# Install the framework
|
|
23
|
+
"Run the qa-framework init command for this project"
|
|
24
|
+
|
|
25
|
+
# Read the framework instructions
|
|
26
|
+
"Read the file qa/00-guides/AGENT-INSTRUCTIONS-MODULE-ANALYSIS.md"
|
|
27
|
+
|
|
28
|
+
# Generate the QA structure
|
|
29
|
+
"Generate the full qa/ directory structure using the framework config"
|
|
30
|
+
|
|
31
|
+
# Analyze a module
|
|
32
|
+
"Analyze the module at [URL/route] following qa/00-guides/AGENT-INSTRUCTIONS-MODULE-ANALYSIS.md"
|
|
33
|
+
|
|
34
|
+
# Generate spec, plan, cases, and automation
|
|
35
|
+
"For submodule {name}, generate all 6 spec files following the templates in qa/00-standards/"
|
|
36
|
+
"Generate a test plan for module {name}"
|
|
37
|
+
"Write Playwright E2E tests for TC-{ID} through TC-{ID}"
|
|
38
|
+
|
|
39
|
+
# Integrate results with Azure DevOps
|
|
40
|
+
"Follow qa/08-azure-integration/AGENT-ADO-INTEGRATION.md to sync results with ADO"
|
|
41
|
+
|
|
42
|
+
# Maintenance
|
|
43
|
+
"Module {name} was updated. Review and update the spec files following qa/00-guides/AGENT-INSTRUCTIONS-MAINTENANCE.md"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Setting Up Agent Instructions in VS Code
|
|
49
|
+
|
|
50
|
+
### Option A — Reference files in the agent conversation
|
|
51
|
+
|
|
52
|
+
Simply paste the relevant instruction file path into the Copilot chat:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Read qa/00-guides/AGENT-INSTRUCTIONS-MODULE-ANALYSIS.md and then analyze the module at {URL}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Option B — Workspace instructions file (recommended)
|
|
59
|
+
|
|
60
|
+
Create `.github/copilot-instructions.md` in your project root:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
# QA Framework Instructions
|
|
64
|
+
|
|
65
|
+
This project uses qa-framework v1.0.0 for spec-driven automated testing.
|
|
66
|
+
|
|
67
|
+
## Agent behavior rules
|
|
68
|
+
|
|
69
|
+
1. Before performing any QA task, read the relevant instruction file from `qa/00-guides/`
|
|
70
|
+
2. Always save artifacts in the correct `qa/` subfolder per `qa/QA-STRUCTURE-GUIDE.md`
|
|
71
|
+
3. Never hardcode credentials — always use env vars and `<PLACEHOLDER>` in documentation
|
|
72
|
+
4. follow the naming conventions in `qa/00-standards/naming-conventions.md`
|
|
73
|
+
|
|
74
|
+
## Available instructions
|
|
75
|
+
|
|
76
|
+
- Module analysis: `qa/00-guides/AGENT-INSTRUCTIONS-MODULE-ANALYSIS.md`
|
|
77
|
+
- Spec generation: `qa/00-guides/AGENT-INSTRUCTIONS-SPEC-GENERATION.md`
|
|
78
|
+
- Test cases: `qa/00-guides/AGENT-INSTRUCTIONS-TEST-CASES.md`
|
|
79
|
+
- Automation: `qa/00-guides/AGENT-INSTRUCTIONS-AUTOMATION.md`
|
|
80
|
+
- ADO integration: `qa/00-guides/AGENT-INSTRUCTIONS-ADO-INTEGRATION.md`
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Option C — Individual task prompts
|
|
84
|
+
|
|
85
|
+
For each major QA task, use the prompt from the relevant `agent-instructions/*.md` file
|
|
86
|
+
as the starting prompt. These are designed to be copied and pasted directly.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Typical Agent Session Workflow
|
|
91
|
+
|
|
92
|
+
### Session 1: Initial Module Analysis
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
1. Agent reads qa/00-guides/AGENT-INSTRUCTIONS-MODULE-ANALYSIS.md
|
|
96
|
+
2. Agent navigates to QA_BASE_URL using Playwright CLI
|
|
97
|
+
3. Agent explores the module: screenshots, routes, form fields, APIs
|
|
98
|
+
4. Agent produces qa/01-specifications/module-{name}/submodule-{x}/ (6 files each)
|
|
99
|
+
5. Agent writes SESSION-SUMMARY-{date}.md at qa/ root
|
|
100
|
+
6. Human reviews specs and approves before proceeding
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Session 2: Test Plan + Test Cases
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
1. Agent reads approved specs from 01-specifications/
|
|
107
|
+
2. Agent reads qa/00-guides/AGENT-INSTRUCTIONS-TEST-CASES.md
|
|
108
|
+
3. Agent selects TCs for automation (P0/P1) and manual (P2/P3)
|
|
109
|
+
4. Agent writes qa/02-test-plans/{module}-automated-test-plan.md
|
|
110
|
+
5. Human reviews priorities
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Session 3: Automation
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
1. Agent reads approved test plan
|
|
117
|
+
2. Agent reads qa/00-guides/AGENT-INSTRUCTIONS-AUTOMATION.md
|
|
118
|
+
3. Agent writes Playwright spec files in qa/07-automation/e2e/tests/{module}/
|
|
119
|
+
4. Agent runs tests, iterates until stable
|
|
120
|
+
5. Agent writes qa/05-test-execution/automated/{date}.md
|
|
121
|
+
6. Human reviews automation coverage
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Session 4: ADO Sync (if enabled)
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
1. Agent reads qa/08-azure-integration/AGENT-ADO-INTEGRATION.md
|
|
128
|
+
2. Agent runs inject-ado-ids.ps1 to prefix test titles
|
|
129
|
+
3. Agent verifies runner output appears in ADO Test Plan
|
|
130
|
+
4. Agent updates qa/08-azure-integration/ado-ids-mapping-{project}.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Agent Do's and Don'ts
|
|
136
|
+
|
|
137
|
+
### DO
|
|
138
|
+
|
|
139
|
+
- ✅ Read the instruction file before starting any QA task
|
|
140
|
+
- ✅ Save all artifacts in the exact path specified by the structure guide
|
|
141
|
+
- ✅ Use TC-ID, RN-ID, FL-ID naming consistently
|
|
142
|
+
- ✅ Replace credentials with `<PLACEHOLDER>` in any markdown output
|
|
143
|
+
- ✅ Write a brief session summary after each working session
|
|
144
|
+
- ✅ Reference the DEF-ID or ADO WI ID in every `test.skip()` call
|
|
145
|
+
- ✅ Validate test stability with ≥2 passes using different `EXEC_IDX` values
|
|
146
|
+
|
|
147
|
+
### DON'T
|
|
148
|
+
|
|
149
|
+
- ❌ Invent test cases without first observing the QA environment
|
|
150
|
+
- ❌ Hardcode credentials, DNIs, or personal data in any file
|
|
151
|
+
- ❌ Save screenshots or debug output to the project root
|
|
152
|
+
- ❌ Run Playwright directly from inside `qa/07-automation/e2e/` (always from project root)
|
|
153
|
+
- ❌ Modify files in `00-guides/` or `00-standards/` (those are framework-owned)
|
|
154
|
+
- ❌ Create test cases for features marked `BLOCKED-PERMISSIONS` without noting the blocker
|
|
155
|
+
- ❌ Remove a `test.skip()` without verifying the underlying defect is resolved
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## File Naming Quick Reference
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Module spec folder: qa/01-specifications/module-{kebab-name}/
|
|
163
|
+
Submodule folder: qa/01-specifications/module-{x}/submodule-{kebab-name}/
|
|
164
|
+
TC ID format: TC-{MODULE}-{SUBMODULE}-{NNN} e.g. TC-OPER-CAT-001
|
|
165
|
+
RN ID format: RN-{MODULE}-{NNN} e.g. RN-OPER-001
|
|
166
|
+
FL ID format: FL-{MODULE}-{NNN} e.g. FL-OPER-001
|
|
167
|
+
Defect file: DEF-{NNN}-{slug}.md e.g. DEF-001-switch-default-off.md
|
|
168
|
+
Execution report: YYYY-MM-DD_HH-MM-SS_desc.md
|
|
169
|
+
Test title (no ADO): [TC-OPER-CAT-001] Title @P0
|
|
170
|
+
Test title (ADO): [22957] Title @P0
|
|
171
|
+
Screenshot: NNN-description.png in qa/07-automation/e2e/diagnosis/
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Checking Framework Compliance
|
|
177
|
+
|
|
178
|
+
At any time, the agent can be asked to validate the QA structure:
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
npx qa-framework validate
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
This performs:
|
|
185
|
+
- Structure check (all 9 folders exist)
|
|
186
|
+
- Config check (required fields populated)
|
|
187
|
+
- Credential scan (no hardcoded passwords in markdown)
|
|
188
|
+
- Naming check (IC IDs follow `TC-{MODULE}-{NNN}` pattern)
|
|
189
|
+
- Coverage check (all spec TCs have matching test file references)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Continuing from a Previous Session
|
|
194
|
+
|
|
195
|
+
Ask the agent:
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
"Read qa/SESSION-SUMMARY-{last-date}.md and qa/README.md, then tell me where we left off
|
|
199
|
+
and what the next steps are."
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The session summary + README combination gives the agent sufficient context to resume
|
|
203
|
+
without re-reading the entire qa/ directory.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Example Module: Suppliers
|
|
2
|
+
|
|
3
|
+
This example shows a **complete, filled-in** application of the `keber/qa-framework`
|
|
4
|
+
to a fictional **Suppliers** module. Use it as a reference when creating your own modules.
|
|
5
|
+
|
|
6
|
+
## What this example demonstrates
|
|
7
|
+
|
|
8
|
+
| Element | File |
|
|
9
|
+
|---------|------|
|
|
10
|
+
| Module inventory (UI + API) | `suppliers/00-inventory.md` |
|
|
11
|
+
| Business rules | `suppliers/01-business-rules.md` |
|
|
12
|
+
| Create supplier workflow | `suppliers/02-workflows.md` |
|
|
13
|
+
| Role × feature matrix | `suppliers/03-roles-permissions.md` |
|
|
14
|
+
| Test data shapes + EXEC_IDX | `suppliers/04-test-data.md` |
|
|
15
|
+
| 10 baseline test scenarios | `suppliers/05-test-scenarios.md` |
|
|
16
|
+
| Playwright E2E spec file | `suppliers/suppliers-create.spec.ts` |
|
|
17
|
+
|
|
18
|
+
## How to use this example
|
|
19
|
+
|
|
20
|
+
1. Read each file in sequence to understand how the 6-file pattern comes together.
|
|
21
|
+
2. Copy the `suppliers/` folder as a starting point for your own submodule.
|
|
22
|
+
3. Replace all fictional data with your project's real selectors, URLs, and rules.
|
|
23
|
+
4. Run the spec file locally after configuring `.env`:
|
|
24
|
+
```bash
|
|
25
|
+
npx playwright test examples/module-example/suppliers/suppliers-create.spec.ts
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Fictional context
|
|
29
|
+
|
|
30
|
+
- **Application**: GarcesFruit ERP (fictional)
|
|
31
|
+
- **Module**: Suppliers (Proveedores)
|
|
32
|
+
- **Stack**: Blazor WebAssembly + .NET API + ADO
|
|
33
|
+
- **Auth**: Email-based login (`#email-input` / `#password-input`)
|
|
34
|
+
- **Roles**: Admin, Purchasing, Viewer
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Suppliers — Inventory
|
|
2
|
+
|
|
3
|
+
**Module**: Suppliers (SUP)
|
|
4
|
+
**Submodule**: Create / Edit / List
|
|
5
|
+
**Last updated**: 2025-01-15
|
|
6
|
+
**Author**: QA Framework Example
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## UI Elements
|
|
11
|
+
|
|
12
|
+
| Element | Type | Selector | Notes |
|
|
13
|
+
|---------|------|----------|-------|
|
|
14
|
+
| "New Supplier" button | Button | `button:has-text("New Supplier")` | Visible to Admin, Purchasing |
|
|
15
|
+
| Supplier name field | Input (text) | `#supplier-name` | Required; max 200 chars |
|
|
16
|
+
| RUT/Tax ID field | Input (text) | `#supplier-rut` | Format: XXXXXXXX-X |
|
|
17
|
+
| Email field | Input (email) | `#supplier-email` | Validated by regex |
|
|
18
|
+
| Supplier type dropdown | Select | `#supplier-type` | Options: Nacional, Internacional |
|
|
19
|
+
| Save button | Button | `button:has-text("Save")` | Disabled until all required fields filled |
|
|
20
|
+
| Cancel button | Button | `button:has-text("Cancel")` | Returns to list without saving |
|
|
21
|
+
| Supplier grid | Table | `.supplier-grid` | Sortable columns: Name, RUT, Type, Status |
|
|
22
|
+
| Search input | Input (text) | `#supplier-search` | Filters grid client-side |
|
|
23
|
+
| Delete button (row) | Button | `.row-actions button[aria-label="Delete"]` | Admin only; shows confirmation |
|
|
24
|
+
| Edit button (row) | Button | `.row-actions button[aria-label="Edit"]` | Admin, Purchasing |
|
|
25
|
+
| Export button | Button | `button:has-text("Export")` | Downloads .xlsx |
|
|
26
|
+
| Status badge | Badge | `.supplier-status-badge` | Values: Active, Inactive, Pending |
|
|
27
|
+
| Toast notification | Alert | `.toast-container .toast` | Appears on Save/Delete success/error |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## API Endpoints
|
|
32
|
+
|
|
33
|
+
| Method | Path | Auth | Description |
|
|
34
|
+
|--------|------|------|-------------|
|
|
35
|
+
| GET | `/api/suppliers` | Required | List all suppliers (paginated) |
|
|
36
|
+
| GET | `/api/suppliers/{id}` | Required | Get supplier by ID |
|
|
37
|
+
| POST | `/api/suppliers` | Admin, Purchasing | Create new supplier |
|
|
38
|
+
| PUT | `/api/suppliers/{id}` | Admin, Purchasing | Update supplier |
|
|
39
|
+
| DELETE | `/api/suppliers/{id}` | Admin only | Soft-delete supplier |
|
|
40
|
+
| GET | `/api/suppliers/export` | Required | Export XLSX |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Key Identifiers
|
|
45
|
+
|
|
46
|
+
- **Route**: `/suppliers`
|
|
47
|
+
- **Modal selector**: `.supplier-modal` (appears on "New Supplier" click)
|
|
48
|
+
- **Success notification**: `.toast.toast-success:has-text("Supplier saved")`
|
|
49
|
+
- **Error notification**: `.toast.toast-error`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Related Submodules
|
|
54
|
+
|
|
55
|
+
- Purchase Orders (references supplier by ID)
|
|
56
|
+
- Supplier Contacts (child of supplier; CRUD separate)
|