@clawhub-cassion-ran-c472caf724
This skill should be used when generating test cases, writing test cases, designing test cases, supplementing exception scenarios and boundary values, design...
---
name: test-case-design
description: This skill should be used when generating test cases, writing test cases, designing test cases, supplementing exception scenarios and boundary values, designing complex interaction test cases, outputting standardized test cases, compatibility testing, adaptation testing, API testing, security testing, UI visual testing, mobile/App/mini-program/H5/desktop/PC Web testing, linkage testing, or routing testing. Only focuses on writing test cases, does not involve test plans, test strategies, or test automation scripts.
---
## 加载指引
> **逐步披露原则**:先读 SKILL.md 获取全貌,再按场景关键词加载对应 references 文件。无需一次加载全部。
## 设计顺序
功能(正向+边界+异常)→ 接口 → 安全 → 平台专项
## 输出
- 默认 Markdown 表格,如需 Excel 调用 xlsx Skill
- 未指明平台 → 仅通用用例;指明平台 → 通用 + 平台专项
- 结构:编号 | 标题 | 类型 | 模块 | 级别 | 预置条件 | 步骤 | 预期结果
## 能力边界
✅ 可生成:功能测试、边界值、异常场景、接口、安全意识、UI视觉用例、性能体验用例(响应时间、加载速度)
❌ 不可生成:测试方案、测试策略、测试计划、渗透测试执行、漏洞扫描、性能压测(并发、压力、负载测试)、自动化脚本
## 指令映射表
| 关键词触发 | 加载文件 | 精确定位 |
|-----------|---------|---------|
| "测试用例"、"写用例"、"设计用例"(通用) | `references/core-capabilities/common-testing.md` + `references/templates/common-rules.md` | common-testing.md 全文加载 |
| "移动端测试"、"App 测试" | `references/core-capabilities/common-testing.md` + `references/platform/mobile-app.md` + `references/templates/common-rules.md` | platform/mobile-app.md:专项测试点 |
| "小程序测试" | `references/core-capabilities/common-testing.md` + `references/platform/mini-program.md` + `references/templates/common-rules.md` | platform/mini-program.md:专项测试点 |
| "移动 Web 测试"、"H5 测试" | `references/core-capabilities/common-testing.md` + `references/platform/mobile-web.md` + `references/templates/common-rules.md` | platform/mobile-web.md:专项测试点 |
| "桌面端测试"、"桌面应用测试" | `references/core-capabilities/common-testing.md` + `references/platform/desktop.md` + `references/templates/common-rules.md` | platform/desktop.md:专项测试点 |
| "PC Web 测试"、"Web 端测试" | `references/core-capabilities/common-testing.md` + `references/platform/pc-web.md` + `references/templates/common-rules.md` | platform/pc-web.md:专项测试点 |
| "联动测试" | `references/core-capabilities/common-testing.md` | 行116-159:第三部分 联动测试 |
| "路由测试"、"跳转测试" | `references/core-capabilities/common-testing.md` | 行160-214:第四部分 路由测试 |
| "UI 测试"、"视觉测试"、"界面测试" | `references/core-capabilities/common-testing.md` | 行215-300:第五部分 UI视觉测试 |
| "接口测试"、"API 测试" | `references/core-capabilities/common-testing.md` | 行301-375:第六部分 接口测试 |
| "安全测试" | `references/core-capabilities/common-testing.md` | 行376-443:第七部分 安全测试 |
| "边界值"、"异常场景" | `references/core-capabilities/common-testing.md` | 行22-86:第一部分 测试用例设计方法 |
| "兼容性测试"、"适配测试" | `references/core-capabilities/common-testing.md` | 按平台加载对应 platform/ 文件 |
| "可访问性测试" | `references/platform/mobile-app.md` + `references/checklists/mobile-app-checklist.md` | platform/mobile-app.md 六、设备兼容 |
| "功能测试" | `references/core-capabilities/common-testing.md` + `references/templates/common-rules.md` + `references/examples/common.md` | examples/common.md 行20-294:一、功能测试 |
| 检查清单(通用) | `references/checklists/common-checklist.md` | |
| 检查清单(平台专项) | `references/checklists/mobile-app-checklist.md` / `mobile-web-checklist.md` / `pc-web-checklist.md` / `desktop-checklist.md` / `mini-program-checklist.md` | |
| 示例参考 | `references/examples/common.md` + `references/examples/{platform}.md` | examples/common.md 含目录 |
## 文件结构
> **注意**:本 skill 无 scripts/ 和 assets/ 目录,所有内容均通过 references/ 提供。
```
references/
├── templates/ # 模板规则
│ └── common-rules.md # 用例模板+测试类型+优先级+编号
├── core-capabilities/ # 通用测试能力
│ └── common-testing.md # 所有通用测试能力(含目录)
├── platform/ # 平台专项测试点
│ ├── mobile-app.md # 移动端App:手势/中断/网络/权限/推送/兼容/性能
│ ├── mobile-web.md # 移动端Web:响应式/触摸/浏览器/视口/登录支付/H5/SEO
│ ├── pc-web.md # PC Web:浏览器/布局/键盘/表单/会话/多窗口/路由/联动/拖拽/富文本/国际化/深色/打印
│ ├── desktop.md # 桌面端:窗口/快捷键/文件/系统集成/多显示器/安装更新/兼容
│ └── mini-program.md # 小程序:生命周期/授权/分享/支付/跳转/订阅/平台差异
├── checklists/ # 用例设计检查清单
│ ├── common-checklist.md # 通用检查清单(含目录)
│ ├── mobile-app-checklist.md
│ ├── mobile-web-checklist.md
│ ├── pc-web-checklist.md
│ ├── desktop-checklist.md
│ └── mini-program-checklist.md
└── examples/ # 示例参考
├── common.md # 通用测试示例(含目录)
├── mobile-app.md # 移动端App示例
├── mobile-web.md # 移动端Web示例
├── pc-web.md # PC Web示例
├── desktop.md # 桌面端示例
└── mini-program.md # 小程序示例
```
FILE:references/templates/common-rules.md
# 测试用例通用规则
本文档整合了测试用例设计的核心规范,包括用例模板、测试类型分类、优先级规则和编号规则。
## 目录
| 行号 | 章节 |
|------|------|
| 16 | 一、测试用例模板 |
| 59 | 二、测试类型分类 |
| 133 | 三、优先级判定规则 |
| 175 | 四、用例编号规则 |
---
## 一、测试用例模板
### 标准字段
| 字段 | 说明 | 必填 |
|-----|------|------|
| 用例编号 | 唯一标识符 | 是 |
| 测试标题 | 简明描述测试目的 | 是 |
| 测试类型 | 功能/安全/兼容/UI 等 | 是 |
| 功能模块 | 所属功能模块 | 是 |
| 子功能 | 具体子功能点 | 否 |
| 用例级别 | P0/P1/P2/P3 | 是 |
| 测试维度 | 手势/屏幕/网络等 | 否 |
| 预置条件 | 执行前的环境和状态 | 是 |
| 测试步骤 | 详细操作步骤 | 是 |
| 预期结果 | 期望的系统响应 | 是 |
| 实际结果 | 实际测试结果 | 执行时填写 |
| 测试状态 | Pass/Fail/Block | 执行时填写 |
### 示例
**用例编号**: TC_LOGIN_001
**测试标题**: 验证用户名密码正确可登录
**测试类型**: 功能测试
**功能模块**: 用户登录
**用例级别**: P0
**预置条件**: 用户已注册,账号密码正确
**测试步骤**:
1. 打开登录页面
2. 输入正确用户名
3. 输入正确密码
4. 点击登录按钮
**预期结果**: 登录成功,跳转至首页
---
## 二、测试类型分类
### 1. 功能测试
验证功能是否按需求规格正常工作,确保所有功能点正确实现。
**子类型**:单元测试、集成测试、系统测试、端到端测试
**示例**:登录功能、表单提交、数据查询
---
### 2. 安全测试
验证系统的安全机制是否有效,防止未授权访问和数据泄露。
**子类型**:身份认证、授权控制、数据安全、漏洞扫描
**示例**:越权访问、敏感数据暴露、接口盗用
---
### 3. 兼容性测试
验证系统在不同环境下的兼容性,确保一致体验。
**子类型**:平台兼容、浏览器兼容、设备兼容、版本兼容
**示例**:不同机型适配、不同浏览器布局、版本升级兼容
---
### 4. UI 测试
验证界面显示和交互是否正确,确保用户体验。
**子类型**:布局测试、样式测试、交互测试、主题测试
**示例**:页面错位、样式不一致、动画卡顿
---
### 5. 性能测试
验证系统的性能指标是否达标,确保流畅体验。
**子类型**:响应时间、并发能力、资源占用、稳定性
**示例**:首屏加载慢、卡顿闪退、高并发崩溃
---
### 6. 可用性测试
验证系统的易用性和用户体验,确保易学易用。
**子类型**:导航测试、表单测试、帮助测试、可访问性
**示例**:操作繁琐、提示不明确、无法键盘操作
---
### 7. 联动测试
验证不同模块/组件之间的数据同步和状态联动。
**子类型**:表单联动、列表联动、搜索联动、状态联动、数据联动
**示例**:省市区联动、筛选条件联动、跨页面状态同步
---
### 8. 路由测试
验证页面路由跳转、参数传递和权限控制。
**子类型**:导航跳转、浏览器导航、路由参数、深链接
**示例**:直接访问 URL、404 处理、登录拦截
---
## 三、优先级判定规则
### P0 - 致命(Critical)
- 核心功能
- 影响主流程
- 导致系统崩溃
- 数据丢失
- 安全漏洞
**处理**:立即修复,阻塞发布
---
### P1 - 严重(Major)
- 重要功能
- 影响用户体验
- 功能错误
- 界面严重问题
**处理**:尽快修复,影响发布
---
### P2 - 一般(Minor)
- 次要功能
- 轻微体验问题
- 界面小问题
- 提示信息不准确
**处理**:排期修复,可带病发布
---
### P3 - 建议(Trivial)
- 优化建议
- 界面美化
- 不影响功能
**处理**:有空再改
---
## 四、用例编号规则
### 编号格式
```
[平台]_[模块]_[维度]_[序号]
```
### 平台前缀
| 平台 | 前缀 |
|-----|------|
| 移动端 App | APP |
| 桌面端 | DESKTOP |
| 小程序 | MP |
| 移动 Web | H5 |
| PC Web 端 | WEB |
| 通用功能测试 | FUNC |
| 通用联动测试 | LINKAGE |
| 通用路由测试 | ROUTING |
### 维度缩写
| 维度 | 缩写 |
|-----|------|
| 手势操作 | GESTURE |
| 屏幕适配 | SCREEN |
| 中断恢复 | INTERRUPT |
| 网络切换 | NETWORK |
| 设备兼容 | COMPAT |
| 权限管理 | PERMISSION |
| 系统交互 | SYSTEM |
| 性能体验 | PERFORMANCE |
| 生命周期 | LIFECYCLE |
| 接口测试 | API |
| 安全测试 | SEC |
| UI 视觉 | UI |
| 联动测试 | LINKAGE |
| 路由测试 | ROUTING |
| 支付测试 | PAYMENT |
| 数据同步 | SYNC |
| 授权管理 | AUTH |
| 浏览器兼容 | BROWSER |
### 示例(完整格式)
```
APP_LOGIN_GESTURE_001 - 移动端登录功能手势操作第 1 个用例
APP_ORDER_NETWORK_005 - 移动端订单功能网络切换第 5 个用例
MP_SHARE_LIFECYCLE_003 - 小程序分享功能生命周期第 3 个用例
WEB_LOGIN_BROWSER_001 - PC Web 端登录功能浏览器兼容第 1 个用例
LINKAGE_FORM_001 - 联动测试表单联动第 1 个用例
ROUTING_NAV_001 - 路由测试导航跳转第 1 个用例
```
### 简化格式(通用测试用例)
对于通用测试用例,可使用简化格式:
```
TC_[测试类型前缀]_[场景关键词]_[序号]
```
简化前缀对照:
| 完整前缀 | 简化前缀 | 适用场景 |
|---------|---------|---------|
| FUNC_CRUD | FUNC | 功能测试-增删改查 |
| FUNC_LIST | FUNC | 功能测试-列表功能 |
| FUNC_FORM | FUNC | 功能测试-表单验证 |
| FUNC_STATUS | FUNC | 功能测试-状态管理 |
| LINKAGE | LINKAGE | 联动测试 |
| ROUTING | ROUTING | 路由测试 |
| API | API | 接口测试 |
| SEC | SEC | 安全测试 |
| UI | UI | UI 视觉测试 |
简化格式示例:
```
TC_FUNC_CRUD_001 - 功能测试-新增数据第1个用例
TC_FUNC_FORM_001 - 功能测试-表单校验第1个用例
TC_LINKAGE_CITY_001 - 联动测试-城市选择第1个用例
TC_ROUTING_URL_001 - 路由测试-URL访问第1个用例
TC_API_GET_001 - 接口测试-GET请求第1个用例
TC_SEC_SQL_001 - 安全测试-SQL注入第1个用例
TC_UI_LAYOUT_001 - UI测试-布局对齐第1个用例
```
FILE:references/platform/desktop.md
# 桌面端专项测试点
> 本文件定义桌面端应用区别于其他平台的专项测试维度和策略要点。
> 示例用例见 `references/examples/desktop.md`,用例设计检查清单见 `references/checklists/desktop-checklist.md`。
---
## 一、窗口管理
### 专项关注点
- 最大化/最小化/还原/全屏时的布局自适应
- 窗口拖拽移动与多显示器间拖拽
- 窗口大小调整时内容重排(尤其最小宽高限制)
- 模态窗口与父窗口的交互关系
- 无标题栏/自绘标题栏的拖拽与缩放
### 常见缺陷
- 最大化后内容不居中或有空白
- 窗口缩到很小时布局错乱
- 多显示器拖拽后窗口位置异常
---
## 二、键盘快捷键
### 专项关注点
- 通用快捷键:Ctrl+C/V/Z/Y/A/S/F 等
- 自定义快捷键与系统快捷键冲突
- 跨平台差异:Ctrl(Windows/Linux)vs Cmd(macOS)
- 全局快捷键(应用不在焦点时也能触发)
- 快捷键在输入框中的行为(不应与文字编辑冲突)
### 常见缺陷
- 快捷键与系统或其他应用冲突
- 焦点在输入框时快捷键误触发
- macOS 上 Ctrl/Cmd 混淆
---
## 三、文件操作
### 专项关注点
- 文件拖拽打开(拖到窗口/托盘图标)
- 文件关联与协议注册(双击文件用本应用打开)
- 文件保存/另存为/自动保存
- 最近文件列表
- 大文件/网络文件的打开与处理
- 文件锁定与并发访问
### 常见缺陷
- 拖拽无视觉反馈
- 文件关联未注册导致双击无法打开
- 自动保存与手动保存冲突
- 大文件打开时界面卡死
---
## 四、系统集成
### 专项关注点
- 系统托盘:图标、右键菜单、最小化到托盘
- 开机自启动设置
- 协议处理(如 myapp://xxx)
- 右键菜单集成(文件资源管理器中的"用 XX 打开")
- 剪贴板:跨应用复制粘贴、格式保留
- 通知中心:系统通知的显示与交互
### 常见缺陷
- 关闭窗口后应用未真正退出(仍在后台)
- 托盘图标不显示或菜单点击无响应
- 剪贴板格式丢失
---
## 五、多显示器适配
### 专项关注点
- 窗口跨显示器移动
- 不同 DPI 显示器间拖拽(混合 DPI 场景)
- 全屏模式在指定显示器上的显示
- 断开/连接显示器后窗口位置恢复
### 常见缺陷
- 混合 DPI 下界面模糊或缩放异常
- 断开外接显示器后窗口不可见
- 全屏在错误显示器上显示
---
## 六、安装与更新
### 专项关注点
- 安装向导:安装路径、快捷方式、协议同意
- 自动更新检测与静默更新
- Electron/Tauri 自动更新机制(electron-updater / Tauri updater)
- 更新包签名验证(防篡改)
- 更新后数据迁移与配置保留
- 卸载:残留清理、用户数据保留选项
- 回滚机制(更新失败后恢复旧版本)
### 常见缺陷
- 更新后配置丢失
- 卸载后残留文件/注册表
- 更新失败后应用无法启动
---
## 七、系统兼容性
### 专项关注点
- Windows 10/11 差异
- macOS Intel vs Apple Silicon(ARM64)
- 管理员权限 vs 普通用户权限
- 深色/浅色/高对比度模式适配
- 多语言系统下的显示
### 常见缺陷
- ARM64 设备上转译运行性能差
- 普通用户权限下功能受限无提示
- 深色模式下文字不可读
FILE:references/platform/mini-program.md
# 小程序专项测试点
> 本文件定义小程序区别于其他平台的专项测试维度和策略要点。
> 示例用例见 `references/examples/mini-program.md`,用例设计检查清单见 `references/checklists/mini-program-checklist.md`。
---
## 一、生命周期
### 专项关注点
- 冷启动 vs 热启动的数据加载差异
- 切后台 → 切前台时页面状态恢复
- 长时间后台后小程序被微信销毁 → 重新打开需重新加载
- 页面栈管理:最多 10 层页面,超出后无法打开新页面
### 常见缺陷
- 返回前台后数据未刷新但仍显示旧数据
- 页面栈溢出导致无法跳转
- 后台销毁后恢复时全局数据丢失
---
## 二、授权管理
### 专项关注点
- 微信用户信息/手机号授权流程(button 组件触发)
- 位置/相机/相册等系统权限授权
- 授权拒绝后功能降级与引导
- 授权状态持久化与过期处理
### 常见缺陷
- 授权弹窗未触发就执行后续逻辑
- 拒绝授权后无引导提示
- 授权过期后未重新获取
---
## 三、分享功能
### 专项关注点
- 右上角菜单分享 vs 页面内按钮分享(onShareAppMessage vs onShareTimeline)
- 分享卡片标题/描述/封面图/路径配置
- 分享到好友 vs 分享到朋友圈的差异
- 从分享卡片打开时参数传递与页面路由
### 常见缺陷
- 分享卡片封面图未配置显示默认截图
- 分享路径参数丢失导致打开空白页
- 朋友圈分享不支持部分场景
---
## 四、支付功能
### 专项关注点
- 微信支付调起流程与回调处理
- 支付中断(用户取消/网络异常)后订单状态
- 支付安全:金额校验、防重复支付
- iOS 虚拟支付限制(小程序内不得购买虚拟商品)
### 常见缺陷
- 支付成功但前端未收到回调导致状态不一致
- 用户取消支付后订单仍显示"待支付"
- iOS 虚拟商品支付被拒审
---
## 五、小程序跳转
### 专项关注点
- 跳转其他小程序(需配置 appid 列表)
- 从其他小程序返回的数据传递
- web-view 组件打开 H5 及 H5 与小程序的双向通信
- 半屏小程序的使用限制
### 常见缺陷
- 未配置目标小程序 appid 导致跳转失败
- web-view 与小程序通信丢失
- 跳转参数格式错误
---
## 六、订阅消息
### 专项关注点
- 一次性订阅 vs 长期订阅的差异
- 订阅授权弹窗的触发时机与频率限制
- 消息模板内容配置与参数填充
- 用户关闭通知后的降级处理
### 常见缺陷
- 一次性订阅用完后无法再次推送
- 消息模板参数未填充导致发送失败
- 诱导订阅被审核拒绝
---
## 七、存储与缓存
### 专项关注点
- wx.setStorage / wx.setStorageSync 的 10MB 容量限制
- Storage 数据持久化:小程序更新后是否保留
- 缓存清理(用户手动/系统自动)后的恢复行为
- Storage 同步写入的性能问题(大量数据应分批)
- 敏感数据存储安全(Token 加密、禁止明文存密码)
### 常见缺陷
- 超出 10MB 限制后写入静默失败
- 缓存清理后页面白屏或数据丢失
- 同步写入大量数据导致卡顿
- Token 存储未加密
---
## 八、地图与定位
### 专项关注点
- 地图组件性能:多标记点渲染、区域缩放流畅度
- 定位精度:GPS vs WiFi vs 基站,权限影响精度
- 隐私合规:必须用户授权才可获取位置
- 后台定位:小程序不支持后台持续定位
- 周边 POI 搜索的召回准确性与性能
- 地图图层叠加(交通/卫星)的加载
### 常见缺陷
- 定位权限拒绝后地图白屏或崩溃
- 大量标记点导致地图卡顿
- 定位偏差过大(室内 WiFi 定位不准)
- POI 搜索结果与预期不符
---
## 九、平台差异适配
### 专项关注点
- 微信/支付宝/百度/抖音等小程序 API 差异
- 组件兼容性(如 input 组件的 confirm-type)
- 登录流程差异(wx.login vs my.getAuthCode)
- 审核规范差异(各平台对内容/功能的要求不同)
### 常见缺陷
- 仅在微信测试通过,其他平台兼容问题
- 使用了非标准 API 导致其他平台报错
FILE:references/platform/mobile-app.md
# 移动端 App 专项测试点
> 本文件定义移动端 App 区别于其他平台的专项测试维度和策略要点。
> 示例用例见 `references/examples/mobile-app.md`,用例设计检查清单见 `references/checklists/mobile-app-checklist.md`。
---
## 一、手势操作
### 专项关注点
- 触摸区域 ≥ 44×44px,尤其注意图标按钮、列表滑动操作区
- 手势冲突:滑动翻页 vs 滑动删除 vs 滑动返回
- 边缘手势:左滑返回(iOS)、底部上拉(系统手势区)可能被 App 拦截
- 多指手势与单指手势的优先级
### 常见缺陷
- 小触摸区域导致误触
- 嵌套滚动中内外层手势冲突
- 长按触发与滚动操作冲突
---
## 二、中断恢复
### 专项关注点
- 来电/短信/闹钟/低电量弹窗/系统更新提示等系统中断
- 切后台后内存回收导致页面重建(Android 更激进)
- 表单填写中途中断 → 返回后数据是否保留
- 支付流程中断 → 订单状态是否一致
### 常见缺陷
- 中断返回后白屏或崩溃
- 表单数据丢失
- 支付状态不一致(用户扣款但订单未更新)
- 长时间后台后 App 被系统杀死,恢复异常
---
## 三、网络切换
### 专项关注点
- WiFi ↔ 4G/5G 切换时进行中的请求处理
- 弱网环境(高延迟/低带宽/高丢包)下的用户体验
- 飞行模式/断网 → 恢复后的自动重连
- 网络权限被系统禁用时的降级
### 常见缺陷
- 网络切换时请求挂起无响应
- 弱网下无限 loading 无超时提示
- 断网后图片/资源加载失败无占位
---
## 四、权限管理
### 专项关注点
- 首次请求权限需说明用途(iOS 强制,Android 推荐)
- 拒绝后功能降级:核心路径不可断
- "不再询问"后引导跳设置页
- 权限回收(系统设置中关闭)后的状态同步
- iOS/Android 权限机制差异
### 常见缺陷
- 拒绝后崩溃或卡死
- 无引导跳设置页,用户不知如何恢复
- 后台返回后权限状态未刷新
---
## 五、推送通知
### 专项关注点
- 通知权限请求时机(应在用户理解价值后再请求)
- 点击通知跳转:冷启动 vs 热启动的不同处理路径
- 通知参数传递与页面路由
- iOS/Android 通知机制差异
### 常见缺陷
- 点击通知跳转到首页而非目标页
- 冷启动时通知参数丢失
- 通知权限关闭后 App 无提示
---
## 六、设备兼容
### 专项关注点
- iOS/Android 系统版本差异(新 API 兼容、废弃 API 处理)
- 不同厂商 ROM 差异(小米 MIUI、华为 EMUI、OPPO ColorOS 等)
- 刘海屏/挖孔屏/折叠屏/长屏安全区域适配
- 系统字体大小设置对布局的影响
### 常见缺陷
- 刘海屏内容被遮挡
- 系统字体放大后布局错乱
- 折叠屏展开/折叠后布局异常
---
## 七、存储与数据
### 专项关注点
- 本地存储方案选择:SharedPreferences / Keychain / SQLite / Room / CoreData
- 缓存策略:图片缓存、接口数据缓存、缓存过期与清理
- 离线数据:本地缓存 → 在线同步的冲突处理
- 清理缓存/清除数据后的恢复行为
- 敏感数据存储安全(Token 加密存储、禁止明文存密码)
### 常见缺陷
- 清理缓存后登录态丢失但界面仍显示已登录
- 离线操作数据在同步时被覆盖
- Token 存储未加密导致安全隐患
- 缓存未设过期策略导致数据过时
---
## 八、更新与版本
### 专项关注点
- 强制更新 vs 可选更新的触发条件与用户引导
- 热更新(React Native/Flutter 等)的回滚机制
- 新旧版本数据结构不一致的兼容处理
- 灰度发布:按比例/地区/用户组逐步放量
- 更新包完整性校验(防篡改)
- 降级场景:用户回退旧版后的数据兼容
### 常见缺陷
- 强制更新弹窗无法关闭但下载失败,用户被卡住
- 新版数据库 schema 变更后旧数据丢失
- 热更新失败后应用崩溃且无法自动回滚
- 降级后本地缓存格式不兼容
---
## 九、性能体验
### 专项关注点
- 冷启动/热启动时间
- 滑动流畅度(列表、页面切换)
- 内存占用(尤其长列表、图片密集页面)
- 耗电量(后台定位、推送等)
### 常见缺陷
- 列表滑动卡顿
- 页面切换白屏
- 后台持续耗电
FILE:references/platform/mobile-web.md
# 移动 Web 端专项测试点
> 本文件定义移动 Web(H5)区别于其他平台的专项测试维度和策略要点。
> 示例用例见 `references/examples/mobile-web.md`,用例设计检查清单见 `references/checklists/mobile-web-checklist.md`。
---
## 一、响应式布局
### 专项关注点
- 关键断点适配:320px / 375px / 414px / 768px
- 媒体查询断点是否覆盖全部目标设备
- 刘海屏/挖孔屏安全区域适配(env(safe-area-inset-*))
- 横屏布局切换
- 长屏幕(19.5:9)与短屏幕(16:9)的内容显示差异
### 常见缺陷
- 小屏幕下文字截断或重叠
- 横屏时布局错乱
- 刘海屏内容被遮挡
---
## 二、触摸交互
### 专项关注点
- 点击态视觉反馈(:active 伪类在移动端的兼容性)
- 300ms 点击延迟与 touch-action 处理
- 滑动翻页/轮播的流畅度
- 双指缩放限制与页面级别缩放控制
- 嵌套滚动区域的手势冲突
- 惯性滚动与橡皮筋效果
### 常见缺陷
- 点击无视觉反馈,用户不确定是否点中
- 快速滑动时页面卡顿
- 嵌套列表内外层滑动冲突
---
## 三、浏览器兼容
### 专项关注点
- iOS Safari / Android Chrome / 微信内置浏览器 / QQ 浏览器 / UC 浏览器
- WebView 容器差异(WKWebView vs Android WebView)
- CSS 特性兼容(flexbox gap、aspect-ratio 等)
- JavaScript API 兼容(IntersectionObserver、ResizeObserver 等)
- 隐私模式/无痕模式对 Storage 的影响
### 常见缺陷
- iOS Safari 日期格式解析差异(需兼容 yyyy-MM-dd)
- 微信内置浏览器长按识别二维码干扰页面交互
- 隐私模式下 localStorage 写入报错
---
## 四、视口与输入
### 专项关注点
- viewport meta 配置(width、initial-scale、viewport-fit)
- 虚拟键盘弹出时布局调整(100vh 在移动端的表现)
- 输入框聚焦后被键盘遮挡
- 不同 input type 触发的键盘类型(number/tel/email/url)
- 中文输入法组合事件(compositionstart/end)
### 常见缺陷
- 键盘弹出后输入框被遮挡
- 100vh 包含地址栏高度导致页面高度计算错误
- 中文输入法搜索时触发多次请求
---
## 五、第三方登录与支付
### 专项关注点
- 微信 H5 授权登录(需在微信浏览器内,使用 OAuth2.0)
- 微信 H5 支付(需配置支付目录和域名)
- 支付宝 H5 支付流程
- 授权回调 URL 的参数传递与状态恢复
- 登录态在多标签页间的同步
### 常见缺陷
- 非微信浏览器内无法调起微信登录
- 支付回调 URL 配置错误导致支付失败
- 登录态跨标签页不同步
---
## 六、H5 特有功能
### 专项关注点
- tel:/sms:/mailto: 链接的触发与参数
- Web Share API 的浏览器支持与降级
- PWA:添加到主屏幕、Service Worker 离线缓存
- 地理定位/相机调用(需 HTTPS + 用户授权)
- 滚动穿透与弹窗锁定
### 常见缺陷
- 弹窗打开时背景仍可滚动(滚动穿透)
- PWA manifest 配置错误导致添加到主屏幕失败
- HTTP 环境下地理位置 API 不可用
---
## 七、缓存与离线
### 专项关注点
- Service Worker 缓存策略:Cache First / Network First / Stale While Revalidate
- HTTP 缓存头配置(Cache-Control / ETag / Last-Modified)
- 离线访问降级:哪些功能可用、哪些需提示
- 缓存更新机制:版本更新后如何让用户获取最新资源
- 预缓存关键资源(App Shell 模式)
### 常见缺陷
- 缓存策略错误导致用户始终看到旧版本
- 离线时白屏无任何降级提示
- 缓存更新后旧资源未失效
- Service Worker 异常导致页面永久无法加载
---
## 八、SEO 与分享
### 专项关注点
- 微信分享卡片:标题/描述/封面图(依赖 JS-SDK 或 meta 标签)
- Open Graph 标签配置
- 页面标题与 meta description
- URL 参数在分享链接中的传递
### 常见缺陷
- 微信分享未调用 JS-SDK 导致默认抓取页面内容
- 分享封面图未配置
- URL 参数在分享中丢失
FILE:references/platform/pc-web.md
# PC Web 端专项测试点
> 本文件定义 PC Web 端区别于其他平台的专项测试维度和策略要点。
> 示例用例见 `references/examples/pc-web.md`,用例设计检查清单见 `references/checklists/pc-web-checklist.md`。
## 目录
| 行号 | 章节 |
|------|------|
| 26 | 一、浏览器兼容性 |
| 42 | 二、页面布局与分辨率 |
| 57 | 三、键盘导航 |
| 74 | 四、表单交互 |
| 90 | 五、会话与认证 |
| 106 | 六、多窗口与标签页 |
| 121 | 七、路由与导航 |
| 137 | 八、数据联动 |
| 153 | 九、拖拽交互 |
| 169 | 十、富文本编辑 |
| 186 | 十一、国际化 |
| 201 | 十二、深色模式 |
| 217 | 十三、打印功能 |
---
## 一、浏览器兼容性
### 专项关注点
- 主流浏览器:Chrome / Firefox / Safari / Edge
- CSS 特性差异:flexbox gap、aspect-ratio、container queries 等
- JavaScript API 差异:新 API 的 polyfill 覆盖
- Safari 特有问题:日期格式、flex 布局、input 事件差异
- 隐私模式对 Cookie/Storage 的影响
### 常见缺陷
- Safari 日期解析失败(需兼容 yyyy-MM-dd)
- Firefox 滚动条样式不一致
- 隐私模式下 localStorage 写入报错
---
## 二、页面布局与分辨率
### 专项关注点
- 主流分辨率:1366×768 / 1920×1080 / 2K / 4K
- DPI 缩放:100% / 125% / 150% 下的布局表现
- 窗口缩放时内容重排(最小宽度限制)
- 滚动条宽度对布局的影响(尤其 Windows 自动隐藏滚动条)
### 常见缺陷
- 125%/150% DPI 下按钮或文字被裁切
- 小分辨率下内容溢出
- 滚动条出现/消失导致布局抖动
---
## 三、键盘导航
### 专项关注点
- Tab 焦点顺序:从上到下、从左到右
- Enter 触发按钮、Space 操作复选框
- Esc 关闭弹窗/取消操作
- 全局快捷键(Ctrl+S 保存、Ctrl+F 搜索等)
- 焦点指示器清晰可见
- 无障碍跳转链接(Skip to main content)
### 常见缺陷
- Tab 焦点跳到隐藏元素
- 弹窗打开时焦点未移入弹窗
- Esc 无法关闭弹窗
---
## 四、表单交互
### 专项关注点
- 表单提交防重复(快速连续点击)
- 必填/格式校验与实时错误提示
- 日期选择器/下拉选择器/文件上传组件
- 自动填充(浏览器自动填充与自定义组件的冲突)
- 复制粘贴(含格式粘贴的处理)
### 常见缺陷
- 快速双击提交产生重复数据
- 浏览器自动填充覆盖自定义组件值
- 日期选择器与手动输入格式不一致
---
## 五、会话与认证
### 专项关注点
- Session 过期处理:弹窗提示 vs 跳转登录页
- 多标签页登录态同步(标签页 A 登出,标签页 B 如何感知)
- 记住登录 / 自动登录
- 多端登录冲突处理
- 单点登录(SSO)流程
### 常见缺陷
- Session 过期后操作无响应或数据丢失
- 多标签页登录态不同步
- 登出后浏览器缓存仍可访问
---
## 六、多窗口与标签页
### 专项关注点
- 跨标签页通信(BroadcastChannel / localStorage 事件)
- 标签页切换时状态保持
- 浏览器前进/后退/刷新的状态恢复
- 窗口间数据传递(window.opener / postMessage)
### 常见缺陷
- 后退后页面状态丢失
- 刷新后表单数据清空
- 多标签页操作同一条数据导致冲突
---
## 七、路由与导航
### 专项关注点
- SPA 路由:URL 与页面状态同步
- 动态路由参数解析与类型校验
- 深层链接直接访问(刷新不丢失状态)
- 路由守卫:未登录/无权限的重定向
- 面包屑导航层级正确
### 常见缺陷
- 刷新后 404(SPA 未配置服务端路由回退)
- 动态路由参数类型错误未处理
- 后退后页面显示错误内容
---
## 八、数据联动
### 专项关注点
- 父子组件数据同步与跨组件状态共享
- 列表 → 详情的数据传递与返回刷新
- 多条件筛选联动与分页重置
- Tab 切换时数据加载与缓存策略
- 模态框操作后页面数据刷新
### 常见缺陷
- 详情修改后返回列表未刷新
- 筛选条件变更后分页未重置
- 快速切换 Tab 出现数据错乱
---
## 九、拖拽交互
### 专项关注点
- 拖拽排序与拖拽上传
- 拖拽过程中的位置预览与辅助线
- 拖拽到无效区域时的反馈
- Ctrl+Z 撤销拖拽操作
- 大量元素拖拽的性能
### 常见缺陷
- 拖拽后数据顺序与视觉不一致
- 撤销拖拽后数据未回滚
- 大列表拖拽时卡顿
---
## 十、富文本编辑
### 专项关注点
- 基础格式:加粗/斜体/下划线/标题/列表
- 插入链接/图片/表格
- 撤销/重做(Ctrl+Z / Ctrl+Y)
- 从 Word/Excel 粘贴内容的格式处理
- Markdown 编辑与预览
- 字数统计与内容限制
### 常见缺陷
- 粘贴 Word 内容格式错乱
- 撤销/重做栈异常
- 富文本内容提交时 XSS 风险
---
## 十一、国际化
### 专项关注点
- 语言切换:静态文本/动态内容/日期/数字/货币格式
- RTL 布局(阿拉伯语等)
- 切换后刷新页面语言保持
- 多语言下的布局溢出(德语等长文本)
### 常见缺陷
- 切换语言后部分文本未翻译
- 长文本语言下布局溢出
- 日期格式不符合区域习惯
---
## 十二、深色模式
### 专项关注点
- 手动切换 vs 跟随系统
- 所有组件在深色模式下的对比度(≥4.5:1)
- 图片/图标/代码块适配
- 切换后刷新保持
- 跨页面模式一致
### 常见缺陷
- 深色模式下部分组件未适配(白色背景)
- 代码块高亮在深色模式下不可读
- 刷新后模式重置
---
## 十三、打印功能
### 专项关注点
- 打印样式:隐藏导航/按钮等非内容元素
- 跨页表格标题重复
- 页眉页脚与页码
- 不同纸张大小(A4/Letter)的布局
- 打印预览与实际输出一致
### 常见缺陷
- 打印时包含不必要的导航和按钮
- 跨页表格表头丢失
- 图片打印模糊
FILE:references/examples/common.md
# 通用测试示例用例
本文件展示各类通用测试用例的标准格式,包括功能测试、联动测试、路由测试、UI视觉测试、接口测试和安全测试。
> **文件路径**: `references/examples/common.md`
## 目录
| 行号 | 章节 |
|------|------|
| 20 | 一、功能测试 |
| 295 | 三、联动测试 |
| 354 | 四、路由测试 |
| 418 | 五、UI 视觉测试 |
| 472 | 六、接口测试 |
| 543 | 七、安全测试 |
---
## 一、功能测试
### TC_FUNC_CRUD_001 验证新增数据功能
**测试类型**: 功能测试 - 增删改查
**功能模块**: 数据管理
**用例级别**: P0
**预置条件**:
1. 用户已登录
2. 有新增数据权限
**测试步骤**:
1. 点击"新增"按钮
2. 填写表单必填字段
3. 填写表单选填字段
4. 点击"保存"按钮
5. 检查新增成功提示
6. 在列表中查找新增的记录
**预期结果**:
1. 新增页面正常打开
2. 必填字段有标识
3. 数据保存成功
4. 显示新增成功提示
5. 列表中显示新增记录
6. 数据与输入一致
---
### TC_FUNC_CRUD_002 验证编辑数据功能
**测试类型**: 功能测试 - 增删改查
**功能模块**: 数据管理
**用例级别**: P0
**预置条件**:
1. 系统中存在可编辑的数据记录
**测试步骤**:
1. 在列表中找到目标记录
2. 点击"编辑"按钮
3. 修改部分字段
4. 点击"保存"按钮
5. 检查更新成功提示
6. 检查列表中数据已更新
**预期结果**:
1. 编辑页面正常打开
2. 原数据正确回填
3. 数据更新成功
4. 显示更新成功提示
5. 列表显示最新数据
6. 再次编辑数据保持
---
### TC_FUNC_CRUD_003 验证删除数据功能
**测试类型**: 功能测试 - 增删改查
**功能模块**: 数据管理
**用例级别**: P1
**预置条件**:
1. 系统中存在可删除的数据记录
**测试步骤**:
1. 在列表中找到目标记录
2. 点击"删除"按钮
3. 检查确认弹窗
4. 点击"确认"删除
5. 检查删除成功提示
6. 在列表中确认记录已删除
**预期结果**:
1. 删除按钮可用
2. 弹出确认提示
3. 删除前需二次确认
4. 显示删除成功提示
5. 列表中记录已移除
6. 数据库中数据已删除
---
### TC_FUNC_CRUD_004 验证数据查询功能
**测试类型**: 功能测试 - 增删改查
**功能模块**: 数据查询
**用例级别**: P1
**预置条件**:
1. 系统中存在多条数据记录
2. 查询功能正常配置
**测试步骤**:
1. 在搜索框输入关键字
2. 点击搜索按钮
3. 检查搜索结果
4. 输入精确条件查询
5. 使用筛选条件查询
6. 清空搜索条件
**预期结果**:
1. 支持模糊搜索
2. 返回匹配的搜索结果
3. 无匹配时显示空状态
4. 精确查询结果准确
5. 筛选条件组合生效
6. 清空后恢复默认列表
---
### TC_FUNC_LIST_001 验证列表分页功能
**测试类型**: 功能测试 - 列表功能
**功能模块**: 列表展示
**用例级别**: P1
**预置条件**:
1. 列表数据超过一页
**测试步骤**:
1. 查看第一页数据
2. 点击"下一页"
3. 检查第二页数据
4. 输入页码跳转
5. 修改每页条数
6. 检查数据更新
**预期结果**:
1. 默认显示第一页
2. 分页信息正确
3. 第二页数据不重复
4. 跳转页码正确
5. 每页条数切换生效
6. 总数统计正确
---
### TC_FUNC_LIST_002 验证列表排序功能
**测试类型**: 功能测试 - 列表功能
**功能模块**: 列表展示
**用例级别**: P1
**预置条件**:
1. 列表支持排序的列
**测试步骤**:
1. 点击升序排列
2. 检查数据顺序
3. 再次点击降序排列
4. 检查数据顺序
5. 切换排序列
6. 检查新列排序
**预期结果**:
1. 升序图标显示
2. 数据按从小到大排列
3. 降序图标显示
4. 数据按从大到小排列
5. 不同列排序互不影响
6. 排序状态可保存
---
### TC_FUNC_FORM_001 验证表单必填校验
**测试类型**: 功能测试 - 表单验证
**功能模块**: 表单校验
**用例级别**: P0
**预置条件**:
1. 表单有必填字段
**测试步骤**:
1. 直接点击保存(不填写任何内容)
2. 检查必填提示
3. 填写部分必填字段
4. 提交检查
5. 填写全部必填字段
6. 提交检查
**预期结果**:
1. 显示必填字段提示
2. 未填字段高亮提示
3. 只填部分无法提交
4. 填写全部可通过验证
5. 提示信息清晰明确
6. 修正后错误提示消失
---
### TC_FUNC_FORM_002 验证表单格式校验
**测试类型**: 功能测试 - 表单验证
**功能模块**: 表单校验
**用例级别**: P1
**预置条件**:
1. 表单有格式校验字段
**测试步骤**:
1. 输入手机号格式错误(如 123)
2. 检查格式错误提示
3. 输入邮箱格式错误(如 abc)
4. 检查格式错误提示
5. 输入正确格式数据
6. 检查验证通过
**预期结果**:
1. 手机号格式校验生效
2. 显示正确格式提示(如 11 位数字)
3. 邮箱格式校验生效
4. 显示正确格式提示
5. 正确格式通过验证
6. 实时校验或提交时校验
---
### TC_FUNC_STATUS_001 验证状态切换功能
**测试类型**: 功能测试 - 状态管理
**功能模块**: 状态控制
**用例级别**: P1
**预置条件**:
1. 数据有状态字段
2. 支持状态切换
**测试步骤**:
1. 查看数据当前状态
2. 执行启用操作
3. 检查状态变化
4. 执行禁用操作
5. 检查状态变化
6. 刷新页面检查状态持久
**预期结果**:
1. 初始状态正确显示
2. 启用操作成功
3. 状态立即更新
4. 禁用操作成功
5. 状态立即更新
6. 刷新后状态保持
---
### TC_FUNC_STATUS_002 验证数据持久化
**测试类型**: 功能测试 - 状态管理
**功能模块**: 数据存储
**用例级别**: P0
**预置条件**:
1. 存在可保存的数据
**测试步骤**:
1. 填写表单数据
2. 点击保存
3. 关闭页面
4. 重新打开
5. 检查数据是否保留
**预期结果**:
1. 保存操作成功
2. 页面正常关闭
3. 重新进入页面
4. 数据完整保留
5. 无数据丢失
---
---
## 三、联动测试
### TC_LINKAGE_001 验证省市区三级联动
**测试类型**: 联动测试 - 功能测试
**功能模块**: 地址选择
**用例级别**: P1
**预置条件**:
1. 地址选择表单正常加载
**测试步骤**:
1. 选择省份(如"广东省")
2. 检查城市下拉框选项
3. 选择城市(如"深圳市")
4. 检查区县下拉框选项
5. 选择区县(如"南山区")
6. 检查完整地址
7. 修改省份为"浙江省"
8. 检查城市和区县是否重置
**预期结果**:
1. 城市列表随省份变化(广东省→广州、深圳等)
2. 区县列表随城市变化(深圳市→南山、福田等)
3. 数据正确对应
4. 修改上级选项,下级自动重置
5. 提交时地址数据完整
---
### TC_LINKAGE_002 验证搜索框实时联想
**测试类型**: 联动测试 - 交互测试
**功能模块**: 搜索
**用例级别**: P1
**预置条件**:
1. 搜索页面
2. 支持实时联想
**测试步骤**:
1. 在搜索框输入"手"
2. 检查联想词列表
3. 继续输入"手机"
4. 检查联想词更新
5. 点击联想词"苹果手机"
6. 检查搜索结果
7. 快速删除输入
8. 检查联想词消失
**预期结果**:
1. 输入时实时显示联想词
2. 联想词准确匹配
3. 点击联想词执行搜索
4. 清空输入时联想词消失
5. 防抖处理(避免频繁请求)
---
## 四、路由测试
### TC_ROUTING_001 验证直接访问详情页 URL
**测试类型**: 路由测试 - 功能测试
**功能模块**: 页面导航
**用例级别**: P1
**预置条件**:
1. 用户已登录
2. 商品详情页 URL 已知
**测试步骤**:
1. 浏览器地址栏输入商品详情页 URL
2. 按回车访问
3. 检查页面加载
**预期结果**:
1. 页面正常加载
2. 显示正确的商品信息
3. URL 与页面内容匹配
4. 页面标题正确
---
### TC_ROUTING_002 验证访问不存在的路由
**测试类型**: 路由测试 - 错误处理
**功能模块**: 错误页面
**用例级别**: P2
**测试步骤**:
1. 访问不存在的路由 `/product/999999`
2. 按回车
**预期结果**:
1. 显示 404 页面
2. 提供返回首页链接
3. 提供搜索功能
4. 页面状态码为 404
---
### TC_ROUTING_003 验证未登录访问需要认证的路由
**测试类型**: 路由测试 - 安全测试
**功能模块**: 路由守卫
**用例级别**: P0
**预置条件**:
1. 用户未登录
2. 订单详情页需要认证
**测试步骤**:
1. 访问订单详情页 `/order/123`
2. 检查跳转行为
**预期结果**:
1. 重定向到登录页
2. 登录后返回原页面
3. 或显示友好的未登录提示
---
## 五、UI 视觉测试
### TC_UI_LAYOUT_001 验证页面元素对齐
**测试类型**: UI 测试 - 布局测试
**功能模块**: 页面布局
**用例级别**: P2
**测试维度**: UI 视觉
**预置条件**:
1. 页面正常加载
**测试步骤**:
1. 检查页面边距一致性
2. 检查元素对齐(左对齐/居中对齐)
3. 检查元素间距均匀
4. 检查网格系统
5. 检查响应式断点
**预期结果**:
1. 边距符合设计稿(如 16px/24px)
2. 同层级元素对齐一致
3. 间距均匀(如 8px 倍数)
4. 网格系统正确
5. 各断点布局正确
---
### TC_UI_DARK_001 验证深色模式适配
**测试类型**: UI 测试 - 主题测试
**功能模块**: 深色模式
**用例级别**: P2
**测试维度**: UI 视觉
**预置条件**:
1. 应用支持深色模式切换
**测试步骤**:
1. 系统切换到深色模式
2. 检查应用背景色
3. 检查文字颜色
4. 检查图标颜色
5. 检查图片适配
**预期结果**:
1. 背景色适配深色主题
2. 文字对比度足够
3. 图标颜色协调
4. 图片正常显示
5. 无白色闪屏
---
## 六、接口测试
### TC_API_GET_001 验证获取用户信息接口
**测试类型**: 接口测试 - 功能测试
**功能模块**: 用户接口
**用例级别**: P1
**接口信息**:
- 方法:GET
- URL:`/api/v1/users/{userId}`
- 认证:Bearer Token
**请求参数**:
- userId: 12345(路径参数)
**测试步骤**:
1. 设置请求头 Authorization: Bearer {token}
2. 发送 GET 请求
3. 检查响应状态码
4. 检查响应数据结构
5. 检查字段值
**预期结果**:
1. 状态码 200
2. 返回用户对象
3. 字段完整(id、name、email 等)
4. 数据与数据库一致
5. 敏感信息脱敏
---
### TC_API_POST_001 验证创建订单接口
**测试类型**: 接口测试 - 功能测试
**功能模块**: 订单接口
**用例级别**: P0
**接口信息**:
- 方法:POST
- URL:`/api/v1/orders`
- 认证:Bearer Token
- Content-Type: application/json
**请求体**:
```json
{
"userId": 12345,
"items": [
{"productId": 1001, "quantity": 2}
],
"address": "北京市朝阳区"
}
```
**测试步骤**:
1. 设置请求头和认证
2. 构造请求体
3. 发送 POST 请求
4. 检查响应
5. 验证数据库记录
**预期结果**:
1. 状态码 201
2. 返回订单对象(含订单号)
3. 数据库创建对应记录
4. 库存扣减
5. 触发订单创建事件
---
## 七、安全测试
### TC_SEC_SQL_001 验证 SQL 注入防护
**测试类型**: 安全测试 - 注入攻击
**功能模块**: 输入校验
**用例级别**: P0
**测试步骤**:
1. 在搜索框输入 `' OR '1'='1`
2. 在登录框输入 `admin' --`
3. 在 URL 参数输入 `1; DROP TABLE users--`
4. 检查响应
5. 检查数据库日志
**预期结果**:
1. 查询返回空或正常结果
2. 无法绕过认证
3. 数据库表未删除
4. 日志记录攻击尝试
5. 使用参数化查询
---
### TC_SEC_XSS_001 验证跨站脚本攻击防护
**测试类型**: 安全测试 - XSS 攻击
**功能模块**: 输入输出
**用例级别**: P0
**测试步骤**:
1. 在评论框输入 `<script>alert('xss')</script>`
2. 在用户名输入 `<img src=x onerror=alert(1)>`
3. 提交并查看页面
4. 检查是否执行脚本
5. 检查输出编码
**预期结果**:
1. 脚本不执行
2. 特殊字符转义
3. 显示为纯文本
4. Content-Type 正确
5. 设置 HttpOnly 标志
---
### TC_SEC_AUTH_001 验证未授权访问防护
**测试类型**: 安全测试 - 认证授权
**功能模块**: 权限控制
**用例级别**: P0
**测试步骤**:
1. 未登录访问需要认证的接口
2. 普通用户访问管理员接口
3. 用户 A 访问用户 B 的数据
4. 使用过期 Token 访问
5. 检查响应
**预期结果**:
1. 返回 401 未认证
2. 返回 403 无权限
3. 数据隔离正确
4. Token 失效拒绝访问
5. 错误信息不敏感
FILE:references/examples/desktop.md
# 桌面端示例用例
## 示例 1:窗口管理
### TC_DESKTOP_WINDOW_001 验证窗口最大化/最小化
**测试类型**: 桌面端测试 - 窗口管理
**功能模块**: 窗口控制
**用例级别**: P2
**预置条件**:
1. 应用已启动
**测试步骤**:
1. 点击最大化按钮
2. 检查窗口状态
3. 点击还原按钮
4. 检查窗口状态
5. 点击最小化按钮
6. 检查任务栏
7. 点击任务栏图标恢复
**预期结果**:
1. 最大化时窗口占满屏幕
2. 内容适配正常
3. 还原时恢复原大小
4. 最小化后显示在任务栏
5. 恢复后状态保持
---
## 示例 2:系统托盘
### TC_DESKTOP_TRAY_001 验证系统托盘功能
**测试类型**: 桌面端测试 - 系统交互
**功能模块**: 系统托盘
**用例级别**: P2
**预置条件**:
1. 应用已启动
2. 托盘图标已显示
**测试步骤**:
1. 点击托盘图标
2. 检查弹出菜单
3. 选择"显示主窗口"
4. 检查窗口显示
5. 右键托盘图标
6. 选择"退出"
7. 检查应用关闭
**预期结果**:
1. 单击显示主窗口
2. 菜单选项正确
3. 窗口正确显示
4. 退出选项可用
5. 应用正常退出
---
## 示例 3:全局快捷键
### TC_DESKTOP_HOTKEY_001 验证全局快捷键
**测试类型**: 桌面端测试 - 快捷键
**功能模块**: 全局快捷键
**用例级别**: P1
**预置条件**:
1. 应用已启动
2. 焦点不在应用窗口
**测试步骤**:
1. 按下全局快捷键(如 Ctrl+Shift+P)
2. 检查应用响应
3. 在其他应用中测试
4. 检查快捷键冲突
**预期结果**:
1. 快捷键触发应用响应
2. 其他应用不响应该快捷键
3. 无快捷键冲突
4. 快捷键在后台生效
---
## 示例 4:文件拖拽
### TC_DESKTOP_DRAG_001 验证文件拖拽打开
**测试类型**: 桌面端测试 - 文件操作
**功能模块**: 文件拖拽
**用例级别**: P1
**预置条件**:
1. 应用已启动
2. 准备测试文件
**测试步骤**:
1. 选中测试文件
2. 拖拽到应用窗口
3. 释放鼠标
4. 检查文件打开
**预期结果**:
1. 拖拽进入有视觉反馈
2. 支持的文件类型正确打开
3. 不支持的文件类型有提示
4. 多文件拖拽正确处理
---
## 示例 5:本地通知
### TC_DESKTOP_NOTIFY_001 验证系统通知
**测试类型**: 桌面端测试 - 系统交互
**功能模块**: 系统通知
**用例级别**: P2
**预置条件**:
1. 应用已启动
2. 系统通知已启用
**测试步骤**:
1. 触发需要通知的事件
2. 检查系统通知显示
3. 点击通知
4. 检查应用响应
**预期结果**:
1. 通知正确显示
2. 标题和内容正确
3. 点击后应用响应
4. 通知可关闭
---
## 示例 6:多显示器
### TC_DESKTOP_MULTI_001 验证多显示器支持
**测试类型**: 桌面端测试 - 多显示器
**功能模块**: 多窗口
**用例级别**: P2
**预置条件**:
1. 连接多个显示器
2. 应用已启动
**测试步骤**:
1. 将窗口拖动到第二显示器
2. 检查窗口显示
3. 关闭第二显示器
4. 检查窗口位置
5. 重新连接显示器
**预期结果**:
1. 第二显示器正确显示
2. 窗口内容适配
3. 断开后窗口移回主显示器
4. 重连后恢复原位置
FILE:references/examples/mini-program.md
# 小程序示例用例
## 示例 1:分享功能
### TC_MP_SHARE_001 验证右上角菜单分享
**测试类型**: 小程序测试 - 分享功能
**功能模块**: 分享
**用例级别**: P1
**预置条件**:
1. 小程序已打开
2. 当前页面支持分享
**测试步骤**:
1. 点击右上角菜单(···)
2. 选择"转发"
3. 选择好友或群
4. 发送分享卡片
5. 好友点击卡片
**预期结果**:
1. 分享面板正常显示
2. 分享卡片标题、图片正确
3. 分享成功提示
4. 好友收到分享卡片
5. 点击卡片打开小程序对应页面
---
## 示例 2:微信登录
### TC_MP_LOGIN_001 验证微信授权登录
**测试类型**: 小程序测试 - 用户登录
**功能模块**: 登录认证
**用例级别**: P0
**预置条件**:
1. 用户未登录
2. 微信已登录
**测试步骤**:
1. 打开小程序
2. 点击"微信登录"按钮
3. 系统弹出授权窗口
4. 点击"允许"
5. 检查登录状态
**预期结果**:
1. 授权窗口显示
2. 授权后获取用户信息
3. 登录成功
4. 显示用户昵称、头像
5. 后续操作无需重复授权
---
## 示例 3:微信支付
### TC_MP_PAYMENT_001 验证微信支付流程
**测试类型**: 小程序测试 - 支付功能
**功能模块**: 支付
**用例级别**: P0
**预置条件**:
1. 用户已登录
2. 购物车有商品
3. 微信支付已绑定
**测试步骤**:
1. 进入订单确认页
2. 选择微信支付
3. 点击"立即支付"
4. 输入支付密码
5. 检查支付结果
**预期结果**:
1. 调起微信支付
2. 支付金额正确
3. 支付成功回调
4. 订单状态更新为"已支付"
5. 显示支付成功页面
---
## 示例 4:生命周期
### TC_MP_LIFECYCLE_001 验证小程序前后台切换
**测试类型**: 小程序测试 - 生命周期
**功能模块**: 应用生命周期
**用例级别**: P1
**预置条件**:
1. 小程序正在运行
**测试步骤**:
1. 从小程序返回微信
2. 小程序进入后台
3. 等待 30 秒
4. 重新进入小程序
5. 检查页面状态
**预期结果**:
1. 返回微信时小程序进入后台
2. 后台时暂停业务逻辑
3. 重新进入时恢复前台
4. 页面状态保持
5. 数据无需重新加载
---
## 示例 5:扫码功能
### TC_MP_SCAN_001 验证扫码跳转
**测试类型**: 小程序测试 - 扫码功能
**功能模块**: 扫码
**用例级别**: P1
**预置条件**:
1. 小程序有扫码入口
2. 准备测试二维码
**测试步骤**:
1. 点击"扫一扫"
2. 扫描小程序码
3. 检查跳转页面
4. 扫描普通二维码
5. 检查解析结果
**预期结果**:
1. 调起扫码功能
2. 识别小程序码
3. 跳转到对应页面
4. 参数正确传递
5. 普通二维码正确解析
---
## 示例 6:订阅消息
### TC_MP_SUBSCRIBE_001 验证订阅消息发送
**测试类型**: 小程序测试 - 消息通知
**功能模块**: 订阅消息
**用例级别**: P1
**预置条件**:
1. 小程序支持订阅消息
2. 用户未订阅
**测试步骤**:
1. 触发需要订阅的操作(如预约)
2. 弹出订阅授权窗口
3. 点击"允许"
4. 后台发送订阅消息
5. 检查微信服务通知
**预期结果**:
1. 订阅授权窗口显示
2. 允许后订阅成功
3. 到时间发送消息
4. 微信服务通知收到消息
5. 点击消息打开小程序
FILE:references/examples/mobile-app.md
# 移动端 App 示例用例
## 示例 1:手势操作
### TC_APP_GESTURE_001 验证下拉刷新功能
**测试类型**: 移动端测试 - 手势测试
**功能模块**: 列表刷新
**用例级别**: P1
**预置条件**:
1. 进入列表页面
2. 网络正常
**测试步骤**:
1. 手指放在屏幕中间偏上位置
2. 向下缓慢滑动
3. 观察到刷新动画出现
4. 释放手指
5. 等待数据加载完成
**预期结果**:
1. 下拉时显示刷新动画
2. 释放后自动回弹到顶部
3. 数据重新加载
4. 刷新成功提示
5. 列表显示最新数据
---
## 示例 2:中断恢复
### TC_APP_INTERRUPT_001 验证来电中断后恢复
**测试类型**: 移动端测试 - 中断恢复
**功能模块**: 应用生命周期
**用例级别**: P1
**预置条件**:
1. App 正在运行
2. 模拟来电或闹钟响铃
**测试步骤**:
1. 在 App 中填写表单(输入部分内容)
2. 模拟来电中断
3. 挂断电话
4. 返回 App
5. 检查表单状态
**预期结果**:
1. 来电时 App 进入后台
2. 返回后 App 恢复到前台
3. 表单数据保留
4. 页面状态保持
5. 无崩溃或闪退
---
## 示例 3:网络切换
### TC_APP_NETWORK_001 验证 WiFi 与 4G 切换
**测试类型**: 移动端测试 - 网络测试
**功能模块**: 网络适配
**用例级别**: P1
**预置条件**:
1. App 正在加载数据
2. WiFi 和 4G 网络可用
**测试步骤**:
1. 使用 WiFi 浏览内容
2. 关闭 WiFi,切换到 4G
3. 继续操作 App
4. 重新打开 WiFi
5. 检查网络连接
**预期结果**:
1. 网络切换时连接不中断
2. 正在进行的请求自动重试
3. 切换后数据加载正常
4. 无网络错误提示
5. 图片等资源继续加载
---
## 示例 4:权限管理
### TC_APP_PERMISSION_001 验证相机权限拒绝后处理
**测试类型**: 移动端测试 - 权限测试
**功能模块**: 权限管理
**用例级别**: P1
**预置条件**:
1. App 有拍照功能
2. 首次使用相机
**测试步骤**:
1. 点击拍照按钮
2. 系统弹出权限请求
3. 选择"拒绝"
4. 再次点击拍照按钮
5. 检查 App 反应
**预期结果**:
1. 首次请求权限有说明
2. 拒绝后不崩溃
3. 再次点击提示开启权限
4. 提供跳转到设置页的入口
5. 其他功能正常使用
---
## 示例 5:推送通知
### TC_APP_PUSH_001 验证推送通知点击跳转
**测试类型**: 移动端测试 - 系统交互
**功能模块**: 推送通知
**用例级别**: P1
**预置条件**:
1. App 已开启推送权限
2. 后台有推送消息
**测试步骤**:
1. 关闭 App(后台运行)
2. 收到推送通知
3. 点击推送通知
4. 检查打开的页面
**预期结果**:
1. 通知栏显示推送
2. 点击后 App 启动
3. 跳转到推送对应的页面
4. 页面数据正确
5. 推送参数正确传递
---
## 示例 6:可访问性测试
### TC_APP_ACCESS_001 屏幕阅读器支持
**测试类型**: 移动端测试 - 可访问性
**功能模块**: 无障碍功能
**用例级别**: P2
**预置条件**:
1. 设备已开启 VoiceOver(iOS)或 TalkBack(Android)
2. App 已安装并登录
**测试步骤**:
1. 开启屏幕阅读器
2. 打开 App 首页
3. 使用手势浏览页面元素
4. 点击各个按钮和链接
5. 检查朗读内容
**预期结果**:
1. 页面标题被正确朗读
2. 导航元素有完整描述
3. 图片有 alt 文本或描述
4. 表单标签被朗读
5. 操作按钮有功能说明
---
### TC_APP_ACCESS_002 触摸区域大小检查
**测试类型**: 移动端测试 - 可访问性
**功能模块**: UI 交互
**用例级别**: P2
**预置条件**:
1. App 页面已加载
**测试步骤**:
1. 进入主要操作页面
2. 使用标尺或测量工具
3. 测量各个可点击元素的触摸区域
4. 记录小于 44x44px 的元素
**预期结果**:
1. 所有按钮触摸区域 ≥ 44x44px
2. 链接触摸区域 ≥ 44x44px
3. 表单输入框高度合适
4. 重要操作按钮足够大
FILE:references/examples/mobile-web.md
# 移动 Web 端测试示例用例
## 示例 1:响应式布局
### TC_H5_RESPONSIVE_001 验证不同屏幕宽度适配
**测试类型**: 移动 Web 测试 - 兼容性测试
**功能模块**: 通用布局
**用例级别**: P1
**预置条件**:
1. 使用 Chrome 开发者工具
2. 开启设备模拟模式
**测试步骤**:
1. 设置屏幕宽度为 320px(小屏手机)
2. 检查页面布局
3. 设置屏幕宽度为 375px(标准手机)
4. 检查页面布局
5. 设置屏幕宽度为 414px(大屏手机)
6. 检查页面布局
7. 设置屏幕宽度为 768px(平板)
8. 检查页面布局
**预期结果**:
1. 各宽度下页面无横向滚动条
2. 内容自适应屏幕宽度
3. 文字不截断、不重叠
4. 图片按比例缩放
5. 导航在小屏下折叠为汉堡菜单
---
## 示例 2:触摸交互
### TC_H5_TOUCH_001 验证触摸事件响应
**测试类型**: 移动 Web 测试 - 交互测试
**功能模块**: 触摸交互
**用例级别**: P1
**预置条件**:
1. 真实移动设备或开启触摸模拟
2. 测试页面包含可触摸元素
**测试步骤**:
1. 单指点击按钮
2. 单指滑动列表
3. 双指缩放图片
4. 长按元素
5. 快速滑动(惯性滚动)
**预期结果**:
1. 点击有视觉反馈(:active 状态)
2. 滑动流畅无延迟
3. 缩放功能正常
4. 长按触发预期操作
5. 惯性滚动自然
---
## 示例 3:浏览器兼容
### TC_H5_COMPAT_001 验证主流移动浏览器兼容
**测试类型**: 移动 Web 测试 - 兼容性测试
**功能模块**: 浏览器兼容
**用例级别**: P1
**预置条件**:
1. 准备测试设备或云测平台
2. 安装主流移动浏览器
**测试步骤**:
1. Safari(iOS)打开页面
2. Chrome(Android)打开页面
3. 微信内置浏览器打开页面
4. QQ 浏览器打开页面
5. UC 浏览器打开页面
6. 检查各浏览器功能和样式
**预期结果**:
1. 各浏览器页面显示一致
2. CSS 特性正常渲染
3. JavaScript 功能正常
4. 无浏览器特有错误
5. 第三方库兼容正常
---
## 示例 4:网络状态
### TC_H5_NETWORK_001 验证弱网环境体验
**测试类型**: 移动 Web 测试 - 网络测试
**功能模块**: 网络适配
**用例级别**: P1
**预置条件**:
1. Chrome 开发者工具开启
2. Network 面板选择 Slow 3G
**测试步骤**:
1. 设置网络为 Slow 3G(400ms RTT)
2. 刷新页面
3. 检查加载状态
4. 提交表单
5. 切换网络为 Offline
6. 检查离线提示
**预期结果**:
1. 页面显示加载进度
2. 图片懒加载有占位图
3. 表单提交有 loading 状态
4. 超时有友好提示
5. 离线时有离线页面或提示
6. 网络恢复后可继续使用
---
## 示例 5:H5 特性
### TC_H5_FEATURE_001 验证 HTML5 特性支持
**测试类型**: 移动 Web 测试 - 功能测试
**功能模块**: H5 特性
**用例级别**: P2
**预置条件**:
1. 移动浏览器
2. 页面使用 H5 特性
**测试步骤**:
1. 测试 localStorage 存取
2. 测试 geolocation 获取位置
3. 测试 camera 调用
4. 测试 audio/video 播放
5. 测试 canvas 渲染
6. 测试 WebSocket 连接
**预期结果**:
1. localStorage 正常存取
2. 位置获取成功(授权后)
3. camera 调用成功(授权后)
4. 音视频播放流畅
5. canvas 渲染正常
6. WebSocket 连接稳定
---
## 示例 6:性能优化
### TC_H5_PERF_001 验证页面加载性能
**测试类型**: 移动 Web 测试 - 性能测试
**功能模块**: 性能优化
**用例级别**: P1
**预置条件**:
1. Chrome 开发者工具
2. Lighthouse 插件
**测试步骤**:
1. 清除缓存
2. 使用 Lighthouse 跑分
3. 检查 Performance 面板
4. 检查 Network 面板
5. 查看资源大小
**预期结果**:
1. Lighthouse Performance ≥ 80 分
2. FCP(首次内容绘制)< 1.5s
3. LCP(最大内容绘制)< 2.5s
4. 页面总大小 < 2MB
5. 图片已压缩
6. JS/CSS 已压缩合并
7. 启用 Gzip/Brotli 压缩
---
## 示例 7:URL 处理
### TC_H5_URL_001 验证 URL 参数处理
**测试类型**: 移动 Web 测试 - 功能测试
**功能模块**: 路由参数
**用例级别**: P1
**预置条件**:
1. 页面支持 URL 参数
**测试步骤**:
1. 访问 `page.html?id=123&name=test`
2. 检查参数读取
3. 访问 `page.html?id=abc`(参数类型错误)
4. 检查错误处理
5. 访问 `page.html`(无参数)
6. 检查默认值处理
**预期结果**:
1. 正确读取 URL 参数
2. 参数类型验证正常
3. 错误参数有友好提示
4. 无参数时使用默认值
5. 特殊字符正确解码
FILE:references/examples/pc-web.md
# PC Web 端测试示例用例
## 示例 1:浏览器兼容性测试
### TC_WEB_BROWSER_001 Chrome 浏览器页面显示正常
**测试类型**: 兼容性测试
**功能模块**: 页面布局
**用例级别**: P0
**测试维度**: 浏览器兼容
**预置条件**:
1. Chrome 浏览器已安装
2. 测试页面已部署
**测试步骤**:
1. 使用 Chrome 最新版访问页面
2. 检查页面布局
3. 检查功能按钮
4. 检查图片显示
5. 检查表单功能
6. 打开开发者工具检查 Console
**预期结果**:
1. 页面布局正常
2. 所有功能按钮可用
3. 图片正确显示
4. 表单可正常填写
5. Console 无报错
---
## 示例 2:键盘导航测试
### TC_WEB_KEYBOARD_001 Tab 键焦点顺序正确
**测试类型**: 可用性测试
**功能模块**: 表单登录
**用例级别**: P1
**测试维度**: 键盘导航
**预置条件**:
1. 页面加载完成
2. 焦点在页面顶部
**测试步骤**:
1. 按 Tab 键开始焦点导航
2. 记录焦点顺序
3. 检查焦点是否跳过非交互元素
4. 检查焦点是否到达所有可交互元素
5. 到达最后一个元素后继续 Tab
**预期结果**:
1. 焦点顺序符合逻辑(从上到下、从左到右)
2. 焦点指示器清晰可见
3. 未跳过任何可交互元素
4. 最后一个元素后焦点循环到第一个
---
## 示例 3:窗口操作测试
### TC_WEB_WINDOW_001 窗口最大化布局正常
**测试类型**: 兼容性测试
**功能模块**: 页面布局
**用例级别**: P1
**测试维度**: 页面布局
**预置条件**:
1. 页面以默认窗口大小打开
**测试步骤**:
1. 点击窗口最大化按钮
2. 检查页面布局
3. 检查元素是否溢出
4. 检查滚动条
5. 点击还原按钮
6. 检查还原后布局
**预期结果**:
1. 最大化后布局正确
2. 元素无溢出
3. 滚动条正确显示
4. 还原后布局保持正常
---
## 示例 4:表单测试
### TC_WEB_FORM_001 表单提交防重复
**测试类型**: 功能测试
**功能模块**: 表单提交
**用例级别**: P0
**测试维度**: 功能测试
**预置条件**:
1. 页面有表单提交功能
**测试步骤**:
1. 填写表单
2. 快速连续点击提交按钮 3 次
3. 观察提交结果
**预期结果**:
1. 只有一次请求发送到服务器
2. 显示一次成功提示
3. 没有产生多条重复数据
---
## 示例 5:会话管理测试
### TC_WEB_SESSION_001 Session 过期处理
**测试类型**: 安全测试
**功能模块**: 会话管理
**用例级别**: P0
**测试维度**: 安全测试
**预置条件**:
1. 用户已登录
**测试步骤**:
1. 保持页面不动等待 Session 过期(约 30 分钟)
2. 进行任意操作
3. 观察系统响应
**预期结果**:
1. 弹出登录提示或跳转登录页
2. 提示 Session 已过期
3. 登录后返回原页面或提示保存未提交数据
---
## 示例 6:路由与导航测试
### TC_WEB_ROUTE_001 SPA 路由跳转正常
**测试类型**: 功能测试
**功能模块**: 路由导航
**用例级别**: P0
**测试维度**: 路由与导航
**预置条件**:
1. 应用为 SPA(单页应用)
2. 用户已登录
**测试步骤**:
1. 点击导航菜单跳转到列表页
2. 检查 URL 变化
3. 点击列表项跳转到详情页
4. 检查 URL 包含 ID 参数
5. 点击浏览器后退按钮
6. 检查页面回到列表页
**预期结果**:
1. 页面内容切换无白屏
2. URL 正确反映当前路由
3. 详情页 URL 参数解析正确
4. 后退按钮正确回退到列表页
5. 页面状态正确恢复
---
## 示例 7:数据联动测试
### TC_WEB_LINK_001 列表筛选联动
**测试类型**: 功能测试
**功能模块**: 数据联动
**用例级别**: P1
**测试维度**: 数据联动
**预置条件**:
1. 页面有列表和筛选功能
**测试步骤**:
1. 选择第一个筛选条件
2. 检查列表数据变化
3. 选择第二个筛选条件
4. 检查列表数据再次变化
5. 清空所有筛选条件
6. 检查列表恢复默认
**预期结果**:
1. 每次筛选条件变化后列表数据同步更新
2. 多个条件组合筛选正确
3. 清空筛选后列表恢复初始状态
4. 筛选过程无报错
---
## 示例 8:拖拽交互测试
### TC_WEB_DRAG_001 表格行拖拽排序
**测试类型**: 功能测试
**功能模块**: 拖拽交互
**用例级别**: P1
**测试维度**: 拖拽交互
**预置条件**:
1. 页面有支持拖拽排序的列表
**测试步骤**:
1. 鼠标悬停在拖拽把手上
2. 按下鼠标拖动行
3. 移动到目标位置
4. 释放鼠标
5. 检查排序结果
6. 按 Ctrl+Z 撤销
**预期结果**:
1. 拖拽过程中有位置预览
2. 拖拽到目标位置释放后排序更新
3. 列表数据保存正确
4. Ctrl+Z 撤销后回到原顺序
---
## 示例 9:国际化测试
### TC_WEB_I18N_001 语言切换
**测试类型**: 功能测试
**功能模块**: 国际化
**用例级别**: P1
**测试维度**: 国际化
**预置条件**:
1. 系统支持中英文切换
**测试步骤**:
1. 页面默认语言为中文
2. 切换到英文
3. 检查页面所有文本
4. 切换回中文
5. 检查页面所有文本
**预期结果**:
1. 切换后所有静态文本变为英文
2. 日期格式变为 MM/DD/YYYY
3. 数字格式变为千分位逗号分隔
4. 切换回中文后正确恢复
5. 切换后刷新页面语言保持
---
## 示例 10:性能测试
### TC_WEB_PERFORMANCE_001 首屏加载时间
**测试类型**: 性能测试
**功能模块**: 页面性能
**用例级别**: P1
**测试维度**: 性能体验
**预置条件**:
1. 页面未访问过(无缓存)
**测试步骤**:
1. 打开 Chrome 开发者工具
2. 选择 Network 标签
3. 勾选 Disable cache
4. 访问页面
5. 记录 FCP(First Contentful Paint)时间
6. 记录 LCP(Largest Contentful Paint)时间
**预期结果**:
1. FCP < 1.8 秒
2. LCP < 2.5 秒
3. 无长时间阻塞的资源
FILE:references/core-capabilities/common-testing.md
# 通用测试能力
本文档整合了测试用例设计的核心方法、测试类型框架、联动测试、路由测试、UI视觉测试、接口测试和安全测试,适用于所有平台的测试用例设计。
## 目录
| 行号 | 章节 |
|------|------|
| 22 | 第一部分:测试用例设计方法 |
| 87 | 第二部分:测试用例质量标准 |
| 116 | 第三部分:联动测试 |
| 160 | 第四部分:路由测试 |
| 215 | 第五部分:UI视觉测试 |
| 301 | 第六部分:接口测试 |
| 376 | 第七部分:安全测试 |
| 444 | 第八部分:页面交互测试 |
| 479 | 第九部分:组件交互测试 |
| 512 | 第十部分:交互动效测试 |
---
## 第一部分:测试用例设计方法
### 1.1 等价类划分法
**定义**:将所有可能的输入数据划分为若干等价类,从每个等价类中选择少数代表性数据作为测试用例。
**步骤**:
1. 分析需求规格说明,确定输入条件的集合
2. 划分有效等价类(合理的、有意义的输入)
3. 划分无效等价类(不合理的、无意义的输入)
4. 为每个等价类编号
5. 设计用例覆盖有效等价类
6. 设计用例覆盖无效等价类
**示例**:用户名输入框(6-18 位字母数字)
- 有效等价类:6-18 位字母数字组合
- 无效等价类:少于 6 位、多于 18 位、包含特殊字符、空值
---
### 1.2 边界值分析法
**定义**:对输入输出的边界值进行测试,错误往往发生在边界附近。
**边界类型**:上界、下界、最小值、最大值、空值、第一个值、最后一个值
**示例**:密码长度 6-18 位
- 边界测试:5 位、6 位、18 位、19 位
---
### 1.3 场景法
**定义**:基于业务流程图,通过模拟用户操作场景来设计测试用例。
**场景类型**:
- 基本流(正常流程)
- 备选流(异常流程、分支流程)
---
### 1.4 错误推测法
**定义**:基于测试人员的经验和直觉,推测系统中可能存在的错误,针对性设计测试用例。
**常见错误点**:输入为空、输入特殊字符、网络异常、重复操作、超时处理
---
### 1.5 因果图法
**定义**:分析输入条件(因)与输出结果(果)之间的关系,用因果图表示,再转换为判定表。
**适用场景**:多个输入条件组合,逻辑关系复杂
---
### 1.6 正交实验法
**定义**:使用正交表从全面测试中筛选出适量的、有代表性的测试用例。
**适用场景**:多因素多水平的组合测试
---
## 第二部分:测试用例质量标准
### 2.1 完整性
- 覆盖所有功能点
- 覆盖正常和异常场景
- 覆盖边界条件
### 2.2 准确性
- 步骤描述清晰无歧义
- 预期结果明确可验证
- 无冗余步骤
### 2.3 可执行性
- 预置条件可实现
- 步骤可操作
- 结果可验证
### 2.4 可维护性
- 结构清晰
- 易于理解和修改
- 复用性高
### 2.5 可追溯性
- 可追溯到需求
- 可追溯到缺陷
- 版本历史清晰
---
## 第三部分:联动测试
### 3.1 表单联动
| 测试场景 | 测试要点 |
|---------|---------|
| 省市区三级联动 | 选择省份,城市列表更新;选择城市,区县列表更新;修改上级选项,下级自动重置 |
| 支付方式联动 | 不同支付方式显示不同表单字段;切换支付方式清空已输入数据 |
| 分类选择联动 | 父分类变化时子分类重置;选项之间相互影响 |
### 3.2 列表联动
| 测试场景 | 测试要点 |
|---------|---------|
| 主从列表联动 | 选择主项,从列表过滤显示 |
| 筛选条件联动 | 多条件筛选实时叠加;清除单个条件不影响其他 |
| 排序联动 | 排序变化列表重新排列;排序状态保持 |
### 3.3 搜索联动
| 测试场景 | 测试要点 |
|---------|---------|
| 关键词联想 | 输入时实时显示联想词;联想词准确匹配 |
| 搜索历史联动 | 显示最近搜索词;点击历史词执行搜索 |
| 热门搜索联动 | 显示热门搜索词;点击跳转搜索结果 |
### 3.4 状态联动
| 测试场景 | 测试要点 |
|---------|---------|
| 按钮状态联动 | 表单填写完整才启用提交按钮;禁用按钮不可点击 |
| 菜单状态联动 | 选中菜单高亮显示;权限不足菜单隐藏或禁用 |
| 选中状态联动 | 列表项选中状态正确;批量操作根据选中状态启用 |
### 3.5 数据联动
| 测试场景 | 测试要点 |
|---------|---------|
| 实时数据同步 | 多页面数据实时更新;无需手动刷新 |
| 多端数据同步 | 移动端和PC端数据一致;切换设备数据保持 |
| 缓存同步 | 缓存与数据库数据一致;缓存失效正确处理 |
---
## 第四部分:路由测试
### 4.1 直接访问
| 测试场景 | 测试要点 |
|---------|---------|
| 直接访问首页 | URL正确,页面正常加载 |
| 直接访问详情页 | URL包含正确参数,页面显示正确内容 |
| 直接访问列表页 | URL参数正确解析,列表数据正确 |
| 直接访问个人中心 | 未登录重定向到登录页;已登录显示用户信息 |
### 4.2 导航跳转
| 测试场景 | 测试要点 |
|---------|---------|
| 导航栏点击 | 点击跳转正确页面;导航高亮当前项 |
| 面包屑导航 | 点击面包屑返回上级;面包屑路径正确 |
| 底部/侧边导航 | 切换底部Tab;侧边栏菜单展开收起 |
| 按钮点击跳转 | 点击按钮跳转正确页面;跳转参数正确 |
### 4.3 浏览器导航
| 测试场景 | 测试要点 |
|---------|---------|
| 浏览器后退 | 返回上一页;页面状态保持 |
| 浏览器前进 | 前进到下一页;状态保持 |
| 浏览器刷新 | 页面数据刷新;不丢失当前状态 |
| 历史记录 | URL历史正确记录;深层链接可访问 |
### 4.4 深链接
| 测试场景 | 测试要点 |
|---------|---------|
| 外部链接打开 | 从微信/短信等打开指定页面;参数正确传递 |
| 推送通知打开 | 点击推送通知打开应用指定页 |
| 分享链接打开 | 分享链接正确唤起应用或打开H5页面 |
### 4.5 错误页面
| 测试场景 | 测试要点 |
|---------|---------|
| 404页面 | 显示友好404页面;提供返回首页链接 |
| 403页面 | 提示无权限;提供申请权限入口 |
| 500页面 | 提示服务器错误;提供重试按钮 |
### 4.6 路由守卫
| 测试场景 | 测试要点 |
|---------|---------|
| 登录验证 | 未登录访问需认证页面重定向登录页 |
| 权限验证 | 无权限访问重定向到403页面 |
| 登录后跳转 | 登录成功后返回原页面或跳转首页 |
---
## 第五部分:UI视觉测试
### 5.1 布局测试
| 检查项 | 说明 |
|-------|------|
| 对齐方式 | 元素左对齐/居中/右对齐正确 |
| 间距一致 | 元素间距统一;符合设计规范 |
| 层次结构 | z-index层级正确;遮罩层正确覆盖 |
| 响应式布局 | 不同屏幕宽度布局正常;无元素溢出或重叠 |
| 留白合理 | 页面边距、元素间距合适 |
| 视觉平衡 | 页面视觉重心居中或符合设计意图 |
### 5.2 颜色测试
| 检查项 | 说明 |
|-------|------|
| 品牌色 | 主色调符合品牌规范 |
| 辅助色 | 次要颜色使用正确 |
| 状态色 | 成功/失败/警告颜色符合规范 |
| 对比度 | 文字与背景对比度≥4.5:1 |
| 主题适配 | 浅色/深色主题颜色正确 |
| 色盲友好 | 重要信息不仅依赖颜色区分 |
### 5.3 字体测试
| 检查项 | 说明 |
|-------|------|
| 字体家族 | 使用正确字体;回退字体正常 |
| 字号层级 | 标题、正文、辅助文字字号区分清晰 |
| 行高 | 行高合适;文字不重叠 |
| 字重 | 标题/正文/辅助字重正确 |
| 文字截断 | 长文本正确省略号截断 |
| 多语言适配 | 中英文切换字体正常;特殊字符显示正常 |
### 5.4 图标测试
| 检查项 | 说明 |
|-------|------|
| 图标风格 | 图标风格统一(线性/填充) |
| 图标尺寸 | 图标尺寸符合设计规范 |
| 图标语义 | 图标含义清晰;无歧义 |
| 图标状态 | 默认/悬停/点击/禁用状态正确 |
| 图标清晰度 | 图标清晰不模糊;不失真 |
### 5.5 图片测试
| 检查项 | 说明 |
|-------|------|
| 图片质量 | 图片清晰无失真;压缩比合适 |
| 图片比例 | 不同比例图片正确显示;无拉伸变形 |
| 加载状态 | 加载中显示占位图/骨架屏 |
| 错误状态 | 图片加载失败显示错误占位图 |
| 懒加载 | 首屏图片优先加载;非首屏延迟加载 |
### 5.6 动画测试
| 检查项 | 说明 |
|-------|------|
| 动画曲线 | 动画曲线自然;符合直觉 |
| 动画时长 | 动画时长合适;不过快或过慢 |
| 动画性能 | 动画流畅≥50fps;无卡顿 |
| 动画可中断 | 快速连续操作动画可中断 |
| 无闪烁 | 动画无视觉闪烁 |
### 5.7 交互状态测试
| 检查项 | 说明 |
|-------|------|
| 默认状态 | 元素默认样式正确 |
| 悬停状态 | 鼠标悬停样式正确 |
| 点击状态 | 点击反馈正确 |
| 禁用状态 | 禁用元素样式明显区分 |
| 聚焦状态 | 键盘聚焦元素有清晰指示 |
### 5.8 多主题测试
| 检查项 | 说明 |
|-------|------|
| 浅色主题 | 浅色主题显示正确 |
| 深色主题 | 深色主题显示正确;颜色对比度足够 |
| 主题切换 | 主题切换流畅;无闪烁 |
| 主题记忆 | 刷新后主题设置保持 |
---
## 第六部分:接口测试
### 6.1 功能测试
| 测试场景 | 测试要点 |
|---------|---------|
| GET请求 | 正常查询单条/列表数据;带参数查询;参数为空/类型错误处理 |
| POST请求 | 正常创建资源;必填字段校验;字段格式校验;重复创建处理 |
| PUT/PATCH请求 | 完整更新/部分更新;更新不存在资源;并发更新处理 |
| DELETE请求 | 正常删除;删除不存在资源;级联删除;软删除 |
| 批量操作 | 批量创建/更新/删除;部分成功处理;事务回滚 |
### 6.2 状态码验证
| 状态码 | 说明 |
|-------|------|
| 200 OK | 正常响应 |
| 201 Created | 创建成功 |
| 204 No Content | 删除成功 |
| 400 Bad Request | 参数错误 |
| 401 Unauthorized | 未认证 |
| 403 Forbidden | 无权限 |
| 404 Not Found | 资源不存在 |
| 409 Conflict | 资源冲突 |
| 422 Unprocessable | 校验失败 |
| 500 Internal Error | 服务器错误 |
### 6.3 数据校验
| 测试场景 | 测试要点 |
|---------|---------|
| 字段校验 | 必填字段、类型、长度、格式、范围验证 |
| 业务规则 | 唯一性约束、外键约束、状态流转规则 |
| 数据一致性 | 数据库写入验证、缓存同步验证 |
### 6.4 认证授权
| 测试场景 | 测试要点 |
|---------|---------|
| Token认证 | Token生成、刷新、过期、撤销 |
| 权限控制 | 角色权限、资源权限、数据权限验证 |
### 6.5 性能测试
| 测试场景 | 测试要点 |
|---------|---------|
| 响应时间 | 单接口响应时间;P95/P99延迟 |
| 并发测试 | 并发用户数;吞吐量(QPS/TPS) |
| 压力测试 | 峰值压力;持续压力;崩溃点 |
| 稳定性 | 长时间运行;内存泄漏检测 |
### 6.6 错误处理
| 测试场景 | 测试要点 |
|---------|---------|
| 错误响应 | 错误码规范;错误信息清晰 |
| 异常处理 | 数据库异常、第三方服务异常、网络异常、超时处理 |
| 重试机制 | 自动重试;重试次数限制;幂等性保证 |
### 6.7 分页排序
| 测试场景 | 测试要点 |
|---------|---------|
| 分页 | 页码参数、每页数量、总数量、越界处理 |
| 排序 | 单字段/多字段排序;排序方向;默认排序 |
### 6.8 搜索过滤
| 测试场景 | 测试要点 |
|---------|---------|
| 搜索 | 精确搜索、模糊搜索、全文搜索、多条件组合 |
| 过滤 | 时间范围、状态、分类、自定义过滤 |
---
## 第七部分:安全测试
### 7.1 注入攻击防护
| 测试场景 | 测试要点 |
|---------|---------|
| SQL注入 | 经典注入、盲注、时间盲注、联合查询、堆叠注入 |
| NoSQL注入 | MongoDB注入、Redis注入 |
| 命令注入 | OS命令注入、路径遍历、文件包含 |
### 7.2 XSS防护
| 测试场景 | 测试要点 |
|---------|---------|
| 反射型XSS | URL参数注入、表单输入注入 |
| 存储型XSS | 评论存储、个人资料、消息存储 |
| DOM型XSS | document.write注入、innerHTML注入、eval注入 |
| 防护措施 | 输入过滤、输出编码、CSP策略、HttpOnly标志 |
### 7.3 认证安全
| 测试场景 | 测试要点 |
|---------|---------|
| 密码安全 | 密码强度校验、加密存储、传输加密 |
| 多因素认证 | 短信验证码、邮箱验证码、TOTP验证 |
| 暴力破解防护 | 登录失败限制、账户锁定、验证码机制 |
### 7.4 会话管理
| 测试场景 | 测试要点 |
|---------|---------|
| Session安全 | Session ID安全生成、超时设置、固定攻击防护 |
| Cookie安全 | Secure、HttpOnly、SameSite标志 |
### 7.5 访问控制
| 测试场景 | 测试要点 |
|---------|---------|
| 水平越权 | 用户A访问用户B数据;同级资源访问 |
| 垂直越权 | 普通用户访问管理员功能;未授权访问后台 |
| 数据权限 | 部门数据隔离、角色数据隔离、敏感数据脱敏 |
### 7.6 CSRF防护
| 测试场景 | 测试要点 |
|---------|---------|
| CSRF攻击 | GET请求CSRF、POST请求CSRF、AJAX请求CSRF |
| CSRF防护 | Token验证、Referer校验、SameSite Cookie、二次确认 |
### 7.7 文件上传安全
| 测试场景 | 测试要点 |
|---------|---------|
| 文件类型 | 白名单验证、MIME类型校验、绕过检测 |
| 文件大小 | 超大文件限制、压缩包炸弹防护 |
| 文件内容 | 内容校验、病毒扫描 |
| 存储安全 | 上传目录权限、访问控制、下载验证 |
### 7.8 业务逻辑安全
| 测试场景 | 测试要点 |
|---------|---------|
| 支付安全 | 金额篡改、重复支付、支付状态伪造、优惠券滥用 |
| 竞争条件 | 并发下单、并发领券、库存超卖 |
| 业务流程 | 跳过步骤、重复提交、状态回退 |
---
## 第八部分:页面交互测试
### 8.1 页面加载
- 首次加载/刷新/弱网/断网加载
- 加载超时处理
- 加载失败重试
- 骨架屏显示
### 8.2 页面导航
- 导航栏显示正确
- 返回按钮、历史记录
- 深链接打开页面
### 8.3 页面切换
- Tab切换/模态窗口/抽屉/弹窗
- 切换动画流畅
- 状态保持、数据刷新
### 8.4 表单交互
- 输入框聚焦/失焦
- 输入验证、错误提示
- 自动填充、输入限制
### 8.5 列表交互
- 下拉刷新、上拉加载
- 列表项操作(点击、滑动、长按)
- 列表排序、筛选
### 8.6 弹窗交互
- 遮罩层、关闭按钮
- ESC键关闭
- 多层弹窗、弹窗嵌套
---
## 第九部分:组件交互测试
### 9.1 按钮组件
- 正常/悬停/点击/禁用状态
- 快速连续点击处理
- 加载状态、权限控制
### 9.2 输入框组件
- 特殊字符、超长文本
- 复制粘贴、清空输入
- 输入提示、错误提示
### 9.3 下拉框组件
- 展开/收起、选项搜索
- 多选、级联选择
- 键盘操作
### 9.4 表格组件
- 列排序、数据筛选
- 分页切换、行操作
- 批量操作、表格导出
### 9.5 轮播图组件
- 自动/手动切换
- 指示器、无限循环
- 暂停轮播
### 9.6 标签页组件
- 点击/滑动切换
- 关闭标签、拖拽排序
---
## 第十部分:交互动效测试
### 10.1 过渡动画
- 页面切换动画
- 组件出现/消失
- 动画可中断
### 10.2 反馈动画
- 按钮点击ripple
- 加载spinner、成功/失败反馈
- 进度条动画
### 10.3 手势动画
- 列表滑动惯性
- 图片缩放、拖拽排序
- 下拉刷新回弹、侧滑菜单
### 10.4 性能优化
- 动画帧率≥50fps
- 无卡顿、内存占用合理
- GPU加速
---
FILE:references/checklists/common-checklist.md
# 通用测试检查清单
本文档整合了功能测试、联动测试、路由测试、UI视觉测试、接口测试和安全测试的检查清单,适用于所有平台的测试用例执行。
## 目录
| 行号 | 章节 |
|------|------|
| 19 | 一、功能测试检查清单 |
| 65 | 二、联动测试检查清单 |
| 110 | 三、路由测试检查清单 |
| 161 | 四、UI视觉测试检查清单 |
| 232 | 五、接口测试检查清单 |
| 307 | 六、安全测试检查清单 |
| 410 | 检查完成记录 |
---
## 一、功能测试检查清单
### 测试覆盖度
- [ ] 所有功能点已覆盖
- [ ] 正常流程已覆盖
- [ ] 异常流程已覆盖
- [ ] 边界条件已覆盖
- [ ] 特殊场景已覆盖
### 功能正确性
- [ ] 功能按需求实现
- [ ] 业务逻辑正确
- [ ] 数据处理正确
- [ ] 状态流转正确
- [ ] 权限控制正确
### 输入验证
- [ ] 有效输入处理正确
- [ ] 无效输入提示友好
- [ ] 边界值处理正确
- [ ] 特殊字符处理正确
- [ ] 空值处理正确
### 输出验证
- [ ] 显示内容正确
- [ ] 数据格式正确
- [ ] 排序正确
- [ ] 筛选正确
- [ ] 统计正确
### 交互测试
- [ ] 用户操作流程顺畅
- [ ] 页面跳转正确
- [ ] 按钮功能正确
- [ ] 表单提交正确
- [ ] 列表操作正确
### 数据一致性
- [ ] 前后端数据一致
- [ ] 多端数据一致
- [ ] 缓存与数据库一致
- [ ] 历史记录正确
- [ ] 实时数据正确
---
## 二、联动测试检查清单
### 表单联动
- [ ] 省市区联动
- [ ] 分类选择联动
- [ ] 条件显示/隐藏
- [ ] 数据级联
- [ ] 表单验证联动
- [ ] 提交按钮状态联动
### 列表联动
- [ ] 主从列表联动
- [ ] 筛选条件联动
- [ ] 排序联动
- [ ] 分页联动
- [ ] 选中状态联动
### 搜索联动
- [ ] 搜索关键词联想
- [ ] 搜索结果联动
- [ ] 搜索历史联动
- [ ] 热门搜索联动
### 状态联动
- [ ] 按钮状态联动
- [ ] 菜单状态联动
- [ ] 标签状态联动
- [ ] 图标状态联动
- [ ] 颜色状态联动
### 数据联动
- [ ] 实时数据同步
- [ ] 多端数据同步
- [ ] 缓存与数据库同步
- [ ] 本地与远程同步
- [ ] 双向数据绑定
### 页面联动
- [ ] 页面参数传递
- [ ] 页面状态同步
- [ ] 多窗口联动
- [ ] iframe 联动
---
## 三、路由测试检查清单
### 直接访问
- [ ] 直接访问首页 URL
- [ ] 直接访问详情页 URL
- [ ] 直接访问列表页 URL
- [ ] 直接访问个人中心页 URL
### 导航跳转
- [ ] 导航栏点击跳转
- [ ] 面包屑导航跳转
- [ ] 底部导航跳转
- [ ] 侧边栏导航跳转
- [ ] Tab 切换
- [ ] 按钮点击跳转
### 浏览器导航
- [ ] 浏览器后退
- [ ] 浏览器前进
- [ ] 浏览器刷新
- [ ] 历史记录
### 深链接
- [ ] 外部链接打开 App 指定页
- [ ] 推送通知打开指定页
- [ ] 分享链接打开指定页
### 错误页面
- [ ] 404 页面显示
- [ ] 403 页面显示
- [ ] 500 页面显示
### 路由参数
- [ ] URL 参数传递
- [ ] URL 参数解析
- [ ] 参数缺失处理
- [ ] 参数错误处理
### 路由守卫
- [ ] 登录验证
- [ ] 权限验证
- [ ] 未登录跳转登录页
- [ ] 无权限跳转 403
### 路由性能
- [ ] 路由切换流畅
- [ ] 页面加载快速
- [ ] 路由动画流畅
---
## 四、UI视觉测试检查清单
### 布局测试
- [ ] 对齐方式正确
- [ ] 间距一致
- [ ] 层次结构清晰
- [ ] 响应式布局适配
- [ ] 元素不重叠
- [ ] 内容不溢出
- [ ] 留白合理
- [ ] 视觉平衡
### 颜色测试
- [ ] 品牌色正确
- [ ] 辅助色正确
- [ ] 状态色正确(成功/失败/警告)
- [ ] 对比度符合 WCAG 标准
- [ ] 深色模式适配
- [ ] 浅色模式适配
- [ ] 颜色语义正确
- [ ] 色盲友好
### 字体测试
- [ ] 字体家族正确
- [ ] 字号层级清晰
- [ ] 行高合适
- [ ] 字重正确
- [ ] 字体颜色对比度足够
- [ ] 文字不截断
- [ ] 多语言字体适配
- [ ] 特殊字符显示正常
### 图标测试
- [ ] 图标风格一致
- [ ] 图标尺寸统一
- [ ] 图标语义清晰
- [ ] 图标状态正确(默认/悬停/点击/禁用)
- [ ] 图标清晰度足够
- [ ] 图标加载正常
### 图片测试
- [ ] 图片质量清晰
- [ ] 图片比例正确
- [ ] 加载状态显示占位图
- [ ] 错误状态显示错误图
- [ ] 图片懒加载正常
- [ ] 图片压缩合适
### 动画测试
- [ ] 动画曲线自然
- [ ] 动画时长合适
- [ ] 动画性能流畅(≥50fps)
- [ ] 动画语义清晰
- [ ] 动画可中断
- [ ] 无动画闪烁
### 交互状态测试
- [ ] 默认状态正确
- [ ] 悬停状态正确
- [ ] 点击状态正确
- [ ] 禁用状态正确
- [ ] 聚焦状态正确
### 多主题测试
- [ ] 浅色主题正常
- [ ] 深色主题正常
- [ ] 主题切换流畅
- [ ] 主题记忆正确
---
## 五、接口测试检查清单
### 使用说明
- ✅ 逐项检查,确保覆盖
- 🔴 发现问题立即记录
- 📝 补充业务特定检查项
---
### 功能测试
- [ ] GET 请求正常返回
- [ ] POST 创建资源成功
- [ ] PUT/PATCH 更新成功
- [ ] DELETE 删除成功
- [ ] 批量操作正确
- [ ] 状态码符合规范
- [ ] 错误响应清晰
### 数据校验
- [ ] 必填字段校验
- [ ] 字段类型校验
- [ ] 字段格式校验
- [ ] 字段长度校验
- [ ] 字段范围校验
- [ ] 唯一性校验
- [ ] 业务规则校验
### 认证授权
- [ ] Token 认证正常
- [ ] 未认证拒绝访问
- [ ] 无权限拒绝访问
- [ ] Token 过期处理
- [ ] Token 刷新正常
- [ ] 权限隔离正确
### 性能测试
- [ ] 响应时间达标(P95 < 500ms)
- [ ] 并发测试通过
- [ ] 压力测试通过
- [ ] 无内存泄漏
- [ ] 连接池正常
### 错误处理
- [ ] 错误码规范
- [ ] 错误信息清晰
- [ ] 异常捕获
- [ ] 日志记录
- [ ] 重试机制
- [ ] 幂等性保证
### 分页排序
- [ ] 分页参数正常
- [ ] 总数量正确
- [ ] 排序功能正常
- [ ] 默认排序合理
### 搜索过滤
- [ ] 精确搜索正常
- [ ] 模糊搜索正常
- [ ] 多条件组合正确
- [ ] 过滤功能正常
### 版本管理
- [ ] 版本控制正确
- [ ] 向后兼容
- [ ] 版本文档完整
### 接口文档
- [ ] Swagger/OpenAPI 规范
- [ ] 参数说明完整
- [ ] 示例清晰
- [ ] 错误码文档
---
## 六、安全测试检查清单
### 使用说明
- ✅ 逐项检查,确保覆盖
- 🔴 发现安全问题立即上报
- 📝 在授权环境下测试
- ⚠️ 遵循 OWASP Top 10
---
### 注入攻击防护
- [ ] SQL 注入防护(参数化查询)
- [ ] NoSQL 注入防护
- [ ] 命令注入防护
- [ ] 路径遍历防护
- [ ] 文件包含防护
### XSS 防护
- [ ] 反射型 XSS 防护
- [ ] 存储型 XSS 防护
- [ ] DOM 型 XSS 防护
- [ ] 输入过滤
- [ ] 输出编码
- [ ] CSP 策略设置
- [ ] HttpOnly 标志
### 认证安全
- [ ] 密码强度校验
- [ ] 密码加密存储
- [ ] 密码传输加密
- [ ] 多因素认证
- [ ] 登录失败限制
- [ ] 账户锁定机制
- [ ] 验证码机制
### 会话管理
- [ ] Session ID 安全生成
- [ ] Session 超时设置
- [ ] Session 固定攻击防护
- [ ] Cookie 安全标志(Secure、HttpOnly)
- [ ] 单点登录安全
### 访问控制
- [ ] 水平越权防护
- [ ] 垂直越权防护
- [ ] 数据权限隔离
- [ ] 敏感数据脱敏
### 敏感信息保护
- [ ] 接口不返回敏感字段
- [ ] 前端无硬编码密钥
- [ ] 日志脱敏处理
- [ ] 错误信息不暴露
- [ ] HTTPS 强制
- [ ] TLS 版本最新
- [ ] 数据库加密
### CSRF 防护
- [ ] CSRF Token 验证
- [ ] Referer 校验
- [ ] SameSite Cookie 设置
- [ ] 关键操作二次确认
### 文件上传安全
- [ ] 文件类型白名单
- [ ] 文件内容校验
- [ ] 文件大小限制
- [ ] 病毒扫描
- [ ] 上传目录权限
- [ ] 文件访问控制
### 业务逻辑安全
- [ ] 支付金额防篡改
- [ ] 重复支付防护
- [ ] 并发竞争处理
- [ ] 库存防超卖
- [ ] 优惠券防滥用
- [ ] 业务流程防跳过
### API 安全
- [ ] Token 安全防护
- [ ] API 频率限制
- [ ] API 配额限制
- [ ] 操作日志审计
- [ ] 异常检测告警
### 安全配置
- [ ] 目录列表禁用
- [ ] 错误页面自定义
- [ ] HTTP 方法限制
- [ ] 安全头设置(X-Frame-Options 等)
- [ ] 框架漏洞修复
- [ ] 依赖库漏洞修复
- [ ] 数据库最小权限
### 合规检查
- [ ] GDPR 合规(如适用)
- [ ] 网络安全法合规
- [ ] 等级保护合规
- [ ] 隐私政策完善
---
## 检查完成记录
| 检查项 | 检查结果 | 问题记录 | 修复状态 |
|-------|---------|---------|---------|
| 功能测试 | ✅ 通过 | - | - |
| 联动测试 | 待检查 | - | - |
| 路由测试 | 待检查 | - | - |
| UI视觉测试 | 待检查 | - | - |
| 接口测试 | 待检查 | - | - |
| 安全测试 | 待检查 | - | - |
FILE:references/checklists/desktop-checklist.md
# 桌面端测试检查清单
## 窗口管理(12 项)
- [ ] 窗口大小调整
- [ ] 窗口最大化
- [ ] 窗口最小化
- [ ] 窗口还原
- [ ] 窗口拖拽移动
- [ ] 多窗口管理
- [ ] 窗口置顶
- [ ] 全屏模式
- [ ] 分屏模式
- [ ] 窗口状态保持
- [ ] 无标题栏窗口
- [ ] 模态窗口
## 键盘快捷键(15 项)
- [ ] 复制粘贴
- [ ] 撤销重做
- [ ] 全选
- [ ] 保存
- [ ] 查找替换
- [ ] 导航快捷键
- [ ] 功能键
- [ ] 自定义快捷键
- [ ] 快捷键冲突
- [ ] 快捷键禁用
- [ ] 跨平台差异
- [ ] 快捷键提示
- [ ] 组合键
- [ ] 长按快捷键
- [ ] 快捷键冲突解决
## 文件操作(14 项)
- [ ] 文件打开
- [ ] 拖拽打开文件
- [ ] 文件保存
- [ ] 另存为
- [ ] 自动保存
- [ ] 文件导入
- [ ] 文件导出
- [ ] 拖拽导出
- [ ] 剪贴板操作
- [ ] 文件关联
- [ ] 最近文件
- [ ] 文件锁定
- [ ] 大文件处理
- [ ] 网络文件
## 系统集成(10 项)
- [ ] 系统托盘图标
- [ ] 托盘右键菜单
- [ ] 通知中心
- [ ] 开机自启动
- [ ] 文件关联
- [ ] 协议处理
- [ ] 右键菜单集成
- [ ] 任务栏集成
- [ ] 菜单栏集成
- [ ] 共享文件
## 多显示器适配(8 项)
- [ ] 单显示器
- [ ] 双屏扩展
- [ ] 多屏扩展
- [ ] 复制模式
- [ ] 不同分辨率
- [ ] DPI 缩放
- [ ] 窗口跨屏
- [ ] 全屏多屏
## 外设支持(10 项)
- [ ] 鼠标左键
- [ ] 鼠标右键
- [ ] 鼠标滚轮
- [ ] 鼠标侧键
- [ ] 鼠标中键
- [ ] 触控板手势
- [ ] 触控屏
- [ ] 打印机
- [ ] 扫描仪
- [ ] 其他外设
## 系统兼容性(12 项)
- [ ] Windows 10
- [ ] Windows 11
- [ ] macOS 不同版本
- [ ] Intel 芯片
- [ ] ARM64 芯片
- [ ] 中文系统
- [ ] 英文系统
- [ ] 其他语言系统
- [ ] 浅色模式
- [ ] 深色模式
- [ ] 高对比度模式
- [ ] 虚拟机
## 安装与更新(12 项)
- [ ] 安装包下载
- [ ] 安装向导
- [ ] 安装位置
- [ ] 快捷方式
- [ ] 首次运行
- [ ] 卸载
- [ ] 残留清理
- [ ] 自动更新检测
- [ ] 自动下载安装
- [ ] 更新后重启
- [ ] 数据迁移
- [ ] 回滚
## 性能与资源(10 项)
- [ ] 冷启动时间
- [ ] 热启动时间
- [ ] 内存占用
- [ ] CPU 占用
- [ ] 磁盘占用
- [ ] 界面响应
- [ ] 长时间运行
- [ ] 多任务并发
- [ ] 资源释放
- [ ] 崩溃恢复
## 安全与权限(8 项)
- [ ] 管理员权限
- [ ] 文件读写权限
- [ ] 网络访问权限
- [ ] 数据加密
- [ ] 敏感信息保护
- [ ] 自动登录
- [ ] 会话超时
- [ ] 安全审计
FILE:references/checklists/mini-program-checklist.md
# 小程序测试检查清单
## 生命周期(10 项)
- [ ] 冷启动
- [ ] 热启动
- [ ] 页面 onLoad
- [ ] 页面 onShow
- [ ] 页面 onReady
- [ ] 页面 onHide
- [ ] 页面 onUnload
- [ ] 切后台
- [ ] 切回前台
- [ ] 长时间后台后销毁
## 授权管理(12 项)
- [ ] 用户信息授权
- [ ] 手机号授权
- [ ] 位置授权
- [ ] 相机授权
- [ ] 相册授权
- [ ] 蓝牙授权
- [ ] 录音授权
- [ ] 授权同意
- [ ] 授权拒绝
- [ ] 拒绝后重新引导
- [ ] 设置页开启权限
- [ ] 授权状态持久化
## 分享功能(14 项)
- [ ] 右上角菜单分享
- [ ] 分享按钮分享
- [ ] 分享标题
- [ ] 分享描述
- [ ] 分享封面图
- [ ] 分享路径
- [ ] 分享给好友
- [ ] 分享到群聊
- [ ] 分享到朋友圈
- [ ] 分享成功回调
- [ ] 分享失败处理
- [ ] 从分享卡片打开
- [ ] 分享参数传递
- [ ] 分享打开指定页面
## 平台差异适配(10 项)
- [ ] 微信小程序 API
- [ ] 支付宝小程序 API
- [ ] 百度小程序 API
- [ ] 抖音小程序 API
- [ ] 组件兼容
- [ ] 样式兼容
- [ ] 登录差异
- [ ] 支付差异
- [ ] 分享差异
- [ ] 审核规范差异
## 小程序码与二维码(8 项)
- [ ] 小程序码生成
- [ ] 小程序码样式
- [ ] 二维码生成
- [ ] 扫码打开小程序
- [ ] 扫码参数解析
- [ ] 扫码权限控制
- [ ] 小程序码跳转
- [ ] 二维码跳转
## 订阅消息与模板消息(8 项)
- [ ] 订阅消息授权
- [ ] 订阅消息发送
- [ ] 订阅消息打开
- [ ] 模板消息发送
- [ ] 模板消息打开
- [ ] 订阅次数限制
- [ ] 订阅权限回收
- [ ] 消息推送设置
## 小程序跳转(10 项)
- [ ] 跳转其他小程序
- [ ] 跳转携带参数
- [ ] 从其他小程序返回
- [ ] web-view 打开 H5
- [ ] H5 跳转小程序
- [ ] 从 App 打开小程序
- [ ] 从小程序打开 App
- [ ] 跳转次数限制
- [ ] 半屏小程序
- [ ] 小程序互相跳转
## 本地存储(8 项)
- [ ] Storage 存储
- [ ] Storage 读取
- [ ] Storage 清除
- [ ] 容量限制
- [ ] 缓存更新
- [ ] 缓存清理
- [ ] 临时文件存储
- [ ] 文件管理系统
## 网络请求(10 项)
- [ ] 域名白名单
- [ ] 请求并发限制
- [ ] 请求超时
- [ ] 请求重试
- [ ] 敏感数据加密
- [ ] 文件上传
- [ ] 文件下载
- [ ] 上传下载进度
- [ ] 弱网请求
- [ ] 断网请求
## 性能优化(10 项)
- [ ] 首屏加载时间
- [ ] 页面渲染流畅
- [ ] 长列表优化
- [ ] 内存占用
- [ ] 主包大小
- [ ] 分包加载
- [ ] 图片懒加载
- [ ] 数据缓存
- [ ] 骨架屏
- [ ] 性能监控
## 支付功能(8 项)
- [ ] 微信支付
- [ ] 支付宝支付
- [ ] 支付回调
- [ ] 支付成功页面
- [ ] 支付失败处理
- [ ] 订单状态同步
- [ ] 退款流程
- [ ] 支付安全
## 客服功能(6 项)
- [ ] 客服按钮显示
- [ ] 客服会话打开
- [ ] 客服消息发送
- [ ] 客服消息接收
- [ ] 客服会话关闭
- [ ] 客服评价
FILE:references/checklists/mobile-app-checklist.md
# 移动端 App 测试检查清单
## 手势操作(15 项)
- [ ] 点击操作测试
- [ ] 双击操作测试
- [ ] 长按操作测试
- [ ] 滑动操作测试
- [ ] 缩放操作测试
- [ ] 拖拽操作测试
- [ ] 下拉刷新测试
- [ ] 上拉加载测试
- [ ] 多指手势测试
- [ ] 手势冲突测试
- [ ] 手势反馈测试
- [ ] 手势禁用测试
- [ ] 特殊手势测试
- [ ] 辅助功能手势测试
- [ ] 游戏手势测试
## 屏幕适配(12 项)
- [ ] 小屏设备测试
- [ ] 中屏设备测试
- [ ] 大屏设备测试
- [ ] 平板设备测试
- [ ] 长屏设备测试
- [ ] 刘海屏测试
- [ ] 折叠屏测试
- [ ] 横屏模式测试
- [ ] 竖屏模式测试
- [ ] 横竖屏切换测试
- [ ] 分辨率适配测试
- [ ] 系统字体大小测试
## 中断恢复(14 项)
- [ ] 来电中断测试
- [ ] 短信中断测试
- [ ] 推送通知中断测试
- [ ] 闹钟中断测试
- [ ] 低电量弹窗测试
- [ ] 系统更新提示测试
- [ ] 切后台再返回测试
- [ ] 多任务切换测试
- [ ] 长时间后台测试
- [ ] 杀进程后重启测试
- [ ] 表单填写中断测试
- [ ] 支付流程中断测试
- [ ] 播放中断测试
- [ ] 网络请求中断测试
## 网络切换(16 项)
- [ ] WiFi 网络测试
- [ ] 4G/5G 网络测试
- [ ] WiFi↔4G/5G切换测试
- [ ] 弱网 - 高延迟测试
- [ ] 弱网 - 低带宽测试
- [ ] 弱网 - 高丢包测试
- [ ] 断网检测测试
- [ ] 断网重连测试
- [ ] 飞行模式测试
- [ ] 离线模式测试
- [ ] 提交时网络切换测试
- [ ] 下载时网络切换测试
- [ ] 上传时网络切换测试
- [ ] 视频播放网络切换测试
- [ ] 网络权限禁用测试
- [ ] DNS 解析失败测试
## 设备兼容(10 项)
- [ ] iOS 最新版本测试
- [ ] iOS 旧版本测试
- [ ] Android 最新版本测试
- [ ] Android 旧版本测试
- [ ] 不同厂商 ROM 测试
- [ ] 不同屏幕分辨率测试
- [ ] 不同硬件配置测试
- [ ] iPad 平板测试
- [ ] 折叠屏设备测试
- [ ] 模拟器测试
## 权限管理(12 项)
- [ ] 相机权限测试
- [ ] 相册权限测试
- [ ] 位置权限测试
- [ ] 通知权限测试
- [ ] 麦克风权限测试
- [ ] 存储权限测试
- [ ] 通讯录权限测试
- [ ] 蓝牙权限测试
- [ ] 权限拒绝后功能降级测试
- [ ] 权限设置页面引导测试
- [ ] 权限回收测试
- [ ] 权限状态持久化测试
## 系统交互(10 项)
- [ ] 系统分享测试
- [ ] 复制粘贴测试
- [ ] 系统键盘测试
- [ ] 截图功能测试
- [ ] 录屏功能测试
- [ ] 系统浏览器打开测试
- [ ] 电话拨打测试
- [ ] 短信发送测试
- [ ] 邮件发送测试
- [ ] 地图打开测试
## 性能体验(12 项)
- [ ] 冷启动时间测试
- [ ] 热启动时间测试
- [ ] 首屏加载时间测试
- [ ] 页面加载时间测试
- [ ] 滑动流畅度测试
- [ ] 动画流畅度测试
- [ ] 内存占用测试
- [ ] CPU 占用测试
- [ ] 耗电量测试
- [ ] 发热控制测试
- [ ] 流量消耗测试
- [ ] 存储空间测试
## 可访问性(8 项)
- [ ] 屏幕阅读器兼容(VoiceOver/TalkBack)
- [ ] 所有图片有 alt 文本或描述
- [ ] 字体大小可调整
- [ ] 高对比度模式支持
- [ ] 点击区域足够大(≥44x44px)
- [ ] 所有功能可手势+语音操作
- [ ] 视频有字幕
- [ ] 重要信息有振动反馈
FILE:references/checklists/mobile-web-checklist.md
# 移动 Web 端测试检查清单
## 浏览器兼容性(12 项)
- [ ] iOS Safari 最新版本正常
- [ ] iOS Safari 主流版本兼容
- [ ] Android Chrome 正常
- [ ] Android Chrome 主流版本兼容
- [ ] 微信内置浏览器正常
- [ ] QQ 浏览器正常
- [ ] UC 浏览器正常
- [ ] 夸克浏览器正常
- [ ] Samsung Internet 正常
- [ ] 隐私/隐身模式正常
- [ ] WebView(WKWebView/Android)兼容
- [ ] JavaScript 特性兼容
## 触摸交互(14 项)
- [ ] 单次点击正常响应
- [ ] 双击缩放功能
- [ ] 长按触发上下文菜单
- [ ] 左右滑动切换
- [ ] 上下滑动滚动
- [ ] 双指缩放功能
- [ ] 下拉刷新功能
- [ ] 上拉加载更多
- [ ] 点击态视觉反馈
- [ ] 触摸禁用设置生效
- [ ] 嵌套滚动无冲突
- [ ] 橡皮筋效果正常
- [ ] 惯性滚动流畅
- [ ] 手势冲突处理正确
## 响应式布局(12 项)
- [ ] 320px 宽度正常
- [ ] 375px 宽度正常
- [ ] 414px 宽度正常
- [ ] 768px(iPad)宽度正常
- [ ] 长屏幕(19.5:9)适配
- [ ] 刘海屏内容不遮挡
- [ ] 媒体查询断点正确
- [ ] 图片宽度自适应
- [ ] 字体大小适配
- [ ] 横向滚动列表正常
- [ ] 固定定位元素正常
- [ ] 横屏布局正确
## 视口配置(8 项)
- [ ] viewport 设置正确
- [ ] 刘海屏安全区域适配
- [ ] 挖孔屏适配
- [ ] 屏幕旋转时视口重计算
- [ ] 键盘弹出布局调整
- [ ] 键盘收起布局恢复
- [ ] 缩放限制生效
- [ ] 分屏模式适配
## 键盘与输入(10 项)
- [ ] 输入框聚焦正常
- [ ] 键盘弹出动画流畅
- [ ] 键盘不遮挡输入框
- [ ] 数字/邮箱键盘类型正确
- [ ] 中文输入法正常
- [ ] 自动更正功能正常
- [ ] 密码显示/隐藏切换
- [ ] 表单自动填充正常
- [ ] 最大长度限制生效
- [ ] 输入格式正则验证
## H5 特有功能(10 项)
- [ ] tel: 链接拨打电话正常
- [ ] sms: 链接发送短信正常
- [ ] mailto: 链接打开邮箱正常
- [ ] 地图链接正常打开
- [ ] Web Share API 分享正常
- [ ] 添加到主屏幕功能
- [ ] 启动画面正常显示
- [ ] 全屏模式正常
- [ ] PWA 离线功能正常
- [ ] 通知推送功能正常
## 第三方登录与支付(10 项)
- [ ] 微信 H5 登录正常
- [ ] 支付宝 H5 登录正常
- [ ] QQ H5 登录正常
- [ ] 微博 H5 登录正常
- [ ] 微信 H5 支付正常
- [ ] 支付宝 H5 支付正常
- [ ] 登录态持久化正常
- [ ] 多账号切换正常
- [ ] 授权回调正常
- [ ] 支付结果查询正常
## WebView 特有(12 项)
- [ ] JSBridge 调用正常
- [ ] 相机调用功能正常
- [ ] 相册调用功能正常
- [ ] 定位调用功能正常
- [ ] 扫码功能正常
- [ ] 物理返回键处理正确
- [ ] 导航栏自定义正常
- [ ] 加载进度条显示正常
- [ ] 错误页正常显示
- [ ] 下拉刷新功能正常
- [ ] 分享功能正常
- [ ] 登录态同步正常
## 网络与缓存(10 项)
- [ ] WiFi 网络正常
- [ ] 4G/5G 网络正常
- [ ] 弱网环境提示友好
- [ ] 断网提示友好
- [ ] 网络恢复自动重连
- [ ] Service Worker 离线缓存
- [ ] LocalStorage 正常使用
- [ ] SessionStorage 正常使用
- [ ] 图片懒加载正常
- [ ] 缓存更新策略正常
## 性能优化(10 项)
- [ ] 首屏加载 < 3 秒
- [ ] FCP 时间 < 1.8 秒
- [ ] LCP 时间 < 2.5 秒
- [ ] 图片压缩优化
- [ ] 代码分割生效
- [ ] 渲染无明显卡顿
- [ ] 无内存泄漏
- [ ] 骨架屏显示正常
- [ ] CDN 资源加载正常
- [ ] 首屏监控数据正常
## SEO 与分享(10 项)
- [ ] meta 标签完整
- [ ] 页面标题优化
- [ ] 微信分享卡片内容正确
- [ ] QQ 分享卡片内容正确
- [ ] 微博分享卡片内容正确
- [ ] OG 标签完整
- [ ] Twitter Card 完整
- [ ] 结构化数据正确
- [ ] 分享回调正常
- [ ] 防屏蔽处理正常
FILE:references/checklists/pc-web-checklist.md
# PC Web 端测试检查清单
## 浏览器兼容性(12 项)
- [ ] Chrome 最新版本正常
- [ ] Chrome 主流版本兼容
- [ ] Firefox 最新版本正常
- [ ] Firefox 主流版本兼容
- [ ] Safari 浏览器兼容
- [ ] Edge 浏览器兼容
- [ ] 多内核浏览器兼容
- [ ] JavaScript 特性兼容
- [ ] CSS 特性兼容
- [ ] 隐私模式访问正常
- [ ] 开发者工具无报错
- [ ] 浏览器扩展兼容性
## 页面布局(10 项)
- [ ] 1366×768 分辨率正常
- [ ] 1920×1080 分辨率正常
- [ ] 2K/4K 分辨率正常
- [ ] 100% DPI 缩放正常
- [ ] 125% DPI 缩放正常
- [ ] 150% DPI 缩放正常
- [ ] 窗口最大化布局正确
- [ ] 窗口自定义大小布局正确
- [ ] 滚动条显示正确
- [ ] 响应式断点正确
## 键盘导航(10 项)
- [ ] Tab 键焦点顺序正确
- [ ] Enter 键可触发按钮
- [ ] 空格键可操作复选框
- [ ] 方向键可导航
- [ ] 全局快捷键正常
- [ ] Esc 键关闭弹窗
- [ ] F5 刷新页面
- [ ] Ctrl+C/V 复制粘贴
- [ ] 焦点指示器清晰可见
- [ ] 无障碍跳转链接可用
## 表单交互(12 项)
- [ ] 文本输入正常
- [ ] 数字输入验证
- [ ] 日期选择器可用
- [ ] 下拉选择正常
- [ ] 文件上传功能
- [ ] 表单必填验证
- [ ] 表单提交成功
- [ ] 防止重复提交
- [ ] 表单重置功能
- [ ] 输入建议/自动补全
- [ ] 复制粘贴功能
- [ ] 表单禁用状态
## 认证与会话(10 项)
- [ ] 正常登录成功
- [ ] 错误密码提示友好
- [ ] Session 过期处理
- [ ] 记住登录功能
- [ ] 正常登出
- [ ] 密码找回流程
- [ ] 密码修改功能
- [ ] 双因素认证(如有)
- [ ] 多端登录冲突处理
- [ ] 超时自动退出
## 多窗口与标签页(8 项)
- [ ] 新窗口打开正常
- [ ] 新标签页打开正常
- [ ] 跨窗口通信正常
- [ ] 关闭窗口确认
- [ ] 标签页切换状态保持
- [ ] 浏览器前进后退正常
- [ ] 页面刷新数据保持
- [ ] 窗口状态记忆
## 路由与导航(12 项)
- [ ] SPA 路由路径正确匹配
- [ ] 嵌套路由层级正确
- [ ] 动态路由参数解析正确
- [ ] URL 与页面状态同步
- [ ] 未登录时路由守卫重定向
- [ ] 权限不足时路由跳转
- [ ] 404 页面正常显示
- [ ] 深层链接直接访问正常
- [ ] 浏览器前进后退状态正确
- [ ] 刷新后 URL 与页面状态一致
- [ ] 面包屑导航层级正确
- [ ] 锚点定位功能正常
## 数据联动(10 项)
- [ ] 父子组件数据同步
- [ ] 跨组件状态共享正确
- [ ] 列表点击跳转详情
- [ ] 详情修改后列表刷新
- [ ] 多条件筛选联动正确
- [ ] 分页切换数据正确
- [ ] 排序切换显示正确
- [ ] 模态框提交后页面刷新
- [ ] 联动字段依赖正确
- [ ] Tab 切换数据加载
## 拖拽交互(10 项)
- [ ] 元素拖拽功能正常
- [ ] 拖拽排序位置正确
- [ ] 拖拽上传文件成功
- [ ] 拖拽禁用状态正常
- [ ] 拖拽键盘操作可用
- [ ] 拖拽不超出边界
- [ ] Ctrl+Z 撤销拖拽
- [ ] 拖拽辅助线对齐
- [ ] 大量元素拖拽流畅
- [ ] 拖拽后数据保存正确
## 富文本编辑(10 项)
- [ ] 基础文本输入正常
- [ ] 加粗/斜体/下划线生效
- [ ] 标题级别切换正确
- [ ] 无序/有序列表正常
- [ ] 插入链接/图片/表格正常
- [ ] Ctrl+Z 撤销正常
- [ ] Ctrl+Y 重做正常
- [ ] 从外部粘贴格式保留
- [ ] Markdown 编辑预览正常
- [ ] 字数统计准确
## 文件操作(8 项)
- [ ] 文件下载正常
- [ ] 文件预览正常
- [ ] 文件保存正常
- [ ] 文件导入正常
- [ ] 文件导出正常
- [ ] 文件删除确认
- [ ] 拖拽文件上传
- [ ] 文件类型限制
## 网络与缓存(10 项)
- [ ] 正常网络访问
- [ ] 断网提示友好
- [ ] 网络恢复处理
- [ ] 弱网加载提示
- [ ] 强缓存生效
- [ ] 协商缓存生效
- [ ] Cookie 正常使用
- [ ] LocalStorage 正常使用
- [ ] SessionStorage 正常使用
- [ ] 请求重试机制
## 国际化与本地化(10 项)
- [ ] 语言切换功能正常
- [ ] 静态文本翻译正确
- [ ] 动态内容翻译正确
- [ ] 数字格式符合区域习惯
- [ ] 日期时间格式符合区域习惯
- [ ] 货币格式正确
- [ ] RTL 布局正常(如适用)
- [ ] 语言选择持久化
- [ ] 刷新后语言保持
- [ ] 跨页面语言一致
## 打印功能(8 项)
- [ ] 点击打印按钮触发打印
- [ ] 打印预览内容正确
- [ ] 打印样式正确(隐藏非必要元素)
- [ ] 页眉页脚显示正确
- [ ] 跨页表格标题重复
- [ ] 图片打印清晰
- [ ] A4/Letter 纸张布局正确
- [ ] Chrome/Firefox/Edge 打印一致
## 深色模式(8 项)
- [ ] 手动切换深色模式
- [ ] 跟随系统深色模式
- [ ] 切换后颜色对比度足够
- [ ] 图片/图标适配深色
- [ ] 表单控件样式正确
- [ ] 代码块高亮可读
- [ ] 模式持久化(刷新保持)
- [ ] 跨页面模式一致
## 性能优化(8 项)
- [ ] 首屏加载 < 3 秒
- [ ] 白屏时间 < 1 秒
- [ ] 图片懒加载正常
- [ ] 动画流畅 60fps
- [ ] 无内存泄漏
- [ ] 长列表加载正常
- [ ] 代码分割生效
- [ ] 资源压缩生效
This skill should be used when generating test cases, writing test cases, designing test cases, supplementing exception scenarios and boundary values, design...
---
name: test-case-design
description: This skill should be used when generating test cases, writing test cases, designing test cases, supplementing exception scenarios and boundary values, designing complex interaction test cases, outputting standardized test cases, compatibility testing, adaptation testing, API testing, security testing, UI visual testing, mobile/App/mini-program/H5/desktop/PC Web testing, linkage testing, or routing testing. Only focuses on writing test cases, does not involve test plans, test strategies, or test automation scripts.
---
## Loading Guide
> **Progressive Disclosure Principle**: Read SKILL.md first to get the full picture, then load corresponding references files based on scenario keywords. No need to load all at once.
## Design Sequence
Function (Positive + Boundary + Exception) → API → Security → Platform Specific
## Output
- Default Markdown table, use xlsx Skill for Excel output
- No platform specified → General test cases only; Platform specified → General + Platform specific
- Structure: ID | Title | Type | Module | Priority | Preconditions | Steps | Expected Results
## Capability Boundaries
✅ Can generate: Functional testing, boundary values, exception scenarios, API testing, security awareness, UI visual test cases, performance experience test cases (response time, loading speed)
❌ Cannot generate: Test plans, test strategies, test plans, penetration test execution, vulnerability scanning, performance stress testing (concurrency, stress, load testing), automation scripts
## Command Mapping Table
| Keyword Trigger | Load File | Precise Positioning |
|-----------|---------|---------|
| "test case", "write test case", "design test case" (general) | `references/core-capabilities/common-testing.md` + `references/templates/common-rules.md` | common-testing.md full load |
| "mobile testing", "App testing" | `references/core-capabilities/common-testing.md` + `references/platform/mobile-app.md` + `references/templates/common-rules.md` | platform/mobile-app.md: specific test points |
| "mini program testing" | `references/core-capabilities/common-testing.md` + `references/platform/mini-program.md` + `references/templates/common-rules.md` | platform/mini-program.md: specific test points |
| "mobile Web testing", "H5 testing" | `references/core-capabilities/common-testing.md` + `references/platform/mobile-web.md` + `references/templates/common-rules.md` | platform/mobile-web.md: specific test points |
| "desktop testing", "desktop app testing" | `references/core-capabilities/common-testing.md` + `references/platform/desktop.md` + `references/templates/common-rules.md` | platform/desktop.md: specific test points |
| "PC Web testing", "Web testing" | `references/core-capabilities/common-testing.md` + `references/platform/pc-web.md` + `references/templates/common-rules.md` | platform/pc-web.md: specific test points |
| "linkage testing" | `references/core-capabilities/common-testing.md` | Lines 116-159: Part 3 Linkage Testing |
| "routing testing", "navigation testing" | `references/core-capabilities/common-testing.md` | Lines 160-214: Part 4 Routing Testing |
| "UI testing", "visual testing", "interface testing" | `references/core-capabilities/common-testing.md` | Lines 215-300: Part 5 UI Visual Testing |
| "API testing", "API testing" | `references/core-capabilities/common-testing.md` | Lines 301-375: Part 6 API Testing |
| "security testing" | `references/core-capabilities/common-testing.md` | Lines 376-443: Part 7 Security Testing |
| "boundary value", "exception scenario" | `references/core-capabilities/common-testing.md` | Lines 22-86: Part 1 Test Case Design Methods |
| "test quality", "quality standard" | `references/core-capabilities/common-testing.md` | Lines 87-115: Part 2 Test Case Quality Standards |
| "page interaction", "component interaction", "animation interaction" | `references/core-capabilities/common-testing.md` | Lines 444-549: Part 8-10 Interaction Testing |
| "compatibility testing", "adaptation testing" | `references/core-capabilities/common-testing.md` | Load corresponding platform/ file by platform |
| "accessibility testing" | `references/platform/mobile-app.md` | Section 6: Device Compatibility — Note: this skill does NOT include dedicated accessibility testing content; only device/screen/resolution compatibility is covered here. Accessibility testing (contrast, screen reader, focus management) is not yet documented in this skill. |
| "functional testing" | `references/core-capabilities/common-testing.md` + `references/templates/common-rules.md` + `references/examples/common.md` | examples/common.md Lines 20-86: Part 1 Functional Testing |
| Checklist (General) | `references/checklists/common-checklist.md` | |
| Checklist (Platform Specific) | `references/checklists/mobile-app-checklist.md` / `mobile-web-checklist.md` / `pc-web-checklist.md` / `desktop-checklist.md` / `mini-program-checklist.md` | |
| Example Reference | `references/examples/common.md` + `references/examples/{platform}.md` | examples/common.md contains table of contents |
## File Structure
> **Note**: This skill has no scripts/ or assets/ directories, all content is provided through references/.
```
references/
├── templates/ # Template rules
│ └── common-rules.md # Test case template + test types + priority + numbering
├── core-capabilities/ # General testing capabilities
│ └── common-testing.md # All general testing capabilities (with TOC)
├── platform/ # Platform specific test points
│ ├── mobile-app.md # Mobile App: gestures/interruption/network/permissions/push/compatibility/performance
│ ├── mobile-web.md # Mobile Web: responsive/touch/browser/viewport/login payment/H5/SEO
│ ├── pc-web.md # PC Web: browser/layout/keyboard/forms/session/multi-window/routing/linkage/drag/richtext/i18n/dark/print
│ ├── desktop.md # Desktop: window/shortcuts/files/system integration/multi-monitor/install update/compatibility
│ └── mini-program.md # Mini Program: lifecycle/authorization/sharing/payment/navigation/subscription/platform differences
├── checklists/ # Test case design checklists
│ ├── common-checklist.md # General checklist (with TOC)
│ ├── mobile-app-checklist.md
│ ├── mobile-web-checklist.md
│ ├── pc-web-checklist.md
│ ├── desktop-checklist.md
│ └── mini-program-checklist.md
└── examples/ # Example references
├── common.md # General test examples (with TOC)
├── mobile-app.md # Mobile App examples
├── mobile-web.md # Mobile Web examples
├── pc-web.md # PC Web examples
├── desktop.md # Desktop examples
└── mini-program.md # Mini Program examples
```
FILE:references/templates/common-rules.md
# Test Case General Rules
This document integrates core specifications for test case design, including test case templates, test type classifications, priority rules, and numbering rules.
## Table of Contents
| Line | Chapter |
|------|------|
| 16 | Part 1: Test Case Template |
| 59 | Part 2: Test Type Classification |
| 133 | Part 3: Priority Determination Rules |
| 175 | Part 4: Test Case Numbering Rules |
---
## Part 1: Test Case Template
### Standard Fields
| Field | Description | Required |
|-----|------|------|
| Test Case ID | Unique identifier | Yes |
| Test Title | Concise description of test purpose | Yes |
| Test Type | Functional/Security/Compatibility/UI etc. | Yes |
| Function Module | Belonging function module | Yes |
| Sub-function | Specific sub-function point | No |
| Test Case Level | P0/P1/P2/P3 | Yes |
| Test Dimension | Gesture/Screen/Network etc. | No |
| Preconditions | Environment and state before execution | Yes |
| Test Steps | Detailed operation steps | Yes |
| Expected Results | Expected system response | Yes |
| Actual Results | Actual test results | Fill during execution |
| Test Status | Pass/Fail/Block | Fill during execution |
### Example
**Test Case ID**: TC_LOGIN_001
**Test Title**: Verify correct username and password can login
**Test Type**: Functional Testing
**Function Module**: User Login
**Test Case Level**: P0
**Preconditions**: User registered, account password correct
**Test Steps**:
1. Open login page
2. Enter correct username
3. Enter correct password
4. Click login button
**Expected Results**: Login successful, redirect to homepage
---
## Part 2: Test Type Classification
### 1. Functional Testing
Verify functions work according to requirements specifications, ensuring all function points are correctly implemented.
**Sub-types**: Unit testing, integration testing, system testing, end-to-end testing
**Examples**: Login function, form submission, data query
---
### 2. Security Testing
Verify system security mechanisms are effective, preventing unauthorized access and data leakage.
**Sub-types**: Identity authentication, authorization control, data security, vulnerability scanning
**Examples**: Unauthorized access, sensitive data exposure, API misuse
---
### 3. Compatibility Testing
Verify system compatibility in different environments, ensuring consistent experience.
**Sub-types**: Platform compatibility, browser compatibility, device compatibility, version compatibility
**Examples**: Different device adaptations, different browser layouts, version upgrade compatibility
---
### 4. UI Testing
Verify interface display and interactions are correct, ensuring user experience.
**Sub-types**: Layout testing, style testing, interaction testing, theme testing
**Examples**: Page misalignment, style inconsistency, animation lag
---
### 5. Performance Testing
Verify system performance indicators meet standards, ensuring smooth experience.
**Sub-types**: Response time, concurrency capability, resource usage, stability
**Examples**: Slow first screen load, lag/crash, high concurrency crash
---
### 6. Usability Testing
Verify system usability and user experience, ensuring easy to learn and use.
**Sub-types**: Navigation testing, form testing, help testing, accessibility
**Examples**: Tedious operations, unclear prompts, unable to keyboard operate
---
### 7. Linkage Testing
Verify data synchronization and state linkage between different modules/components.
**Sub-types**: Form linkage, list linkage, search linkage, state linkage, data linkage
**Examples**: Province-city linkage, filter condition linkage, cross-page state synchronization
---
### 8. Routing Testing
Verify page routing jumps, parameter passing, and permission control.
**Sub-types**: Navigation jump, browser navigation, routing parameters, deep links
**Examples**: Direct URL access, 404 handling, login interception
---
## Part 3: Priority Determination Rules
### P0 - Critical
- Core functions
- Affect main process
- Cause system crash
- Data loss
- Security vulnerabilities
**Handling**: Fix immediately, block release
---
### P1 - Major
- Important functions
- Affect user experience
- Function errors
- Serious interface issues
**Handling**: Fix as soon as possible, affect release
---
### P2 - Minor
- Secondary functions
- Minor experience issues
- Minor interface issues
- Inaccurate prompt information
**Handling**: Schedule fix, can release with issues
---
### P3 - Trivial
- Optimization suggestions
- Interface beautification
- Does not affect function
**Handling**: Fix when available
---
## Part 4: Test Case Numbering Rules
### Numbering Format
```
[Platform]_[Module]_[Dimension]_[Sequence]
```
### Platform Prefix
| Platform | Prefix |
|-----|------|
| Mobile App | APP |
| Desktop | DESKTOP |
| Mini Program | MP |
| Mobile Web | H5 |
| PC Web | WEB |
| General Functional Testing | FUNC |
| General Linkage Testing | LINKAGE |
| General Routing Testing | ROUTING |
### Dimension Abbreviation
| Dimension | Abbreviation |
|-----|------|
| Gesture Operation | GESTURE |
| Screen Adaptation | SCREEN |
| Interruption Recovery | INTERRUPT |
| Network Switching | NETWORK |
| Device Compatibility | COMPAT |
| Permission Management | PERMISSION |
| System Interaction | SYSTEM |
| Performance Experience | PERFORMANCE |
| Lifecycle | LIFECYCLE |
| API Testing | API |
| Security Testing | SEC |
| UI Visual | UI |
| Linkage Testing | LINKAGE |
| Routing Testing | ROUTING |
| Payment Testing | PAYMENT |
| Data Sync | SYNC |
| Authorization Management | AUTH |
| Browser Compatibility | BROWSER |
### Examples (Full Format)
```
APP_LOGIN_GESTURE_001 - Mobile login function gesture operation test case 1
APP_ORDER_NETWORK_005 - Mobile order function network switching test case 5
MP_SHARE_LIFECYCLE_003 - Mini program sharing function lifecycle test case 3
WEB_LOGIN_BROWSER_001 - PC Web login function browser compatibility test case 1
LINKAGE_FORM_001 - Linkage testing form linkage test case 1
ROUTING_NAV_001 - Routing testing navigation jump test case 1
```
### Simplified Format (General Test Cases)
For general test cases, simplified format can be used:
```
TC_[Test Type Prefix]_[Scenario Keyword]_[Sequence]
```
Simplified prefix comparison:
| Full Prefix | Simplified Prefix | Applicable Scenario |
|---------|---------|---------|
| FUNC_CRUD | FUNC | Functional Testing - CRUD |
| FUNC_LIST | FUNC | Functional Testing - List Functions |
| FUNC_FORM | FUNC | Functional Testing - Form Validation |
| FUNC_STATUS | FUNC | Functional Testing - State Management |
| LINKAGE | LINKAGE | Linkage Testing |
| ROUTING | ROUTING | Routing Testing |
| API | API | API Testing |
| SEC | SEC | Security Testing |
| UI | UI | UI Testing |
Simplified format examples:
```
TC_FUNC_CRUD_001 - Functional Testing - Create data test case 1
TC_FUNC_FORM_001 - Functional Testing - Form validation test case 1
TC_LINKAGE_CITY_001 - Linkage Testing - City selection test case 1
TC_ROUTING_URL_001 - Routing Testing - URL access test case 1
TC_API_GET_001 - API Testing - GET request test case 1
TC_SEC_SQL_001 - Security Testing - SQL injection test case 1
TC_UI_LAYOUT_001 - UI Testing - Layout alignment test case 1
```
FILE:references/platform/desktop.md
# Desktop Specific Test Points
## 1. Window Management
### What to Test
- Window size adjustment (drag border, maximize, minimize, restore)
- Multi-window management (switch, arrange, close)
- Window always on top, full screen mode
- Window state persistence (position, size)
### Why Test
- Desktop application window management is core function, affecting user multi-task operation
- Window state persistence improves user experience
### Common Pitfalls
- Window size adjustment not smooth
- Multi-window switch confusion
- Window position not saved, restart returns to default
---
## 2. Keyboard Shortcuts
### What to Test
- Common shortcuts (Ctrl+C/V, Ctrl+Z/Y, Ctrl+S)
- Application custom shortcuts
- Shortcut conflict handling
- Shortcut hint and custom settings
### Why Test
- Desktop users rely on keyboard shortcuts to improve efficiency
- Shortcut conflict leads to function abnormality
### Common Pitfalls
- Shortcuts conflict with system or other applications
- No shortcut hint, user doesn't know available shortcuts
- Custom shortcut settings not saved
---
## 3. File Operations
### What to Test
- File open, save, save as
- Drag file open
- Auto save and recovery
- File association (double-click open with this application)
- Recent files
### Why Test
- File operation is the core function of desktop applications
- Auto save prevents data loss
### Common Pitfalls
- Large file open slow or crash
- Auto save interval too long, data lost after crash
- File association failure, double-click can't open
---
## 4. System Integration
### What to Test
- System tray icon and right-click menu
- Notification center message push
- Auto start on boot
- Right-click menu integration (Windows Explorer)
- Menu bar integration (macOS)
### Why Test
- System integration improves application availability
- Notification center is important channel for user recall
### Common Pitfalls
- Tray icon not displayed or click no response
- Notification not pushed or click no jump
- Auto start setting invalid
---
## 5. Multi-monitor Adaptation
### What to Test
- Single monitor, dual screen extend, multi-screen extend
- Duplicate mode
- Different resolution and DPI zoom
- Window cross-screen drag
### Why Test
- Multi-monitor is common configuration of desktop, need to adapt to various modes
- Window cross-screen drag needs to ensure position correct
### Common Pitfalls
- Window displays on disconnected monitor, user can't find
- Different resolution causes window size abnormality
- Full screen mode displays on wrong monitor
---
## 6. Peripheral Support
### What to Test
- Mouse operation (left button, right button, wheel, side button)
- Touchpad gesture (two-finger scroll, zoom)
- Touch screen operation (if supported)
- Printer, scanner and other peripherals
### Why Test
- Desktop applications need to support various input devices
- Peripherals extend application capabilities
### Common Pitfalls
- Touchpad gesture not recognized
- High DPI mouse movement not smooth
- Print function abnormal
---
## 7. System Compatibility
### What to Test
- Windows 10, Windows 11
- macOS different versions
- Intel chip, ARM64 chip (Apple Silicon)
- Light mode, dark mode, high contrast mode
### Why Test
- Desktop operating systems have various versions, need to ensure compatibility
- New chip architecture (ARM64) needs special adaptation
### Common Pitfalls
- Function abnormal on specific system version
- ARM64 architecture application can't run or performance poor
- Dark mode adaptation incomplete
---
## 8. Installation and Update
### What to Test
- Installer download and installation wizard
- Installation location selection and shortcut creation
- First run initialization
- Uninstall and residue cleanup
- Auto update detection and download
- Forced update vs optional update
### Why Test
- Installation and update are the first step of user contact with application, experience affects retention
- Timely updates fix vulnerabilities and add features
### Common Pitfalls
- Installation process error, can't complete installation
- Uninstall not clean,残留 files and registry
- Update download failure no retry mechanism
- Forced update interrupts user operation
---
## 9. Performance and Resources
### What to Test
- Cold start time, hot start time
- Memory usage, CPU usage
- Interface response speed
- Long time running stability
### Why Test
- Desktop application performance affects user experience, need to ensure smooth
- Resource usage too high affects other applications
### Common Pitfalls
- Start too slow, user loses patience
- Memory leak, long time use causes application crash
- Interface response lag, operation not smooth
---
## 10. Security and Permissions
### What to Test
- Administrator permission request (Windows)
- File read-write permission
- Network access permission
- Data encryption and sensitive information protection
### Why Test
- Desktop applications have higher permissions, need to ensure security
- Sensitive data needs encryption protection
### Common Pitfalls
- Permission request too frequent, user experience poor
- Sensitive data stored in plain text, security risk
- No security audit log
FILE:references/platform/mini-program.md
# Mini Program Specific Test Points
## 1. Lifecycle
### What to Test
- Cold start, hot start
- Page onLoad, onShow, onReady, onHide, onUnload
- Switch to background, switch to foreground
- Destroy after long time background
### Why Test
- Mini program lifecycle is special, different from H5 and App
- Lifecycle function execution order affects page initialization and data loading
### Common Pitfalls
- Data reloads every time enter page, doesn't use cache
- Background switch after page state lost
- Long time background destroy, return after data lost
---
## 2. Authorization Management
### What to Test
- User info, phone number, location, camera, album authorization
- Authorization agree, deny, re-guide
- Open permission in settings page
- Authorization state persistence
### Why Test
- Mini program authorization mechanism is special, need user active trigger
- Authorization denial shouldn't cause function unavailable
### Common Pitfalls
- Authorization request without explanation, user doesn't know why
- Authorization denied then function directly unavailable
- "Don't ask again" after no guidance, user doesn't know how to enable
---
## 3. Share Function
### What to Test
- Top-right menu share, share button share
- Share title, description, cover image, path
- Share to friend, group chat, moments
- From share card open specified page
### Why Test
- Share is the core spread method of mini programs, affects user growth
- Share parameters need to correctly pass to target page
### Common Pitfalls
- Share cover image not displayed or displayed incompletely
- From share card open doesn't jump to specified page
- Share parameters lost, page data loading failure
---
## 4. Platform Difference Adaptation
### What to Test
- WeChat, Alipay, Baidu, Douyin mini program API differences
- Component compatibility, style compatibility
- Login, payment, share differences
- Review specification differences
### Why Test
- Multi-platform mini programs need to adapt to different platform characteristics
- Review specifications are different, need to ensure pass review
### Common Pitfalls
- API doesn't exist on specific platform, function unavailable
- Style displays differently on different platforms
- Review rejected, doesn't conform to platform specification
---
## 5. Mini Program Code and QR Code
### What to Test
- Mini program code, QR code generate
- Scan code open mini program
- Scan code parameter parsing
- Mini program code jump
### Why Test
- Mini program code and QR code are important entry points, need to ensure normal use
- Scan code parameters need to correctly parse and pass
### Common Pitfalls
- Mini program code scan failure
- Scan code parameters parsing error, page data loading failure
- QR code expired, can't open
---
## 6. Subscription Message and Template Message
### What to Test
- Subscription message authorization, send, open
- Template message send, open
- Subscription count limit, permission revoke
### Why Test
- Subscription message is important channel for mini program to reach users
- Subscription count is limited, need reasonable use
### Common Pitfalls
- Subscription authorization not triggered, can't send message
- Subscription count used up, can't send important message
- Message click doesn't jump to specified page
---
## 7. Mini Program Jump
### What to Test
- Jump to other mini program
- Jump carry parameters, return from other mini program
- web-view open H5, H5 jump to mini program
- From App open mini program, from mini program open App
### Why Test
- Mini program ecosystem supports mutual jump, extends usage scenarios
- Jump parameters need to correctly pass
### Common Pitfalls
- Jump to other mini program failure
- Jump parameters lost
- web-view open H5 page abnormal
---
## 8. Local Storage
### What to Test
- Storage store, read, clear
- Capacity limit (10MB per mini program)
- Cache update, cleanup
- Temp file storage, file management system
### Why Test
- Mini program storage capacity is limited, need reasonable use
- Cache update not timely leads to user using old version
### Common Pitfalls
- Storage exceeds capacity, data storage failure
- Cache doesn't update, user always uses old version
- Temp file not cleaned, occupy storage
---
## 9. Network Request
### What to Test
- Domain whitelist configuration
- Request concurrency limit (10 concurrent)
- Request timeout, retry
- Sensitive data encryption
- File upload, download
### Why Test
- Mini program network request has restrictions, need to adapt
- Sensitive data needs encryption transmission
### Common Pitfalls
- Domain not in whitelist, request blocked
- Request concurrency exceeds limit, request failure
- Large file upload timeout
---
## 10. Performance Optimization
### What to Test
- First screen load time, page render smoothness
- Main package size, sub-package loading
- Image lazy loading, data cache
- Skeleton screen, performance monitoring
### Why Test
- Mini program performance affects user experience and review
- Main package size exceeds limit can't upload
### Common Pitfalls
- First screen load too slow, user loses patience
- Main package too large, exceeds 2MB limit
- Image not lazy loaded, page scroll lag
---
## 11. Payment Function
### What to Test
- WeChat payment, Alipay payment
- Payment callback, payment success page
- Payment failure handling
- Order state synchronization, refund process
### Why Test
- Payment is core function of e-commerce mini programs, needs to ensure safety
- Payment result callback is critical, affecting order state
### Common Pitfalls
- Payment success but callback failure, order shows unpaid
- Payment failure no prompt, user doesn't know reason
- Order state not synchronized, display error
---
## 12. Customer Service Function
### What to Test
- Customer service button display, session open
- Customer service message send, receive
- Customer service session close, evaluation
### Why Test
- Customer service is important channel for user feedback, needs to ensure normal
- Message send receive needs to be timely
### Common Pitfalls
- Customer service button not displayed or click no response
- Message send failure or delay
- Session close after can't re-enter
FILE:references/platform/mobile-app.md
# Mobile App Specific Test Points
## 1. Gesture Operations
### What to Test
- Pull-down refresh, pull-up load trigger area and animation
- Long press trigger context menu vs long press enter edit mode (conflict handling)
- Two-finger zoom boundaries (min/max zoom ratio)
- Swipe delete vs swipe switch conflict
- Gesture and page scroll event conflict (nested scroll)
### Why Test
- Mobile devices rely on gesture interaction, poor gesture experience directly affects user satisfaction
- Gesture conflicts lead to user confusion and reduced efficiency
### Common Pitfalls
- Pull-down refresh trigger area too small, user hard to trigger
- Long press and swipe gesture conflict, user accidentally triggers wrong function
- Zoom animation not smooth, user experience lag
---
## 2. Interruption Recovery
### What to Test
- Form data retention after call/SMS/alarm interruption
- Order state consistency after payment process interruption
- Return after long time background (cold start vs hot start)
- Recovery after permission popup interruption
### Why Test
- Mobile scenarios are fragmented, users frequently switch apps, data loss causes user complaints
- Payment interruption may cause order state inconsistency, affecting user rights
### Common Pitfalls
- Form data lost after background return, user needs to re-enter
- Payment interrupted then returned, order shows unpaid but deducted
- Permission popup interrupts operation flow, user doesn't know how to continue
---
## 3. Network Switching
### What to Test
- Handling of in-progress requests during WiFi↔4G/5G switching
- Submit operations under weak network (high latency/low bandwidth/high packet loss)
- Reconnection mechanism after airplane mode switching
- Data auto-sync after network recovery
### Why Test
- Mobile network environment is complex, users frequently switch networks, app needs to adapt
- Weak network environment is common, poor handling leads to operation failure
### Common Pitfalls
- Network switching causes request failure, user needs to retry
- Submit under weak network no response, user doesn't know if successful
- Network recovery doesn't auto-sync, data shows old version
---
## 4. Permission Management
### What to Test
- First permission request needs to explain purpose
- Function degradation + guide to enable after denial
- Handling after permission revocation
- Guide after "Don't ask again"
### Why Test
- Mobile permissions are sensitive, unreasonable requests lead to user rejection
- Permission denial shouldn't cause app unusable, need graceful degradation
### Common Pitfalls
- Permission request without explanation, user doesn't know why
- Permission denied then function directly unavailable, user experience poor
- "Don't ask again" after no guidance, user doesn't know how to enable
---
## 5. Push Notifications
### What to Test
- Cold start vs hot start when clicking push
- Push parameter passing and page data loading
- Handling of multiple push clicks
### Why Test
- Push is important channel for user recall, click behavior affects conversion
- Push parameter passing error leads to wrong page or data loading failure
### Common Pitfalls
- Click push opens app but doesn't jump to specified page
- Push carries parameters but page data loading error
- Multiple push clicks only process the first one
---
## 6. Device Compatibility
### What to Test
- Different screen sizes and resolutions adaptation
- Notch screen, punch hole screen, waterfall screen adaptation
- Different iOS/Android versions compatibility
- Different manufacturer ROM compatibility
### Why Test
- Mobile device fragmentation is severe, need to ensure experience consistency
- New device features (notch, punch hole) need special adaptation
### Common Pitfalls
- Content blocked by notch on notch screen
- Button too small on small screen, hard to click
- Function abnormal on specific ROM
---
## 7. Performance Experience
### What to Test
- Cold start time, first screen load time
- Page scroll smoothness, animation frame rate
- Memory usage, power consumption
### Why Test
- Mobile device performance is limited, poor performance leads to lag, heat, power consumption
- Users are sensitive to start speed and operation smoothness
### Common Pitfalls
- Cold start too slow, user loses patience
- List scroll lag, frame rate below 50fps
- Long time use causes phone heat and power consumption
---
## 8. Storage and Data
### What to Test
- Local data storage and reading
- Cache cleanup and update
- Data migration and version compatibility
### Why Test
- Mobile storage is limited, need reasonable cache strategy
- Data migration errors cause user data loss
### Common Pitfalls
- Cache too large, occupy too much storage
- App update after data lost or abnormal
- Cache cleanup causes important data lost
---
## 9. Updates and Versions
### What to Test
- In-app update detection and download
- Forced update vs optional update
- Update progress and installation
### Why Test
- Timely updates fix vulnerabilities and add features
- Forced update strategy affects user experience
### Common Pitfalls
- Update detection not timely, user uses old version for long time
- Forced update interrupts user operation, experience poor
- Update download failure no retry mechanism
FILE:references/platform/mobile-web.md
# Mobile Web Specific Test Points
## 1. Responsive Layout
### What to Test
- Layout adaptation at different screen widths (320px-768px)
- Touch area size (minimum 44×44px)
- Font size adaptation (respect system font size settings)
- Image adaptive display (not stretched, not cropped)
### Why Test
- Mobile devices have various screen sizes, need to ensure layout normal at all sizes
- Touch area too small leads to misoperation, affecting user experience
### Common Pitfalls
- Layout disorder on small screen, content overlap
- Button too small, user hard to click
- Font size doesn't adapt, user sets large font but page unchanged
---
## 2. Touch Interaction
### What to Test
- Click, double-click, long press, swipe gesture response
- Pull-down refresh, pull-up load more trigger
- Zoom, drag gesture support
- Touch and mouse event compatibility
### Why Test
- Mobile Web mainly relies on touch interaction, gesture experience directly affects user satisfaction
- Some components need to support both touch and mouse (e.g., tablet with keyboard)
### Common Pitfalls
- Click delay (300ms), user feels lag
- Pull-down refresh and page scroll conflict
- Gesture response not sensitive, user needs multiple attempts
---
## 3. Browser Compatibility
### What to Test
- iOS Safari, Android Chrome mainstream versions
- WeChat built-in browser, QQ Browser, UC Browser, etc.
- Private/incognito mode
- WebView compatibility (WKWebView, X5 Kernel)
### Why Test
- Mobile browsers have various kernels, compatibility issues are common
- WeChat built-in browser has special restrictions (e.g., autoplay)
### Common Pitfalls
- Function abnormal on specific browser
- WeChat built-in browser video autoplay failure
- WebView page white screen or crash
---
## 4. Viewport and Safe Area
### What to Test
- Viewport settings correct (width=device-width, initial-scale=1)
- Notch screen, punch hole screen safe area adaptation
- Keyboard popup page layout adjustment
- Orientation switch layout adaptation
### Why Test
- Notch screen, punch hole screen need to avoid blocking content
- Keyboard popup may block input field, need automatic adjustment
### Common Pitfalls
- Content blocked by notch on notch screen
- Keyboard popup blocks input field, user can't see input content
- Orientation switch after layout disorder
---
## 5. H5 Specific Features
### What to Test
- tel:, sms:, mailto: link jump
- Map link open
- Add to home screen (PWA)
- Web Share API share
### Why Test
- H5 needs to interact with system functions (call, SMS, email, map)
- PWA provides near-native app experience
### Common Pitfalls
- tel: link doesn't jump to dial interface on some browsers
- Add to home screen prompt not displayed
- Share API not supported, no fallback scheme
---
## 6. Third-party Login and Payment
### What to Test
- WeChat H5 login, Alipay H5 login
- WeChat H5 payment, Alipay H5 payment
- Login state persistence and synchronization
- Payment result callback and query
### Why Test
- H5 usually integrates third-party login and payment
- Payment result callback is critical, affecting order state
### Common Pitfalls
- Login callback failure, can't get user info
- Payment success but callback failure, order shows unpaid
- Login state lost after refresh
---
## 7. WebView Specific
### What to Test
- JSBridge communication normal
- Native capability call (camera, album, location, scan)
- Physical back button handling
- Page loading progress display
### Why Test
- H5 in WebView needs to interact with native
- Native capabilities need to be called through JSBridge
### Common Pitfalls
- JSBridge call failure, native function unavailable
- Back button directly exits app, doesn't return to previous page
- Page loading white screen, no progress prompt
---
## 8. Cache and Offline
### What to Test
- Service Worker offline cache
- LocalStorage, SessionStorage use
- Cache update strategy (version control)
- Offline state prompt and handling
### Why Test
- Offline cache improves user experience, reduces loading time
- Cache update not timely leads to user using old version
### Common Pitfalls
- Service Worker registration failure, offline function unavailable
- Cache doesn't update, user always uses old version
- LocalStorage exceeds capacity, data storage failure
FILE:references/platform/pc-web.md
# PC Web Specific Test Points
## 1. Browser Compatibility
### What to Test
- Chrome, Firefox, Safari, Edge mainstream versions
- Different versions of same browser (e.g., Chrome 90/100/110)
- JavaScript, CSS features compatibility
- Developer tools no error output
### Why Test
- PC users use various browsers, need to ensure compatibility
- New features may not be supported by old browsers
### Common Pitfalls
- CSS Grid layout abnormal on old browsers
- ES6+ syntax error on old browsers
- Specific browser plugin causes page error
---
## 2. Page Layout
### What to Test
- Layout at different resolutions (1366×768, 1920×1080, 2K, 4K)
- Different DPI zoom (100%, 125%, 150%)
- Window maximize and custom size
- Scrollbar display and scroll smoothness
### Why Test
- PC screen sizes vary greatly, need to adapt to various resolutions
- High DPI screen needs zoom adaptation, otherwise text and icons are too small
### Common Pitfalls
- Layout disorder on high resolution
- Content too small after zoom, hard to read
- Window size change after element overlap
---
## 3. Keyboard Navigation
### What to Test
- Tab key focus order
- Enter key trigger button
- Space key operate checkbox
- Arrow key navigation
- Esc key close dialog
- Global shortcut keys (Ctrl+C/V, Ctrl+S, etc.)
### Why Test
- PC users are accustomed to keyboard operation, need to support complete keyboard navigation
- Accessibility requires keyboard operability
### Common Pitfalls
- Tab order illogical, user jumps disorderly
- Can't trigger button with Enter key
- No focus indicator, user doesn't know current focus position
---
## 4. Form Interaction
### What to Test
- Various input types (text, number, date, file, etc.)
- Form validation (required, format, length)
- Auto-complete, input suggestion
- Copy paste function
- Form submit and reset
### Why Test
- Form is core interaction method of PC Web, experience directly affects conversion
- Form validation error leads to user submission failure
### Common Pitfalls
- Date picker style inconsistent
- Auto-complete covers input field
- Form submit no response, user doesn't know if successful
---
## 5. Authentication and Session
### What to Test
- Login, logout function
- Session expiration handling
- Remember login function
- Password retrieve and modify
- Multi-device login conflict
### Why Test
- Authentication is the foundation of Web applications, security and experience are equally important
- Session expiration handling affects user continuous operation
### Common Pitfalls
- Session expires but no prompt, user operation fails
- Remember login invalid, user needs to login every time
- Multi-device login kicks out without prompt
---
## 6. Multi-window and Tabs
### What to Test
- New window, new tab open page
- Cross-window communication (localStorage, BroadcastChannel)
- Browser forward/back, refresh
- Tab switch state persistence
### Why Test
- PC users are accustomed to multi-tab operation, need to support state synchronization
- Cross-window communication is needed for some scenarios (e.g., payment callback)
### Common Pitfalls
- Data not synchronized between tabs
- Refresh after form data lost
- Cross-window communication failure
---
## 7. Routing and Navigation
### What to Test
- SPA route path correct match
- Nested route level correct
- Dynamic route parameter parsing
- Route guard (login, permission verification)
- 404 page display
- Deep link direct access
### Why Test
- SPA routing is the core of page navigation, error leads to page not found
- Route guard is the foundation of security, need to ensure effective
### Common Pitfalls
- Route parameter parsing error, page data loading failure
- Not logged in access authenticated page, no redirect to login
- 404 page not displayed, user sees white screen
---
## 8. Data Linkage
### What to Test
- Parent-child component data synchronization
- Cross-component state sharing
- List click jump detail, detail modify then list refresh
- Multi-condition filter linkage
### Why Test
- Complex applications have multi-level data linkage, need to ensure data consistency
- Data not synchronized leads to user seeing old data
### Common Pitfalls
- Parent component data modify, child component not updated
- List and detail data inconsistent
- Filter condition linkage error, data doesn't match
---
## 9. Drag Interaction
### What to Test
- Element drag function
- Drag sort position
- Drag upload file
- Drag not exceed boundary
- Undo drag (Ctrl+Z)
### Why Test
- Drag is common interaction method of PC Web, need to support mouse drag
- Drag sort is common function, need to ensure position correct
### Common Pitfalls
- Drag process element position offset
- Drag sort position error
- No undo function, user misoperation can't recover
---
## 10. Rich Text Editor
### What to Test
- Basic text input
- Style settings (bold, italic, underline, color)
- Insert link, image, table
- Undo redo (Ctrl+Z/Y)
- Paste from external (Word, Excel)
### Why Test
- Rich text editor is complex component, need to ensure function complete
- Paste from external may bring format pollution
### Common Pitfalls
- Paste from Word brings redundant styles
- Undo redo history lost
- Image upload failure
---
## 11. File Operations
### What to Test
- File download, preview, save
- File import, export
- Drag file upload
- File type and size limit
### Why Test
- File operation is common function of PC Web, need to support various formats
- File upload needs to limit type and size, prevent security risks
### Common Pitfalls
- Large file download timeout
- File preview format not supported
- File upload no progress prompt
---
## 12. Internationalization and Localization
### What to Test
- Language switch function
- Static text and dynamic content translation
- Number, date time, currency format
- RTL layout (Arabic, Hebrew)
### Why Test
- Multi-language support is the foundation of internationalization
- Different regions have different format habits
### Common Pitfalls
- Language switch after page not fully refreshed
- Date format doesn't conform to region habit
- RTL layout text direction error
---
## 13. Print Function
### What to Test
- Click print button trigger print
- Print preview content correct
- Print style correct (hide unnecessary elements)
- Header footer display correct
- Cross-page table title repeat
### Why Test
- Print is common requirement of PC Web, need to ensure print effect
- Print style may be different from screen display
### Common Pitfalls
- Print preview content incomplete
- Background color, image not printed
- Table cross-page title not repeated
---
## 14. Dark Mode
### What to Test
- Manual switch dark mode
- Follow system dark mode
- Color contrast sufficient after switch
- Image, icon adaptation dark
### Why Test
- Dark mode reduces eye fatigue, improves user experience
- Need to ensure dark mode color contrast sufficient
### Common Pitfalls
- Dark mode text color too light, hard to read
- Image doesn't adapt dark, display too bright
- Mode switch has white flash
FILE:references/examples/common.md
# General Test Examples
This file shows standard formats for various general test cases, including functional testing, linkage testing, routing testing, UI visual testing, API testing, and security testing.
> **File Path**: `references/examples/common.md`
## Table of Contents
| Line | Chapter |
|------|------|
| 20 | Part 1: Functional Testing |
| 295 | Part 3: Linkage Testing |
| 354 | Part 4: Routing Testing |
| 418 | Part 5: UI Visual Testing |
| 472 | Part 6: API Testing |
| 543 | Part 7: Security Testing |
---
## Part 1: Functional Testing
### TC_FUNC_CRUD_001 Verify Create Data Function
**Test Type**: Functional Testing - CRUD
**Function Module**: Data Management
**Test Case Level**: P0
**Preconditions**:
1. User logged in
2. Has create data permission
**Test Steps**:
1. Click "Create" button
2. Fill form required fields
3. Fill form optional fields
4. Click "Save" button
5. Check create success prompt
6. Find newly created record in list
**Expected Results**:
1. Create page opens normally
2. Required fields have indicators
3. Data saved successfully
4. Display create success prompt
5. List displays new record
6. Data consistent with input
---
### TC_FUNC_CRUD_002 Verify Edit Data Function
**Test Type**: Functional Testing - CRUD
**Function Module**: Data Management
**Test Case Level**: P0
**Preconditions**:
1. System has editable data records
**Test Steps**:
1. Find target record in list
2. Click "Edit" button
3. Modify some fields
4. Click "Save" button
5. Check update success prompt
6. Check list data updated
**Expected Results**:
1. Edit page opens normally
2. Original data correctly backfilled
3. Data update successful
4. Display update success prompt
5. List displays latest data
6. Data persists on re-edit
---
### TC_FUNC_CRUD_003 Verify Delete Data Function
**Test Type**: Functional Testing - CRUD
**Function Module**: Data Management
**Test Case Level**: P1
**Preconditions**:
1. System has deletable data records
**Test Steps**:
1. Find target record in list
2. Click "Delete" button
3. Check confirmation dialog
4. Click "Confirm" delete
5. Check delete success prompt
6. Confirm record deleted in list
**Expected Results**:
1. Delete button available
2. Popup confirmation prompt
3. Secondary confirmation before delete
4. Display delete success prompt
5. Record removed from list
6. Data deleted in database
---
### TC_FUNC_CRUD_004 Verify Data Query Function
**Test Type**: Functional Testing - CRUD
**Function Module**: Data Query
**Test Case Level**: P1
**Preconditions**:
1. System has multiple data records
2. Query function normally configured
**Test Steps**:
1. Enter keyword in search box
2. Click search button
3. Check search results
4. Enter exact condition query
5. Use filter condition query
6. Clear search conditions
**Expected Results**:
1. Support fuzzy search
2. Return matching search results
3. Display empty state when no match
4. Exact query results accurate
5. Filter condition combination effective
6. Restore default list after clear
---
### TC_FUNC_LIST_001 Verify List Pagination Function
**Test Type**: Functional Testing - List Functions
**Function Module**: List Display
**Test Case Level**: P1
**Preconditions**:
1. List data exceeds one page
**Test Steps**:
1. View first page data
2. Click "Next Page"
3. Check second page data
4. Enter page number to jump
5. Modify items per page
6. Check data update
**Expected Results**:
1. Default display first page
2. Pagination info correct
3. Second page data not duplicate
4. Jump page number correct
5. Items per page switch effective
6. Total count statistics correct
---
### TC_FUNC_LIST_002 Verify List Sorting Function
**Test Type**: Functional Testing - List Functions
**Function Module**: List Display
**Test Case Level**: P1
**Preconditions**:
1. List has sortable columns
**Test Steps**:
1. Click ascending sort
2. Check data order
3. Click descending sort again
4. Check data order
5. Switch sort column
6. Check new column sort
**Expected Results**:
1. Ascending icon displays
2. Data arranged small to large
3. Descending icon displays
4. Data arranged large to small
5. Different column sorts don't affect each other
6. Sort state can be saved
---
### TC_FUNC_FORM_001 Verify Form Required Validation
**Test Type**: Functional Testing - Form Validation
**Function Module**: Form Validation
**Test Case Level**: P0
**Preconditions**:
1. Form has required fields
**Test Steps**:
1. Directly click save (without filling any content)
2. Check required prompt
3. Fill some required fields
4. Submit check
5. Fill all required fields
6. Submit check
**Expected Results**:
1. Display required field prompt
2. Unfilled fields highlighted prompt
3. Cannot submit with only partial fill
4. Pass validation with all fields filled
5. Prompt message clear and explicit
6. Error prompt disappears after correction
---
### TC_FUNC_FORM_002 Verify Form Format Validation
**Test Type**: Functional Testing - Form Validation
**Function Module**: Form Validation
**Test Case Level**: P1
**Preconditions**:
1. Form has format validation fields
**Test Steps**:
1. Enter phone format error (e.g., 123)
2. Check format error prompt
3. Enter email format error (e.g., abc)
4. Check format error prompt
5. Enter correct format data
6. Check validation pass
**Expected Results**:
1. Phone format validation effective
2. Display correct format prompt (e.g., 11 digits)
3. Email format validation effective
4. Display correct format prompt
5. Correct format passes validation
6. Real-time validation or validation on submit
---
### TC_FUNC_STATUS_001 Verify State Switch Function
**Test Type**: Functional Testing - State Management
**Function Module**: State Control
**Test Case Level**: P1
**Preconditions**:
1. Data has state field
2. Support state switching
**Test Steps**:
1. View data current state
2. Execute enable operation
3. Check state change
4. Execute disable operation
5. Check state change
6. Refresh page check state persistence
**Expected Results**:
1. Initial state displays correctly
2. Enable operation successful
3. State updates immediately
4. Disable operation successful
5. State updates immediately
6. State persists after refresh
---
### TC_FUNC_STATUS_002 Verify Data Persistence
**Test Type**: Functional Testing - State Management
**Function Module**: Data Storage
**Test Case Level**: P0
**Preconditions**:
1. Exists savable data
**Test Steps**:
1. Fill form data
2. Click save
3. Close page
4. Reopen
5. Check if data retained
**Expected Results**:
1. Save operation successful
2. Page closes normally
3. Re-enter page
4. Data complete retention
5. No data loss
---
---
## Part 3: Linkage Testing
### TC_LINKAGE_001 Verify Province-City-District Three-Level Linkage
**Test Type**: Linkage Testing - Functional Testing
**Function Module**: Address Selection
**Test Case Level**: P1
**Preconditions**:
1. Address selection form normally loaded
**Test Steps**:
1. Select province (e.g., "Guangdong Province")
2. Check city dropdown options
3. Select city (e.g., "Shenzhen City")
4. Check district dropdown options
5. Select district (e.g., "Nanshan District")
6. Check complete address
7. Modify province to "Zhejiang Province"
8. Check if city and district reset
**Expected Results**:
1. City list changes with province (Guangdong→Guangzhou, Shenzhen, etc.)
2. District list changes with city (Shenzhen→Nanshan, Futian, etc.)
3. Data correctly corresponds
4. Modify parent option, child automatically resets
5. Address data complete on submit
---
### TC_LINKAGE_002 Verify Search Box Real-time Suggestion
**Test Type**: Linkage Testing - Interaction Testing
**Function Module**: Search
**Test Case Level**: P1
**Preconditions**:
1. Search page
2. Support real-time suggestion
**Test Steps**:
1. Enter "ph" in search box
2. Check suggestion word list
3. Continue entering "phone"
4. Check suggestion word update
5. Click suggestion word "Apple Phone"
6. Check search results
7. Quickly delete input
8. Check suggestion word disappears
**Expected Results**:
1. Real-time display suggestion words during input
2. Suggestion words accurately match
3. Click suggestion word to execute search
4. Suggestion words disappear when input cleared
5. Debounce processing (avoid frequent requests)
---
## Part 4: Routing Testing
### TC_ROUTING_001 Verify Direct Access to Detail Page URL
**Test Type**: Routing Testing - Functional Testing
**Function Module**: Page Navigation
**Test Case Level**: P1
**Preconditions**:
1. User logged in
2. Product detail page URL known
**Test Steps**:
1. Enter product detail page URL in browser address bar
2. Press Enter to access
3. Check page load
**Expected Results**:
1. Page loads normally
2. Display correct product information
3. URL matches page content
4. Page title correct
---
### TC_ROUTING_002 Verify Access to Non-existent Route
**Test Type**: Routing Testing - Error Handling
**Function Module**: Error Page
**Test Case Level**: P2
**Test Steps**:
1. Access non-existent route `/product/999999`
2. Press Enter
**Expected Results**:
1. Display 404 page
2. Provide link to return to homepage
3. Provide search function
4. Page status code is 404
---
### TC_ROUTING_003 Verify Access to Route Requiring Authentication Without Login
**Test Type**: Routing Testing - Security Testing
**Function Module**: Route Guard
**Test Case Level**: P0
**Preconditions**:
1. User not logged in
2. Order detail page requires authentication
**Test Steps**:
1. Access order detail page `/order/123`
2. Check jump behavior
**Expected Results**:
1. Redirect to login page
2. Return to original page after login
3. Or display friendly not logged in prompt
---
## Part 5: UI Visual Testing
### TC_UI_LAYOUT_001 Verify Page Element Alignment
**Test Type**: UI Testing - Layout Testing
**Function Module**: Page Layout
**Test Case Level**: P2
**Test Dimension**: UI Visual
**Preconditions**:
1. Page normally loaded
**Test Steps**:
1. Check page margin consistency
2. Check element alignment (left/center alignment)
3. Check element spacing uniform
4. Check grid system
5. Check responsive breakpoints
**Expected Results**:
1. Margins conform to design (e.g., 16px/24px)
2. Same level elements align consistently
3. Spacing uniform (e.g., 8px multiples)
4. Grid system correct
5. Layout correct at each breakpoint
---
### TC_UI_DARK_001 Verify Dark Mode Adaptation
**Test Type**: UI Testing - Theme Testing
**Function Module**: Dark Mode
**Test Case Level**: P2
**Test Dimension**: UI Visual
**Preconditions**:
1. Application supports dark mode switching
**Test Steps**:
1. System switch to dark mode
2. Check application background color
3. Check text color
4. Check icon color
5. Check image adaptation
**Expected Results**:
1. Background color adapts to dark theme
2. Text contrast sufficient
3. Icon color coordinated
4. Images display normally
5. No white flash screen
---
## Part 6: API Testing
### TC_API_GET_001 Verify Get User Info API
**Test Type**: API Testing - Functional Testing
**Function Module**: User API
**Test Case Level**: P1
**API Info**:
- Method: GET
- URL: `/api/v1/users/{userId}`
- Authentication: Bearer Token
**Request Parameters**:
- userId: 12345 (path parameter)
**Test Steps**:
1. Set request header Authorization: Bearer {token}
2. Send GET request
3. Check response status code
4. Check response data structure
5. Check field values
**Expected Results**:
1. Status code 200
2. Return user object
3. Fields complete (id, name, email, etc.)
4. Data consistent with database
5. Sensitive information masked
---
### TC_API_POST_001 Verify Create Order API
**Test Type**: API Testing - Functional Testing
**Function Module**: Order API
**Test Case Level**: P0
**API Info**:
- Method: POST
- URL: `/api/v1/orders`
- Authentication: Bearer Token
- Content-Type: application/json
**Request Body**:
```json
{
"userId": 12345,
"items": [
{"productId": 1001, "quantity": 2}
],
"address": "Beijing Chaoyang District"
}
```
**Test Steps**:
1. Set request header and authentication
2. Construct request body
3. Send POST request
4. Check response
5. Verify database record
**Expected Results**:
1. Status code 201
2. Return order object (with order number)
3. Database creates corresponding record
4. Inventory deduction
5. Trigger order creation event
---
## Part 7: Security Testing
### TC_SEC_SQL_001 Verify SQL Injection Protection
**Test Type**: Security Testing - Injection Attack
**Function Module**: Input Validation
**Test Case Level**: P0
**Test Steps**:
1. Enter `' OR '1'='1` in search box
2. Enter `admin' --` in login box
3. Enter `1; DROP TABLE users--` in URL parameter
4. Check response
5. Check database log
**Expected Results**:
1. Query returns empty or normal result
2. Cannot bypass authentication
3. Database table not deleted
4. Log records attack attempt
5. Use parameterized queries
---
### TC_SEC_XSS_001 Verify Cross-Site Script Attack Protection
**Test Type**: Security Testing - XSS Attack
**Function Module**: Input Output
**Test Case Level**: P0
**Test Steps**:
1. Enter `<script>alert('xss')</script>` in comment box
2. Enter `<img src=x onerror=alert(1)>` in username
3. Submit and view page
4. Check if script executes
5. Check output encoding
**Expected Results**:
1. Script does not execute
2. Special characters escaped
3. Display as plain text
4. Content-Type correct
5. Set HttpOnly flag
---
### TC_SEC_AUTH_001 Verify Unauthorized Access Protection
**Test Type**: Security Testing - Authentication Authorization
**Function Module**: Permission Control
**Test Case Level**: P0
**Test Steps**:
1. Access interface requiring authentication without login
2. Normal user access administrator interface
3. User A access user B data
4. Access with expired Token
5. Check response
**Expected Results**:
1. Return 401 not authenticated
2. Return 403 no permission
3. Data isolation correct
4. Token invalid reject access
5. Error information not sensitive
FILE:references/examples/desktop.md
# Desktop Test Examples
This file provides test case examples for desktop application specific scenarios.
## Example 1: Window Management Test
**Test Case ID**: TC_DESKTOP_WINDOW_001
**Test Title**: Verify window size adjustment and state persistence
**Test Type**: Functional Testing
**Function Module**: Window Management
**Test Case Level**: P1
**Preconditions**:
1. Application normally launched
**Test Steps**:
1. Drag window border to adjust size
2. Click maximize button
3. Click restore button
4. Click minimize button
5. Restore window from taskbar
6. Close application
7. Reopen application
**Expected Results**:
1. Window size smoothly adjusts
2. Window maximizes to full screen
3. Window restores to previous size
4. Window minimizes to taskbar
5. Window restores from taskbar
6. Application closes
7. Window size and position same as before closing
---
## Example 2: Keyboard Shortcuts Test
**Test Case ID**: TC_DESKTOP_SHORTCUT_001
**Test Title**: Verify common shortcuts
**Test Type**: Functional Testing
**Function Module**: Shortcuts
**Test Case Level**: P1
**Preconditions**:
1. Application normally launched
2. Has editable content
**Test Steps**:
1. Select text
2. Press Ctrl+C
3. Move cursor to target position
4. Press Ctrl+V
5. Press Ctrl+Z
6. Press Ctrl+Y
**Expected Results**:
1. Text selected
2. Content copied to clipboard
3. Cursor moves to target position
4. Content pasted
5. Operation undone
6. Operation redone
---
## Example 3: File Operations Test
**Test Case ID**: TC_DESKTOP_FILE_001
**Test Title**: Verify file drag open
**Test Type**: Functional Testing
**Function Module**: File Operations
**Test Case Level**: P1
**Preconditions**:
1. Application normally launched
2. Has files that can be opened
**Test Steps**:
1. Select file in file manager
2. Drag file to application window
3. Release mouse
4. Check file open
**Expected Results**:
1. File selected
2. Drag process has visual feedback
3. File drops to application window
4. Application opens file, displays content
---
## Example 4: System Integration Test
**Test Case ID**: TC_DESKTOP_SYSTEM_001
**Test Title**: Verify system tray icon and menu
**Test Type**: Functional Testing
**Function Module**: System Integration
**Test Case Level**: P1
**Preconditions**:
1. Application normally launched
**Test Steps**:
1. Minimize application to tray
2. Click tray icon
3. Check right-click menu
4. Select menu item
5. Double-click tray icon
**Expected Results**:
1. Application minimizes to system tray, icon displays
2. Application window restores or menu displays
3. Right-click menu displays, items complete
4. Corresponding function executes
5. Application window restores
---
## Example 5: Multi-monitor Test
**Test Case ID**: TC_DESKTOP_MONITOR_001
**Test Title**: Verify window cross-screen drag
**Test Type**: Functional Testing
**Function Module**: Multi-monitor
**Test Case Level**: P2
**Preconditions**:
1. System connects two monitors
2. Application normally launched
**Test Steps**:
1. Drag window from Monitor A to Monitor B
2. Check window display
3. Maximize window on Monitor B
4. Restore window
5. Drag back to Monitor A
**Expected Results**:
1. Window smoothly drags to Monitor B
2. Window displays normally on Monitor B
3. Window maximizes on Monitor B
4. Window restores to appropriate size
5. Window smoothly drags back to Monitor A
---
## Example 6: Installation and Update Test
**Test Case ID**: TC_DESKTOP_INSTALL_001
**Test Title**: Verify auto update process
**Test Type**: Functional Testing
**Function Module**: Update
**Test Case Level**: P1
**Preconditions**:
1. Application has new version
2. Auto update enabled
**Test Steps**:
1. Launch application
2. Check update detection
3. Confirm update download
4. Wait for download complete
5. Install update
6. Restart application
**Expected Results**:
1. Application launches
2. Detects new version, prompts update
3. Download starts
4. Download progress displays, completes
5. Update installs
6. Application restarts, version number updates
FILE:references/examples/mini-program.md
# Mini Program Test Examples
This file provides test case examples for mini program specific scenarios.
## Example 1: Lifecycle Test
**Test Case ID**: TC_MP_LIFECYCLE_001
**Test Title**: Verify cold start and hot start
**Test Type**: Functional Testing
**Function Module**: Lifecycle
**Test Case Level**: P1
**Preconditions**:
1. Mini program not launched or in background
**Test Steps**:
1. First launch mini program (cold start)
2. Check loading performance
3. Switch to background
4. Re-enter mini program (hot start)
5. Check page state
**Expected Results**:
1. Cold start: Full initialization, loading time < 3 seconds
2. Loading indicator displays
3. Mini program switches to background
4. Hot start: Quick recovery, page state persists
5. User operation state not lost
---
## Example 2: Authorization Management Test
**Test Case ID**: TC_MP_AUTH_001
**Test Title**: Verify location authorization process
**Test Type**: Functional Testing
**Function Module**: Authorization
**Test Case Level**: P1
**Preconditions**:
1. First use location function
2. No location authorization
**Test Steps**:
1. Click location button
2. Check authorization request
3. Click deny
4. Check function degradation
5. Click re-request
6. Click agree
**Expected Results**:
1. Trigger location authorization request
2. Authorization popup displays, explains purpose
3. User denies, function degrades, prompts to enable
4. Re-request authorization
5. User agrees
6. Location function normally uses
---
## Example 3: Share Function Test
**Test Case ID**: TC_MP_SHARE_001
**Test Title**: Verify share to friend
**Test Type**: Functional Testing
**Function Module**: Share
**Test Case Level**: P1
**Preconditions**:
1. Enter page that can be shared
**Test Steps**:
1. Click top-right menu
2. Select "Share to Friend"
3. Select friend
4. Send share
5. Friend receives share card
6. Friend clicks share card
**Expected Results**:
1. Top-right menu opens
2. Enter share interface
3. Select target friend
4. Share sent
5. Friend receives share card, displays title, description, image
6. Jump to mini program specified page
---
## Example 4: Mini Program Code Test
**Test Case ID**: TC_MP_CODE_001
**Test Title**: Verify scan code open mini program
**Test Type**: Functional Testing
**Function Module**: Mini Program Code
**Test Case Level**: P1
**Preconditions**:
1. Have valid mini program code
**Test Steps**:
1. Open WeChat scan
2. Scan mini program code
3. Check recognition result
4. Enter mini program
5. Check page jump
**Expected Results**:
1. Scan interface opens
2. Successfully recognizes mini program code
3. Displays mini program name and entry
4. Jump to mini program
5. Jump to specified page based on code parameters
---
## Example 5: Subscription Message Test
**Test Case ID**: TC_MP_SUBSCRIBE_001
**Test Title**: Verify subscription message authorization and send
**Test Type**: Functional Testing
**Function Module**: Subscription Message
**Test Case Level**: P1
**Preconditions**:
1. User not authorized subscription message
**Test Steps**:
1. Trigger subscription message authorization
2. Check authorization popup
3. Click agree
4. Trigger message send
5. User receives message
6. Click message
**Expected Results**:
1. Subscription authorization popup displays
2. Displays message type and purpose
3. User agrees to authorization
4. Backend sends subscription message
5. User receives WeChat service notification
6. Click message jumps to mini program specified page
---
## Example 6: Mini Program Jump Test
**Test Case ID**: TC_MP_JUMP_001
**Test Title**: Verify jump to other mini program
**Test Type**: Functional Testing
**Function Module**: Mini Program Jump
**Test Case Level**: P1
**Preconditions**:
1. Current mini program has jump permission
**Test Steps**:
1. Click jump button
2. Check target mini program info
3. Confirm jump
4. Enter target mini program
5. Return to original mini program
**Expected Results**:
1. Trigger jump
2. Displays target mini program name and icon
3. User confirms jump
4. Jump to target mini program specified page
5. Can return to original mini program
FILE:references/examples/mobile-app.md
# Mobile App Test Examples
This file provides test case examples for mobile App specific scenarios.
## Example 1: Gesture Operation Test
**Test Case ID**: TC_APP_GESTURE_001
**Test Title**: Verify pull-down refresh function
**Test Type**: Functional Testing
**Function Module**: List Page
**Test Case Level**: P1
**Preconditions**:
1. App normally launched
2. Enter list page
**Test Steps**:
1. Pull down at top of list
2. Check refresh indicator display
3. Release finger
4. Check list data refresh
5. Check refresh time display
**Expected Results**:
1. Pull-down distance reaches threshold, refresh indicator displays
2. Indicator animation smooth
3. Release after trigger refresh
4. List data updates, displays latest
5. Refresh time updates to current time
---
## Example 2: Interruption Recovery Test
**Test Case ID**: TC_APP_INTERRUPT_001
**Test Title**: Verify form data retention after incoming call interruption
**Test Type**: Functional Testing
**Function Module**: Form Page
**Test Case Level**: P1
**Preconditions**:
1. App normally launched
2. Enter form filling page
3. Partially filled form
**Test Steps**:
1. Fill some form fields
2. Simulate incoming call
3. Answer call and wait 10 seconds
4. Hang up call
5. Return to App
**Expected Results**:
1. Form fields display filled content
2. Incoming call interface displays
3. Call normally answered
4. Call ended
5. Form data complete retention, no loss
---
## Example 3: Network Switching Test
**Test Case ID**: TC_APP_NETWORK_001
**Test Title**: Verify request handling during WiFi to 4G switching
**Test Type**: Functional Testing
**Function Module**: Network Request
**Test Case Level**: P1
**Preconditions**:
1. App connected to WiFi
2. Enter page with network request
**Test Steps**:
1. Trigger network request
2. During request, switch to 4G network
3. Check request result
4. Check page display
**Expected Results**:
1. Request sent
2. Network switching successful
3. Request normally returns or auto retry
4. Page data displays normally, no error
---
## Example 4: Permission Management Test
**Test Case ID**: TC_APP_PERMISSION_001
**Test Title**: Verify camera permission request and handling
**Test Type**: Functional Testing
**Function Module**: Permission Management
**Test Case Level**: P1
**Preconditions**:
1. App first install, no camera permission
2. Enter page requiring camera
**Test Steps**:
1. Click camera button
2. Check permission request popup
3. Click deny
4. Check function degradation
5. Click re-request
6. Click agree
**Expected Results**:
1. Permission request popup displays, explains purpose
2. User clicks deny
3. Function gracefully degrades, prompts user to enable
4. Re-request permission
5. User clicks agree
6. Camera function normally uses
---
## Example 5: Push Notification Test
**Test Case ID**: TC_APP_PUSH_001
**Test Title**: Verify click push notification jump to specified page
**Test Type**: Functional Testing
**Function Module**: Push Notification
**Test Case Level**: P1
**Preconditions**:
1. App has push permission
2. User logged in
3. App in background
**Test Steps**:
1. Send push notification with specified page parameters
2. User clicks push notification
3. Check App launch
4. Check jump page
5. Check page data loading
**Expected Results**:
1. Push notification received
2. App launches
3. Jump to specified page
4. Page parameters correctly passed
5. Page data loads normally
---
## Example 6: Accessibility Test
**Test Case ID**: TC_APP_ACCESSIBILITY_001
**Test Title**: Verify VoiceOver/TalkBack compatibility
**Test Type**: Accessibility Testing
**Function Module**: Accessibility
**Test Case Level**: P2
**Preconditions**:
1. App normally launched
2. System VoiceOver/TalkBack enabled
**Test Steps**:
1. Use VoiceOver/TalkBack browse page
2. Click button
3. Input text
4. Check voice feedback
**Expected Results**:
1. Voice correctly reads element labels
2. Button click has voice feedback
3. Input content has voice feedback
4. All functions can be completed through voice
FILE:references/examples/mobile-web.md
# Mobile Web Test Examples
This file provides test case examples for mobile Web specific scenarios.
## Example 1: Responsive Layout Test
**Test Case ID**: TC_H5_LAYOUT_001
**Test Title**: Verify page layout at different screen widths
**Test Type**: UI Testing
**Function Module**: Page Layout
**Test Case Level**: P1
**Preconditions**:
1. Page normally loaded
**Test Steps**:
1. View page at 320px width
2. View page at 375px width
3. View page at 414px width
4. View page at 768px width
5. Check element arrangement
**Expected Results**:
1. 320px: Content normally displays, no horizontal scroll
2. 375px: Layout reasonable, elements not crowded
3. 414px: Layout comfortable, spacing appropriate
4. 768px: May switch to tablet layout
5. Element arrangement conforms to responsive design
---
## Example 2: Touch Interaction Test
**Test Case ID**: TC_H5_TOUCH_001
**Test Title**: Verify pull-down refresh trigger
**Test Type**: Functional Testing
**Function Module**: List Page
**Test Case Level**: P1
**Preconditions**:
1. Page normally loaded
2. At top of list
**Test Steps**:
1. Pull down at top of page
2. Check refresh indicator
3. Release finger
4. Check list refresh
**Expected Results**:
1. Pull-down distance reaches threshold, indicator displays
2. Indicator animation smooth
3. Release triggers refresh
4. List data updates
---
## Example 3: Browser Compatibility Test
**Test Case ID**: TC_H5_BROWSER_001
**Test Title**: Verify function normal in WeChat built-in browser
**Test Type**: Compatibility Testing
**Function Module**: Browser Compatibility
**Test Case Level**: P1
**Preconditions**:
1. Open page in WeChat
**Test Steps**:
1. Browse page content
2. Click button
3. Submit form
4. Play video
5. Use share function
**Expected Results**:
1. Page content displays normally
2. Button click effective
3. Form submits normally
4. Video plays normally (note: autoplay may be restricted)
5. Share function normally calls WeChat share
---
## Example 4: Viewport Configuration Test
**Test Case ID**: TC_H5_VIEWPORT_001
**Test Title**: Verify notch screen safe area adaptation
**Test Type**: UI Testing
**Function Module**: Viewport
**Test Case Level**: P2
**Preconditions**:
1. Use notch screen device
2. Page normally loaded
**Test Steps**:
1. View page in portrait
2. Check top navigation bar position
3. Check bottom button position
4. Switch to landscape
5. Check content display
**Expected Results**:
1. Page normally displays
2. Navigation bar not blocked by notch
3. Bottom button not blocked by home indicator
4. Landscape layout normal
5. Content not blocked by notch
---
## Example 5: H5 Specific Features Test
**Test Case ID**: TC_H5_FEATURE_001
**Test Title**: Verify tel: link jump to dial
**Test Type**: Functional Testing
**Function Module**: H5 Features
**Test Case Level**: P1
**Preconditions**:
1. Page has tel: link
**Test Steps**:
1. Click phone number link
2. Check system response
3. Confirm dial
**Expected Results**:
1. Click link
2. System dial interface pops up, number filled
3. User can confirm dial
---
## Example 6: Third-party Login Test
**Test Case ID**: TC_H5_LOGIN_001
**Test Title**: Verify WeChat H5 login process
**Test Type**: Functional Testing
**Function Module**: Third-party Login
**Test Case Level**: P0
**Preconditions**:
1. User not logged in
2. In WeChat environment
**Test Steps**:
1. Click login button
2. Authorize WeChat login
3. Check callback
4. Check login state
**Expected Results**:
1. Jump to WeChat authorization page
2. User clicks agree
3. Callback returns to page, carries code
4. Login successful, user info displays
---
## Example 7: WebView Specific Test
**Test Case ID**: TC_H5_WEBVIEW_001
**Test Title**: Verify JSBridge call native camera
**Test Type**: Functional Testing
**Function Module**: WebView
**Test Case Level**: P1
**Preconditions**:
1. Page in App WebView
2. JSBridge normally configured
**Test Steps**:
1. Click camera button
2. Check JSBridge call
3. Native camera opens
4. Take photo
5. Check callback
**Expected Results**:
1. Trigger JSBridge call
2. Native camera interface opens
3. User takes photo
4. Photo returns to H5
5. H5 displays photo
FILE:references/examples/pc-web.md
# PC Web Test Examples
This file provides test case examples for PC Web specific scenarios.
## Example 1: Keyboard Navigation Test
**Test Case ID**: TC_WEB_KEYBOARD_001
**Test Title**: Verify Tab key focus order
**Test Type**: Accessibility Testing
**Function Module**: Keyboard Navigation
**Test Case Level**: P1
**Preconditions**:
1. Page normally loaded
**Test Steps**:
1. Press Tab key
2. Check focus position
3. Continue pressing Tab
4. Check focus order
5. Press Shift+Tab
**Expected Results**:
1. First focusable element gets focus
2. Focus indicator clearly visible
3. Focus moves to next element in order
4. Focus order conforms to page structure
5. Shift+Tab moves focus to previous element
---
## Example 2: Form Interaction Test
**Test Case ID**: TC_WEB_FORM_001
**Test Title**: Verify form auto-complete
**Test Type**: Functional Testing
**Function Module**: Form
**Test Case Level**: P1
**Preconditions**:
1. User has saved form data in browser
**Test Steps**:
1. Click input field
2. Check auto-complete suggestion
3. Select suggested value
4. Check form fill
**Expected Results**:
1. Input field gets focus
2. Browser displays auto-complete suggestion
3. User selects suggestion
4. Form automatically fills corresponding fields
---
## Example 3: Multi-window Test
**Test Case ID**: TC_WEB_WINDOW_001
**Test Title**: Verify cross-window data synchronization
**Test Type**: Functional Testing
**Function Module**: Multi-window
**Test Case Level**: P1
**Preconditions**:
1. Page opened in two tabs
**Test Steps**:
1. Modify data in Tab A
2. Switch to Tab B
3. Check data display
4. Refresh Tab B
**Expected Results**:
1. Tab A data modification successful
2. Switch to Tab B
3. Tab B data synchronizes update (if using real-time sync)
4. After refresh, Tab B data consistent with Tab A
---
## Example 4: Routing Test
**Test Case ID**: TC_WEB_ROUTING_001
**Test Title**: Verify route guard redirect when not logged in
**Test Type**: Security Testing
**Function Module**: Routing
**Test Case Level**: P0
**Preconditions**:
1. User not logged in
**Test Steps**:
1. Enter authenticated page URL in address bar
2. Press Enter
3. Check page jump
4. Check URL change
**Expected Results**:
1. Enter URL
2. Page loads
3. Route guard detects not logged in, redirects to login page
4. URL changes to login page address
---
## Example 5: Drag Interaction Test
**Test Case ID**: TC_WEB_DRAG_001
**Test Title**: Verify drag sort function
**Test Type**: Functional Testing
**Function Module**: Drag
**Test Case Level**: P1
**Preconditions**:
1. Page has sortable list
**Test Steps**:
1. Mouse press list item
2. Drag to target position
3. Release mouse
4. Check list order
5. Refresh page
**Expected Results**:
1. Item follows mouse movement
2. Drag process has visual feedback
3. Release after item drops to new position
4. List order updates
5. After refresh, order persists
---
## Example 6: Rich Text Editor Test
**Test Case ID**: TC_WEB_EDITOR_001
**Test Title**: Verify paste from Word
**Test Type**: Functional Testing
**Function Module**: Rich Text Editor
**Test Case Level**: P1
**Preconditions**:
1. Rich text editor normally loaded
2. Word document has formatted content
**Test Steps**:
1. Copy content from Word
2. Paste into editor
3. Check content format
4. Check style cleanup
**Expected Results**:
1. Content copied
2. Successfully pasted into editor
3. Text content complete
4. Redundant styles cleaned, conform to editor specifications
---
## Example 7: Print Function Test
**Test Case ID**: TC_WEB_PRINT_001
**Test Title**: Verify print preview content
**Test Type**: Functional Testing
**Function Module**: Print
**Test Case Level**: P2
**Preconditions**:
1. Page has print button
**Test Steps**:
1. Click print button
2. Check print preview
3. Check page settings
4. Cancel print
**Expected Results**:
1. Print preview window opens
2. Preview content complete, hides unnecessary elements
3. Page settings (A4, margins) correct
4. Cancel print, return to page
---
## Example 8: Dark Mode Test
**Test Case ID**: TC_WEB_DARK_001
**Test Title**: Verify dark mode color contrast
**Test Type**: UI Testing
**Function Module**: Dark Mode
**Test Case Level**: P2
**Preconditions**:
1. Page supports dark mode
**Test Steps**:
1. Switch system to dark mode
2. Check page background
3. Check text color
4. Check icon color
5. Use contrast detection tool
**Expected Results**:
1. Page switches to dark theme
2. Background color is dark
3. Text color is light, contrast sufficient
4. Icon color adapts to dark theme
5. Contrast ratio ≥4.5:1
FILE:references/core-capabilities/common-testing.md
# General Testing Capabilities
This document integrates core methods for test case design, test type frameworks, linkage testing, routing testing, UI visual testing, API testing, and security testing, applicable to test case design across all platforms.
## Table of Contents
| Line | Chapter |
|------|------|
| 22 | Part 1: Test Case Design Methods |
| 87 | Part 2: Test Case Quality Standards |
| 116 | Part 3: Linkage Testing |
| 160 | Part 4: Routing Testing |
| 215 | Part 5: UI Visual Testing |
| 301 | Part 6: API Testing |
| 376 | Part 7: Security Testing |
| 444 | Part 8: Page Interaction Testing |
| 479 | Part 9: Component Interaction Testing |
| 512 | Part 10: Interaction Animation Testing |
---
## Part 1: Test Case Design Methods
### 1.1 Equivalence Partitioning
**Definition**: Divide all possible input data into several equivalence classes, selecting a few representative data points from each class as test cases.
**Steps**:
1. Analyze requirements specifications to determine the set of input conditions
2. Partition valid equivalence classes (reasonable, meaningful inputs)
3. Partition invalid equivalence classes (unreasonable, meaningless inputs)
4. Number each equivalence class
5. Design test cases covering valid equivalence classes
6. Design test cases covering invalid equivalence classes
**Example**: Username input field (6-18 alphanumeric characters)
- Valid equivalence class: 6-18 alphanumeric combinations
- Invalid equivalence class: Less than 6 characters, more than 18 characters, contains special characters, empty value
---
### 1.2 Boundary Value Analysis
**Definition**: Test boundary values of inputs and outputs, as errors often occur near boundaries.
**Boundary Types**: Upper bound, lower bound, minimum value, maximum value, empty value, first value, last value
**Example**: Password length 6-18 characters
- Boundary tests: 5 characters, 6 characters, 18 characters, 19 characters
---
### 1.3 Scenario-Based Method
**Definition**: Based on business process diagrams, design test cases by simulating user operation scenarios.
**Scenario Types**:
- Basic flow (normal process)
- Alternative flows (exception processes, branch processes)
---
### 1.4 Error Guessing Method
**Definition**: Based on tester's experience and intuition, guess potential errors in the system and design targeted test cases.
**Common Error Points**: Empty input, special character input, network exceptions, repeated operations, timeout handling
---
### 1.5 Cause-Effect Graphing
**Definition**: Analyze relationships between input conditions (causes) and output results (effects), represent with cause-effect graphs, then convert to decision tables.
**Applicable Scenarios**: Multiple input condition combinations with complex logical relationships
---
### 1.6 Orthogonal Experimental Method
**Definition**: Use orthogonal tables to select appropriate, representative test cases from comprehensive testing.
**Applicable Scenarios**: Multi-factor multi-level combination testing
---
## Part 2: Test Case Quality Standards
### 2.1 Completeness
- Cover all functional points
- Cover normal and exception scenarios
- Cover boundary conditions
### 2.2 Accuracy
- Step descriptions are clear and unambiguous
- Expected results are explicit and verifiable
- No redundant steps
### 2.3 Executability
- Preconditions are achievable
- Steps are operable
- Results are verifiable
### 2.4 Maintainability
- Clear structure
- Easy to understand and modify
- High reusability
### 2.5 Traceability
- Traceable to requirements
- Traceable to defects
- Clear version history
---
## Part 3: Linkage Testing
### 3.1 Form Linkage
| Test Scenario | Test Points |
|---------|---------|
| Province-City-District three-level linkage | Select province, city list updates; select city, district list updates; modify parent option, child automatically resets |
| Payment method linkage | Different payment methods display different form fields; switching payment methods clears entered data |
| Category selection linkage | Child category resets when parent category changes; options affect each other |
### 3.2 List Linkage
| Test Scenario | Test Points |
|---------|---------|
| Master-detail list linkage | Select master item, detail list filters display |
| Filter condition linkage | Multi-condition filters apply in real-time; clearing single condition doesn't affect others |
| Sort linkage | List reorders when sorting changes; sort state persists |
### 3.3 Search Linkage
| Test Scenario | Test Points |
|---------|---------|
| Keyword suggestion | Real-time display of suggestions during input; suggestions accurately match |
| Search history linkage | Display recent search terms; click history term to execute search |
| Popular search linkage | Display popular search terms; click to jump to search results |
### 3.4 State Linkage
| Test Scenario | Test Points |
|---------|---------|
| Button state linkage | Submit button only enabled when form is complete; disabled button is not clickable |
| Menu state linkage | Selected menu highlighted; insufficient permission menus hidden or disabled |
| Selection state linkage | List item selection state correct; batch operations enabled based on selection state |
### 3.5 Data Linkage
| Test Scenario | Test Points |
|---------|---------|
| Real-time data synchronization | Multi-page data updates in real-time; no manual refresh needed |
| Multi-device data synchronization | Mobile and PC data consistent; data persists when switching devices |
| Cache synchronization | Cache and database data consistent; cache expiration handled correctly |
---
## Part 4: Routing Testing
### 4.1 Direct Access
| Test Scenario | Test Points |
|---------|---------|
| Direct access to homepage | URL correct, page loads normally |
| Direct access to detail page | URL contains correct parameters, page displays correct content |
| Direct access to list page | URL parameters parsed correctly, list data correct |
| Direct access to personal center | Redirect to login if not logged in; display user info if logged in |
### 4.2 Navigation Jump
| Test Scenario | Test Points |
|---------|---------|
| Navigation bar click | Click to jump to correct page; navigation highlights current item |
| Breadcrumb navigation | Click breadcrumb to return to parent; breadcrumb path correct |
| Bottom/side navigation | Switch bottom tabs; side menu expand/collapse |
| Button click jump | Click button to jump to correct page; jump parameters correct |
### 4.3 Browser Navigation
| Test Scenario | Test Points |
|---------|---------|
| Browser back | Return to previous page; page state persists |
| Browser forward | Forward to next page; state persists |
| Browser refresh | Page data refreshes; current state not lost |
| History records | URL history correctly recorded; deep links accessible |
### 4.4 Deep Links
| Test Scenario | Test Points |
|---------|---------|
| External link open | Open specified page from WeChat/SMS; parameters passed correctly |
| Push notification open | Click push notification to open app specified page |
| Share link open | Share link correctly opens app or H5 page |
### 4.5 Error Pages
| Test Scenario | Test Points |
|---------|---------|
| 404 page | Display friendly 404 page; provide link to return to homepage |
| 403 page | Prompt no permission; provide entry to request permission |
| 500 page | Prompt server error; provide retry button |
### 4.6 Route Guards
| Test Scenario | Test Points |
|---------|---------|
| Login verification | Redirect to login page when accessing authenticated pages without login |
| Permission verification | Redirect to 403 page when accessing without permission |
| Post-login jump | Return to original page or jump to homepage after successful login |
---
## Part 5: UI Visual Testing
### 5.1 Layout Testing
| Check Item | Description |
|-------|------|
| Alignment | Element left/center/right alignment correct |
| Spacing consistency | Element spacing uniform; conforms to design specifications |
| Hierarchy structure | z-index level correct; overlay layer correctly covers |
| Responsive layout | Layout normal at different screen widths; no element overflow or overlap |
| Reasonable whitespace | Page margins, element spacing appropriate |
| Visual balance | Page visual center balanced or conforms to design intent |
### 5.2 Color Testing
| Check Item | Description |
|-------|------|
| Brand color | Primary color conforms to brand specifications |
| Auxiliary color | Secondary colors used correctly |
| State color | Success/failure/warning colors conform to specifications |
| Contrast | Text to background contrast ratio ≥4.5:1 |
| Theme adaptation | Light/dark theme colors correct |
| Color blind friendly | Important information not distinguished by color alone |
### 5.3 Font Testing
| Check Item | Description |
|-------|------|
| Font family | Correct font used; fallback fonts normal |
| Font size hierarchy | Title, body, auxiliary text sizes clearly distinguished |
| Line height | Line height appropriate; text not overlapping |
| Font weight | Title/body/auxiliary font weights correct |
| Text truncation | Long text correctly truncated with ellipsis |
| Multi-language adaptation | Chinese/English font switching normal; special characters display normal |
### 5.4 Icon Testing
| Check Item | Description |
|-------|------|
| Icon style | Icon style uniform (linear/filled) |
| Icon size | Icon size conforms to design specifications |
| Icon semantics | Icon meaning clear; no ambiguity |
| Icon state | Default/hover/click/disabled states correct |
| Icon clarity | Icons clear not blurry; not distorted |
### 5.5 Image Testing
| Check Item | Description |
|-------|------|
| Image quality | Images clear not distorted; compression ratio appropriate |
| Image ratio | Different ratio images display correctly; no stretching distortion |
| Loading state | Display placeholder/skeleton screen during loading |
| Error state | Display error placeholder when image fails to load |
| Lazy loading | First screen images load first; non-first screen delayed loading |
### 5.6 Animation Testing
| Check Item | Description |
|-------|------|
| Animation curve | Animation curve natural; conforms to intuition |
| Animation duration | Animation duration appropriate; not too fast or slow |
| Animation performance | Animation smooth ≥50fps; no lag |
| Animation interruptible | Rapid continuous operations can interrupt animation |
| No flickering | Animation has no visual flickering |
### 5.7 Interaction State Testing
| Check Item | Description |
|-------|------|
| Default state | Element default style correct |
| Hover state | Mouse hover style correct |
| Click state | Click feedback correct |
| Disabled state | Disabled element style clearly distinguished |
| Focus state | Keyboard focused element has clear indicator |
### 5.8 Multi-theme Testing
| Check Item | Description |
|-------|------|
| Light theme | Light theme displays correctly |
| Dark theme | Dark theme displays correctly; color contrast sufficient |
| Theme switching | Theme switching smooth; no flickering |
| Theme memory | Theme setting persists after refresh |
---
## Part 6: API Testing
### 6.1 Functional Testing
| Test Scenario | Test Points |
|---------|---------|
| GET request | Normal query single/list data; query with parameters; empty/type error parameter handling |
| POST request | Normal resource creation; required field validation; field format validation; duplicate creation handling |
| PUT/PATCH request | Full update/partial update; update non-existent resource; concurrent update handling |
| DELETE request | Normal deletion; delete non-existent resource; cascade deletion; soft deletion |
| Batch operations | Batch create/update/delete; partial success handling; transaction rollback |
### 6.2 Status Code Validation
| Status Code | Description |
|-------|------|
| 200 OK | Normal response |
| 201 Created | Creation successful |
| 204 No Content | Deletion successful |
| 400 Bad Request | Parameter error |
| 401 Unauthorized | Not authenticated |
| 403 Forbidden | No permission |
| 404 Not Found | Resource does not exist |
| 409 Conflict | Resource conflict |
| 422 Unprocessable | Validation failed |
| 500 Internal Error | Server error |
### 6.3 Data Validation
| Test Scenario | Test Points |
|---------|---------|
| Field validation | Required fields, type, length, format, range validation |
| Business rules | Uniqueness constraints, foreign key constraints, state transition rules |
| Data consistency | Database write validation, cache synchronization validation |
### 6.4 Authentication & Authorization
| Test Scenario | Test Points |
|---------|---------|
| Token authentication | Token generation, refresh, expiration, revocation |
| Permission control | Role permissions, resource permissions, data permissions validation |
### 6.5 Performance Testing
| Test Scenario | Test Points |
|---------|---------|
| Response time | Single API response time; P95/P99 latency |
| Concurrency testing | Concurrent users; throughput (QPS/TPS) |
| Stress testing | Peak stress; sustained stress; crash point |
| Stability | Long-time running; memory leak detection |
### 6.6 Error Handling
| Test Scenario | Test Points |
|---------|---------|
| Error response | Error code specifications; error message clarity |
| Exception handling | Database exceptions, third-party service exceptions, network exceptions, timeout handling |
| Retry mechanism | Automatic retry; retry count limit; idempotency guarantee |
### 6.7 Pagination & Sorting
| Test Scenario | Test Points |
|---------|---------|
| Pagination | Page number parameter, items per page, total count, out-of-bounds handling |
| Sorting | Single/multi-field sorting; sort direction; default sorting |
### 6.8 Search & Filtering
| Test Scenario | Test Points |
|---------|---------|
| Search | Exact search, fuzzy search, full-text search, multi-condition combination |
| Filtering | Time range, status, category, custom filtering |
---
## Part 7: Security Testing
### 7.1 Injection Attack Protection
| Test Scenario | Test Points |
|---------|---------|
| SQL injection | Classic injection, blind injection, time-based blind injection, union query, stacked injection |
| NoSQL injection | MongoDB injection, Redis injection |
| Command injection | OS command injection, path traversal, file inclusion |
### 7.2 XSS Protection
| Test Scenario | Test Points |
|---------|---------|
| Reflected XSS | URL parameter injection, form input injection |
| Stored XSS | Comment storage, profile storage, message storage |
| DOM-based XSS | document.write injection, innerHTML injection, eval injection |
| Protection measures | Input filtering, output encoding, CSP policy, HttpOnly flag |
### 7.3 Authentication Security
| Test Scenario | Test Points |
|---------|---------|
| Password security | Password strength validation, encrypted storage, transmission encryption |
| Multi-factor authentication | SMS verification code, email verification code, TOTP verification |
| Brute force protection | Login failure limit, account lockout, CAPTCHA mechanism |
### 7.4 Session Management
| Test Scenario | Test Points |
|---------|---------|
| Session security | Session ID secure generation, timeout setting, fixation attack protection |
| Cookie security | Secure, HttpOnly, SameSite flags |
### 7.5 Access Control
| Test Scenario | Test Points |
|---------|---------|
| Horizontal privilege escalation | User A accesses user B data; same-level resource access |
| Vertical privilege escalation | Regular user accesses admin functions; unauthorized backend access |
| Data permissions | Department data isolation, role data isolation, sensitive data masking |
### 7.6 CSRF Protection
| Test Scenario | Test Points |
|---------|---------|
| CSRF attacks | GET request CSRF, POST request CSRF, AJAX request CSRF |
| CSRF protection | Token validation, Referer validation, SameSite Cookie, secondary confirmation |
### 7.7 File Upload Security
| Test Scenario | Test Points |
|---------|---------|
| File type | Whitelist validation, MIME type validation, bypass detection |
| File size | Oversized file limit, compression bomb protection |
| File content | Content validation, virus scanning |
| Storage security | Upload directory permissions, access control, download validation |
### 7.8 Business Logic Security
| Test Scenario | Test Points |
|---------|---------|
| Payment security | Amount tampering, duplicate payment, payment status forgery, coupon abuse |
| Race conditions | Concurrent ordering, concurrent coupon claiming, inventory overselling |
| Business process | Step skipping, duplicate submission, state rollback |
---
## Part 8: Page Interaction Testing
### 8.1 Page Loading
- First load/refresh/weak network/offline loading
- Loading timeout handling
- Loading failure retry
- Skeleton screen display
### 8.2 Page Navigation
- Navigation bar displays correctly
- Back button, history records
- Deep link open page
### 8.3 Page Switching
- Tab switching/modal window/drawer/dialog
- Switching animation smooth
- State persistence, data refresh
### 8.4 Form Interaction
- Input field focus/blur
- Input validation, error prompts
- Auto-fill, input restrictions
### 8.5 List Interaction
- Pull-down refresh, pull-up load more
- List item operations (click, swipe, long press)
- List sorting, filtering
### 8.6 Dialog Interaction
- Overlay layer, close button
- ESC key close
- Multi-layer dialogs, dialog nesting
---
## Part 9: Component Interaction Testing
### 9.1 Button Component
- Normal/hover/click/disabled states
- Rapid continuous click handling
- Loading state, permission control
### 9.2 Input Component
- Special characters,超长文本
- Copy paste, clear input
- Input hints, error prompts
### 9.3 Dropdown Component
- Expand/collapse, option search
- Multi-select, cascade selection
- Keyboard operation
### 9.4 Table Component
- Column sorting, data filtering
- Pagination switching, row operations
- Batch operations, table export
### 9.5 Carousel Component
- Auto/manual switching
- Indicators, infinite loop
- Pause carousel
### 9.6 Tabs Component
- Click/slide switching
- Close tabs, drag sorting
---
## Part 10: Interaction Animation Testing
### 10.1 Transition Animation
- Page switching animation
- Component appear/disappear
- Animation interruptible
### 10.2 Feedback Animation
- Button click ripple
- Loading spinner, success/failure feedback
- Progress bar animation
### 10.3 Gesture Animation
- List slide inertia
- Image zoom, drag sorting
- Pull-down refresh bounce, side slide menu
### 10.4 Performance Optimization
- Animation frame rate ≥50fps
- No lag, reasonable memory usage
- GPU acceleration
---
FILE:references/checklists/common-checklist.md
# General Testing Checklist
This document integrates checklists for functional testing, linkage testing, routing testing, UI visual testing, API testing, and security testing, applicable to test case execution across all platforms.
## Table of Contents
| Line | Chapter |
|------|------|
| 19 | Part 1: Functional Testing Checklist |
| 65 | Part 2: Linkage Testing Checklist |
| 110 | Part 3: Routing Testing Checklist |
| 161 | Part 4: UI Visual Testing Checklist |
| 232 | Part 5: API Testing Checklist |
| 307 | Part 6: Security Testing Checklist |
| 410 | Check Completion Record |
---
## Part 1: Functional Testing Checklist
### Test Coverage
- [ ] All function points covered
- [ ] Normal process covered
- [ ] Exception process covered
- [ ] Boundary conditions covered
- [ ] Special scenarios covered
### Function Correctness
- [ ] Functions implemented according to requirements
- [ ] Business logic correct
- [ ] Data processing correct
- [ ] State transition correct
- [ ] Permission control correct
### Input Validation
- [ ] Valid input handled correctly
- [ ] Invalid input prompts friendly
- [ ] Boundary values handled correctly
- [ ] Special characters handled correctly
- [ ] Empty values handled correctly
### Output Validation
- [ ] Display content correct
- [ ] Data format correct
- [ ] Sorting correct
- [ ] Filtering correct
- [ ] Statistics correct
### Interaction Testing
- [ ] User operation process smooth
- [ ] Page jumps correct
- [ ] Button functions correct
- [ ] Form submission correct
- [ ] List operations correct
### Data Consistency
- [ ] Frontend and backend data consistent
- [ ] Multi-device data consistent
- [ ] Cache and database consistent
- [ ] History records correct
- [ ] Real-time data correct
---
## Part 2: Linkage Testing Checklist
### Form Linkage
- [ ] Province-City-District linkage
- [ ] Category selection linkage
- [ ] Conditional show/hide
- [ ] Data cascade
- [ ] Form validation linkage
- [ ] Submit button state linkage
### List Linkage
- [ ] Master-detail list linkage
- [ ] Filter condition linkage
- [ ] Sorting linkage
- [ ] Pagination linkage
- [ ] Selection state linkage
### Search Linkage
- [ ] Search keyword suggestion
- [ ] Search result linkage
- [ ] Search history linkage
- [ ] Popular search linkage
### State Linkage
- [ ] Button state linkage
- [ ] Menu state linkage
- [ ] Tab state linkage
- [ ] Icon state linkage
- [ ] Color state linkage
### Data Linkage
- [ ] Real-time data synchronization
- [ ] Multi-device data synchronization
- [ ] Cache and database synchronization
- [ ] Local and remote synchronization
- [ ] Two-way data binding
### Page Linkage
- [ ] Page parameter passing
- [ ] Page state synchronization
- [ ] Multi-window linkage
- [ ] iframe linkage
---
## Part 3: Routing Testing Checklist
### Direct Access
- [ ] Direct access to homepage URL
- [ ] Direct access to detail page URL
- [ ] Direct access to list page URL
- [ ] Direct access to personal center page URL
### Navigation Jump
- [ ] Navigation bar click jump
- [ ] Breadcrumb navigation jump
- [ ] Bottom navigation jump
- [ ] Sidebar navigation jump
- [ ] Tab switching
- [ ] Button click jump
### Browser Navigation
- [ ] Browser back
- [ ] Browser forward
- [ ] Browser refresh
- [ ] History records
### Deep Links
- [ ] External link open App specified page
- [ ] Push notification open specified page
- [ ] Share link open specified page
### Error Pages
- [ ] 404 page display
- [ ] 403 page display
- [ ] 500 page display
### Routing Parameters
- [ ] URL parameter passing
- [ ] URL parameter parsing
- [ ] Missing parameter handling
- [ ] Wrong parameter handling
### Route Guards
- [ ] Login verification
- [ ] Permission verification
- [ ] Not logged in redirect to login page
- [ ] No permission redirect to 403
### Routing Performance
- [ ] Route switching smooth
- [ ] Page loading fast
- [ ] Route animation smooth
---
## Part 4: UI Visual Testing Checklist
### Layout Testing
- [ ] Alignment correct
- [ ] Spacing consistent
- [ ] Hierarchy structure clear
- [ ] Responsive layout adaptation
- [ ] Elements not overlapping
- [ ] Content not overflowing
- [ ] Whitespace reasonable
- [ ] Visual balance
### Color Testing
- [ ] Brand color correct
- [ ] Auxiliary color correct
- [ ] State color correct (success/failure/warning)
- [ ] Contrast conforms to WCAG standards
- [ ] Dark mode adaptation
- [ ] Light mode adaptation
- [ ] Color semantics correct
- [ ] Color blind friendly
### Font Testing
- [ ] Font family correct
- [ ] Font size hierarchy clear
- [ ] Line height appropriate
- [ ] Font weight correct
- [ ] Font color contrast sufficient
- [ ] Text not truncated
- [ ] Multi-language font adaptation
- [ ] Special characters display normal
### Icon Testing
- [ ] Icon style consistent
- [ ] Icon size uniform
- [ ] Icon semantics clear
- [ ] Icon states correct (default/hover/click/disabled)
- [ ] Icon clarity sufficient
- [ ] Icon loading normal
### Image Testing
- [ ] Image quality clear
- [ ] Image ratio correct
- [ ] Loading state displays placeholder
- [ ] Error state displays error image
- [ ] Image lazy loading normal
- [ ] Image compression appropriate
### Animation Testing
- [ ] Animation curve natural
- [ ] Animation duration appropriate
- [ ] Animation performance smooth (≥50fps)
- [ ] Animation semantics clear
- [ ] Animation interruptible
- [ ] No animation flickering
### Interaction State Testing
- [ ] Default state correct
- [ ] Hover state correct
- [ ] Click state correct
- [ ] Disabled state correct
- [ ] Focus state correct
### Multi-theme Testing
- [ ] Light theme normal
- [ ] Dark theme normal
- [ ] Theme switching smooth
- [ ] Theme memory correct
---
## Part 5: API Testing Checklist
### Usage Instructions
- ✅ Check item by item to ensure coverage
- 🔴 Record issues immediately when found
- 📝 Add business-specific check items
---
### Functional Testing
- [ ] GET request returns normally
- [ ] POST creates resource successfully
- [ ] PUT/PATCH updates successfully
- [ ] DELETE deletes successfully
- [ ] Batch operations correct
- [ ] Status code conforms to specification
- [ ] Error response clear
### Data Validation
- [ ] Required field validation
- [ ] Field type validation
- [ ] Field format validation
- [ ] Field length validation
- [ ] Field range validation
- [ ] Uniqueness validation
- [ ] Business rule validation
### Authentication & Authorization
- [ ] Token authentication normal
- [ ] Unauthenticated access denied
- [ ] Unauthorized access denied
- [ ] Token expiration handling
- [ ] Token refresh normal
- [ ] Permission isolation correct
### Performance Testing
- [ ] Response time meets standard (P95 < 500ms)
- [ ] Concurrency test passed
- [ ] Stress test passed
- [ ] No memory leak
- [ ] Connection pool normal
### Error Handling
- [ ] Error code specification
- [ ] Error message clear
- [ ] Exception capture
- [ ] Log recording
- [ ] Retry mechanism
- [ ] Idempotency guarantee
### Pagination & Sorting
- [ ] Pagination parameters normal
- [ ] Total count correct
- [ ] Sorting function normal
- [ ] Default sorting reasonable
### Search & Filtering
- [ ] Exact search normal
- [ ] Fuzzy search normal
- [ ] Multi-condition combination correct
- [ ] Filtering function normal
### Version Management
- [ ] Version control correct
- [ ] Backward compatible
- [ ] Version documentation complete
### API Documentation
- [ ] Swagger/OpenAPI specification
- [ ] Parameter description complete
- [ ] Examples clear
- [ ] Error code documentation
---
## Part 6: Security Testing Checklist
### Usage Instructions
- ✅ Check item by item to ensure coverage
- 🔴 Report security issues immediately when found
- 📝 Test in authorized environment
- ⚠️ Follow OWASP Top 10
---
### Injection Attack Protection
- [ ] SQL injection protection (parameterized queries)
- [ ] NoSQL injection protection
- [ ] Command injection protection
- [ ] Path traversal protection
- [ ] File inclusion protection
### XSS Protection
- [ ] Reflected XSS protection
- [ ] Stored XSS protection
- [ ] DOM-based XSS protection
- [ ] Input filtering
- [ ] Output encoding
- [ ] CSP policy setting
- [ ] HttpOnly flag
### Authentication Security
- [ ] Password strength validation
- [ ] Password encrypted storage
- [ ] Password transmission encryption
- [ ] Multi-factor authentication
- [ ] Login failure limit
- [ ] Account lockout mechanism
- [ ] CAPTCHA mechanism
### Session Management
- [ ] Session ID secure generation
- [ ] Session timeout setting
- [ ] Session fixation attack protection
- [ ] Cookie security flags (Secure, HttpOnly)
- [ ] Single sign-on security
### Access Control
- [ ] Horizontal privilege escalation protection
- [ ] Vertical privilege escalation protection
- [ ] Data permission isolation
- [ ] Sensitive data masking
### Sensitive Information Protection
- [ ] API does not return sensitive fields
- [ ] No hardcoded keys in frontend
- [ ] Log desensitization processing
- [ ] Error information not exposed
- [ ] HTTPS enforced
- [ ] TLS version latest
- [ ] Database encryption
### CSRF Protection
- [ ] CSRF Token validation
- [ ] Referer validation
- [ ] SameSite Cookie setting
- [ ] Key operations secondary confirmation
### File Upload Security
- [ ] File type whitelist
- [ ] File content validation
- [ ] File size limit
- [ ] Virus scanning
- [ ] Upload directory permissions
- [ ] File access control
### Business Logic Security
- [ ] Payment amount tampering protection
- [ ] Duplicate payment protection
- [ ] Concurrent competition handling
- [ ] Inventory overselling protection
- [ ] Coupon abuse protection
- [ ] Business process step skipping protection
### API Security
- [ ] Token security protection
- [ ] API rate limiting
- [ ] API quota limiting
- [ ] Operation log audit
- [ ] Abnormal detection alarm
### Security Configuration
- [ ] Directory listing disabled
- [ ] Error page customization
- [ ] HTTP method restriction
- [ ] Security header setting (X-Frame-Options etc.)
- [ ] Framework vulnerability repair
- [ ] Dependency library vulnerability repair
- [ ] Database minimum permissions
### Compliance Check
- [ ] GDPR compliance (if applicable)
- [ ] Cybersecurity Law compliance
- [ ] Level protection compliance
- [ ] Privacy policy complete
---
## Check Completion Record
| Check Item | Check Result | Issue Record | Fix Status |
|-------|---------|---------|---------|
| Functional Testing | ✅ Passed | - | - |
| Linkage Testing | Pending Check | - | - |
| Routing Testing | Pending Check | - | - |
| UI Visual Testing | Pending Check | - | - |
| API Testing | Pending Check | - | - |
| Security Testing | Pending Check | - | - |
FILE:references/checklists/desktop-checklist.md
# Desktop Testing Checklist
## Window Management (12 items)
- [ ] Window size adjustment
- [ ] Window maximize
- [ ] Window minimize
- [ ] Window restore
- [ ] Window drag move
- [ ] Multi-window management
- [ ] Window always on top
- [ ] Full screen mode
- [ ] Split screen mode
- [ ] Window state persistence
- [ ] Frameless window
- [ ] Modal window
## Keyboard Shortcuts (15 items)
- [ ] Copy paste
- [ ] Undo redo
- [ ] Select all
- [ ] Save
- [ ] Find replace
- [ ] Navigation shortcuts
- [ ] Function keys
- [ ] Custom shortcuts
- [ ] Shortcut conflict
- [ ] Shortcut disabled
- [ ] Cross-platform difference
- [ ] Shortcut hint
- [ ] Combination keys
- [ ] Long press shortcut
- [ ] Shortcut conflict resolution
## File Operations (14 items)
- [ ] File open
- [ ] Drag open file
- [ ] File save
- [ ] Save as
- [ ] Auto save
- [ ] File import
- [ ] File export
- [ ] Drag export
- [ ] Clipboard operation
- [ ] File association
- [ ] Recent files
- [ ] File lock
- [ ] Large file handling
- [ ] Network file
## System Integration (10 items)
- [ ] System tray icon
- [ ] Tray right-click menu
- [ ] Notification center
- [ ] Auto start on boot
- [ ] File association
- [ ] Protocol handling
- [ ] Right-click menu integration
- [ ] Taskbar integration
- [ ] Menu bar integration
- [ ] Share file
## Multi-monitor Adaptation (8 items)
- [ ] Single monitor
- [ ] Dual screen extend
- [ ] Multi-screen extend
- [ ] Duplicate mode
- [ ] Different resolution
- [ ] DPI zoom
- [ ] Window cross-screen
- [ ] Full screen multi-screen
## Peripheral Support (10 items)
- [ ] Mouse left button
- [ ] Mouse right button
- [ ] Mouse wheel
- [ ] Mouse side button
- [ ] Mouse middle button
- [ ] Touchpad gesture
- [ ] Touch screen
- [ ] Printer
- [ ] Scanner
- [ ] Other peripherals
## System Compatibility (12 items)
- [ ] Windows 10
- [ ] Windows 11
- [ ] macOS different versions
- [ ] Intel chip
- [ ] ARM64 chip
- [ ] Chinese system
- [ ] English system
- [ ] Other language systems
- [ ] Light mode
- [ ] Dark mode
- [ ] High contrast mode
- [ ] Virtual machine
## Installation & Update (12 items)
- [ ] Installer download
- [ ] Installation wizard
- [ ] Installation location
- [ ] Shortcut
- [ ] First run
- [ ] Uninstall
- [ ] Residue cleanup
- [ ] Auto update detection
- [ ] Auto download install
- [ ] Restart after update
- [ ] Data migration
- [ ] Rollback
## Performance & Resources (10 items)
- [ ] Cold start time
- [ ] Hot start time
- [ ] Memory usage
- [ ] CPU usage
- [ ] Disk usage
- [ ] Interface response
- [ ] Long time running
- [ ] Multi-task concurrent
- [ ] Resource release
- [ ] Crash recovery
## Security & Permissions (8 items)
- [ ] Administrator permission
- [ ] File read-write permission
- [ ] Network access permission
- [ ] Data encryption
- [ ] Sensitive information protection
- [ ] Auto login
- [ ] Session timeout
- [ ] Security audit
FILE:references/checklists/mini-program-checklist.md
# Mini Program Testing Checklist
## Lifecycle (10 items)
- [ ] Cold start
- [ ] Hot start
- [ ] Page onLoad
- [ ] Page onShow
- [ ] Page onReady
- [ ] Page onHide
- [ ] Page onUnload
- [ ] Switch to background
- [ ] Switch to foreground
- [ ] Destroy after long time background
## Authorization Management (12 items)
- [ ] User info authorization
- [ ] Phone number authorization
- [ ] Location authorization
- [ ] Camera authorization
- [ ] Photo album authorization
- [ ] Bluetooth authorization
- [ ] Recording authorization
- [ ] Authorization agree
- [ ] Authorization deny
- [ ] Re-guide after deny
- [ ] Open permission in settings page
- [ ] Authorization state persistence
## Share Function (14 items)
- [ ] Top-right menu share
- [ ] Share button share
- [ ] Share title
- [ ] Share description
- [ ] Share cover image
- [ ] Share path
- [ ] Share to friend
- [ ] Share to group chat
- [ ] Share to moments
- [ ] Share success callback
- [ ] Share failure handling
- [ ] Open from share card
- [ ] Share parameter passing
- [ ] Share open specified page
## Platform Difference Adaptation (10 items)
- [ ] WeChat mini program API
- [ ] Alipay mini program API
- [ ] Baidu mini program API
- [ ] Douyin mini program API
- [ ] Component compatibility
- [ ] Style compatibility
- [ ] Login difference
- [ ] Payment difference
- [ ] Share difference
- [ ] Review specification difference
## Mini Program Code & QR Code (8 items)
- [ ] Mini program code generate
- [ ] Mini program code style
- [ ] QR code generate
- [ ] Scan code open mini program
- [ ] Scan code parameter parsing
- [ ] Scan code permission control
- [ ] Mini program code jump
- [ ] QR code jump
## Subscription Message & Template Message (8 items)
- [ ] Subscription message authorization
- [ ] Subscription message send
- [ ] Subscription message open
- [ ] Template message send
- [ ] Template message open
- [ ] Subscription count limit
- [ ] Subscription permission revoke
- [ ] Message push setting
## Mini Program Jump (10 items)
- [ ] Jump to other mini program
- [ ] Jump carry parameters
- [ ] Return from other mini program
- [ ] web-view open H5
- [ ] H5 jump to mini program
- [ ] Open mini program from App
- [ ] Open App from mini program
- [ ] Jump count limit
- [ ] Half-screen mini program
- [ ] Mini program mutual jump
## Local Storage (8 items)
- [ ] Storage store
- [ ] Storage read
- [ ] Storage clear
- [ ] Capacity limit
- [ ] Cache update
- [ ] Cache cleanup
- [ ] Temp file storage
- [ ] File management system
## Network Request (10 items)
- [ ] Domain whitelist
- [ ] Request concurrency limit
- [ ] Request timeout
- [ ] Request retry
- [ ] Sensitive data encryption
- [ ] File upload
- [ ] File download
- [ ] Upload download progress
- [ ] Weak network request
- [ ] Offline request
## Performance Optimization (10 items)
- [ ] First screen load time
- [ ] Page render smooth
- [ ] Long list optimization
- [ ] Memory usage
- [ ] Main package size
- [ ] Sub-package load
- [ ] Image lazy loading
- [ ] Data cache
- [ ] Skeleton screen
- [ ] Performance monitoring
## Payment Function (8 items)
- [ ] WeChat payment
- [ ] Alipay payment
- [ ] Payment callback
- [ ] Payment success page
- [ ] Payment failure handling
- [ ] Order state synchronization
- [ ] Refund process
- [ ] Payment security
## Customer Service Function (6 items)
- [ ] Customer service button display
- [ ] Customer service session open
- [ ] Customer service message send
- [ ] Customer service message receive
- [ ] Customer service session close
- [ ] Customer service evaluation
FILE:references/checklists/mobile-app-checklist.md
# Mobile App Testing Checklist
## Gesture Operations (15 items)
- [ ] Click operation test
- [ ] Double-click operation test
- [ ] Long press operation test
- [ ] Swipe operation test
- [ ] Zoom operation test
- [ ] Drag operation test
- [ ] Pull-down refresh test
- [ ] Pull-up load more test
- [ ] Multi-finger gesture test
- [ ] Gesture conflict test
- [ ] Gesture feedback test
- [ ] Gesture disabled test
- [ ] Special gesture test
- [ ] Accessibility gesture test
- [ ] Game gesture test
## Screen Adaptation (12 items)
- [ ] Small screen device test
- [ ] Medium screen device test
- [ ] Large screen device test
- [ ] Tablet device test
- [ ] Long screen device test
- [ ] Notch screen test
- [ ] Foldable screen test
- [ ] Landscape mode test
- [ ] Portrait mode test
- [ ] Orientation switch test
- [ ] Resolution adaptation test
- [ ] System font size test
## Interruption Recovery (14 items)
- [ ] Incoming call interruption test
- [ ] SMS interruption test
- [ ] Push notification interruption test
- [ ] Alarm interruption test
- [ ] Low battery popup test
- [ ] System update prompt test
- [ ] Background then return test
- [ ] Multi-task switching test
- [ ] Long time background test
- [ ] Kill process then restart test
- [ ] Form filling interruption test
- [ ] Payment process interruption test
- [ ] Playback interruption test
- [ ] Network request interruption test
## Network Switching (16 items)
- [ ] WiFi network test
- [ ] 4G/5G network test
- [ ] WiFi↔4G/5G switching test
- [ ] Weak network - high latency test
- [ ] Weak network - low bandwidth test
- [ ] Weak network - high packet loss test
- [ ] Offline detection test
- [ ] Offline reconnection test
- [ ] Airplane mode test
- [ ] Offline mode test
- [ ] Submit during network switch test
- [ ] Download during network switch test
- [ ] Upload during network switch test
- [ ] Video playback network switch test
- [ ] Network permission disabled test
- [ ] DNS resolution failure test
## Device Compatibility (10 items)
- [ ] iOS latest version test
- [ ] iOS old version test
- [ ] Android latest version test
- [ ] Android old version test
- [ ] Different manufacturer ROM test
- [ ] Different screen resolution test
- [ ] Different hardware configuration test
- [ ] iPad tablet test
- [ ] Foldable device test
- [ ] Emulator test
## Permission Management (12 items)
- [ ] Camera permission test
- [ ] Photo album permission test
- [ ] Location permission test
- [ ] Notification permission test
- [ ] Microphone permission test
- [ ] Storage permission test
- [ ] Contacts permission test
- [ ] Bluetooth permission test
- [ ] Permission denied then function degradation test
- [ ] Permission settings page guide test
- [ ] Permission revocation test
- [ ] Permission state persistence test
## System Interaction (10 items)
- [ ] System share test
- [ ] Copy paste test
- [ ] System keyboard test
- [ ] Screenshot function test
- [ ] Screen recording function test
- [ ] System browser open test
- [ ] Phone dial test
- [ ] SMS send test
- [ ] Email send test
- [ ] Map open test
## Performance Experience (12 items)
- [ ] Cold start time test
- [ ] Hot start time test
- [ ] First screen load time test
- [ ] Page load time test
- [ ] Scroll smoothness test
- [ ] Animation smoothness test
- [ ] Memory usage test
- [ ] CPU usage test
- [ ] Power consumption test
- [ ] Heat control test
- [ ] Data usage test
- [ ] Storage space test
## Accessibility (8 items)
- [ ] Screen reader compatibility (VoiceOver/TalkBack)
- [ ] All images have alt text or description
- [ ] Font size adjustable
- [ ] High contrast mode support
- [ ] Touch area large enough (≥44x44px)
- [ ] All functions operable by gesture + voice
- [ ] Videos have subtitles
- [ ] Important information has vibration feedback
FILE:references/checklists/mobile-web-checklist.md
# Mobile Web Testing Checklist
## Browser Compatibility (12 items)
- [ ] iOS Safari latest version normal
- [ ] iOS Safari mainstream version compatible
- [ ] Android Chrome normal
- [ ] Android Chrome mainstream version compatible
- [ ] WeChat built-in browser normal
- [ ] QQ Browser normal
- [ ] UC Browser normal
- [ ] Quark Browser normal
- [ ] Samsung Internet normal
- [ ] Privacy/Incognito mode normal
- [ ] WebView (WKWebView/Android) compatible
- [ ] JavaScript features compatible
## Touch Interaction (14 items)
- [ ] Single click normal response
- [ ] Double-click zoom function
- [ ] Long press trigger context menu
- [ ] Left-right swipe switch
- [ ] Up-down swipe scroll
- [ ] Two-finger zoom function
- [ ] Pull-down refresh function
- [ ] Pull-up load more
- [ ] Click state visual feedback
- [ ] Touch disabled setting effective
- [ ] Nested scroll no conflict
- [ ] Rubber band effect normal
- [ ] Inertial scroll smooth
- [ ] Gesture conflict handling correct
## Responsive Layout (12 items)
- [ ] 320px width normal
- [ ] 375px width normal
- [ ] 414px width normal
- [ ] 768px (iPad) width normal
- [ ] Long screen (19.5:9) adaptation
- [ ] Notch screen content not blocked
- [ ] Media query breakpoints correct
- [ ] Image width adaptive
- [ ] Font size adaptation
- [ ] Horizontal scroll list normal
- [ ] Fixed position elements normal
- [ ] Landscape layout correct
## Viewport Configuration (8 items)
- [ ] Viewport setting correct
- [ ] Notch screen safe area adaptation
- [ ] Punch hole screen adaptation
- [ ] Viewport recalculation on screen rotation
- [ ] Layout adjustment when keyboard pops up
- [ ] Layout recovery when keyboard closes
- [ ] Zoom limit effective
- [ ] Split screen mode adaptation
## Keyboard & Input (10 items)
- [ ] Input field focus normal
- [ ] Keyboard popup animation smooth
- [ ] Keyboard not block input field
- [ ] Number/email keyboard type correct
- [ ] Chinese input method normal
- [ ] Auto-correction function normal
- [ ] Password show/hide switch
- [ ] Form auto-fill normal
- [ ] Max length limit effective
- [ ] Input format regex validation
## H5 Specific Features (10 items)
- [ ] tel: link dial phone normal
- [ ] sms: link send SMS normal
- [ ] mailto: link open email normal
- [ ] Map link open normal
- [ ] Web Share API share normal
- [ ] Add to home screen function
- [ ] Launch screen display normal
- [ ] Full screen mode normal
- [ ] PWA offline function normal
- [ ] Notification push function normal
## Third-party Login & Payment (10 items)
- [ ] WeChat H5 login normal
- [ ] Alipay H5 login normal
- [ ] QQ H5 login normal
- [ ] Weibo H5 login normal
- [ ] WeChat H5 payment normal
- [ ] Alipay H5 payment normal
- [ ] Login state persistence normal
- [ ] Multi-account switch normal
- [ ] Authorization callback normal
- [ ] Payment result query normal
## WebView Specific (12 items)
- [ ] JSBridge call normal
- [ ] Camera call function normal
- [ ] Photo album call function normal
- [ ] Location call function normal
- [ ] Scan code function normal
- [ ] Physical back button handling correct
- [ ] Navigation bar customization normal
- [ ] Loading progress bar display normal
- [ ] Error page display normal
- [ ] Pull-down refresh function normal
- [ ] Share function normal
- [ ] Login state synchronization normal
## Network & Cache (10 items)
- [ ] WiFi network normal
- [ ] 4G/5G network normal
- [ ] Weak network environment prompt friendly
- [ ] Offline prompt friendly
- [ ] Network recovery auto reconnection
- [ ] Service Worker offline cache
- [ ] LocalStorage normal use
- [ ] SessionStorage normal use
- [ ] Image lazy loading normal
- [ ] Cache update strategy normal
## Performance Optimization (10 items)
- [ ] First screen load < 3 seconds
- [ ] FCP time < 1.8 seconds
- [ ] LCP time < 2.5 seconds
- [ ] Image compression optimization
- [ ] Code splitting effective
- [ ] Rendering no obvious lag
- [ ] No memory leak
- [ ] Skeleton screen display normal
- [ ] CDN resource loading normal
- [ ] First screen monitoring data normal
## SEO & Sharing (10 items)
- [ ] Meta tags complete
- [ ] Page title optimization
- [ ] WeChat share card content correct
- [ ] QQ share card content correct
- [ ] Weibo share card content correct
- [ ] OG tags complete
- [ ] Twitter Card complete
- [ ] Structured data correct
- [ ] Share callback normal
- [ ] Anti-blocking handling normal
FILE:references/checklists/pc-web-checklist.md
# PC Web Testing Checklist
## Browser Compatibility (12 items)
- [ ] Chrome latest version normal
- [ ] Chrome mainstream version compatible
- [ ] Firefox latest version normal
- [ ] Firefox mainstream version compatible
- [ ] Safari browser compatible
- [ ] Edge browser compatible
- [ ] Multi-core browser compatible
- [ ] JavaScript features compatible
- [ ] CSS features compatible
- [ ] Privacy mode access normal
- [ ] Developer tools no errors
- [ ] Browser extension compatibility
## Page Layout (10 items)
- [ ] 1366×768 resolution normal
- [ ] 1920×1080 resolution normal
- [ ] 2K/4K resolution normal
- [ ] 100% DPI zoom normal
- [ ] 125% DPI zoom normal
- [ ] 150% DPI zoom normal
- [ ] Window maximize layout correct
- [ ] Window custom size layout correct
- [ ] Scrollbar display correct
- [ ] Responsive breakpoints correct
## Keyboard Navigation (10 items)
- [ ] Tab key focus order correct
- [ ] Enter key can trigger button
- [ ] Space key can operate checkbox
- [ ] Arrow keys can navigate
- [ ] Global shortcuts normal
- [ ] Esc key close dialog
- [ ] F5 refresh page
- [ ] Ctrl+C/V copy paste
- [ ] Focus indicator clearly visible
- [ ] Accessibility jump link available
## Form Interaction (12 items)
- [ ] Text input normal
- [ ] Number input validation
- [ ] Date picker available
- [ ] Dropdown selection normal
- [ ] File upload function
- [ ] Form required validation
- [ ] Form submit success
- [ ] Prevent duplicate submit
- [ ] Form reset function
- [ ] Input suggestion/auto-complete
- [ ] Copy paste function
- [ ] Form disabled state
## Authentication & Session (10 items)
- [ ] Normal login success
- [ ] Wrong password prompt friendly
- [ ] Session expiration handling
- [ ] Remember login function
- [ ] Normal logout
- [ ] Password retrieve process
- [ ] Password modify function
- [ ] Two-factor authentication (if applicable)
- [ ] Multi-device login conflict handling
- [ ] Timeout auto logout
## Multi-window & Tabs (8 items)
- [ ] New window open normal
- [ ] New tab open normal
- [ ] Cross-window communication normal
- [ ] Close window confirmation
- [ ] Tab switch state persistence
- [ ] Browser forward/back normal
- [ ] Page refresh data persistence
- [ ] Window state memory
## Routing & Navigation (12 items)
- [ ] SPA route path correct match
- [ ] Nested route level correct
- [ ] Dynamic route parameter parsing correct
- [ ] URL and page state synchronization
- [ ] Route guard redirect when not logged in
- [ ] Route jump when insufficient permission
- [ ] 404 page display normal
- [ ] Deep link direct access normal
- [ ] Browser forward/back state correct
- [ ] After refresh URL and page state consistent
- [ ] Breadcrumb navigation level correct
- [ ] Anchor positioning function normal
## Data Linkage (10 items)
- [ ] Parent-child component data sync
- [ ] Cross-component state share correct
- [ ] List click jump detail
- [ ] Detail modify then list refresh
- [ ] Multi-condition filter linkage correct
- [ ] Pagination switch data correct
- [ ] Sorting switch display correct
- [ ] Modal submit then page refresh
- [ ] Linkage field dependency correct
- [ ] Tab switch data load
## Drag Interaction (10 items)
- [ ] Element drag function normal
- [ ] Drag sort position correct
- [ ] Drag upload file success
- [ ] Drag disabled state normal
- [ ] Drag keyboard operation available
- [ ] Drag not exceed boundary
- [ ] Ctrl+Z undo drag
- [ ] Drag guide line alignment
- [ ] Large amount element drag smooth
- [ ] After drag data save correct
## Rich Text Editor (10 items)
- [ ] Basic text input normal
- [ ] Bold/italic/underline effective
- [ ] Heading level switch correct
- [ ] Unordered/ordered list normal
- [ ] Insert link/image/table normal
- [ ] Ctrl+Z undo normal
- [ ] Ctrl+Y redo normal
- [ ] Paste from external format保留
- [ ] Markdown edit preview normal
- [ ] Word count accurate
## File Operations (8 items)
- [ ] File download normal
- [ ] File preview normal
- [ ] File save normal
- [ ] File import normal
- [ ] File export normal
- [ ] File delete confirmation
- [ ] Drag file upload
- [ ] File type limit
## Network & Cache (10 items)
- [ ] Normal network access
- [ ] Offline prompt friendly
- [ ] Network recovery handling
- [ ] Weak network load prompt
- [ ] Strong cache effective
- [ ] Negotiation cache effective
- [ ] Cookie normal use
- [ ] LocalStorage normal use
- [ ] SessionStorage normal use
- [ ] Request retry mechanism
## Internationalization & Localization (10 items)
- [ ] Language switch function normal
- [ ] Static text translation correct
- [ ] Dynamic content translation correct
- [ ] Number format conforms to region habit
- [ ] Date time format conforms to region habit
- [ ] Currency format correct
- [ ] RTL layout normal (if applicable)
- [ ] Language selection persistence
- [ ] After refresh language persistence
- [ ] Cross-page language consistent
## Print Function (8 items)
- [ ] Click print button trigger print
- [ ] Print preview content correct
- [ ] Print style correct (hide unnecessary elements)
- [ ] Header footer display correct
- [ ] Cross-page table title repeat
- [ ] Image print clear
- [ ] A4/Letter paper layout correct
- [ ] Chrome/Firefox/Edge print consistent
## Dark Mode (8 items)
- [ ] Manual switch dark mode
- [ ] Follow system dark mode
- [ ] After switch color contrast sufficient
- [ ] Image/icon adaptation dark
- [ ] Form control style correct
- [ ] Code block highlight readable
- [ ] Mode persistence (refresh persistence)
- [ ] Cross-page mode consistent
## Performance Optimization (8 items)
- [ ] First screen load < 3 seconds
- [ ] White screen time < 1 second
- [ ] Image lazy loading normal
- [ ] Animation smooth 60fps
- [ ] No memory leak
- [ ] Long list load normal
- [ ] Code splitting effective
- [ ] Resource compression effective
具备高级测试用例设计能力,能输出覆盖复杂页面跳转、路由参数及多页面联动的标准化高质量测试用例。
# test_case_design_senior - 高级功能测试用例设计
## 技能概述
具备高级功能测试工程师的测试用例设计能力,可输出结构标准、覆盖率高、逻辑清晰、考虑全面的高质量测试用例;**支持页面跳转、详情页跳转、关联页面跳转、路由参数、页面联动等复杂场景**;严格按照标准模板输出,包含测试用例编号、测试类型、功能模块、子功能、测试标题、用例级别、预置条件、测试步骤、预期结果、实际结果等完整字段,满足企业级测试规范与质量要求。
---
## 核心能力
### 1. 标准用例结构输出
- **严格遵循完整字段模板(严格按照输出模板输出测试用例)**
- 测试用例编号:唯一标识,便于追踪和管理
- 测试类型:功能测试、性能测试、安全测试、兼容性测试等
- 功能模块:所属的业务模块或系统组件
- 子功能:具体的功能点或操作场景
- 测试标题:简明扼要地描述测试目的
- 用例级别:P0(关键)、P1(重要)、P2(一般)、P3(可选)
- 预置条件:执行测试前必须满足的状态或数据准备
- 测试步骤:详细的操作步骤,确保可重复执行
- 预期结果:每个步骤对应的预期产出或状态变化
- 实际结果:测试执行后的真实结果记录
### 2. 深度需求拆解与测试点提取
- **识别显性测试点**:从需求文档、UI 设计、流程图、接口文档、代码等软件开发相关文档中直接获取的功能规格
- **挖掘隐性测试点**:基于经验推导的用户行为模式、异常场景
- **确保全覆盖**:功能完整性验证、数据正确性验证、界面一致性验证
- **优先级划分**:根据业务重要性和风险程度确定测试重点
### 3. 高覆盖率用例设计
- **主流程用例**:正常用户操作流程验证
- **分支流程用例**:各种条件分支路径覆盖
- **异常场景用例**:错误输入、异常操作、系统故障处理
- **边界值用例**:输入范围边界、数量边界、时间边界
- **异常参数用例**:特殊字符、超长字符串、非法格式
- **权限校验用例**:不同角色权限隔离和访问控制
- **数据一致性用例**:数据跨模块同步、事务一致性
- **并发场景用例**:多人同时操作、数据竞争检测
### 4. 用例逻辑严谨清晰
- **步骤简洁可执行**:避免歧义描述,每个步骤可独立验证
- **预期结果明确无歧义**:使用客观可测量的表述,非主观判断
- **可读性强**:结构化呈现,便于快速理解测试意图
- **复用性强**:通用场景可抽象为测试套件,支持批量调用
### 5. 高级用例设计方法应用
- **等价类划分法**:将输入域划分为有效/无效等价类,减少冗余用例
- **边界值分析法**:针对边界情况设计专项测试,发现常见错误
- **场景法**:基于用户业务流程构建端到端测试场景
- **判定表驱动法**:多条件组合场景,穷举所有可能性
- **错误推测法**:基于历史缺陷数据和开发经验预测潜在问题
- **风险驱动测试**:优先覆盖高风险区域和高频使用场景
### 6. 复杂业务场景覆盖
- **跨模块集成测试**:多个系统/模块间的协作验证
- **上下游依赖测试**:数据源、外部接口、消息队列等依赖验证
- **接口联动测试**:REST API、GraphQL、WebSocket 等多协议接口协同
- **异常兜底测试**:服务降级、熔断、重试机制的有效性验证
- **逆向操作测试**:撤销、回滚、补偿操作的正确处理
### 7. 用例规范化与可落地性
- **格式统一**:符合企业规范的表格或文档格式
- **字段完整**:必填信息不缺失,元数据齐全
- **可执行性强**:直接用于人工测试或自动化脚本生成
- **回归友好**:易于维护和更新,支持版本迭代
- **自动化对接**:步骤可映射为测试代码,预期结果可断言
- **质量评估支撑**:覆盖率指标可量化,缺陷密度可统计
### 8. 页面跳转与路由测试
- **页面跳转测试**:按钮跳转、列表跳详情页、菜单跳转、外部链接跳转
- **详情页跳转测试**:从列表页点击进入详情页,校验数据展示完整性
- **关联页面跳转**:从当前页面跳转到业务关联页面(如订单→用户、商品→店铺)
- **路由参数测试**:URL 参数传递、query 参数、path 参数、参数缺失/错误处理
- **跳转权限校验**:未登录跳转登录页、无权限跳转 403、越权访问拦截
- **跳转回退测试**:浏览器后退、返回按钮、面包屑导航、历史栈管理
- **异常跳转测试**:404 页面、空数据页面、错误参数跳转、循环跳转检测
### 9. 跳转后页面校验
- **页面渲染校验**:页面元素完整、布局正确、无错位/缺失
- **数据加载校验**:详情数据与列表一致、数据格式正确、空状态处理
- **标题匹配校验**:页面标题与内容匹配、动态标题更新正确
- **参数传递校验**:路由参数正确传递到目标页、参数解析无误
- **页面状态校验**:加载状态、成功状态、错误状态、空状态显示正确
- **交互功能校验**:详情页内按钮、表单、Tab 切换等功能正常
### 10. 跨页面联动逻辑
- **多页面业务关联**:分析页面间的业务流程关系,设计端到端测试
- **数据传递测试**:页面间数据传递、表单数据携带、状态共享
- **状态同步测试**:一个页面操作后,关联页面状态同步更新
- **缓存一致性**:页面返回后数据是否刷新、缓存策略验证
- **消息通知联动**:操作后触发通知,通知点击跳转正确页面
---
## 输出模板
### 测试用例 Excel/表格格式
| 测试用例编号 | 测试类型 | 功能模块 | 子功能 | 测试标题 | 用例级别 | 预置条件 | 测试步骤 | 预期结果 | 实际结果 |
|------------|---------|---------|--------|---------|---------|---------|---------|---------|---------|
| TC_XXX_001 | 功能测试 | 用户管理 | 登录 | 验证正确的用户名和密码可以成功登录 | P0 | 1. 用户已注册<br>2. 网络正常 | 1. 打开登录页面<br>2. 输入正确的用户名<br>3. 输入正确的密码<br>4. 点击登录按钮 | 1. 跳转至首页<br>2. 显示用户信息 | 待执行 |
### 测试用例编号规则
`TC_{模块缩写}_{功能序列号}_{场景后缀}`
示例:
- `TC_USER_LOGIN_001_NORMAL` - 用户模块 - 登录功能 - 第 001 条 - 正常场景
- `TC_ORDER_DETAIL_002_JUMP` - 订单模块 - 详情页 - 第 002 条 - 跳转场景
- `TC_PRODUCT_LINK_003_CROSS` - 商品模块 - 关联页面 - 第 003 条 - 跨页面联动
### 用例级别定义
| 级别 | 说明 | 适用场景 |
|-----|------|---------|
| P0 | 关键用例 | 核心业务流程、阻碍系统正常使用的问题、主流程跳转 |
| P1 | 重要用例 | 主要功能、影响用户体验的问题、详情页跳转、权限校验 |
| P2 | 一般用例 | 次要功能、不影响主体流程的问题、关联页面跳转 |
| P3 | 可选用例 | 边缘场景、美化优化相关、异常参数跳转 |
### 测试类型分类
- **功能测试**:验证功能是否符合需求
- **性能测试**:响应时间、吞吐量、资源占用
- **安全测试**:身份认证、授权、数据加密、XSS/SQL 注入
- **兼容性测试**:浏览器、操作系统、设备分辨率
- **回归测试**:修改后验证原有功能未受损
- **接口测试**:API 契约、数据传输、错误处理
- **UI 测试**:界面布局、交互体验、文案准确性
- **路由测试**:页面跳转、路由参数、URL 规范、浏览器历史
- **联动测试**:跨页面数据传递、状态同步、业务关联
---
## 使用方法
### 触发场景
当用户提供以下类型的请求时,此技能自动激活:
1. **生成/编写测试用例**:"帮我写一下用户登录功能的测试用例"
2. **完善用例**:"这些测试用例不够全面,请补充异常场景"
3. **审查用例**:"检查一下这些测试用例是否有遗漏"
4. **转换格式**:"把 Word 里的需求转换成测试用例"
5. **补充覆盖**:"这个支付功能还缺哪些测试场景"
6. **评审辅助**:"我需要准备测试用例评审,生成一套完整的用例"
7. **页面跳转测试**:"帮我设计列表跳详情页的测试用例"
8. **路由参数测试**:"这个页面 URL 带参数,怎么测试"
9. **跨页面联动**:"订单页和用户页有关联,怎么设计用例"
### 输入要素
为生成高质量的测试用例,尽量提供以下信息:
1. **需求描述**:功能需求的详细说明
2. **业务背景**:该功能在整体产品中的定位
3. **约束条件**:技术限制、合规要求等
4. **目标用户**:主要使用人群及其特征
5. **关联系统**:涉及的其他模块或第三方服务
6. **页面路由信息**:URL 结构、路由参数、跳转逻辑
7. **页面关联关系**:页面间的业务关联、数据流向
### 输出内容
1. **完整测试用例集**:涵盖所有识别出的测试点
2. **测试优先级排序**:按 P0-P3 分级展示
3. **覆盖率说明**:已覆盖的测试维度列表
4. **缺失风险提示**:可能存在的测试盲区建议
5. **页面跳转专项说明**:跳转路径、参数校验、权限检查
6. **联动场景说明**:跨页面数据流、状态同步点
---
## 最佳实践
### 用例设计原则
✅ **DO - 推荐做法**
- 每个用例只验证一个明确的目标
- 使用清晰的数字序号标记步骤
- 预期结果使用"应该/必须/会"等确定性词汇
- 包含正向和反向两种情况的验证
- 标注敏感信息的脱敏处理方式
- 为复杂场景添加截图或伪代码说明
- 页面跳转用例明确标注跳转目标页面
- 路由参数用例覆盖参数缺失、错误、越界场景
- 联动用例标注数据传递路径和同步点
❌ **DON'T - 避免做法**
- 模糊的描述如"检查是否可以正常工作"
- 一次性执行过多无关操作
- 忽略前置条件和环境配置
- 混合多个验证点在一个步骤中
- 使用主观判断代替客观测量
- 忽略异常处理流程
- 忽略跳转后的页面状态校验
- 忽略路由参数的安全性校验
- 忽略跨页面数据一致性问题
### 用例评审要点
1. **完整性检查**:是否覆盖所有需求点和隐性场景
2. **独立性检查**:用例之间是否存在强依赖关系
3. **可执行性检查**:步骤是否清晰、工具是否可得
4. **可维护性检查**:命名规范、变更可追溯
5. **优先级合理性**:P0 用例是否真正关键
6. **跳转覆盖检查**:页面跳转路径是否全覆盖
7. **参数校验检查**:路由参数测试是否充分
8. **联动逻辑检查**:跨页面数据流是否清晰
### 用例管理建议
- 建立用例库版本管理机制
- 定期清理过期或废弃的用例
- 根据缺陷反馈持续优化用例
- 结合自动化测试框架进行用例复用
- 保持用例与需求版本的关联性
- 为页面跳转用例维护路由映射表
- 为联动用例维护页面依赖关系图
---
## 示例案例
### 示例 1:电商下单功能测试用例
```markdown
## 订单模块 - 商品下单 - P0
### TC_ORDER_CREATE_001 正常下单流程
**测试类型**: 功能测试
**功能模块**: 订单管理
**子功能**: 商品下单
**用例级别**: P0
**预置条件**:
1. 用户已登录且账户余额充足
2. 商品库存大于 0
3. 收货地址已配置
**测试步骤**:
1. 浏览商品详情页
2. 选择规格型号(如有)
3. 点击"立即下单"按钮
4. 确认订单信息(商品、数量、价格、收货地址)
5. 选择支付方式
6. 点击"提交订单"
7. 完成支付
**预期结果**:
1. 进入订单确认页
2. 订单金额计算准确(含运费优惠)
3. 订单创建成功,返回订单号
4. 库存扣减正确
5. 收到订单 confirmation 通知
**实际结果**: 待执行
```
### 示例 2:用户注册功能异常场景
```markdown
## 用户模块 - 注册 - P1
### TC_USER_REGISTER_002 邮箱格式错误
**测试类型**: 功能测试
**功能模块**: 用户管理
**子功能**: 用户注册
**用例级别**: P1
**预置条件**: 访问注册页面
**测试步骤**:
1. 在邮箱输入框输入不完整格式的邮箱(如 abc@com)
2. 输入合法的密码和确认密码
3. 点击"注册"按钮
**预期结果**:
1. 邮箱字段显示红色错误提示
2. 提示内容明确告知格式要求
3. 无法继续提交表单
4. 控制台无报错日志
**实际结果**: 待执行
```
### 示例 3:列表跳详情页测试
```markdown
## 商品模块 - 列表跳详情 - P0
### TC_PRODUCT_LIST_001 正常跳转详情页
**测试类型**: 路由测试
**功能模块**: 商品管理
**子功能**: 列表跳详情
**用例级别**: P0
**预置条件**:
1. 用户已登录
2. 商品列表页有数据
**测试步骤**:
1. 打开商品列表页
2. 点击任意商品卡片/名称
3. 等待页面跳转完成
4. 校验详情页展示内容
**预期结果**:
1. 成功跳转到商品详情页
2. URL 包含正确的商品 ID(如 /product/12345)
3. 详情页展示的商品信息与列表一致
4. 商品图片、价格、库存等关键信息正确
5. 详情页功能按钮(购买、收藏等)可用
**实际结果**: 待执行
```
### 示例 4:路由参数测试
```markdown
## 订单模块 - 详情页 - P1
### TC_ORDER_DETAIL_002 路由参数缺失
**测试类型**: 路由测试
**功能模块**: 订单管理
**子功能**: 详情页路由
**用例级别**: P1
**预置条件**: 用户已登录
**测试步骤**:
1. 手动访问订单详情页 URL,但省略订单 ID 参数(如 /order/detail?id=)
2. 观察页面反应
**预期结果**:
1. 页面显示错误提示"订单 ID 不能为空"
2. 或自动跳转到订单列表页
3. 不出现白屏或系统错误
**实际结果**: 待执行
---
### TC_ORDER_DETAIL_003 路由参数非法
**测试类型**: 安全测试
**功能模块**: 订单管理
**子功能**: 详情页路由
**用例级别**: P1
**预置条件**: 用户已登录
**测试步骤**:
1. 手动访问订单详情页 URL,传入非法订单 ID(如 /order/detail?id=abc)
2. 观察页面反应
**预期结果**:
1. 页面显示"订单不存在"或类似提示
2. 不展示任何订单详情信息
3. 不提供越权访问其他订单的入口
**实际结果**: 待执行
```
### 示例 5:跨页面联动测试
```markdown
## 订单模块 - 用户关联 - P1
### TC_ORDER_USER_001 订单页跳用户详情页
**测试类型**: 联动测试
**功能模块**: 订单管理
**子功能**: 关联页面跳转
**用例级别**: P1
**预置条件**:
1. 用户已登录
2. 存在已完成的订单
**测试步骤**:
1. 打开订单详情页
2. 点击买家信息区域的用户名称/头像
3. 等待页面跳转
4. 校验跳转目标页面
**预期结果**:
1. 成功跳转到用户详情/店铺页
2. 用户信息与订单中的买家信息一致
3. URL 包含正确的用户 ID
4. 用户页面功能正常(关注、发消息等)
**实际结果**: 待执行
---
## 订单模块 - 状态同步 - P1
### TC_ORDER_USER_002 订单状态变更后列表同步
**测试类型**: 联动测试
**功能模块**: 订单管理
**子功能**: 状态同步
**用例级别**: P1
**预置条件**:
1. 用户已登录
2. 存在待发货订单
**测试步骤**:
1. 打开订单列表页,记录订单状态
2. 点击进入订单详情页
3. 在详情页执行发货操作
4. 返回列表页(浏览器后退或点击面包屑)
5. 检查订单列表中该订单状态
**预期结果**:
1. 列表页订单状态已更新为"已发货"
2. 或页面提示刷新后显示最新状态
3. 数据与详情页操作结果一致
**实际结果**: 待执行
```
### 示例 6:权限跳转测试
```markdown
## 系统模块 - 权限控制 - P0
### TC_SYS_AUTH_001 未登录访问详情页
**测试类型**: 安全测试
**功能模块**: 权限管理
**子功能**: 登录拦截
**用例级别**: P0
**预置条件**: 用户未登录
**测试步骤**:
1. 直接访问需要登录的详情页 URL(如 /order/detail?id=123)
2. 观察页面跳转
**预期结果**:
1. 自动跳转到登录页
2. 登录成功后能回到原访问页面(携带 redirect 参数)
3. 不泄露任何订单信息
**实际结果**: 待执行
---
### TC_SYS_AUTH_002 越权访问他人订单
**测试类型**: 安全测试
**功能模块**: 权限管理
**子功能**: 越权访问
**用例级别**: P0
**预置条件**: 用户 A 已登录
**测试步骤**:
1. 获取用户 B 的订单 ID
2. 用户 A 访问用户 B 的订单详情页(/order/detail?id=用户 B 订单 ID)
3. 观察页面反应
**预期结果**:
1. 显示"无权访问"或"订单不存在"
2. 不展示任何用户 B 的订单信息
3. 记录安全日志
**实际结果**: 待执行
```
### 示例 7:浏览器回退测试
```markdown
## 通用模块 - 浏览器历史 - P2
### TC_BROWSER_BACK_001 详情页返回列表
**测试类型**: 路由测试
**功能模块**: 浏览器历史管理
**子功能**: 回退功能
**用例级别**: P2
**预置条件**:
1. 用户在商品列表页
2. 列表有分页或筛选条件
**测试步骤**:
1. 在列表页设置筛选条件(如价格区间、品牌)
2. 点击某个商品进入详情页
3. 使用浏览器后退按钮返回
4. 检查列表页状态
**预期结果**:
1. 返回列表页而非首页
2. 之前的筛选条件保持
3. 滚动位置保持或合理重置
4. 列表数据未丢失
**实际结果**: 待执行
```
---
## 质量保证标准
### 用例评审通过标准
1. ✅ **覆盖率达标**: 核心功能 P0 用例覆盖率 100%
2. ✅ **逻辑自洽**: 无矛盾或冲突的步骤描述
3. ✅ **可执行性**: 可在 3 分钟内完成单条用例验证
4. ✅ **边界覆盖**: 输入边界、异常场景均有对应用例
5. ✅ **优先级合理**: P0 用例不超过总数 30%
6. ✅ **跳转覆盖**: 页面跳转场景全覆盖
7. ✅ **参数校验**: 路由参数测试完整
8. ✅ **联动完整**: 跨页面数据流测试清晰
### 交付质量标准
- 用例总数不低于需求点的 3 倍(包含异常场景)
- P0+P1 用例占比不低于 60%
- 每条用例平均步骤数 3-8 步
- 无空洞描述,预期结果均可客观验证
- 符合企业测试管理规范格式要求
- 页面跳转用例包含跳转目标、参数、权限校验
- 联动用例包含数据传递路径和同步点说明
---
## 技术支持
### 常用测试方法速查
**等价类划分示例**:
- 年龄输入框:有效等价类 [1,120],无效等价类 <1, >120, 非数字
- 状态下拉:有效等价类 [启用,禁用,冻结],无效等价类 其他任意值
- **路由参数**:有效等价类 [合法 ID 格式],无效等价类 [空值、非数字、超长、特殊字符]
**边界值分析示例**:
- 文件上传大小限制 10MB:9MB, 10MB, 10.1MB
- 文本框限制 200 字符:199 字,200 字,201 字
- **列表分页**:第 1 页、最后 1 页、超出最大页码
**判定表示例**:
| 条件 | A(有优惠券) | B(满 100 元) | C(可用) | 结果 |
|-----|-----------|----------|-------|-----|
| 1 | Y | Y | Y | 可以使用 |
| 2 | Y | Y | N | 不可用(已过期) |
| 3 | Y | N | Y | 不可用(不满足门槛) |
| 4 | N | Y/Y | Y/Y | 不适用 |
### 页面跳转测试检查清单
- [ ] 正常跳转:点击跳转目标正确
- [ ] 参数传递:URL 参数完整且正确
- [ ] 权限校验:未登录/无权限拦截正确
- [ ] 404 处理:不存在资源跳转 404 页
- [ ] 空状态:无数据时展示空状态页
- [ ] 浏览器回退:历史栈管理正确
- [ ] 返回按钮:页面内返回功能正常
- [ ] 面包屑导航:层级导航准确
- [ ] 外部跳转:新标签页打开外部链接
- [ ] 循环跳转:检测并阻止循环重定向
### 跨页面联动测试检查清单
- [ ] 数据传递:页面间数据携带正确
- [ ] 状态同步:操作后关联页面状态更新
- [ ] 缓存策略:返回页面数据刷新策略合理
- [ ] 消息通知:通知点击跳转正确页面
- [ ] 业务闭环:跨页面业务流程完整
- [ ] 数据一致:多页面展示同一数据一致
- [ ] 操作反馈:一个页面操作,关联页面有反馈
---
## 附录
### 常见测试数据类型
| 数据类型 | 有效范围 | 典型边界 | 异常示例 |
|---------|---------|---------|---------|
| 整数 | -2147483648 到 2147483647 | -1, 0, 1, 最大值,最大值 +1 | 小数、字母 |
| 浮点数 | 根据精度要求 | 0.0, 0.1, 最小正数 | 无穷大、NaN |
| 字符串 | 1-200 字符 | 0 字符、200 字符、201 字符 | null、emoji、特殊符号 |
| 日期 | 1970-01-01 到 2099-12-31 | 前一天、当天、后一天 | 未来年份、非法日期 |
| 布尔值 | true/false | - | 1, 0, "true", "" |
| 枚举 | predefined values | 首项、末项、中间项 | 不在定义范围内的值 |
| **路由参数** | 符合 URL 规范 | 正常 ID、空值、边界值 | 特殊字符、SQL 注入、XSS |
### 参考资源
- ISTQB 测试术语标准
- ISO/IEC/IEEE 29119 软件测试标准
- Google Testing Blog
- Microsoft Test Engineering Guidelines
- Web 路由测试最佳实践
- 前端页面联动测试指南