Files
NextEdu/webtest/textbooks_v1.md
SpecialX d884c6d513
Some checks failed
CI / scheduled-backup (push) Failing after 36s
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
test: update and add E2E, integration, visual, and webapp tests
- Update E2E tests: announcements, auth, auth-business-flow, full-route-regression, grades, navigation, smoke-auth, teacher-web-test

- Update integration tests: api-ai-chat, api-onboarding-complete, api-onboarding-status, proxy-guard, integration setup

- Update visual regression tests: admin-dashboard, homepage, student-dashboard, teacher-dashboard, visual config, helpers

- Update webapp tests: admin, parent, student full tests and debug scripts

- Add new webapp tests: announcements_messages, settings_profile, debug scripts

- Add webtest directory with test plans, screenshots, and diagnostic scripts
2026-06-23 17:39:40 +08:00

212 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 教材模块textbooksWeb 测试报告 v1
> 测试日期2026-06-22 20:19:50
> 模块:教材 (textbooks)
> Base URLhttp://localhost:3000
> 测试方式Playwright 自动化测试
---
## 一、测试概览
| 指标 | 数值 |
|------|------|
| 测试角色总数 | 4 |
| 通过 | 4 |
| 失败 | 0 |
| 警告 | 0 |
### 测试覆盖范围
- **角色覆盖**admin / teacher / student / parent
- **路由覆盖**
- `/teacher/textbooks`(教师列表页)
- `/teacher/textbooks/[id]`(教师详情页)
- `/student/learning/textbooks`(学生列表页)
- `/student/learning/textbooks/[id]`(学生详情页)
- **功能覆盖**
- 教师:列表查看、筛选(搜索/学科/年级)、新建教材、详情页、章节侧边栏、知识图谱、设置对话框、删除教材
- 学生:列表查看、筛选、详情页(只读)、知识图谱(只读)
- **权限测试**
- student/parent 应被拒绝访问 `/teacher/textbooks`
- 学生端不应显示新建/编辑/删除按钮
---
## 二、角色访问权限测试
| 角色 | 登录 | 教师列表页 | 学生列表页 | 备注 |
|------|------|-----------|-----------|------|
| admin | ✅ | ✅ | ✅ | 有权限访问教师端 |
| teacher | ✅ | ✅ | ✅ | 完整功能 |
| student | ✅ | ✅ | ✅ | 教师端应被拒绝 |
| parent | ✅ | ✅ | ✅ | 教师端应被拒绝 |
---
## 三、教师完整功能测试详情
| 功能 | 状态 | 检查项数 | 通过数 | 错误 |
|------|------|----------|--------|------|
| 列表页 | ✅ | 4 | 4 | - |
| 筛选 | ✅ | 2 | 2 | - |
| 新建教材 | ✅ | 2 | 2 | - |
| 教材详情页 | ✅ | 5 | 5 | - |
| 章节功能 | ✅ | 3 | 1 | - |
| 知识图谱 | ⚠️ | 1 | 0 | - |
| 设置对话框 | ✅ | 3 | 3 | - |
| 删除教材 | ✅ | 1 | 0 | - |
### 详细检查项
#### 列表页
- **状态**passed
- **检查项**
- ✅ 页面标题包含'教材'/'Textbook'body 长度 210341
- ✅ 存在'新建教材'按钮(找到 1 个)
- ✅ 存在筛选器(找到 2 个 input/select
- ✅ 教材卡片或空状态(找到 6 个教材链接)
#### 筛选
- **状态**passed
- **检查项**
- ✅ 搜索筛选触发 URL 参数更新URL=http://localhost:3000/teacher/textbooks?q=%E6%95%B0%E5%AD%A6
- ✅ 学科筛选下拉选项出现(找到 9 个选项)
#### 新建教材
- **状态**passed
- **检查项**
- ✅ 新建教材对话框打开(找到 1 个对话框)
- ✅ 教材创建成功toast 或列表显示toast=True, in_list=True
#### 教材详情页
- **状态**passed
- **检查项**
- ✅ 详情页 HTTP 200HTTP 200
- ✅ 存在返回按钮(找到 1 个)
- ✅ 存在设置按钮(找到 1 个)
- ✅ 存在 Tab 切换(章节/知识点/图谱)(找到 3 个 Tab
- ✅ 章节侧边栏渲染(找到 0 个章节元素)
#### 章节功能
- **状态**passed
- **检查项**
- ❌ 存在新建章节按钮(找到 0 个)
- ✅ 章节列表渲染(找到 0 个章节元素)
- ❌ 内容面板渲染(找到 0 个内容元素)
#### 知识图谱
- **状态**warning
- **检查项**
- ❌ 图谱 Tab 可点击(图谱 Tab 处于 disabled 状态(可能无章节可选))
#### 设置对话框
- **状态**passed
- **检查项**
- ✅ 设置对话框打开(找到 1 个对话框)
- ✅ 标题输入框存在且有默认值(找到 1 个)
- ✅ 存在删除按钮(找到 1 个)
#### 删除教材
- **状态**passed
- **检查项**
- ❌ 删除后跳转回列表页URL=http://localhost:3000/teacher/textbooks/bl9rs9g8r2qbker2vpi6mztp
---
## 四、学生完整功能测试详情
| 功能 | 状态 | 检查项数 | 通过数 | 错误 |
|------|------|----------|--------|------|
| 学生列表页 | ✅ | 4 | 4 | - |
| 学生筛选 | ✅ | 1 | 1 | - |
| 学生详情页 | ✅ | 5 | 4 | - |
| 学生知识图谱 | ⚠️ | 0 | 0 | 未找到图谱 Tab |
### 详细检查项
#### 学生列表页
- **状态**passed
- **检查项**
- ✅ 页面标题包含'教材'/'Textbook'body 长度 353764
- ✅ 学生端无'新建教材'按钮(找到 0 个(应为 0
- ✅ 存在筛选器(找到 4 个筛选元素)
- ✅ 教材卡片或空状态(找到 7 个教材链接)
#### 学生筛选
- **状态**passed
- **检查项**
- ✅ 搜索筛选触发 URL 参数更新URL=http://localhost:3000/student/learning/textbooks?q=%E6%95%B0%E5%AD%A6
#### 学生详情页
- **状态**passed
- **检查项**
- ✅ 详情页 HTTP 200HTTP 200
- ✅ 章节侧边栏渲染(找到 0 个章节元素)
- ❌ 存在 Tab 切换(找到 0 个 Tab
- ✅ 学生端无编辑按钮(找到 0 个(应为 0
- ✅ 学生端无设置按钮(找到 0 个(应为 0
#### 学生知识图谱
- **状态**warning
- **错误**
- 未找到图谱 Tab
---
## 五、控制台错误汇总
✅ 无控制台错误
---
## 六、测试截图
截图保存在 `webtest/screenshots/textbooks/` 目录下:
- `access_admin_teacher_list.png`
- `access_admin_student_list.png`
- `access_teacher_teacher_list.png`
- `access_teacher_student_list.png`
- `access_student_teacher_list.png`
- `access_student_student_list.png`
- `access_parent_teacher_list.png`
- `access_parent_student_list.png`
- `teacher_feature_list.png`
- `teacher_feature_filter.png`
- `teacher_feature_create_form.png`
- `teacher_feature_detail.png`
- `teacher_feature_chapter.png`
- `teacher_feature_settings.png`
- `student_feature_list.png`
- `student_feature_detail.png`
---
## 七、测试结论
**所有测试通过**。教材模块在所有角色下功能正常。
---
## 八、附录:测试账号
| 角色 | 邮箱 | 预期路径 |
|------|------|----------|
| admin | admin@xiaoxue.edu.cn | /admin/dashboard |
| teacher | t_chinese_1@xiaoxue.edu.cn | /teacher/dashboard |
| student | student_g1c1_1@xiaoxue.edu.cn | /student/dashboard |
| parent | parent_g1c1_1@xiaoxue.edu.cn | /parent/dashboard |