102 lines
4.0 KiB
Markdown
102 lines
4.0 KiB
Markdown
# Requirements Document: Admin Integration Testing
|
|
|
|
## Introduction
|
|
|
|
本文档定义了后台管理系统前后端联调测试的需求规格。联调测试确保后端 API 和前端页面能够正确协作,验证完整的业务流程。
|
|
|
|
## Glossary
|
|
|
|
- **Integration_Test**: 前后端联调测试,验证 API 和页面的协作
|
|
- **API_Developer**: 后端 API 开发者
|
|
- **Frontend_Developer**: 前端页面开发者
|
|
- **Smoke_Test**: 冒烟测试,快速验证核心功能是否可用
|
|
|
|
## Requirements
|
|
|
|
### Requirement 1: 基础联调环境
|
|
|
|
**User Story:** As a developer, I want to set up the integration testing environment, so that frontend and backend can communicate properly.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN the backend API server starts, IT SHALL listen on port 61551
|
|
2. WHEN the frontend dev server starts, IT SHALL proxy /api requests to backend
|
|
3. WHEN CORS is configured, THE backend SHALL allow requests from frontend dev server
|
|
4. WHEN both servers are running, THE frontend SHALL be able to call backend APIs
|
|
|
|
### Requirement 2: 认证流程联调
|
|
|
|
**User Story:** As a developer, I want to verify the authentication flow works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN a user logs in with valid credentials, THE system SHALL return access token and refresh token
|
|
2. WHEN the frontend stores tokens, IT SHALL include them in subsequent API requests
|
|
3. WHEN the access token expires, THE frontend SHALL automatically refresh it
|
|
4. WHEN a user logs out, THE system SHALL invalidate the tokens
|
|
|
|
### Requirement 3: 内容管理模块联调
|
|
|
|
**User Story:** As a developer, I want to verify the content management module works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN creating a banner, THE frontend form data SHALL be correctly saved to database
|
|
2. WHEN uploading an image, THE file SHALL be stored and URL returned
|
|
3. WHEN updating banner status, THE change SHALL be reflected in the list
|
|
4. WHEN deleting a banner, IT SHALL be soft-deleted and hidden from list
|
|
|
|
### Requirement 4: 测评管理模块联调
|
|
|
|
**User Story:** As a developer, I want to verify the assessment management module works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN creating an assessment type, THE data SHALL be correctly saved
|
|
2. WHEN importing questions in batch, THE system SHALL process and return results
|
|
3. WHEN mapping questions to categories, THE relationships SHALL be persisted
|
|
4. WHEN viewing category tree, THE hierarchy SHALL be correctly displayed
|
|
|
|
### Requirement 5: 用户管理模块联调
|
|
|
|
**User Story:** As a developer, I want to verify the user management module works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN searching users with filters, THE results SHALL match the criteria
|
|
2. WHEN viewing user details, ALL related data SHALL be displayed
|
|
3. WHEN changing user level, THE change SHALL be persisted
|
|
4. WHEN exporting users, THE Excel file SHALL be downloaded
|
|
|
|
### Requirement 6: 订单管理模块联调
|
|
|
|
**User Story:** As a developer, I want to verify the order management module works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN viewing order list, THE data SHALL be correctly paginated
|
|
2. WHEN viewing order details, ALL related records SHALL be displayed
|
|
3. WHEN processing refund, THE order status SHALL be updated
|
|
4. WHEN exporting orders, THE Excel file SHALL be downloaded
|
|
|
|
### Requirement 7: 分销管理模块联调
|
|
|
|
**User Story:** As a developer, I want to verify the distribution management module works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN generating invite codes, UNIQUE codes SHALL be created
|
|
2. WHEN viewing commission statistics, THE amounts SHALL be accurate
|
|
3. WHEN approving withdrawal, THE status SHALL be updated
|
|
4. WHEN completing withdrawal, THE transaction ID SHALL be recorded
|
|
|
|
### Requirement 8: 权限控制联调
|
|
|
|
**User Story:** As a developer, I want to verify the permission control works end-to-end.
|
|
|
|
#### Acceptance Criteria
|
|
|
|
1. WHEN a user without permission accesses an API, THE backend SHALL return 403
|
|
2. WHEN a user without permission views a page, THE buttons SHALL be hidden
|
|
3. WHEN permissions are updated, THE changes SHALL take effect immediately
|