@keber/qa-framework 1.1.2 → 1.2.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/README.md CHANGED
@@ -28,27 +28,38 @@ This framework was designed to be:
28
28
 
29
29
  ## Quick Start
30
30
 
31
- ### Option A: Install from npm (recommended)
31
+ ### Install from npm
32
32
 
33
33
  ```bash
34
- npm install --save-dev github:keber/qa-framework
35
- npx qa-framework init
34
+ npm install @keber/qa-framework
36
35
  ```
37
36
 
38
- ### Option B: Clone directly (during early adoption)
37
+ The postinstall script scaffolds the `qa/` structure automatically. No need to run `init` manually.
38
+
39
+ ### Using with an AI agent (GitHub Copilot, Claude, etc.)
40
+
41
+ Use this prompt in your IDE agent chat:
42
+
43
+ ```
44
+ Install @keber/qa-framework, check it's readme file and set up the project for integration with azure devops
45
+ ```
46
+
47
+ The install creates `qa/AGENT-NEXT-STEPS.md` with the exact steps the agent needs to complete the setup (optional integrations, module configuration, credentials, etc.).
48
+
49
+ ### Using manually (without an agent)
39
50
 
40
51
  ```bash
41
- # Clone into your project's tools directory or as a submodule
42
- git clone <this-repo> tools/qa-framework
43
- node tools/qa-framework/scripts/cli.js init
52
+ npm install @keber/qa-framework
53
+ # then read qa/AGENT-NEXT-STEPS.md for next steps
44
54
  ```
45
55
 
46
56
  The `init` command will:
47
57
 
48
58
  1. Create the `qa/` directory tree in your project root
49
- 2. Copy all base templates into place
59
+ 2. Copy all base templates and agent instructions into place
50
60
  3. Create `qa/qa-framework.config.json` for project-specific settings
51
- 4. Optionally set up Playwright and Azure DevOps integrations
61
+ 4. Create `.github/copilot-instructions.md` with QA agent behavior rules
62
+ 5. Create `qa/AGENT-NEXT-STEPS.md` with follow-up steps
52
63
 
53
64
  ---
54
65
 
@@ -308,3 +308,33 @@ After writing automation for a module, create `COVERAGE-MAPPING.md` in the test
308
308
  | TC-OPER-CAT-003 | Duplicate rejection | ... | tests/operacion/... | ⚠️ Partially (UI only) |
309
309
  | TC-OPER-ASI-001 | Access assistance list | ... | — | ⛔ Blocked (BLOCKED-PERMISSIONS) |
310
310
  ```
311
+
312
+ ---
313
+
314
+ ## Module Completion Checklist
315
+
316
+ Run this checklist when all P0 tests for a module are passing.
317
+
318
+ ### Stability gate
319
+ - [ ] All P0 tests pass on **2 consecutive runs** with different `EXEC_IDX` values (≥ 60 seconds apart)
320
+ - [ ] No `waitForTimeout(N)` longer than 2000ms left in the suite
321
+ - [ ] All skipped tests have a `DEF-` or ADO WI reference in their skip message
322
+
323
+ ### Artifacts
324
+ - [ ] `COVERAGE-MAPPING.md` created or updated in the test directory
325
+ - [ ] Execution report written to `qa/05-test-execution/automated/`
326
+
327
+ ### Living Index update — `qa/README.md`
328
+ - [ ] Update the module's row in the status table (TCs automated, date, status → ✅)
329
+ - [ ] Add a row to the `## Sprint History` section with: sprint name, date, submódulos covered, TC count, link to execution report
330
+
331
+ ### AGENT-NEXT-STEPS.md — trim
332
+ - [ ] Move the completed sprint checklist block to `qa/README.md` under `## Sprint History`
333
+ - [ ] Delete the completed sprint section from `AGENT-NEXT-STEPS.md`
334
+ - [ ] Verify `AGENT-NEXT-STEPS.md` now contains **only one active sprint** (the next one)
335
+
336
+ ### Memory
337
+ - [ ] If new patterns or environment quirks were discovered: add them to `qa/memory/` with a descriptive filename
338
+ - [ ] Update `qa/memory/INDEX.md` to reflect any new or updated files
339
+
340
+ > **Rule**: `AGENT-NEXT-STEPS.md` is a task queue, not a log. Completed sprints live in `qa/README.md`. The file must never accumulate more than one active sprint.
@@ -114,6 +114,13 @@ After every maintenance session, update the master index:
114
114
  - Automation status (if changed)
