@torus-engineering/tas-kit 1.7.0 → 1.9.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/.claude/commands/tas-adr.md +33 -29
- package/.claude/commands/tas-apitest-plan.md +173 -0
- package/.claude/commands/tas-apitest.md +143 -0
- package/.claude/commands/tas-bug.md +113 -109
- package/.claude/commands/tas-design.md +37 -33
- package/.claude/commands/tas-dev.md +128 -115
- package/.claude/commands/tas-e2e-mobile.md +155 -0
- package/.claude/commands/tas-e2e-web.md +163 -0
- package/.claude/commands/tas-e2e.md +102 -0
- package/.claude/commands/tas-epic.md +35 -31
- package/.claude/commands/tas-feature.md +47 -43
- package/.claude/commands/tas-fix.md +51 -47
- package/.claude/commands/tas-functest-mobile.md +144 -0
- package/.claude/commands/tas-functest-web.md +192 -0
- package/.claude/commands/tas-functest.md +76 -0
- package/.claude/commands/tas-plan.md +200 -184
- package/.claude/commands/tas-prd.md +37 -33
- package/.claude/commands/tas-review.md +111 -104
- package/.claude/commands/tas-sad.md +43 -39
- package/.claude/commands/tas-security.md +81 -80
- package/.claude/commands/tas-story.md +91 -87
- package/.claude/commands/tas-verify.md +51 -41
- package/.claude/rules/common/post-review-agent.md +49 -39
- package/.claude/rules/common/testing.md +24 -0
- package/.claude/rules/common/token-logging.md +27 -0
- package/.claude/rules/csharp/api-testing.md +171 -0
- package/.claude/rules/csharp/patterns.md +10 -0
- package/.claude/rules/python/patterns.md +10 -0
- package/.claude/rules/typescript/patterns.md +10 -0
- package/.claude/rules/web/performance.md +9 -0
- package/.claude/skills/api-design/SKILL.md +3 -1
- package/.claude/skills/{backend-patterns → js-backend-patterns}/SKILL.md +2 -1
- package/.claude/skills/tas-implementation-complete/SKILL.md +99 -97
- package/.claude/skills/tas-tdd/SKILL.md +123 -82
- package/.claude/skills/token-logger/SKILL.md +19 -0
- package/.tas/templates/API-Test-Spec.md +400 -0
- package/.tas/templates/E2E-Execution-Report.md +198 -0
- package/.tas/templates/E2E-Mobile-Spec.md +130 -0
- package/.tas/templates/E2E-Report.md +174 -0
- package/.tas/templates/E2E-Scenario.md +180 -0
- package/.tas/templates/E2E-Web-Spec.md +164 -0
- package/.tas/templates/Feature.md +55 -55
- package/.tas/templates/Func-Test-Script.md +254 -0
- package/.tas/templates/Func-Test-Spec.md +187 -0
- package/.tas/templates/SAD.md +274 -274
- package/.tas/templates/Story.md +90 -88
- package/bin/cli.js +56 -56
- package/lib/deleted-files.json +36 -0
- package/lib/install.js +213 -176
- package/package.json +34 -34
- package/.claude/agents/README.md +0 -83
- package/.claude/agents/ado-agent.md +0 -39
- package/.claude/agents/code-architect.md +0 -62
- package/.claude/agents/code-simplifier.md +0 -53
- package/.claude/agents/comment-analyzer.md +0 -59
- package/.claude/agents/conversation-analyzer.md +0 -57
- package/.claude/agents/docs-lookup.md +0 -55
- package/.claude/agents/harness-optimizer.md +0 -62
- package/.claude/agents/loop-operator.md +0 -56
- package/.claude/agents/performance-optimizer.md +0 -78
- package/.claude/agents/pr-test-analyzer.md +0 -68
- package/.claude/agents/pytorch-build-resolver.md +0 -76
- package/.claude/agents/refactor-cleaner.md +0 -70
- package/.claude/agents/seo-specialist.md +0 -75
- package/.claude/agents/silent-failure-hunter.md +0 -69
- package/.claude/agents/type-design-analyzer.md +0 -75
- package/.claude/rules/common/agents.md +0 -65
- package/.claude/rules/common/coding-style.md +0 -90
- package/.claude/rules/common/development-workflow.md +0 -44
- package/.claude/rules/common/git-workflow.md +0 -24
- package/.claude/rules/common/performance.md +0 -55
- package/.claude/skills/agent-harness-construction/SKILL.md +0 -77
- package/.claude/skills/agent-introspection-debugging/SKILL.md +0 -157
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
---
|
|
2
|
+
api_name:
|
|
3
|
+
api_slug:
|
|
4
|
+
api_version:
|
|
5
|
+
spec_source:
|
|
6
|
+
code_path:
|
|
7
|
+
status:
|
|
8
|
+
created_date:
|
|
9
|
+
updated_date:
|
|
10
|
+
executor:
|
|
11
|
+
story_id:
|
|
12
|
+
framework: xUnit
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# API Test Specification: {API Name}
|
|
16
|
+
|
|
17
|
+
**API Version**: v{api_version}
|
|
18
|
+
**Framework**: {framework}
|
|
19
|
+
**Author**: @[executor]
|
|
20
|
+
**Created**: [created_date]
|
|
21
|
+
**Updated**: [updated_date]
|
|
22
|
+
**Status**: [status] (Draft | Review | Approved | Deprecated)
|
|
23
|
+
**Spec Source**: [spec_source]
|
|
24
|
+
**Code Path**: [code_path]
|
|
25
|
+
**Story**: [story_id] (if applicable)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Version History
|
|
30
|
+
|
|
31
|
+
> Mỗi API version có section riêng biệt. APPEND-ONLY: không sửa version cũ.
|
|
32
|
+
|
|
33
|
+
| Version | Status | Created | Description |
|
|
34
|
+
|---------|--------|---------|-------------|
|
|
35
|
+
| v1 | Draft | [created_date] | Initial version |
|
|
36
|
+
| v2 | Draft | [updated_date] | Added new endpoints |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Test Environment Setup
|
|
41
|
+
|
|
42
|
+
### Configuration (appsettings.json)
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"ApiTest": {
|
|
47
|
+
"BaseUrl": "https://localhost:5001",
|
|
48
|
+
"TimeoutSeconds": 30,
|
|
49
|
+
"Auth": {
|
|
50
|
+
"Type": "Bearer",
|
|
51
|
+
"TokenEndpoint": "/api/auth/token",
|
|
52
|
+
"Username": "",
|
|
53
|
+
"Password": ""
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Environment-Specific Overrides
|
|
60
|
+
|
|
61
|
+
| Environment | BaseUrl | Notes |
|
|
62
|
+
|-------------|---------|-------|
|
|
63
|
+
| Local | https://localhost:5001 | Development environment |
|
|
64
|
+
| Test | https://test-api.example.com | Shared test environment |
|
|
65
|
+
| Staging | https://staging-api.example.com | Pre-production |
|
|
66
|
+
| Production | https://api.example.com | Smoke tests only |
|
|
67
|
+
|
|
68
|
+
### Test Data Requirements
|
|
69
|
+
|
|
70
|
+
| Data Item | Value | Source | Environment-Specific | Notes |
|
|
71
|
+
|-----------|-------|--------|---------------------|-------|
|
|
72
|
+
| Test User Email | test@example.com | test-data.{env}.json | Yes | Different per env |
|
|
73
|
+
| Test User Password | (from .env) | process.env.APITEST__AUTH__PASSWORD | Yes | NEVER hardcode |
|
|
74
|
+
| Auth Token | Generated at runtime | POST /api/auth/token | Yes | Refresh per test class |
|
|
75
|
+
| {Entity} ID | {value} | test-data.{env}.json | Yes | Pre-seeded data |
|
|
76
|
+
|
|
77
|
+
### Setup/Teardown Notes
|
|
78
|
+
|
|
79
|
+
**Before All Tests:**
|
|
80
|
+
- Authenticate and store token for authenticated requests
|
|
81
|
+
- Seed test data if required
|
|
82
|
+
- Configure HttpClient with base address and timeout
|
|
83
|
+
|
|
84
|
+
**After All Tests:**
|
|
85
|
+
- Dispose HttpClient
|
|
86
|
+
- Clean up test data (unless debugging needed)
|
|
87
|
+
|
|
88
|
+
**Before Each Test:**
|
|
89
|
+
- Reset state if needed (clear headers, reset counters)
|
|
90
|
+
|
|
91
|
+
**After Each Test:**
|
|
92
|
+
- Log test result
|
|
93
|
+
- Capture response on failure for debugging
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## v{N} — Test Cases
|
|
98
|
+
|
|
99
|
+
### Endpoints Overview
|
|
100
|
+
|
|
101
|
+
| Method | Path | Description | Auth Required |
|
|
102
|
+
|--------|------|-------------|---------------|
|
|
103
|
+
| GET | /api/users | List users | Yes |
|
|
104
|
+
| POST | /api/users | Create user | Yes |
|
|
105
|
+
| GET | /api/users/{id} | Get user by ID | Yes |
|
|
106
|
+
| PUT | /api/users/{id} | Update user | Yes |
|
|
107
|
+
| DELETE | /api/users/{id} | Delete user | Yes |
|
|
108
|
+
|
|
109
|
+
### Coverage Matrix
|
|
110
|
+
|
|
111
|
+
| Endpoint | Happy Path | 401 Unauthorized | 403 Forbidden | 404 Not Found | 400/422 Validation | Business Rule |
|
|
112
|
+
|----------|:---------:|:----------------:|:-------------:|:-------------:|:------------------:|:-------------:|
|
|
113
|
+
| GET /api/users | ✓ | ✓ | | | | |
|
|
114
|
+
| POST /api/users | ✓ | ✓ | | | ✓ | |
|
|
115
|
+
| GET /api/users/{id} | ✓ | ✓ | | ✓ | | |
|
|
116
|
+
| PUT /api/users/{id} | ✓ | ✓ | | ✓ | ✓ | |
|
|
117
|
+
| DELETE /api/users/{id} | ✓ | ✓ | ✓ | ✓ | | |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### Test Case Details
|
|
122
|
+
|
|
123
|
+
#### GET /api/users — List Users
|
|
124
|
+
|
|
125
|
+
##### TC-001: Happy Path — Returns Paginated User List
|
|
126
|
+
- **Endpoint**: `GET /api/users?page=1&limit=10`
|
|
127
|
+
- **Auth**: Required (Bearer token)
|
|
128
|
+
- **Preconditions**:
|
|
129
|
+
- Valid authentication token
|
|
130
|
+
- At least 10 users exist in database
|
|
131
|
+
- **Request Query Params**:
|
|
132
|
+
- `page`: 1
|
|
133
|
+
- `limit`: 10
|
|
134
|
+
- **Expected Response**:
|
|
135
|
+
- Status: 200 OK
|
|
136
|
+
- Body:
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"data": [
|
|
140
|
+
{
|
|
141
|
+
"id": "guid",
|
|
142
|
+
"email": "user@example.com",
|
|
143
|
+
"name": "John Doe",
|
|
144
|
+
"role": "User",
|
|
145
|
+
"createdAt": "2024-01-01T00:00:00Z"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"total": 100,
|
|
149
|
+
"page": 1,
|
|
150
|
+
"limit": 10
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
- **Assertions**:
|
|
154
|
+
- Response status is 200
|
|
155
|
+
- `data` is array with length ≤ 10
|
|
156
|
+
- Each item has required fields: id, email, name, role, createdAt
|
|
157
|
+
- `total` ≥ 0
|
|
158
|
+
- `page` and `limit` match request
|
|
159
|
+
- **AC Reference**: N/A (API spec)
|
|
160
|
+
- **Test Method Name**: `Get_Users_Returns200_WhenAuthenticated`
|
|
161
|
+
|
|
162
|
+
##### TC-002: Security — Returns 401 When No Token
|
|
163
|
+
- **Endpoint**: `GET /api/users`
|
|
164
|
+
- **Auth**: Not provided
|
|
165
|
+
- **Preconditions**: None
|
|
166
|
+
- **Expected Response**:
|
|
167
|
+
- Status: 401 Unauthorized
|
|
168
|
+
- Body contains error message
|
|
169
|
+
- **Assertions**:
|
|
170
|
+
- Response status is 401
|
|
171
|
+
- **AC Reference**: N/A
|
|
172
|
+
- **Test Method Name**: `Get_Users_Returns401_WhenNotAuthenticated`
|
|
173
|
+
|
|
174
|
+
##### TC-003: Edge Case — Empty List When No Users Exist
|
|
175
|
+
- **Endpoint**: `GET /api/users`
|
|
176
|
+
- **Auth**: Required
|
|
177
|
+
- **Preconditions**:
|
|
178
|
+
- Database is empty or no users match filter
|
|
179
|
+
- **Expected Response**:
|
|
180
|
+
- Status: 200 OK
|
|
181
|
+
- Body:
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"data": [],
|
|
185
|
+
"total": 0,
|
|
186
|
+
"page": 1,
|
|
187
|
+
"limit": 10
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
- **Assertions**:
|
|
191
|
+
- Response status is 200
|
|
192
|
+
- `data` is empty array
|
|
193
|
+
- `total` is 0
|
|
194
|
+
- **AC Reference**: N/A
|
|
195
|
+
- **Test Method Name**: `Get_Users_ReturnsEmptyArray_WhenNoUsersExist`
|
|
196
|
+
|
|
197
|
+
#### POST /api/users — Create User
|
|
198
|
+
|
|
199
|
+
##### TC-004: Happy Path — Creates New User
|
|
200
|
+
- **Endpoint**: `POST /api/users`
|
|
201
|
+
- **Auth**: Required
|
|
202
|
+
- **Request Body**:
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"email": "newuser@example.com",
|
|
206
|
+
"name": "New User",
|
|
207
|
+
"password": "SecurePass123!",
|
|
208
|
+
"role": "User"
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
- **Expected Response**:
|
|
212
|
+
- Status: 201 Created
|
|
213
|
+
- Body contains created user with generated `id`
|
|
214
|
+
- `Location` header contains URL of new resource
|
|
215
|
+
- **Assertions**:
|
|
216
|
+
- Response status is 201
|
|
217
|
+
- `id` is valid GUID
|
|
218
|
+
- `email`, `name`, `role` match request
|
|
219
|
+
- `password` is NOT in response
|
|
220
|
+
- `createdAt` is recent
|
|
221
|
+
- **AC Reference**: N/A
|
|
222
|
+
- **Test Method Name**: `Post_Users_Returns201_WhenValidRequest`
|
|
223
|
+
|
|
224
|
+
##### TC-005: Validation — Returns 400 When Email Invalid
|
|
225
|
+
- **Endpoint**: `POST /api/users`
|
|
226
|
+
- **Auth**: Required
|
|
227
|
+
- **Request Body**:
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"email": "invalid-email",
|
|
231
|
+
"name": "Test User",
|
|
232
|
+
"password": "SecurePass123!",
|
|
233
|
+
"role": "User"
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
- **Expected Response**:
|
|
237
|
+
- Status: 400 Bad Request
|
|
238
|
+
- Body contains validation errors
|
|
239
|
+
- **Assertions**:
|
|
240
|
+
- Response status is 400
|
|
241
|
+
- Error message indicates email format issue
|
|
242
|
+
- **AC Reference**: N/A
|
|
243
|
+
- **Test Method Name**: `Post_Users_Returns400_WhenEmailInvalid`
|
|
244
|
+
|
|
245
|
+
##### TC-006: Business Rule — Returns 409 When Email Already Exists
|
|
246
|
+
- **Endpoint**: `POST /api/users`
|
|
247
|
+
- **Auth**: Required
|
|
248
|
+
- **Preconditions**: User with email already exists
|
|
249
|
+
- **Request Body**:
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"email": "existing@example.com",
|
|
253
|
+
"name": "Test User",
|
|
254
|
+
"password": "SecurePass123!",
|
|
255
|
+
"role": "User"
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
- **Expected Response**:
|
|
259
|
+
- Status: 409 Conflict
|
|
260
|
+
- Body indicates email already registered
|
|
261
|
+
- **Assertions**:
|
|
262
|
+
- Response status is 409
|
|
263
|
+
- Error message mentions duplicate email
|
|
264
|
+
- **AC Reference**: N/A
|
|
265
|
+
- **Test Method Name**: `Post_Users_Returns409_WhenEmailAlreadyExists`
|
|
266
|
+
|
|
267
|
+
#### GET /api/users/{id} — Get User by ID
|
|
268
|
+
|
|
269
|
+
##### TC-007: Happy Path — Returns User When ID Exists
|
|
270
|
+
- **Endpoint**: `GET /api/users/{id}`
|
|
271
|
+
- **Auth**: Required
|
|
272
|
+
- **Path Params**: `id` = valid GUID
|
|
273
|
+
- **Expected Response**:
|
|
274
|
+
- Status: 200 OK
|
|
275
|
+
- Body contains user details
|
|
276
|
+
- **Assertions**:
|
|
277
|
+
- Response status is 200
|
|
278
|
+
- All required fields present
|
|
279
|
+
- **AC Reference**: N/A
|
|
280
|
+
- **Test Method Name**: `GetById_Users_Returns200_WhenExists`
|
|
281
|
+
|
|
282
|
+
##### TC-008: Error Path — Returns 404 When ID Not Found
|
|
283
|
+
- **Endpoint**: `GET /api/users/{id}`
|
|
284
|
+
- **Auth**: Required
|
|
285
|
+
- **Path Params**: `id` = valid but non-existent GUID
|
|
286
|
+
- **Expected Response**:
|
|
287
|
+
- Status: 404 Not Found
|
|
288
|
+
- **Assertions**:
|
|
289
|
+
- Response status is 404
|
|
290
|
+
- **AC Reference**: N/A
|
|
291
|
+
- **Test Method Name**: `GetById_Users_Returns404_WhenNotFound`
|
|
292
|
+
|
|
293
|
+
#### PUT /api/users/{id} — Update User
|
|
294
|
+
|
|
295
|
+
##### TC-009: Happy Path — Updates User
|
|
296
|
+
- **Endpoint**: `PUT /api/users/{id}`
|
|
297
|
+
- **Auth**: Required
|
|
298
|
+
- **Request Body**:
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"name": "Updated Name"
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
- **Expected Response**:
|
|
305
|
+
- Status: 200 OK
|
|
306
|
+
- Body contains updated user
|
|
307
|
+
- **Assertions**:
|
|
308
|
+
- Response status is 200
|
|
309
|
+
- `name` matches request
|
|
310
|
+
- **AC Reference**: N/A
|
|
311
|
+
- **Test Method Name**: `Put_Users_Returns200_WhenValidUpdate`
|
|
312
|
+
|
|
313
|
+
##### TC-010: Validation — Returns 400 When Name Empty
|
|
314
|
+
- **Endpoint**: `PUT /api/users/{id}`
|
|
315
|
+
- **Auth**: Required
|
|
316
|
+
- **Request Body**:
|
|
317
|
+
```json
|
|
318
|
+
{
|
|
319
|
+
"name": ""
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
- **Expected Response**:
|
|
323
|
+
- Status: 400 Bad Request
|
|
324
|
+
- **Assertions**:
|
|
325
|
+
- Response status is 400
|
|
326
|
+
- **AC Reference**: N/A
|
|
327
|
+
- **Test Method Name**: `Put_Users_Returns400_WhenNameEmpty`
|
|
328
|
+
|
|
329
|
+
#### DELETE /api/users/{id} — Delete User
|
|
330
|
+
|
|
331
|
+
##### TC-011: Happy Path — Deletes User
|
|
332
|
+
- **Endpoint**: `DELETE /api/users/{id}`
|
|
333
|
+
- **Auth**: Required
|
|
334
|
+
- **Expected Response**:
|
|
335
|
+
- Status: 204 No Content
|
|
336
|
+
- **Assertions**:
|
|
337
|
+
- Response status is 204
|
|
338
|
+
- Subsequent GET returns 404
|
|
339
|
+
- **AC Reference**: N/A
|
|
340
|
+
- **Test Method Name**: `Delete_Users_Returns204_WhenExists`
|
|
341
|
+
|
|
342
|
+
##### TC-012: Authorization — Returns 403 When Deleting Self
|
|
343
|
+
- **Endpoint**: `DELETE /api/users/{id}` where id = current user's id
|
|
344
|
+
- **Auth**: Required
|
|
345
|
+
- **Expected Response**:
|
|
346
|
+
- Status: 403 Forbidden
|
|
347
|
+
- **Assertions**:
|
|
348
|
+
- Response status is 403
|
|
349
|
+
- Error message indicates cannot delete own account
|
|
350
|
+
- **AC Reference**: N/A
|
|
351
|
+
- **Test Method Name**: `Delete_Users_Returns403_WhenDeletingSelf`
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Story-Specific Test Cases (Optional)
|
|
356
|
+
|
|
357
|
+
> Nếu spec được generate từ Story, thêm AC mapping ở đây.
|
|
358
|
+
|
|
359
|
+
| AC ID | AC Description | Test Case IDs |
|
|
360
|
+
|-------|----------------|---------------|
|
|
361
|
+
| AC-1 | {Given...When...Then...} | TC-001, TC-002 |
|
|
362
|
+
| AC-2 | {Given...When...Then...} | TC-004, TC-005 |
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Regression Tests (Optional)
|
|
367
|
+
|
|
368
|
+
> Test cases cho bugs đã được tìm thấy và fix.
|
|
369
|
+
|
|
370
|
+
| Bug ID | Description | Test Case ID | Date Added |
|
|
371
|
+
|--------|-------------|--------------|------------|
|
|
372
|
+
| BUG-001 | User profile missing notification_settings field | TC-R001 | 2024-01-15 |
|
|
373
|
+
|
|
374
|
+
### TC-R001: BUG-001 Regression — notification_settings Present in Response
|
|
375
|
+
- **Endpoint**: `GET /api/users/{id}`
|
|
376
|
+
- **Auth**: Required
|
|
377
|
+
- **Expected Response**:
|
|
378
|
+
- Status: 200 OK
|
|
379
|
+
- Body includes `notification_settings` field
|
|
380
|
+
- **Assertions**:
|
|
381
|
+
- `notification_settings` is present and not undefined
|
|
382
|
+
- **Test Method Name**: `BUG_R001_NotificationSettings_IsPresent`
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Changelog
|
|
387
|
+
|
|
388
|
+
| Date | Version | Changes | Author |
|
|
389
|
+
|------|---------|---------|--------|
|
|
390
|
+
| [created_date] | v1 | Initial API test specification | @[executor] |
|
|
391
|
+
| [updated_date] | v2 | Added endpoints for user management | @[executor] |
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## AI Usage Log
|
|
396
|
+
|
|
397
|
+
| # | Date | Command | Input (est.) | Output (est.) |
|
|
398
|
+
|---|------|---------|-------------|---------------|
|
|
399
|
+
| 1 | [created_date] | /tas-apitest-plan | ~{N}k | ~{N}k |
|
|
400
|
+
| **Total** | | | **~{N}k** | **~{N}k** |
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
created_date:
|
|
3
|
+
executor:
|
|
4
|
+
status: # Pass | Fail | Partial
|
|
5
|
+
test_layer: # functional | e2e
|
|
6
|
+
scenario_id:
|
|
7
|
+
feature_id:
|
|
8
|
+
epic_id:
|
|
9
|
+
platform: # mobile-ios | mobile-android | web-chromium | web-firefox | web-webkit
|
|
10
|
+
environment: # dev | staging | prod
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Test Execution Report: {Scenario/Feature Name}
|
|
14
|
+
|
|
15
|
+
**Layer**: {{test_layer}} (Functional | E2E)
|
|
16
|
+
**Platform**: {{platform}}
|
|
17
|
+
**Environment**: {{environment}}
|
|
18
|
+
**Executor**: @[executor]
|
|
19
|
+
**Date**: [created_date]
|
|
20
|
+
**Status**: [status]
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Summary
|
|
25
|
+
|
|
26
|
+
| Metric | Value |
|
|
27
|
+
|--------|-------|
|
|
28
|
+
| Total Tests | {count} |
|
|
29
|
+
| Passed | {count} |
|
|
30
|
+
| Failed | {count} |
|
|
31
|
+
| Skipped | {count} |
|
|
32
|
+
| Flaky | {count} |
|
|
33
|
+
| Pass Rate | {X}% |
|
|
34
|
+
| Execution Time | {duration} |
|
|
35
|
+
| Environment | {{environment}} |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Results by Test ID
|
|
40
|
+
|
|
41
|
+
| Test ID | AC Ref | Description | Result | Duration | Failure Reason |
|
|
42
|
+
|---------|--------|-------------|--------|----------|----------------|
|
|
43
|
+
| {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_001_H | AC-1 | {description} | PASS | {Xs} | - |
|
|
44
|
+
| {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_002_N | AC-1 | {description} | PASS | {Xs} | - |
|
|
45
|
+
| {PROJECT}_E{EPIC}_F{FEATURE}_S{STORY}_FT_003_E | AC-1 | {description} | FAIL | {Xs} | {brief reason: element not found / assertion mismatch / timeout / ...} |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Failed Tests
|
|
50
|
+
|
|
51
|
+
### {Test ID}: {Test Description}
|
|
52
|
+
|
|
53
|
+
**AC Reference**: AC-{N}
|
|
54
|
+
**Failure Reason**: {Mô tả ngắn gọn LÝ DO fail — ví dụ: "Button 'Submit' không hiển thị sau khi nhập email hợp lệ", "API trả về 401 thay vì 200", "Timeout sau 5s chờ màn hình Home load"}
|
|
55
|
+
**Error Type**: {Assertion Failure | Timeout | Crash | Element Not Found}
|
|
56
|
+
**Error Message**:
|
|
57
|
+
```
|
|
58
|
+
{Error stack trace or message}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Screenshot/Video**: `artifacts/{platform}/{test-id}.png`
|
|
62
|
+
|
|
63
|
+
**Root Cause Analysis**:
|
|
64
|
+
> {Brief analysis of why the test failed}
|
|
65
|
+
|
|
66
|
+
**Severity**: {Critical | Major | Minor}
|
|
67
|
+
**Action Required**: {Fix code | Fix test | Investigate flaky | Skip with reason}
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Flaky Tests
|
|
72
|
+
|
|
73
|
+
| Test ID | Flaky Rate | Last 3 Runs | Suspected Cause |
|
|
74
|
+
|---------|------------|-------------|-----------------|
|
|
75
|
+
| {ID} | {X/3} | P/F/P | {Animation timing | Network | Race condition} |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Platform Results
|
|
80
|
+
|
|
81
|
+
{{#if platform.startsWith("mobile")}}
|
|
82
|
+
### Mobile Platform Details
|
|
83
|
+
|
|
84
|
+
| Detail | Value |
|
|
85
|
+
|--------|-------|
|
|
86
|
+
| Device | {iPhone 17 Pro / Samsung S21} |
|
|
87
|
+
| OS | {iOS 18.x / Android 14} |
|
|
88
|
+
| App Build | {Debug / Release} |
|
|
89
|
+
| Detox Version | {version} |
|
|
90
|
+
| React Native | {version} |
|
|
91
|
+
| Node | {version} |
|
|
92
|
+
|
|
93
|
+
### Device-Specific Issues
|
|
94
|
+
| Issue | Device | Impact | Resolution |
|
|
95
|
+
|-------|--------|--------|------------|
|
|
96
|
+
| {Issue} | {Device} | {Tests affected} | {Fix/Workaround} |
|
|
97
|
+
{{/if}}
|
|
98
|
+
|
|
99
|
+
{{#if platform.startsWith("web")}}
|
|
100
|
+
### Web Platform Details
|
|
101
|
+
|
|
102
|
+
| Detail | Value |
|
|
103
|
+
|--------|-------|
|
|
104
|
+
| Browser | {Chromium / Firefox / WebKit} |
|
|
105
|
+
| Browser Version | {version} |
|
|
106
|
+
| Playwright Version | {version} |
|
|
107
|
+
| Viewport | {width}x{height} |
|
|
108
|
+
| Node | {version} |
|
|
109
|
+
|
|
110
|
+
### Browser-Specific Issues
|
|
111
|
+
| Issue | Browser | Impact | Resolution |
|
|
112
|
+
|-------|---------|--------|------------|
|
|
113
|
+
| {Issue} | {Browser} | {Tests affected} | {Fix/Workaround} |
|
|
114
|
+
{{/if}}
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Artifacts
|
|
119
|
+
|
|
120
|
+
| Type | Path | Description |
|
|
121
|
+
|------|------|-------------|
|
|
122
|
+
| Screenshots | `artifacts/{platform}/screenshots/` | Failure screenshots |
|
|
123
|
+
| Videos | `artifacts/{platform}/videos/` | Test execution recordings |
|
|
124
|
+
| Logs | `artifacts/{platform}/logs/` | Debug logs |
|
|
125
|
+
| HTML Report | `reports/{layer}-report.html` | Interactive HTML report |
|
|
126
|
+
| JUnit XML | `reports/{layer}-results.xml` | CI/CD compatible results |
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Test Coverage Analysis
|
|
131
|
+
|
|
132
|
+
### AC Coverage
|
|
133
|
+
|
|
134
|
+
| AC ID | FT Tests | E2E Tests | Covered | Status |
|
|
135
|
+
|-------|----------|-----------|---------|--------|
|
|
136
|
+
| AC-1 | FT_001_H, FT_002_N | E2E_001 (Step 1) | Yes | All Pass |
|
|
137
|
+
| AC-2 | FT_003_H | E2E_001 (Step 3) | Yes | 1 Fail |
|
|
138
|
+
| AC-3 | - | - | No | Not tested |
|
|
139
|
+
|
|
140
|
+
### Uncovered Areas
|
|
141
|
+
- {List any ACs or scenarios not covered by this test run}
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Performance Metrics
|
|
146
|
+
|
|
147
|
+
| Step/Test | Duration | Threshold | Status |
|
|
148
|
+
|-----------|----------|-----------|--------|
|
|
149
|
+
| {Step 1: Login} | {1.2s} | {< 3s} | OK |
|
|
150
|
+
| {Step 2: Navigate} | {0.5s} | {< 2s} | OK |
|
|
151
|
+
| {Step 3: Load Data} | {4.1s} | {< 3s} | SLOW |
|
|
152
|
+
| Total Flow | {8.5s} | {< 15s} | OK |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Blockers & Issues
|
|
157
|
+
|
|
158
|
+
| # | Issue | Severity | Impact | Status | Bug ID |
|
|
159
|
+
|---|-------|----------|--------|--------|--------|
|
|
160
|
+
| 1 | {Issue description} | Critical | {Tests blocked} | {Open / Resolved} | {BUG-XXX} |
|
|
161
|
+
| 2 | {Issue description} | Major | {Tests affected} | {Open / Resolved} | {BUG-XXX} |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Recommendations
|
|
166
|
+
|
|
167
|
+
### Immediate Actions
|
|
168
|
+
- [ ] {Fix failing test / Fix code bug}
|
|
169
|
+
- [ ] {Create bug ticket for issue X}
|
|
170
|
+
|
|
171
|
+
### Follow-up
|
|
172
|
+
- [ ] {Investigate flaky test}
|
|
173
|
+
- [ ] {Add missing test coverage for AC-X}
|
|
174
|
+
|
|
175
|
+
### Maintenance
|
|
176
|
+
- [ ] {Update test data for next sprint}
|
|
177
|
+
- [ ] {Refactor helper function X}
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Sign-off
|
|
182
|
+
|
|
183
|
+
| Role | Name | Date | Approved |
|
|
184
|
+
|------|------|------|----------|
|
|
185
|
+
| QA | @[name] | [date] | [ ] |
|
|
186
|
+
| Tech Lead | @[name] | [date] | [ ] |
|
|
187
|
+
| PE (for Verify) | @[name] | [date] | [ ] |
|
|
188
|
+
|
|
189
|
+
**Deployment Readiness**: [ ] Ready [ ] Not Ready
|
|
190
|
+
**Reason (if not ready)**: {explanation}
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Changelog
|
|
195
|
+
|
|
196
|
+
| Date | Changes | Author |
|
|
197
|
+
|------|---------|--------|
|
|
198
|
+
| [created_date] | Initial execution report | @[executor] |
|