qa-skills 3.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 +168 -0
- package/bin/cli.js +42 -0
- package/dist/agents/registry.d.ts +5 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +101 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/types.d.ts +9 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/dependencies.d.ts +21 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +125 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/installer.d.ts +25 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +437 -0
- package/dist/installer.js.map +1 -0
- package/dist/scaffold.d.ts +27 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +182 -0
- package/dist/scaffold.js.map +1 -0
- package/package.json +40 -0
- package/skills/qa-accessibility-test-writer/SKILL.md +127 -0
- package/skills/qa-accessibility-test-writer/references/axe-core-patterns.md +349 -0
- package/skills/qa-accessibility-test-writer/references/best-practices.md +184 -0
- package/skills/qa-accessibility-test-writer/references/wcag-tests.md +331 -0
- package/skills/qa-api-contract-curator/SKILL.md +104 -0
- package/skills/qa-api-contract-curator/references/breaking-changes.md +363 -0
- package/skills/qa-api-contract-curator/references/openapi-structure.md +404 -0
- package/skills/qa-browser-data-collector/SKILL.md +132 -0
- package/skills/qa-browser-data-collector/references/data-collection-checklist.md +91 -0
- package/skills/qa-browser-data-collector/references/playwright-mcp-patterns.md +113 -0
- package/skills/qa-bug-ticket-creator/SKILL.md +148 -0
- package/skills/qa-bug-ticket-creator/references/bug-report-format.md +149 -0
- package/skills/qa-bug-ticket-creator/references/severity-guide.md +81 -0
- package/skills/qa-bug-ticket-creator/templates/bug-ticket-template.md +39 -0
- package/skills/qa-changelog-analyzer/SKILL.md +134 -0
- package/skills/qa-changelog-analyzer/references/git-analysis-patterns.md +138 -0
- package/skills/qa-changelog-analyzer/references/impact-mapping.md +120 -0
- package/skills/qa-clickup-integration/SKILL.md +166 -0
- package/skills/qa-clickup-integration/references/api-patterns.md +102 -0
- package/skills/qa-clickup-integration/references/field-mapping.md +71 -0
- package/skills/qa-codeceptjs-writer/SKILL.md +136 -0
- package/skills/qa-codeceptjs-writer/references/best-practices.md +207 -0
- package/skills/qa-codeceptjs-writer/references/config.md +255 -0
- package/skills/qa-codeceptjs-writer/references/patterns.md +285 -0
- package/skills/qa-coverage-analyzer/SKILL.md +166 -0
- package/skills/qa-coverage-analyzer/references/best-practices.md +142 -0
- package/skills/qa-coverage-analyzer/references/coverage-dimensions.md +155 -0
- package/skills/qa-coverage-analyzer/references/tools.md +204 -0
- package/skills/qa-cypress-writer/SKILL.md +134 -0
- package/skills/qa-cypress-writer/references/assertions.md +121 -0
- package/skills/qa-cypress-writer/references/best-practices.md +82 -0
- package/skills/qa-cypress-writer/references/config.md +121 -0
- package/skills/qa-cypress-writer/references/patterns.md +170 -0
- package/skills/qa-data-factory/SKILL.md +126 -0
- package/skills/qa-data-factory/references/factory-patterns.md +164 -0
- package/skills/qa-data-factory/references/faker-guide.md +131 -0
- package/skills/qa-diagram-generator/SKILL.md +125 -0
- package/skills/qa-diagram-generator/references/c4-model.md +53 -0
- package/skills/qa-diagram-generator/references/charts.md +58 -0
- package/skills/qa-diagram-generator/references/class-diagram.md +85 -0
- package/skills/qa-diagram-generator/references/er-diagram.md +69 -0
- package/skills/qa-diagram-generator/references/flowchart.md +92 -0
- package/skills/qa-diagram-generator/references/from-screenshot.md +45 -0
- package/skills/qa-diagram-generator/references/gantt.md +49 -0
- package/skills/qa-diagram-generator/references/journey.md +50 -0
- package/skills/qa-diagram-generator/references/mindmap.md +75 -0
- package/skills/qa-diagram-generator/references/sequence.md +69 -0
- package/skills/qa-diagram-generator/references/state-diagram.md +56 -0
- package/skills/qa-discovery-interview/SKILL.md +182 -0
- package/skills/qa-discovery-interview/references/completeness-checklist.md +53 -0
- package/skills/qa-discovery-interview/references/conflict-patterns.md +101 -0
- package/skills/qa-discovery-interview/references/qa-categories.md +147 -0
- package/skills/qa-discovery-interview/templates/qa-brief-template.md +168 -0
- package/skills/qa-environment-checker/SKILL.md +142 -0
- package/skills/qa-environment-checker/references/dependency-matrix.md +101 -0
- package/skills/qa-environment-checker/references/health-checks.md +209 -0
- package/skills/qa-environment-checker/templates/env-readiness-template.md +64 -0
- package/skills/qa-flaky-detector/SKILL.md +153 -0
- package/skills/qa-flaky-detector/references/ci-analysis.md +140 -0
- package/skills/qa-flaky-detector/references/flaky-patterns.md +247 -0
- package/skills/qa-github-issues-enhanced/SKILL.md +175 -0
- package/skills/qa-github-issues-enhanced/references/issue-templates.md +425 -0
- package/skills/qa-github-issues-enhanced/references/label-taxonomy.md +130 -0
- package/skills/qa-github-issues-enhanced/references/workflow-patterns.md +188 -0
- package/skills/qa-httpx-writer/SKILL.md +138 -0
- package/skills/qa-httpx-writer/references/assertions.md +195 -0
- package/skills/qa-httpx-writer/references/best-practices.md +140 -0
- package/skills/qa-httpx-writer/references/config.md +212 -0
- package/skills/qa-httpx-writer/references/patterns.md +262 -0
- package/skills/qa-jest-writer/SKILL.md +131 -0
- package/skills/qa-jest-writer/references/assertions.md +125 -0
- package/skills/qa-jest-writer/references/best-practices.md +136 -0
- package/skills/qa-jest-writer/references/config.md +134 -0
- package/skills/qa-jest-writer/references/patterns.md +172 -0
- package/skills/qa-jira-integration/SKILL.md +135 -0
- package/skills/qa-jira-integration/references/api-patterns.md +143 -0
- package/skills/qa-jira-integration/references/field-mapping.md +79 -0
- package/skills/qa-jira-integration/references/xray-integration.md +85 -0
- package/skills/qa-jmeter-writer/SKILL.md +171 -0
- package/skills/qa-jmeter-writer/references/best-practices.md +157 -0
- package/skills/qa-jmeter-writer/references/config.md +204 -0
- package/skills/qa-jmeter-writer/references/patterns.md +242 -0
- package/skills/qa-junit5-writer/SKILL.md +157 -0
- package/skills/qa-junit5-writer/references/assertions.md +118 -0
- package/skills/qa-junit5-writer/references/config.md +97 -0
- package/skills/qa-junit5-writer/references/patterns.md +162 -0
- package/skills/qa-k6-writer/SKILL.md +155 -0
- package/skills/qa-k6-writer/references/best-practices.md +236 -0
- package/skills/qa-k6-writer/references/config.md +219 -0
- package/skills/qa-k6-writer/references/patterns.md +304 -0
- package/skills/qa-linear-integration/SKILL.md +137 -0
- package/skills/qa-linear-integration/references/api-patterns.md +249 -0
- package/skills/qa-linear-integration/references/field-mapping.md +121 -0
- package/skills/qa-locust-writer/SKILL.md +151 -0
- package/skills/qa-locust-writer/references/best-practices.md +126 -0
- package/skills/qa-locust-writer/references/config.md +170 -0
- package/skills/qa-locust-writer/references/patterns.md +235 -0
- package/skills/qa-manual-test-designer/SKILL.md +145 -0
- package/skills/qa-manual-test-designer/references/exploratory-charters.md +138 -0
- package/skills/qa-manual-test-designer/references/personas.md +146 -0
- package/skills/qa-manual-test-designer/templates/exploratory-charter-template.md +47 -0
- package/skills/qa-manual-test-designer/templates/test-case-template.md +31 -0
- package/skills/qa-mobile-test-writer/SKILL.md +144 -0
- package/skills/qa-mobile-test-writer/references/best-practices.md +214 -0
- package/skills/qa-mobile-test-writer/references/config.md +309 -0
- package/skills/qa-mobile-test-writer/references/patterns.md +304 -0
- package/skills/qa-nfr-analyst/SKILL.md +177 -0
- package/skills/qa-nfr-analyst/references/iso-25010-model.md +159 -0
- package/skills/qa-nfr-analyst/references/owasp-wstg-baseline.md +202 -0
- package/skills/qa-nfr-analyst/references/wcag-checklist.md +184 -0
- package/skills/qa-nfr-analyst/templates/owasp-checklist-template.md +89 -0
- package/skills/qa-nfr-analyst/templates/wcag-checklist-template.md +48 -0
- package/skills/qa-orchestrator/SKILL.md +132 -0
- package/skills/qa-orchestrator/references/handoff-chains.md +105 -0
- package/skills/qa-orchestrator/references/pipeline-modes.md +115 -0
- package/skills/qa-orchestrator/references/scheduler-rules.md +84 -0
- package/skills/qa-pact-writer/SKILL.md +133 -0
- package/skills/qa-pact-writer/references/best-practices.md +100 -0
- package/skills/qa-pact-writer/references/config.md +135 -0
- package/skills/qa-pact-writer/references/patterns.md +161 -0
- package/skills/qa-plan-creator/SKILL.md +139 -0
- package/skills/qa-plan-creator/references/introduction-plan.md +43 -0
- package/skills/qa-plan-creator/references/migration-plan.md +44 -0
- package/skills/qa-plan-creator/references/onboarding-plan.md +46 -0
- package/skills/qa-plan-creator/references/performance-plan.md +44 -0
- package/skills/qa-plan-creator/references/regression-plan.md +45 -0
- package/skills/qa-plan-creator/references/release-plan.md +45 -0
- package/skills/qa-plan-creator/references/sprint-plan.md +44 -0
- package/skills/qa-plan-creator/references/test-plan.md +59 -0
- package/skills/qa-plan-creator/references/uat-plan.md +43 -0
- package/skills/qa-plan-creator/templates/checklist-template.md +36 -0
- package/skills/qa-plan-creator/templates/regression-checklist-template.md +49 -0
- package/skills/qa-plan-creator/templates/release-checklist-template.md +46 -0
- package/skills/qa-plan-creator/templates/test-plan-template.md +74 -0
- package/skills/qa-playwright-py-writer/SKILL.md +156 -0
- package/skills/qa-playwright-py-writer/references/best-practices.md +194 -0
- package/skills/qa-playwright-py-writer/references/config.md +195 -0
- package/skills/qa-playwright-py-writer/references/patterns.md +212 -0
- package/skills/qa-playwright-ts-writer/SKILL.md +151 -0
- package/skills/qa-playwright-ts-writer/references/assertions.md +109 -0
- package/skills/qa-playwright-ts-writer/references/best-practices.md +191 -0
- package/skills/qa-playwright-ts-writer/references/config.md +144 -0
- package/skills/qa-playwright-ts-writer/references/patterns.md +171 -0
- package/skills/qa-pytest-writer/SKILL.md +145 -0
- package/skills/qa-pytest-writer/references/assertions.md +149 -0
- package/skills/qa-pytest-writer/references/best-practices.md +97 -0
- package/skills/qa-pytest-writer/references/config.md +176 -0
- package/skills/qa-pytest-writer/references/patterns.md +251 -0
- package/skills/qa-qase-integration/SKILL.md +149 -0
- package/skills/qa-qase-integration/references/api-reference.md +354 -0
- package/skills/qa-qase-integration/references/ci-integration.md +196 -0
- package/skills/qa-qase-integration/references/field-mapping.md +157 -0
- package/skills/qa-requirements-generator/SKILL.md +152 -0
- package/skills/qa-requirements-generator/references/iso-29148-structure.md +153 -0
- package/skills/qa-requirements-generator/references/requirement-patterns.md +278 -0
- package/skills/qa-rest-assured-writer/SKILL.md +137 -0
- package/skills/qa-rest-assured-writer/references/best-practices.md +50 -0
- package/skills/qa-rest-assured-writer/references/config.md +124 -0
- package/skills/qa-rest-assured-writer/references/patterns.md +192 -0
- package/skills/qa-risk-analyzer/SKILL.md +158 -0
- package/skills/qa-risk-analyzer/references/impact-analysis.md +133 -0
- package/skills/qa-risk-analyzer/references/risk-factors.md +123 -0
- package/skills/qa-robot-framework-writer/SKILL.md +147 -0
- package/skills/qa-robot-framework-writer/references/best-practices.md +249 -0
- package/skills/qa-robot-framework-writer/references/config.md +204 -0
- package/skills/qa-robot-framework-writer/references/libraries.md +273 -0
- package/skills/qa-robot-framework-writer/references/patterns.md +216 -0
- package/skills/qa-security-test-writer/SKILL.md +123 -0
- package/skills/qa-security-test-writer/references/best-practices.md +155 -0
- package/skills/qa-security-test-writer/references/owasp-top10.md +331 -0
- package/skills/qa-security-test-writer/references/zap-config.md +258 -0
- package/skills/qa-selenium-java-writer/SKILL.md +143 -0
- package/skills/qa-selenium-java-writer/references/best-practices.md +59 -0
- package/skills/qa-selenium-java-writer/references/config.md +143 -0
- package/skills/qa-selenium-java-writer/references/patterns.md +170 -0
- package/skills/qa-selenium-py-writer/SKILL.md +150 -0
- package/skills/qa-selenium-py-writer/references/best-practices.md +175 -0
- package/skills/qa-selenium-py-writer/references/config.md +224 -0
- package/skills/qa-selenium-py-writer/references/patterns.md +255 -0
- package/skills/qa-shortcut-integration/SKILL.md +143 -0
- package/skills/qa-shortcut-integration/references/api-patterns.md +126 -0
- package/skills/qa-shortcut-integration/references/field-mapping.md +66 -0
- package/skills/qa-spec-auditor/SKILL.md +162 -0
- package/skills/qa-spec-auditor/references/audit-checklist.md +144 -0
- package/skills/qa-spec-auditor/references/drift-patterns.md +207 -0
- package/skills/qa-spec-writer/SKILL.md +143 -0
- package/skills/qa-spec-writer/references/gherkin-guide.md +253 -0
- package/skills/qa-spec-writer/references/specification-patterns.md +274 -0
- package/skills/qa-spring-test-writer/SKILL.md +170 -0
- package/skills/qa-spring-test-writer/references/best-practices.md +57 -0
- package/skills/qa-spring-test-writer/references/config.md +179 -0
- package/skills/qa-spring-test-writer/references/patterns.md +235 -0
- package/skills/qa-supertest-writer/SKILL.md +150 -0
- package/skills/qa-supertest-writer/references/assertions.md +192 -0
- package/skills/qa-supertest-writer/references/best-practices.md +102 -0
- package/skills/qa-supertest-writer/references/config.md +166 -0
- package/skills/qa-supertest-writer/references/patterns.md +242 -0
- package/skills/qa-task-creator/SKILL.md +142 -0
- package/skills/qa-task-creator/references/linking-patterns.md +127 -0
- package/skills/qa-task-creator/references/task-types.md +169 -0
- package/skills/qa-task-creator/templates/task-template.md +24 -0
- package/skills/qa-test-doc-compiler/SKILL.md +114 -0
- package/skills/qa-test-doc-compiler/references/agile-tailoring.md +220 -0
- package/skills/qa-test-doc-compiler/references/iso-29119-3-documents.md +302 -0
- package/skills/qa-test-healer/SKILL.md +101 -0
- package/skills/qa-test-healer/references/diagnosis-patterns.md +142 -0
- package/skills/qa-test-healer/references/fix-strategies.md +177 -0
- package/skills/qa-test-reporter/SKILL.md +130 -0
- package/skills/qa-test-reporter/references/best-practices.md +162 -0
- package/skills/qa-test-reporter/references/iso-29119-reports.md +236 -0
- package/skills/qa-test-reporter/references/report-formats.md +287 -0
- package/skills/qa-test-reviewer/SKILL.md +142 -0
- package/skills/qa-test-reviewer/references/anti-patterns.md +268 -0
- package/skills/qa-test-reviewer/references/review-checklist.md +93 -0
- package/skills/qa-test-strategy/SKILL.md +133 -0
- package/skills/qa-test-strategy/references/entry-exit-criteria.md +176 -0
- package/skills/qa-test-strategy/references/risk-matrix.md +102 -0
- package/skills/qa-test-strategy/references/testing-types.md +143 -0
- package/skills/qa-testcase-from-docs/SKILL.md +161 -0
- package/skills/qa-testcase-from-docs/references/test-case-format.md +196 -0
- package/skills/qa-testcase-from-docs/references/test-design-techniques.md +126 -0
- package/skills/qa-testcase-from-docs/templates/test-case-template.md +31 -0
- package/skills/qa-testcase-from-ui/SKILL.md +109 -0
- package/skills/qa-testcase-from-ui/references/ui-element-patterns.md +126 -0
- package/skills/qa-testcase-from-ui/references/visual-analysis-guide.md +146 -0
- package/skills/qa-testcase-from-ui/templates/test-case-template.md +31 -0
- package/skills/qa-visual-regression-writer/SKILL.md +175 -0
- package/skills/qa-visual-regression-writer/references/best-practices.md +154 -0
- package/skills/qa-visual-regression-writer/references/config.md +220 -0
- package/skills/qa-visual-regression-writer/references/patterns.md +213 -0
- package/skills/qa-vitest-writer/SKILL.md +141 -0
- package/skills/qa-vitest-writer/references/assertions.md +105 -0
- package/skills/qa-vitest-writer/references/best-practices.md +62 -0
- package/skills/qa-vitest-writer/references/config.md +127 -0
- package/skills/qa-vitest-writer/references/patterns.md +141 -0
- package/skills/qa-webdriverio-writer/SKILL.md +145 -0
- package/skills/qa-webdriverio-writer/references/best-practices.md +176 -0
- package/skills/qa-webdriverio-writer/references/config.md +240 -0
- package/skills/qa-webdriverio-writer/references/patterns.md +269 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-spec-writer
|
|
3
|
+
description: Transform requirements into detailed technical specifications with acceptance criteria, boundary conditions, and edge cases.
|
|
4
|
+
output_dir: docs/specs
|
|
5
|
+
dependencies:
|
|
6
|
+
recommended:
|
|
7
|
+
- qa-requirements-generator
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# QA Spec Writer
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Create detailed technical specifications from requirements documents. Transform high-level requirements into test-ready specifications with acceptance criteria, boundary conditions, edge cases, and business rules.
|
|
15
|
+
|
|
16
|
+
## Trigger Phrases
|
|
17
|
+
|
|
18
|
+
- "Write technical spec from requirements" / "Create spec from [requirements doc]"
|
|
19
|
+
- "Transform requirements into specifications"
|
|
20
|
+
- "Add acceptance criteria to [feature/spec]"
|
|
21
|
+
- "Define boundary conditions and edge cases"
|
|
22
|
+
- "Technical specification with Given/When/Then"
|
|
23
|
+
- "Spec with error handling and validation rules"
|
|
24
|
+
- "Decompose requirement into spec" / "State transitions for [feature]"
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. **Input:** Read requirements document (from qa-requirements-generator or manual)
|
|
29
|
+
2. **Analysis:** Decompose each requirement into specification elements
|
|
30
|
+
3. **Specification:** Write detailed technical spec with:
|
|
31
|
+
- Functional behavior descriptions
|
|
32
|
+
- Input/output specifications
|
|
33
|
+
- Boundary conditions and edge cases
|
|
34
|
+
- Error handling and validation rules
|
|
35
|
+
- Business rules and constraints
|
|
36
|
+
- State transitions
|
|
37
|
+
4. **Acceptance Criteria:** Formalize in Given/When/Then (Gherkin) format
|
|
38
|
+
5. **Output:** Technical specification document per ISO 29148
|
|
39
|
+
|
|
40
|
+
## Specification Structure
|
|
41
|
+
|
|
42
|
+
For each feature/module:
|
|
43
|
+
|
|
44
|
+
### Functional Specification
|
|
45
|
+
```
|
|
46
|
+
[SPEC-{module}-{number}]
|
|
47
|
+
Title: {Feature Name}
|
|
48
|
+
Requirement: [REQ-FN-xxx]
|
|
49
|
+
|
|
50
|
+
Description:
|
|
51
|
+
Detailed technical behavior description
|
|
52
|
+
|
|
53
|
+
Input Specifications:
|
|
54
|
+
| Field | Type | Required | Validation | Default |
|
|
55
|
+
| ----- | ---- | -------- | ---------- | ------- |
|
|
56
|
+
|
|
57
|
+
Output Specifications:
|
|
58
|
+
| Condition | Output | Status Code |
|
|
59
|
+
| --------- | ------ | ----------- |
|
|
60
|
+
|
|
61
|
+
Boundary Conditions:
|
|
62
|
+
- Min/max values
|
|
63
|
+
- Empty/null inputs
|
|
64
|
+
- Character limits
|
|
65
|
+
|
|
66
|
+
Edge Cases:
|
|
67
|
+
- Concurrent access
|
|
68
|
+
- Network timeout
|
|
69
|
+
- Partial data
|
|
70
|
+
|
|
71
|
+
Error Handling:
|
|
72
|
+
| Error Condition | Error Code | User Message | Recovery |
|
|
73
|
+
| --------------- | ---------- | ------------ | -------- |
|
|
74
|
+
|
|
75
|
+
Business Rules:
|
|
76
|
+
- BR-001: {rule description}
|
|
77
|
+
|
|
78
|
+
State Transitions:
|
|
79
|
+
{state diagram reference}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Acceptance Criteria Template
|
|
83
|
+
```gherkin
|
|
84
|
+
Feature: {Feature Name}
|
|
85
|
+
|
|
86
|
+
Scenario: {Happy Path}
|
|
87
|
+
Given {precondition}
|
|
88
|
+
When {action}
|
|
89
|
+
Then {expected outcome}
|
|
90
|
+
|
|
91
|
+
Scenario: {Negative Case}
|
|
92
|
+
Given {precondition}
|
|
93
|
+
When {invalid action}
|
|
94
|
+
Then {error handling}
|
|
95
|
+
|
|
96
|
+
Scenario: {Boundary}
|
|
97
|
+
Given {precondition}
|
|
98
|
+
When {boundary input}
|
|
99
|
+
Then {boundary behavior}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Scope
|
|
103
|
+
|
|
104
|
+
**Can do (autonomous):**
|
|
105
|
+
- Generate specs from requirements documents
|
|
106
|
+
- Define acceptance criteria in Gherkin format
|
|
107
|
+
- Identify boundary conditions and edge cases
|
|
108
|
+
- Document error handling scenarios
|
|
109
|
+
- Call qa-diagram-generator for state/sequence diagrams
|
|
110
|
+
|
|
111
|
+
**Cannot do (requires confirmation):**
|
|
112
|
+
- Change requirement scope or priority
|
|
113
|
+
- Make architectural decisions
|
|
114
|
+
- Define new business rules not in requirements
|
|
115
|
+
|
|
116
|
+
**Will not do (out of scope):**
|
|
117
|
+
- Write test code
|
|
118
|
+
- Modify production code
|
|
119
|
+
- Deploy systems
|
|
120
|
+
|
|
121
|
+
## Embedding: Diagram Generator
|
|
122
|
+
When visualization is needed, reference qa-diagram-generator:
|
|
123
|
+
- State machines → `references/state-diagram.md`
|
|
124
|
+
- API flows → `references/sequence.md`
|
|
125
|
+
- Decision logic → `references/flowchart.md`
|
|
126
|
+
|
|
127
|
+
## Quality Checklist
|
|
128
|
+
- [ ] Every spec traces to a requirement ID
|
|
129
|
+
- [ ] All inputs have validation rules defined
|
|
130
|
+
- [ ] Boundary conditions identified for numeric/string fields
|
|
131
|
+
- [ ] Negative scenarios documented
|
|
132
|
+
- [ ] Error handling specified for each failure mode
|
|
133
|
+
- [ ] Acceptance criteria are in Given/When/Then format
|
|
134
|
+
- [ ] No implementation details leaked into specs
|
|
135
|
+
|
|
136
|
+
## Troubleshooting
|
|
137
|
+
|
|
138
|
+
| Symptom | Likely Cause | Fix |
|
|
139
|
+
| ------- | ------------ | --- |
|
|
140
|
+
| Specs too vague | Requirements lack detail | Run qa-requirements-generator first |
|
|
141
|
+
| Missing edge cases | Only happy path analyzed | Use systematic techniques: EP, BVA, decision tables |
|
|
142
|
+
| Acceptance criteria not testable | Using subjective language | Replace with measurable criteria |
|
|
143
|
+
| Specs conflict with each other | Requirements have contradictions | Flag for stakeholder resolution |
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# Gherkin Syntax Guide
|
|
2
|
+
|
|
3
|
+
Gherkin is a Business Readable, Domain Specific Language for behavior descriptions. It uses keywords to structure scenarios in Given/When/Then format.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Core Keywords
|
|
8
|
+
|
|
9
|
+
| Keyword | Purpose |
|
|
10
|
+
| ------- | ------- |
|
|
11
|
+
| `Feature` | High-level description of a capability |
|
|
12
|
+
| `Scenario` | Concrete example of behavior |
|
|
13
|
+
| `Scenario Outline` | Template for data-driven scenarios |
|
|
14
|
+
| `Given` | Precondition / initial context |
|
|
15
|
+
| `When` | Action / event |
|
|
16
|
+
| `Then` | Expected outcome / observable result |
|
|
17
|
+
| `And` | Continuation of previous step (Given/When/Then) |
|
|
18
|
+
| `But` | Contrast to previous step |
|
|
19
|
+
| `Background` | Steps run before every scenario in the feature |
|
|
20
|
+
| `Examples` | Data table for Scenario Outline |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Happy Path Scenarios
|
|
25
|
+
|
|
26
|
+
Describe the primary success flow with clear preconditions and outcomes.
|
|
27
|
+
|
|
28
|
+
```gherkin
|
|
29
|
+
Feature: User Registration
|
|
30
|
+
|
|
31
|
+
Scenario: New user successfully registers
|
|
32
|
+
Given the user is on the registration page
|
|
33
|
+
And no account exists for "user@example.com"
|
|
34
|
+
When the user enters valid registration details
|
|
35
|
+
And the user submits the form
|
|
36
|
+
Then the account is created
|
|
37
|
+
And a confirmation email is sent
|
|
38
|
+
And the user is redirected to the dashboard
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Guidelines:**
|
|
42
|
+
- One primary action in `When`
|
|
43
|
+
- Outcomes should be observable and verifiable
|
|
44
|
+
- Avoid implementation details (e.g., "clicks the Submit button" vs "submits the form")
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Negative Scenarios
|
|
49
|
+
|
|
50
|
+
Describe invalid inputs, unauthorized access, or error conditions.
|
|
51
|
+
|
|
52
|
+
```gherkin
|
|
53
|
+
Feature: User Login
|
|
54
|
+
|
|
55
|
+
Scenario: Login fails with invalid password
|
|
56
|
+
Given a user account exists with email "user@example.com"
|
|
57
|
+
When the user enters email "user@example.com" and wrong password
|
|
58
|
+
And the user submits the login form
|
|
59
|
+
Then the user remains on the login page
|
|
60
|
+
And "Invalid email or password" is displayed
|
|
61
|
+
And the failed attempt is logged
|
|
62
|
+
|
|
63
|
+
Scenario: Login fails when account is locked
|
|
64
|
+
Given the user account is locked due to 5 failed attempts
|
|
65
|
+
When the user attempts to login with correct credentials
|
|
66
|
+
Then "Account locked. Try again in 15 minutes" is displayed
|
|
67
|
+
And the user cannot log in
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Guidelines:**
|
|
71
|
+
- Specify the exact error message or behavior
|
|
72
|
+
- Include security considerations (e.g., generic messages to avoid enumeration)
|
|
73
|
+
- Document recovery path if applicable
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Boundary Scenarios
|
|
78
|
+
|
|
79
|
+
Test limits: min, max, empty, null, and transition points.
|
|
80
|
+
|
|
81
|
+
```gherkin
|
|
82
|
+
Feature: Product Search
|
|
83
|
+
|
|
84
|
+
Scenario: Search with empty query returns all products
|
|
85
|
+
Given the catalog has 100 products
|
|
86
|
+
When the user searches with an empty query
|
|
87
|
+
Then all 100 products are returned
|
|
88
|
+
And results are paginated with 20 per page
|
|
89
|
+
|
|
90
|
+
Scenario: Search with maximum length query
|
|
91
|
+
Given the search supports up to 200 characters
|
|
92
|
+
When the user searches with a 200-character query
|
|
93
|
+
Then the search executes successfully
|
|
94
|
+
And results matching the query are returned
|
|
95
|
+
|
|
96
|
+
Scenario: Pagination at last page
|
|
97
|
+
Given there are 45 products (3 pages of 20)
|
|
98
|
+
When the user navigates to page 3
|
|
99
|
+
Then 5 products are displayed
|
|
100
|
+
And "Page 3 of 3" is shown
|
|
101
|
+
And the "Next" button is disabled
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Guidelines:**
|
|
105
|
+
- Use exact boundary values (0, 1, max, max+1)
|
|
106
|
+
- Specify behavior for empty and null explicitly
|
|
107
|
+
- Include off-by-one cases (e.g., last page)
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Data-Driven Scenarios (Scenario Outline)
|
|
112
|
+
|
|
113
|
+
Use `Scenario Outline` with `Examples` to run the same scenario with different data.
|
|
114
|
+
|
|
115
|
+
```gherkin
|
|
116
|
+
Feature: Password Validation
|
|
117
|
+
|
|
118
|
+
Scenario Outline: Password fails validation rules
|
|
119
|
+
Given the user is on the registration form
|
|
120
|
+
When the user enters password "<password>"
|
|
121
|
+
And the user submits the form
|
|
122
|
+
Then "Password must <rule>" is displayed
|
|
123
|
+
And the form is not submitted
|
|
124
|
+
|
|
125
|
+
Examples:
|
|
126
|
+
| password | rule |
|
|
127
|
+
| short | be at least 8 characters |
|
|
128
|
+
| noNumbers1 | contain at least one number |
|
|
129
|
+
| NOUPPERCASE| contain at least one uppercase|
|
|
130
|
+
| nolower1 | contain at least one lowercase|
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Guidelines:**
|
|
134
|
+
- Use `<placeholder>` in steps, define in Examples table
|
|
135
|
+
- One scenario outline per logical variation
|
|
136
|
+
- Keep Examples readable; split into multiple outlines if needed
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Background
|
|
141
|
+
|
|
142
|
+
Use `Background` for steps shared by all scenarios in the feature.
|
|
143
|
+
|
|
144
|
+
```gherkin
|
|
145
|
+
Feature: Shopping Cart
|
|
146
|
+
|
|
147
|
+
Background:
|
|
148
|
+
Given the user is logged in
|
|
149
|
+
And the user has an empty cart
|
|
150
|
+
|
|
151
|
+
Scenario: Add item to cart
|
|
152
|
+
When the user adds "Widget A" to the cart
|
|
153
|
+
Then the cart contains 1 item
|
|
154
|
+
And "Widget A" is in the cart
|
|
155
|
+
|
|
156
|
+
Scenario: Remove item from cart
|
|
157
|
+
Given the cart contains "Widget A"
|
|
158
|
+
When the user removes "Widget A" from the cart
|
|
159
|
+
Then the cart is empty
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Guidelines:**
|
|
163
|
+
- Keep Background short (2–4 steps)
|
|
164
|
+
- Use for setup, not for scenario-specific context
|
|
165
|
+
- If Background grows large, consider a separate feature or hooks
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Step Best Practices
|
|
170
|
+
|
|
171
|
+
### Do
|
|
172
|
+
- Use third person: "the user", "the system"
|
|
173
|
+
- Make steps declarative: "the cart contains 2 items" vs "the user added 2 items"
|
|
174
|
+
- One concept per step
|
|
175
|
+
- Use domain language, not UI language
|
|
176
|
+
- Make outcomes verifiable: "is displayed", "returns 200", "is saved"
|
|
177
|
+
|
|
178
|
+
### Don't
|
|
179
|
+
- Don't use "should" or "would" — use definitive "is", "returns", "displays"
|
|
180
|
+
- Don't chain multiple actions in one step
|
|
181
|
+
- Don't reference implementation (clicks, API calls) unless the feature is about that
|
|
182
|
+
- Don't use subjective criteria: "user-friendly" → "displays within 2 seconds"
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Anti-Patterns
|
|
187
|
+
|
|
188
|
+
| Anti-Pattern | Problem | Fix |
|
|
189
|
+
| ----------- | ------- | --- |
|
|
190
|
+
| Imperative steps | "Click Submit, then click Confirm" | "Submits the form", "Confirms the action" |
|
|
191
|
+
| Vague outcomes | "Then it works" | "Then the order status is 'confirmed'" |
|
|
192
|
+
| Implementation details | "Then the database has a new row" | "Then the order appears in order history" |
|
|
193
|
+
| Too many steps | 15+ steps per scenario | Split into smaller scenarios |
|
|
194
|
+
| Duplicate scenarios | Same scenario, different feature | Use tags or Background |
|
|
195
|
+
| Test data in steps | "user with id 12345" | "a user", use tables for specific data |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Tags (Optional)
|
|
200
|
+
|
|
201
|
+
Use tags for filtering and organization:
|
|
202
|
+
|
|
203
|
+
```gherkin
|
|
204
|
+
@smoke @critical
|
|
205
|
+
Scenario: User can login
|
|
206
|
+
|
|
207
|
+
@regression @slow
|
|
208
|
+
Scenario: Bulk import 10000 records
|
|
209
|
+
|
|
210
|
+
@wip
|
|
211
|
+
Scenario: New checkout flow (in progress)
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Full Example
|
|
217
|
+
|
|
218
|
+
```gherkin
|
|
219
|
+
Feature: Order Placement
|
|
220
|
+
As a customer
|
|
221
|
+
I want to place an order
|
|
222
|
+
So that I can purchase products
|
|
223
|
+
|
|
224
|
+
Background:
|
|
225
|
+
Given the user is logged in
|
|
226
|
+
And the user has items in the cart
|
|
227
|
+
|
|
228
|
+
Scenario: Successful order placement
|
|
229
|
+
Given the user has a valid shipping address
|
|
230
|
+
And the user has a valid payment method
|
|
231
|
+
When the user completes checkout
|
|
232
|
+
Then the order is created with status "pending"
|
|
233
|
+
And a confirmation email is sent
|
|
234
|
+
And the cart is emptied
|
|
235
|
+
|
|
236
|
+
Scenario: Order fails with invalid payment
|
|
237
|
+
Given the user has an expired payment method
|
|
238
|
+
When the user attempts checkout
|
|
239
|
+
Then "Payment failed" is displayed
|
|
240
|
+
And the order is not created
|
|
241
|
+
And the cart retains the items
|
|
242
|
+
|
|
243
|
+
Scenario Outline: Order respects quantity limits
|
|
244
|
+
Given the product "<product>" has max quantity <max>
|
|
245
|
+
When the user sets quantity to <quantity>
|
|
246
|
+
Then <result>
|
|
247
|
+
|
|
248
|
+
Examples:
|
|
249
|
+
| product | max | quantity | result |
|
|
250
|
+
| Widget | 10 | 5 | quantity is accepted |
|
|
251
|
+
| Widget | 10 | 10 | quantity is accepted |
|
|
252
|
+
| Widget | 10 | 11 | "Max 10 per order" shown |
|
|
253
|
+
```
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
# Specification Patterns
|
|
2
|
+
|
|
3
|
+
Common specification patterns for recurring feature types. Use these as templates when writing specs.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Forms
|
|
8
|
+
|
|
9
|
+
### Input Specification Pattern
|
|
10
|
+
| Field | Type | Required | Validation | Default |
|
|
11
|
+
| ----- | ---- | -------- | ---------- | ------- |
|
|
12
|
+
| email | string | Yes | RFC 5322, max 254 chars | — |
|
|
13
|
+
| password | string | Yes | Min 8, max 128, complexity rules | — |
|
|
14
|
+
| phone | string | No | E.164 format if provided | null |
|
|
15
|
+
|
|
16
|
+
### Boundary Conditions
|
|
17
|
+
- Empty required fields → validation error before submit
|
|
18
|
+
- Max length exceeded → truncation or error (specify which)
|
|
19
|
+
- Special characters in text fields → escape/sanitize rules
|
|
20
|
+
- Unicode/emoji support → define allowed character set
|
|
21
|
+
|
|
22
|
+
### Error Handling
|
|
23
|
+
| Condition | Behavior |
|
|
24
|
+
| --------- | -------- |
|
|
25
|
+
| Client-side validation fails | Inline message, prevent submit |
|
|
26
|
+
| Server-side validation fails | 400, field-level error map |
|
|
27
|
+
| Duplicate submission | Idempotency key or disable button |
|
|
28
|
+
| Session expired during submit | 401, redirect to login |
|
|
29
|
+
|
|
30
|
+
### Acceptance Criteria Pattern
|
|
31
|
+
```gherkin
|
|
32
|
+
Scenario: Valid form submission
|
|
33
|
+
Given the user has filled all required fields correctly
|
|
34
|
+
When the user submits the form
|
|
35
|
+
Then the form data is saved
|
|
36
|
+
And a success message is displayed
|
|
37
|
+
And the user is redirected to the confirmation page
|
|
38
|
+
|
|
39
|
+
Scenario: Required field validation
|
|
40
|
+
Given the user is on the registration form
|
|
41
|
+
When the user leaves "email" empty and submits
|
|
42
|
+
Then "Email is required" is displayed
|
|
43
|
+
And the form is not submitted
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## APIs
|
|
49
|
+
|
|
50
|
+
### Request/Response Specification
|
|
51
|
+
| Method | Path | Auth | Request Body | Response |
|
|
52
|
+
| ------ | ---- | ---- | ------------ | -------- |
|
|
53
|
+
| POST | /api/v1/orders | Bearer | OrderCreateDto | 201 + Order |
|
|
54
|
+
| GET | /api/v1/orders/{id} | Bearer | — | 200 + Order or 404 |
|
|
55
|
+
|
|
56
|
+
### Input Specifications
|
|
57
|
+
- Path params: type, format (UUID, slug), validation
|
|
58
|
+
- Query params: type, allowed values, pagination (page, limit, max)
|
|
59
|
+
- Headers: Content-Type, Authorization, idempotency-key
|
|
60
|
+
- Body: schema reference, required vs optional
|
|
61
|
+
|
|
62
|
+
### Boundary Conditions
|
|
63
|
+
- Pagination: page=0, page=-1, limit=0, limit=10000
|
|
64
|
+
- Empty collections vs null
|
|
65
|
+
- Optional fields: omit vs null vs empty string
|
|
66
|
+
- Content-Length limits
|
|
67
|
+
|
|
68
|
+
### Error Handling
|
|
69
|
+
| Status | Condition | Response Body |
|
|
70
|
+
| ------ | --------- | ------------- |
|
|
71
|
+
| 400 | Validation error | `{ "errors": [{ "field": "...", "message": "..." }] }` |
|
|
72
|
+
| 401 | Missing/invalid token | `{ "error": "unauthorized" }` |
|
|
73
|
+
| 404 | Resource not found | `{ "error": "not_found", "id": "..." }` |
|
|
74
|
+
| 409 | Conflict (e.g., duplicate) | `{ "error": "conflict", "details": "..." }` |
|
|
75
|
+
| 429 | Rate limit exceeded | Retry-After header, error body |
|
|
76
|
+
|
|
77
|
+
### Acceptance Criteria Pattern
|
|
78
|
+
```gherkin
|
|
79
|
+
Scenario: Successful API call
|
|
80
|
+
Given a valid authentication token
|
|
81
|
+
And the resource exists
|
|
82
|
+
When the client sends a GET request to "/api/v1/orders/123"
|
|
83
|
+
Then the response status is 200
|
|
84
|
+
And the response body contains the order JSON
|
|
85
|
+
|
|
86
|
+
Scenario: Unauthorized access
|
|
87
|
+
Given no authentication token
|
|
88
|
+
When the client sends a GET request to "/api/v1/orders/123"
|
|
89
|
+
Then the response status is 401
|
|
90
|
+
And the response body contains an error message
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Search & Filter
|
|
96
|
+
|
|
97
|
+
### Input Specification
|
|
98
|
+
| Parameter | Type | Required | Validation | Default |
|
|
99
|
+
| --------- | ---- | -------- | ---------- | ------- |
|
|
100
|
+
| q | string | No | Max 200 chars, sanitize | "" |
|
|
101
|
+
| category | enum | No | From allowed list | all |
|
|
102
|
+
| sort | enum | No | field:asc\|desc | relevance |
|
|
103
|
+
| page | integer | No | Min 1, max 100 | 1 |
|
|
104
|
+
| limit | integer | No | Min 1, max 50 | 20 |
|
|
105
|
+
|
|
106
|
+
### Boundary Conditions
|
|
107
|
+
- Empty search query → return all or require non-empty (specify)
|
|
108
|
+
- Invalid filter value → ignore or 400
|
|
109
|
+
- No results → empty array, not null
|
|
110
|
+
- Sort by non-indexed field → define performance expectations
|
|
111
|
+
|
|
112
|
+
### Edge Cases
|
|
113
|
+
- SQL injection / NoSQL injection in search terms
|
|
114
|
+
- Very long search strings
|
|
115
|
+
- Special regex characters in query
|
|
116
|
+
- Unicode search (collation rules)
|
|
117
|
+
- Concurrent index updates during search
|
|
118
|
+
|
|
119
|
+
### Acceptance Criteria Pattern
|
|
120
|
+
```gherkin
|
|
121
|
+
Scenario: Search with results
|
|
122
|
+
Given the index contains matching items
|
|
123
|
+
When the user searches for "laptop"
|
|
124
|
+
Then results matching "laptop" are returned
|
|
125
|
+
And results are ordered by relevance
|
|
126
|
+
And pagination metadata is included
|
|
127
|
+
|
|
128
|
+
Scenario: Search with no results
|
|
129
|
+
Given the index has no matching items
|
|
130
|
+
When the user searches for "xyznonexistent"
|
|
131
|
+
Then an empty array is returned
|
|
132
|
+
And total count is 0
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Authentication
|
|
138
|
+
|
|
139
|
+
### Flow Specification
|
|
140
|
+
1. Login: credentials → token + refresh token
|
|
141
|
+
2. Token refresh: refresh token → new access token
|
|
142
|
+
3. Logout: invalidate tokens (server-side)
|
|
143
|
+
4. Password reset: request → email link → new password
|
|
144
|
+
|
|
145
|
+
### Input Specifications
|
|
146
|
+
| Field | Validation |
|
|
147
|
+
| ----- | ---------- |
|
|
148
|
+
| username/email | Required, format |
|
|
149
|
+
| password | Required, min length |
|
|
150
|
+
| refresh_token | JWT format, not expired |
|
|
151
|
+
| new_password | Complexity rules, not same as current |
|
|
152
|
+
|
|
153
|
+
### Boundary Conditions
|
|
154
|
+
- Lockout after N failed attempts
|
|
155
|
+
- Token expiry (access vs refresh)
|
|
156
|
+
- Concurrent sessions (allow or deny)
|
|
157
|
+
- Password history (prevent reuse of last N)
|
|
158
|
+
|
|
159
|
+
### Error Handling
|
|
160
|
+
| Condition | Response |
|
|
161
|
+
| --------- | -------- |
|
|
162
|
+
| Invalid credentials | 401, generic message (no user enumeration) |
|
|
163
|
+
| Account locked | 423, lockout duration |
|
|
164
|
+
| Token expired | 401, use refresh token |
|
|
165
|
+
| Refresh token expired | 401, re-login required |
|
|
166
|
+
|
|
167
|
+
### Acceptance Criteria Pattern
|
|
168
|
+
```gherkin
|
|
169
|
+
Scenario: Successful login
|
|
170
|
+
Given valid credentials exist
|
|
171
|
+
When the user submits valid credentials
|
|
172
|
+
Then an access token is returned
|
|
173
|
+
And a refresh token is returned
|
|
174
|
+
And tokens are stored securely
|
|
175
|
+
|
|
176
|
+
Scenario: Account lockout
|
|
177
|
+
Given the user has 4 failed login attempts
|
|
178
|
+
When the user attempts to login again with wrong password
|
|
179
|
+
Then the account is locked for 15 minutes
|
|
180
|
+
And "Account temporarily locked" is displayed
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## File Operations
|
|
186
|
+
|
|
187
|
+
### Input Specification
|
|
188
|
+
| Parameter | Type | Validation |
|
|
189
|
+
| --------- | ---- | ---------- |
|
|
190
|
+
| file | binary | Max size, allowed MIME types |
|
|
191
|
+
| filename | string | Max length, allowed chars, extension |
|
|
192
|
+
| overwrite | boolean | Default false |
|
|
193
|
+
|
|
194
|
+
### Boundary Conditions
|
|
195
|
+
- File size: 0 bytes, exactly max, over max
|
|
196
|
+
- Filename: empty, path traversal (../), reserved names
|
|
197
|
+
- Concurrent upload of same filename
|
|
198
|
+
- Disk full during write
|
|
199
|
+
- Partial upload (chunked) interruption
|
|
200
|
+
|
|
201
|
+
### Error Handling
|
|
202
|
+
| Condition | Behavior |
|
|
203
|
+
| --------- | -------- |
|
|
204
|
+
| File too large | 413, clear message with max size |
|
|
205
|
+
| Invalid file type | 400, list allowed types |
|
|
206
|
+
| Filename invalid | 400, sanitization rules |
|
|
207
|
+
| Storage unavailable | 503, retry guidance |
|
|
208
|
+
| Virus detected | 400, quarantine (if applicable) |
|
|
209
|
+
|
|
210
|
+
### Acceptance Criteria Pattern
|
|
211
|
+
```gherkin
|
|
212
|
+
Scenario: Successful file upload
|
|
213
|
+
Given the user has selected a valid file under 10MB
|
|
214
|
+
When the user uploads the file
|
|
215
|
+
Then the file is stored with a unique ID
|
|
216
|
+
And the file metadata is returned
|
|
217
|
+
And the file is accessible at the returned URL
|
|
218
|
+
|
|
219
|
+
Scenario: File size exceeded
|
|
220
|
+
Given the user has selected a file larger than 10MB
|
|
221
|
+
When the user attempts to upload
|
|
222
|
+
Then an error "File must be under 10MB" is displayed
|
|
223
|
+
And the file is not stored
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Notifications
|
|
229
|
+
|
|
230
|
+
### Channel Specification
|
|
231
|
+
| Channel | Input | Delivery | Retry |
|
|
232
|
+
| ------- | ----- | -------- | ----- |
|
|
233
|
+
| Email | to, subject, body, attachments | Async | 3 attempts, exponential backoff |
|
|
234
|
+
| SMS | to, message (160 chars) | Async | 2 attempts |
|
|
235
|
+
| Push | device_token, payload | Async | 1 attempt |
|
|
236
|
+
| In-app | user_id, message, link | Sync | N/A |
|
|
237
|
+
|
|
238
|
+
### Boundary Conditions
|
|
239
|
+
- Empty recipient list
|
|
240
|
+
- Invalid email/phone format
|
|
241
|
+
- Message length limits (SMS 160, push payload size)
|
|
242
|
+
- Rate limiting per user/channel
|
|
243
|
+
- Unsubscribe / opt-out handling
|
|
244
|
+
|
|
245
|
+
### Edge Cases
|
|
246
|
+
- Duplicate notifications (idempotency)
|
|
247
|
+
- User opts out mid-send
|
|
248
|
+
- Provider (email/SMS) returns temporary failure
|
|
249
|
+
- Notification preferences (do not disturb, channel off)
|
|
250
|
+
|
|
251
|
+
### Error Handling
|
|
252
|
+
| Condition | Behavior |
|
|
253
|
+
| --------- | -------- |
|
|
254
|
+
| Invalid recipient | Skip, log, continue with others |
|
|
255
|
+
| Provider down | Queue, retry later |
|
|
256
|
+
| User unsubscribed | Do not send, update preference |
|
|
257
|
+
| Rate limit hit | Queue for next window |
|
|
258
|
+
|
|
259
|
+
### Acceptance Criteria Pattern
|
|
260
|
+
```gherkin
|
|
261
|
+
Scenario: Email notification sent
|
|
262
|
+
Given the user has enabled email notifications
|
|
263
|
+
And an event triggers a notification
|
|
264
|
+
When the notification is processed
|
|
265
|
+
Then an email is queued for delivery
|
|
266
|
+
And the email contains the correct content
|
|
267
|
+
And the notification is marked as sent
|
|
268
|
+
|
|
269
|
+
Scenario: User opted out
|
|
270
|
+
Given the user has disabled email notifications
|
|
271
|
+
When an event triggers an email notification
|
|
272
|
+
Then no email is sent
|
|
273
|
+
And the notification is marked as skipped
|
|
274
|
+
```
|