115
115
  - Last updated date for the module
116
116
 
117
+ If a **sprint was fully completed** as part of this maintenance pass (all TCs passing after the changes):
118
+ 1. Move the completed sprint checklist from `AGENT-NEXT-STEPS.md` to the `## Sprint History` section of `qa/README.md`
119
+ 2. Delete the completed sprint block from `AGENT-NEXT-STEPS.md`
120
+ 3. Confirm `AGENT-NEXT-STEPS.md` contains **only one active sprint** — never let it accumulate history
121
+
122
+ Also update `qa/memory/INDEX.md` if any memory files were created or modified.
123
+
117
124
  ---
118
125
 
119
126
  ## Step 6: Write a Session Summary
@@ -11,6 +11,7 @@ This document explains the purpose, contents, and conventions for every folder i
11
11
  ```
12
12
  qa/
13
13
  ├── README.md ← Living master index (project-maintained)
14
+ ├── AGENT-NEXT-STEPS.md ← Active sprint queue for the agent (project-maintained)
14
15
  ├── QA-STRUCTURE-GUIDE.md ← Copy of this guide (installed by framework)
15
16
  ├── qa-framework.config.json ← Project configuration
16
17
  │
@@ -23,7 +24,8 @@ qa/
23
24
  ├── 05-test-execution/ ← Execution reports and results
24
25
  ├── 06-defects/ ← Defect tracking (optional)
25
26
  ├── 07-automation/ ← Automation code (Playwright, etc.)
26
- └── 08-azure-integration/ ← Azure DevOps integration (optional)
27
+ ├── 08-azure-integration/ ← Azure DevOps integration (optional)
28
+ └── memory/ ← Project QA learnings (project-maintained)
27
29
  ```
28
30
 
29
31
  ---
@@ -267,17 +269,69 @@ See `docs/generalization-decisions.md §7` for the full evaluation of this folde
267
269
 
268
270
  ## `qa/README.md` — The Living Index
269
271
 
270
- The `qa/README.md` is the **only project-maintained file at the root of `qa/`**. It should be updated whenever:
272
+ The `qa/README.md` is the primary human-readable project status document. It should be updated whenever:
271
273
  - A new module is analyzed
272
274
  - A new test execution is completed
273
275
  - A blocker is identified or resolved
274
- - A major milestone is reached
276
+ - A major milestone or sprint is completed
275
277
 
276
278
  Minimum contents:
277
279
  - Module status table (name, TCs documented, TCs automated, ADO plan link)
278
280
  - Quick-start commands for common tasks
279
281
  - Active blockers section
280
282
  - Last execution results summary
