Files
dth/openspec/changes/chg_0006_lms_bootstrap/testcases.md
T

64 lines
1.6 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.
---
change_id: chg_0006
owner: qa@dth
status: draft
spec_ref: spec.md
---
# Testcases
## Cases
### C1_list_students_has_seeded
- Scenario: S1
- Type: integration
- Priority: P0
- Given: admin token
- When: GET /api/ssw/dth/lms/students
- Then: data 数组长度 ≥ 2;每项含 id/student_no/name/email/created_at
- Bound Task: T4
### C2_create_and_get_student
- Scenario: S2
- Type: integration
- Priority: P0
- Given: admin token
- When: POST /api/ssw/dth/lms/students body={"student_no":"S2026001","name":"张三","email":"zhangsan@school.edu"}
- Then: data.id 匹配 UUID 正则;GET /students/:id 的 data.name == "张三"
- Bound Task: T4
### C3_list_courses_has_seeded
- Scenario: S3
- Type: integration
- Priority: P0
- Given: admin token
- When: GET /api/ssw/dth/lms/courses
- Then: data 数组长度 ≥ 2;每项含 id/code/name/credits/instructor/created_at
- Bound Task: T4
### C4_enroll_student_to_course
- Scenario: S4
- Type: integration
- Priority: P0
- Given: admin token + 1 个 seed student id + 1 个 seed course id
- When: POST /courses/:courseId/enroll body={"student_id":"<student id>"}
- Then: code = 200;GET /students/:studentId/enrollments 长度 ≥ 1 含 course_id
- Bound Task: T4
### C5_test_runner_passes_all
- Scenario: all
- Type: e2e
- Priority: P0
- Given: 后端运行
- When: bash tests/e2e/dth_lms.test.sh
- Then: exit 0
- Bound Task: T4
### C6_check_spec_coverage_gap_zero
- Scenario: all
- Type: e2e
- Priority: P0
- Given: chg 工件齐备
- When: PROJECT_ROOT=. bash openspec/scripts/check_spec_coverage.sh
- Then: stdout PASS gap=0
- Bound Task: T5