- openspec 5 件套完整(proposal/spec/tasks/testcases/testcases.map.yaml) - check_spec_coverage.sh: 10 scenarios / 10 cases OK, gap=0 - tsc backend: 0 新错(仅预存 chg_0002 vertical-lr.ts:52) - tsc frontend: 0 错 - 9 e2e 套件 PASS (DTH_BASE=127.0.0.1:30051): - chg_0002 (16) + chg_0005 (27) + chg_0006 (17) + chg_0007 (33) - chg_0008 (15) + chg_0009 (27) + chg_0010 (37) + chg_0011 (24) - chg_0012 (45 sub-assertion / 10 case) - 报告落 /tmp/chg_0012-qa.log 5 回归 + 1 新 = 6 套(brief 要求):chg_0006 + chg_0008 + chg_0009 + chg_0010 + chg_0011 + chg_0012 ✓ 加固跑了 chg_0002 / chg_0005 / chg_0007 也全 PASS — chg_0012 改动未触及 19 算子/auth/books/shop Co-Authored-By: Claude <[email protected]>
2.9 KiB
2.9 KiB
Testcases: chg_0012_lms_multiscene_v2
Each case asserts one specific scenario from spec.md via the e2e shell script
tests/e2e/dth_lms_v2.test.sh. The script reuses json_get / assert / login
helpers from chg_0006/0010/0011.
S1 LMS v1 数据模型基础
- C1_lms_v1_data_model_basic
- GET /api/ssw/dth/lms/students → ≥ 2 students, schema complete, seed UUID present
- GET /api/ssw/dth/lms/courses → ≥ 2 courses, schema complete, seed UUID present
S2 多场景数据模型 v2
- C2_multiscene_v2_data_model
- GET /api/ssw/dth/lms-v2/courses/:id/scenes → code 200 (lms_course_scene table exists)
- POST with scene_type="video" → 422 INVALID_SCENE_TYPE (CHECK constraint rejects)
S3 创建多场景课程
- C3_create_multi_scene_course
- admin POST /lms-v2/courses with code + scenes[slide,quiz] → 200 + 2 scenes
- duplicate code → 409 DUPLICATE_COURSE_CODE
- admin POST /lms-v2/courses/from-frc-template → 200 + 6 simulation scenes
S4 选课 + 进度 append-only 幂等
- C4_enroll_and_progress_append_only
- enroll → 200
- complete scene 1 → progress_count = 1
- complete scene 1 again → progress_count still 1 (idempotent)
- complete scene 2 → progress_count = 2
S5 SlideScene Markdown 渲染(MiniMD 5 节点)
- C5_slide_markdown_render
- render slide scene → 200
- html contains:
<h1>,<h2>,<ul>, 2×<li>,<p>normal,<code>code-block-here - "illegal_node_blah" preserved verbatim (rendered as
<p>)
S6 QuizScene 判分
- C6_quiz_grading
- perfect choice → score = 1.0
- wrong choice → score = 0.0
- 50% keyword hit (1/2) → score = 1.0
- 0% keyword hit → score = 0.0
S7 SimScene iframe + embed_url 校验
- C7_sim_iframe_embed_url
- create with https URL → 200
- render → embed_url matches
- create with
javascript:URL → 400 INVALID_EMBED_URL
S8 FRC 6-scene 模板(严格对位 chg_0010 S1-S6)
- C8_frc_6_scene_template
- from-frc-template → 6 scenes, all type=simulation
- order_index strictly 1,2,3,4,5,6
- 6 embed_url keywords present (did-tds, psi, paillier, threshold, abac, audit)
S9 E2E 完整流程
- C9_e2e_full_flow
- admin login → from-frc-template → student login → enroll
- 6 render calls all 200
- 6 complete calls all 200
- final progress_count = 6, progress_pct = 1.0
S10 PBL 占位一致性
- C10_pbl_placeholder_consistency
- create with scene_type="pbl" → 200
- render → code = 501 NOT_IMPLEMENTED
- backend msg = "PBL 场景 v2 实现,当前仅作课程占位"
- frontend PBLScene.tsx constant = same string (drift detector)
all test_runner_and_gate_pass
- C11_test_runner_passes_all — bash tests/e2e/dth_lms_v2.test.sh exit 0
- C12_check_spec_coverage_gap_zero — bash openspec/scripts/check_spec_coverage.sh gap=0
Total: 12 cases, 45 sub-assertions.