283
+ - **`## Sprint History`** section — completed sprint checklists moved here from `AGENT-NEXT-STEPS.md`
284
+
285
+ Template: `templates/qa-readme.md`
286
+
287
+ ---
288
+
289
+ ## `qa/AGENT-NEXT-STEPS.md` — Sprint Queue
290
+
291
+ The `AGENT-NEXT-STEPS.md` is the agent's task queue for the current sprint. It is read by the agent at the start of every conversation.
292
+
293
+ **Design principles (SRP + KISS)**:
294
+ - Contains **one active sprint only** — no history, no completed checklists
295
+ - Three sections maximum: module status table, active sprint checklist, context references
296
+ - Does not repeat standing instructions already in `copilot-instructions.md`
297
+ - Detailed environment notes and patterns belong in `qa/memory/`, referenced from here
298
+
299
+ When a sprint completes, the agent **moves** the completed checklist to `qa/README.md → ## Sprint History` and **deletes** that section from this file.
300
+
301
+ Template: `templates/agent-next-steps.md`
302
+
303
+ ---
304
+
305
+ ## `qa/memory/` — Project QA Learnings
306
+
307
+ Project-maintained folder for accumulated knowledge about the application under test: environment quirks, DOM patterns, Playwright gotchas, sprint-specific discoveries.
308
+
309
+ ```
310
+ qa/memory/
311
+ ├── INDEX.md ← Required entry point — index of all files
312
+ ├── {technology}-patterns.md ← Framework/stack-specific patterns (e.g., playwright-blazor-wasm-patterns.md)
313
+ ├── {sprint-name}-discovery.md ← DOM/UI findings for an in-progress sprint
314
+ └── {sprint-name}-lessons.md ← Retrospective patterns after a sprint completes
315
+ ```
316
+
317
+ ### `qa/memory/INDEX.md` — Required
318
+
319
+ The `INDEX.md` is the **gate** that the agent reads before loading any other memory file. Its purpose is to let the agent load only what is relevant to the current task, rather than loading all files.
320
+
321
+ ```markdown
322
+ # Memory Index — {PROJECT_NAME}
323
+
324
+ | File | Topic | When to load |
325
+ |---|---|---|
326
+ | playwright-blazor-wasm-patterns.md | Blazor/Radzen DOM patterns | Any Playwright automation task |
327
+ | sprint4-discovery.md | DOM quirks for BusinessPartner module | Sprint 4 automation only |
328
+ | sprint3-lessons.md | Patterns from Sprint 3 | Reference when working on similar modules |
329
+ ```
330
+
331
+ **Rules for `qa/memory/`**:
332
+ - Always update `INDEX.md` when adding or modifying a memory file
333
+ - Sprint-specific discovery files (`sprint-N-discovery.md`) are for the duration of that sprint; consolidate long-term patterns into a technology-specific file afterwards
334
+ - Never load all memory files unconditionally — always read `INDEX.md` first and select by relevance
281
335
 
282
336
  ---
283
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keber/qa-framework",
3
- "version": "1.1.2",
3
+ "version": "1.2.0-0",
4
4
  "description": "Reusable spec-driven QA framework for IDE-agent-assisted automated testing. Installable as an npm package. Provides structure, templates, agent instructions, and optional integrations for Playwright and Azure DevOps.",
