1.7 KiB
1.7 KiB
测试方案
开始时间:2026-05-18-19-56-47
自动化测试
pytest -q- 更新 API 测试:
/api/samples返回版本化样例。/api/segment视频结果包含source_time和result_time。/api/compare-frame可以返回多方法对比结果。
运行验证
curl -s http://127.0.0.1:8001/api/health- 使用样例视频调用
/api/segment。 - 使用样例视频调用
/api/compare-frame。 - Chrome DevTools Protocol 打开页面、加载样例、运行分割,检查:
- 结果视频元素出现。
- 帧列表出现。
- 多方法对比按钮启用。
手工验证
- 打开
http://192.168.3.11:8001/。 - 点击“加载样例”。
- 点击“运行分割”。
- 右侧应显示“预览与结果视频”的视频播放器。
- 下方“预览与结果查看”出现结果帧列表。
- 点击任一结果帧,原始视频和结果视频同步跳转。
- 点击“多方法对比”,查看当前帧的多方法结果。
执行结果
python3 -m compileall backend tests:通过。node --check frontend/app.js:通过。pytest -q:5 passed。curl http://127.0.0.1:8001/api/health:服务返回ok。/api/segment使用内置样例视频:返回 H.264 结果视频、source_time、result_time、result_index。/api/compare-frame使用内置样例视频第 24 帧:返回 4 种方法结果。- Chrome headless 页面流程:加载样例、运行分割、结果视频展示、12 个结果帧、多方法对比 4 张卡片均通过。
- Chrome headless 双向同步验证:源视频 seek 到 2 秒后结果视频跳到最近处理帧 0.625 秒;结果视频 seek 到 0.375 秒后源视频跳到对应源帧 1.25 秒。