5
5
  "keywords": [
6
6
  "qa",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./qa-framework.config.schema.json",
3
- "frameworkVersion": "1.0.0",
3
+ "frameworkVersion": "1.1.3",
4
4
 
5
5
  "project": {
6
6
  "name": "{{PROJECT_NAME}}",
package/scripts/init.js CHANGED
@@ -79,11 +79,16 @@ process.stderr.write(`[qa-framework/init] Using config source: ${configSource}\n
79
79
  const topLevelFolders = [
80
80
  '00-guides',
81
81
  '00-standards',
82
- '05-test-plans',
82
+ '01-specifications',
83
+ '02-test-plans',
84
+ '03-test-cases',
85
+ '04-test-data',
86
+ '05-test-execution',
83
87
  '06-defects/open',
84
88
  '06-defects/resolved',
85
89
  '07-automation/e2e',
86
90
  '08-azure-integration',
91
+ 'memory',
87
92
  ];
88
93
 
89
94
  for (const folder of topLevelFolders) {
@@ -92,12 +97,47 @@ for (const folder of topLevelFolders) {
92
97
  console.log(` [created] ${path.relative(cwd, fullPath)}/`);
93
98
  }
94
99
 
100
+ // --- qa/README.md ---
101
+ const qaReadmeTemplate = path.resolve(__dirname, '..', 'templates', 'qa-readme.md');
102
+ if (fs.existsSync(qaReadmeTemplate)) {
103
+ let readmeContent = fs.readFileSync(qaReadmeTemplate, 'utf8');
104
+ readmeContent = readmeContent
105
+ .replace(/\{PROJECT_DISPLAY_NAME\}/g, config.project?.displayName ?? config.project?.name ?? 'Project')
106
+ .replace(/\{VERSION\}/g, config.frameworkVersion ?? '1.0.0')
107
+ .replace(/\{LANGUAGE\}/g, config.conventions?.language ?? 'en')
108
+ .replace(/\{QA_BASE_URL\}/g, config.project?.qaBaseUrl ?? '<QA_BASE_URL>');
109
+ writeIfMissing(path.join(qaRoot, 'README.md'), readmeContent);
110
+ }
111
+
112
+ // --- qa/memory/INDEX.md ---
113
+ const memoryDir = path.join(qaRoot, 'memory');
114
+ writeIfMissing(path.join(memoryDir, 'INDEX.md'),
115
+ `# Memory Index — ${config.project?.displayName ?? config.project?.name ?? 'Project'}
116
+
117
+ > The agent reads this file first before loading any memory file.
118
+ > Add a row here whenever you create or update a file in this directory.
119
+
120
+ | File | Topic | When to load |
121
+ |---|---|---|
122
+
123
+ _No memory files yet. Add files to this directory and register them above._
124
+ `);
125
+
95
126
  // --- Standards placeholder ---
96
127
  const stdDir = path.join(qaRoot, '00-standards');
97
128
  writeIfMissing(path.join(stdDir, 'naming-conventions.md'), `# Naming Conventions\n\n> Fill in per your project. See keber/qa-framework docs/spec-driven-philosophy.md.\n`);
98
129
  writeIfMissing(path.join(stdDir, 'bug-report-template.md'), fs.readFileSync(
99
130
  path.resolve(__dirname, '..', 'templates', 'defect-report.md'), 'utf8'
100
131
  ));
132
+ writeIfMissing(path.join(stdDir, 'test-case-template.md'), fs.readFileSync(
133
+ path.resolve(__dirname, '..', 'templates', 'test-case.md'), 'utf8'
134
+ ));
135
+ writeIfMissing(path.join(stdDir, 'execution-report-template.md'), fs.readFileSync(
136
+ path.resolve(__dirname, '..', 'templates', 'execution-report.md'), 'utf8'
137
+ ));
138
+ writeIfMissing(path.join(stdDir, 'test-data-guidelines.md'), fs.readFileSync(
139
+ path.resolve(__dirname, '..', 'templates', 'test-data-guidelines.md'), 'utf8'
140
+ ));
101
141
 
102
142
  // --- Per-module folders ---
103
143
  const modules = config.modules ?? [];
@@ -247,11 +287,19 @@ This project uses \`@keber/qa-framework\` v${config.frameworkVersion ?? '1.0.0'}
247
287
 
248
288
  ## Agent behavior rules
249
289
 
250
- 1. Before performing any QA task, read the relevant instruction file from \`qa/00-guides/\`
290
+ 0. **On every conversation start:** check if \`qa/AGENT-NEXT-STEPS.md\` exists. If it does, read it and complete its steps before anything else.
291
+ 1. Before performing any QA task, read the relevant instruction file from \`qa/00-guides/\`. For project context, read \`qa/memory/INDEX.md\` if it exists, then load only the memory files relevant to the current task — do not load all memory files unconditionally.
251
292
  2. Always save artifacts in the correct \`qa/\` subfolder - refer to \`qa/QA-STRUCTURE-GUIDE.md\`
252
293
  3. Never hardcode credentials - always use env vars and \`<PLACEHOLDER>\` in documentation
253
294
  4. Follow the naming conventions in \`qa/00-standards/naming-conventions.md\`
254
- 5. Project QA config is at \`qa/qa-framework.config.json\`
295
+ 5. Read previous test suites code in \`qa/07-automation/e2e/tests/\` if available before writing new automation to maintain consistency in style and approach
296
+ 6. Project QA config is at \`qa/qa-framework.config.json\`
297
+ 7. Save learnings in \`qa/memory/\` with proper naming and metadata. Always update \`qa/memory/INDEX.md\` after adding or updating any memory file.
298
+ 8. **On module/sprint completion** (all TCs passing): (1) update the module status row in \`qa/README.md\`; (2) move the completed sprint checklist from \`AGENT-NEXT-STEPS.md\` to the \`## Sprint History\` section of \`qa/README.md\`; (3) trim \`AGENT-NEXT-STEPS.md\` so it contains only the next sprint — never let it accumulate more than one active sprint.
299
+
300
+ ## Formatting rules for generated content
301
+ 1. Generate the output in \`UTF-8\` encoding without BOM (\`UTF-8\`, no signature).
302
+ 2. Ensure the raw output is \`UTF-8\` encoded with no \`EF BB BF\` bytes at the beginning.
255
303
 
256
304
  ## Available agent instructions
257
305
 
@@ -265,16 +313,49 @@ This project uses \`@keber/qa-framework\` v${config.frameworkVersion ?? '1.0.0'}
265
313
  | Stabilize failing tests | \`qa/00-guides/AGENT-INSTRUCTIONS-TEST-STABILIZATION.md\` |
266
314
  | Sync with Azure DevOps | \`qa/00-guides/AGENT-INSTRUCTIONS-ADO-INTEGRATION.md\` |
267
315
  | Maintenance after changes | \`qa/00-guides/AGENT-INSTRUCTIONS-MAINTENANCE.md\` |
316
+
317
+ ## Project KB
318
+ 1. \`qa/README.md\` — The Living Index: module status, sprint history, blockers, quick-start commands.
319
+ 2. \`qa/memory/INDEX.md\` — Index of all memory files; load this before selecting which files to read.
268
320
  `;
269
321
  writeIfMissing(copilotInstrPath, copilotInstrContent);
270
322
 
271
- process.stderr.write('\n[qa-framework/init] ✅ QA framework scaffold complete!\n');
272
- process.stderr.write('\nNext steps for the agent:\n');
273
- process.stderr.write(' 1. If ADO integration is needed, run: npm install @keber/ado-qa\n');
274
- process.stderr.write(' 2. If Playwright automation is needed, run: npm install @playwright/test\n');
275
- process.stderr.write(' 3. Edit qa/qa-framework.config.json - add your project modules\n');
276
- process.stderr.write(' 4. Copy qa/07-automation/.env.example -> qa/07-automation/.env and fill in credentials\n');
277
- process.stderr.write(' 5. Add qa/07-automation/.env and qa/07-automation/.auth/ to .gitignore\n');
323
+ // --- AGENT-NEXT-STEPS.md — readable by the agent after install ---
324
+ const nextStepsContent = `# ✅ @keber/qa-framework installed successfully
325
+
326
+ > This file was generated automatically by the postinstall script.
327
+ > Read it and follow the steps below, then delete this file.
328
+
329
+ ## What was scaffolded
330
+
331
+ - \`qa/\` folder structure with spec templates and agent instructions
332
+ - \`.github/copilot-instructions.md\` with QA agent behavior rules
333
+
334
+ ## Required next steps
335
+
336
+ ### 1. Configure your project modules
337
+ Edit \`qa/qa-framework.config.json\` and add your project modules under the \`"modules"\` array.
338
+
339
+ ### 2. Optional integrations
340
+
341
+ **Azure DevOps integration:**
342
+ \`\`\`bash
343
+ npm install @keber/ado-qa
344
+ \`\`\`
345
+
346
+ **Playwright automation:**
347
+ \`\`\`bash
348
+ npm install @playwright/test
349
+ cd qa/07-automation && npm install && npx playwright install chromium
350
+ \`\`\`
351
+
352
+ ### 3. Credentials
353
+ - Copy \`qa/07-automation/.env.example\` → \`qa/07-automation/.env\` and fill in credentials
354
+ - Add \`qa/07-automation/.env\` and \`qa/07-automation/.auth/\` to \`.gitignore\`
355
+ `;
356
+ const nextStepsPath = path.join(qaRoot, 'AGENT-NEXT-STEPS.md');
357
+ fs.writeFileSync(nextStepsPath, nextStepsContent, 'utf8');
358
+ console.log(` [created] ${path.relative(cwd, nextStepsPath)}`);
278
359
 
279
360
  // -----------------------------------------------------------------------
280
361
  // Helpers
@@ -0,0 +1,58 @@
1
+ # AGENT-NEXT-STEPS — {PROJECT_NAME}
2
+
3
+ > **Sprint activo: Sprint {N} — {SPRINT_NAME}**
4
+ > Lee este archivo primero. Lee los archivos referenciados solo cuando la tarea lo requiera.
5
+
6
+ ---
7
+
8
+ ## Estado del módulo
9
+
10
+ | Módulo / Submódulo | Specs | Plan | Auto | Estado |
11
+ |---|---|---|---|---|
12
+ | {MODULE_NAME} / {SUBMODULE_NAME} | ✅ | ✅ | ⬜ | Sprint {N} activo |
13
+
14
+ > Actualizar esta tabla cuando un sprint se complete. Historial de sprints completados → `qa/README.md ## Sprint History`.
15
+
16
+ ---
17
+
18
+ ## Sprint {N} — Tareas pendientes
19
+
20
+ - [ ] {Tarea 1}
21
+ - [ ] {Tarea 2}
22
+ - [ ] {Tarea 3}
23
+ - [ ] Actualizar `qa/README.md` (fila del módulo + Sprint History)
24
+ - [ ] Trim este archivo: dejar solo el sprint siguiente
25
+
26
+ **Precondiciones**: {Dependencias de datos o módulos previos, si aplica}
27
+
28
+ **Notas específicas**: {Quirks del DOM, rutas, selectores problemáticos conocidos — o eliminar esta línea}
29
+ → Si las notas son extensas, guardarlas en `qa/memory/{sprint-name}-discovery.md` y referenciar aquí.
30
+
31
+ ---
32
+
33
+ ## Contexto obligatorio antes de codificar
34
+
35
+ - Patrones del proyecto: `qa/memory/INDEX.md` → cargar solo los archivos relevantes
36
+ - Referencia de estilo: `qa/07-automation/e2e/tests/{module}/` (leer suite existente más reciente)
37
+
38
+ ---
39
+
40
+ ## Sprints siguientes (solo referencia — sin checklists)
41
+
42
+ - **Sprint {N+1}**: {Descripción breve — qué módulo/submódulo}
43
+ - **Sprint {N+2}**: {Descripción breve}
44
+
45
+ ---
46
+
47
+ <!-- ═══════════════════════════════════════════════════════════════════
48
+ REGLAS DE MANTENIMIENTO DE ESTE ARCHIVO (para el agente)
49
+ ——————————————————————————————————————————————————————————————————
50
+ 1. MÁXIMO UN SPRINT ACTIVO. Cuando un sprint se completa:
51
+ a. Mover su checklist al README.md bajo ## Sprint History
52
+ b. Borrar esa sección de este archivo
53
+ c. Promover el siguiente sprint a "activo"
54
+ 2. NO repetir instrucciones permanentes que ya estén en copilot-instructions.md.
55
+ 3. Los detalles técnicos (DOM, patrones) van en qa/memory/, no aquí.
56
+ 4. Los sprints "siguientes" son bullets de 1 línea, sin checklists.
57
+ Este archivo es una cola de trabajo. No es un log ni una bitácora.
58
+ ══════════════════════════════════════════════════════════════════ -->
@@ -0,0 +1,86 @@
1
+ # QA — {PROJECT_DISPLAY_NAME}
2
+
3
+ > Framework: `@keber/qa-framework` v{VERSION}
4
+ > Language: {LANGUAGE} | Base URL: `{QA_BASE_URL}`
5
+
6
+ ---
7
+
8
+ ## Module Status
9
+
10
+ | Module | Submodule | TCs Total | TCs Automated | Plan | ADO Suite | Status | Last Run |
11
+ |---|---|---|---|---|---|---|---|
12
+ | {MODULE_NAME} | {SUBMODULE_NAME} | — | — | ⬜ | — | 🔲 Not started | — |
13
+
14
+ **Legend**: ✅ Done · ⚠️ Partial · 🔲 Not started · ⛔ Blocked
15
+
16
+ ---
17
+
18
+ ## Quick-Start Commands
19
+
20
+ ```bash
21
+ # Run all automated tests
22
+ cd qa/07-automation
23
+ npx playwright test
24
+
25
+ # Run a specific module
26
+ npx playwright test tests/{module-folder}/
27
+
28
+ # Run with UI (debug mode)
29
+ npx playwright test --ui
30
+
31
+ # Generate HTML report
32
+ npx playwright show-report
33
+
34
+ # Re-run only failed tests
35
+ npx playwright test --last-failed
36
+ ```
37
+
38
+ > Set credentials in `qa/07-automation/.env` (copy from `.env.example`).
39
+
40
+ ---
41
+
42
+ ## Active Blockers
43
+
44
+ | ID | Description | Affects | Opened | Status |
45
+ |---|---|---|---|---|
46
+ | — | No active blockers | — | — | — |
47
+
48
+ ---
49
+
50
+ ## Last Execution
51
+
52
+ | Date | Suite | Pass | Skip | Fail | Duration | Report |
53
+ |---|---|---|---|---|---|---|
54
+ | — | — | — | — | — | — | — |
55
+
56
+ ---
57
+
58
+ ## Sprint History
59
+
60
+ <!-- Completed sprint checklists are moved here from AGENT-NEXT-STEPS.md -->
61
+ <!-- Format per sprint: -->
62
+ <!--
63
+ ### Sprint N — {SPRINT_NAME} ({YYYY-MM-DD})
64
+
65
+ **Submodules**: {list}
66
+ **TCs automated**: {N} P0 + {M} P1
67
+ **Execution report**: `qa/05-test-execution/automated/{date-slug}.md`
68
+
69
+ Checklist (completed):
70
+ - [x] {Task 1}
71
+ - [x] {Task 2}
72
+ -->
73
+
74
+ _No sprints completed yet._
75
+
76
+ ---
77
+
78
+ ## Resources
79
+
80
+ | Resource | Link |
81
+ |---|---|
82
+ | QA Structure Guide | `qa/QA-STRUCTURE-GUIDE.md` |
83
+ | Naming Conventions | `qa/00-standards/naming-conventions.md` |
84
+ | Memory Index | `qa/memory/INDEX.md` |
85
+ | Agent Next Steps | `qa/AGENT-NEXT-STEPS.md` |
86
+ | Automation Config | `qa/07-automation/playwright.config.ts` |
@@ -0,0 +1,130 @@
1
+ # Test Data Guidelines
2
+
3
+ > Reference: `qa/04-test-data/`
4
+ > All test data definitions must follow these rules. No exceptions for credentials.
5
+
6
+ ---
7
+
8
+ ## Rules
9
+
10
+ ### 1. Never hardcode credentials
11
+
12
+ All user emails, passwords, API keys, and tokens must come from environment variables.
13
+
14
+ ```typescript
15
+ // ✅ CORRECT
16
+ const email = process.env.QA_USER_EMAIL!;
17
+ const password = process.env.QA_USER_PASSWORD!;
18
+
19
+ // ❌ WRONG — never commit credentials
20
+ const email = 'admin@example.com';
21
+ const password = 'secret123';
22
+ ```
23
+
24
+ Document env var names in `qa/04-test-data/users.md`. Use `<PLACEHOLDER>` for values in all documentation.
25
+
26
+ ### 2. Use EXEC_IDX for unique values per run
27
+
28
+ Never create records with static names — they collide between runs and can leave leftover data.
29
+
30
+ ```typescript
31
+ const EXEC_IDX = Math.floor(Date.now() / 60_000) % 100_000;
32
+
33
+ // Names / codes
34
+ const name = `Test-Entity-${EXEC_IDX}`;
35
+
36
+ // Future-safe dates (year 2120+ avoids real production data overlap)
37
+ const year = 2120 + (EXEC_IDX % 10);
38
+ const month = String((EXEC_IDX % 12) + 1).padStart(2, '0');
39
+ const day = String((EXEC_IDX % 28) + 1).padStart(2, '0');
40
+ const date = `${year}-${month}-${day}`;
41
+ ```
42
+
43
+ ### 3. Provision in `beforeAll`, not `beforeEach`
44
+
45
+ Create required records once per suite, not once per test. Each test that **consumes** a record needs its own provisioned record — never share a single record among multiple tests.
46
+
47
+ ```typescript
48
+ test.beforeAll(async ({ browser }) => {
49
+ const page = await browser.newPage();
50
+ // If 3 tests each need 1 record, create 3:
51
+ for (let i = 0; i < 3; i++) {
52
+ await createEntity(page, `Record-${EXEC_IDX}-${i}`);
53
+ }
54
+ await page.close();
55
+ });
56
+ ```
57
+
58
+ ### 4. Seed scripts go in `04-test-data/seeders/`
59
+
60
+ Complex setup that cannot be done via the UI goes in a seeder script, not inside a spec file.
61
+
62
+ ```
63
+ qa/04-test-data/
64
+ ├── users.md ← Role catalog + env var names (no real values)
65
+ ├── fixtures/ ← Static JSON/Markdown for reference data
66
+ ├── factories/ ← Dynamic data generation patterns
67
+ └── seeders/ ← DB/API seed scripts for complex prerequisites
68
+ ```
69
+
70
+ ### 5. Add `.env` and `.auth/` to `.gitignore`
71
+
72
+ ```
73
+ qa/07-automation/.env
74
+ qa/07-automation/.auth/
75
+ ```
76
+
77
+ The `.env.example` file (committed) lists all required keys with `<PLACEHOLDER>` as the value.
78
+
79
+ ---
80
+
81
+ ## User Table Format (`04-test-data/users.md`)
82
+
83
+ ```markdown
84
+ | Role | Env var (email) | Env var (password) | Permissions |
85
+ |---|---|---|---|
86
+ | Admin | QA_ADMIN_EMAIL | QA_ADMIN_PASSWORD | Full access |
87
+ | Read-only | QA_READONLY_EMAIL | QA_READONLY_PASSWORD | View only |
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Fixture Files (`04-test-data/fixtures/`)
93
+
94
+ Use Markdown tables or JSON for static reference data that tests depend on (catalogs, option lists, etc.).
95
+
96
+ ```markdown
97
+ # fixtures/catalogs.md
98
+ ## Labor Types
99
+ | Code | Name |
100
+ |---|---|
101
+ | LT-01 | Consulting |
102
+ | LT-02 | Development |
103
+ ```
104
+
105
+ Reference fixtures in specs via `import` (JSON) or inline expectations matching the fixture values.
106
+
107
+ ---
108
+
109
+ ## Factory Pattern (`04-test-data/factories/`)
110
+
111
+ Document how to generate complex data shapes needed by multiple tests:
112
+
113
+ ```typescript
114
+ // factories/supplier.ts
115
+ export function buildSupplier(idx: number) {
116
+ return {
117
+ name: `Supplier-${idx}`,
118
+ rut: `${76_000_000 + idx}-0`,
119
+ email: `supplier-${idx}@test.example`,
120
+ };
121
+ }
122
+ ```
123
+
124
+ ---
125
+
126
+ ## On test teardown
127
+
128
+ Do **not** delete test data after each run unless the test explicitly requires a clean state. Leftover data from old EXEC_IDX values does not affect subsequent runs because EXEC_IDX generates distinct names.
129
+
130
+ Exception: if the system enforces uniqueness on a field that EXEC_IDX cannot make unique (e.g., a singleton config), document the teardown strategy in `04-test-data/seeders/`.