diff --git a/docs/guanghan_topology_presentation_adaptation_test_report_2026-07-09.md b/docs/guanghan_topology_presentation_adaptation_test_report_2026-07-09.md new file mode 100644 index 0000000..e69bcdd --- /dev/null +++ b/docs/guanghan_topology_presentation_adaptation_test_report_2026-07-09.md @@ -0,0 +1,164 @@ +# 广寒基地拓扑图表现层适配测试报告 + +日期:2026-07-09 +测试对象:`http://localhost:8080/guanghan_topology_demo.html?mission=GHC-05` +测试阶段:适配完成后的确认测试,不包含修复 + +## 1. 结论 + +当前实现整体通过测试。页面已经按照 B1 目标改为由数据库表现层驱动主要视觉语义: + +- 节点样式来自 `layout.presentation.nodeStyles`; +- 连接线样式来自 `layout.presentation.edgeStyles`; +- 散热器样式来自 `layout.presentation.decorationStyles`; +- 图例来自 `layout.presentation.legendItems`; +- 页面保留通用交互壳,包括任务/时间查询、弹窗、响应式和错误提示。 + +本轮没有发现需要立即修改代码的功能性缺陷。 +发现一个运行状态问题:开始测试时 `localhost:8080` 仍是旧服务进程,API 没有返回 `layout.presentation`,导致新前端无法渲染节点。重启服务后问题消失。该问题属于部署/服务重启状态,不是当前代码逻辑缺陷。 + +## 2. 自动化测试 + +执行命令: + +```powershell +.\.venv\Scripts\python.exe -m unittest tests.test_topology_api tests.test_guanghan_topology_demo tests.test_guanghan_topology_e2e -v +``` + +结果: + +```text +Ran 27 tests in 13.456s +OK +``` + +覆盖范围: + +- API 同源服务与 health; +- 任务列表与任务末记录时间; +- `mission` / `at` 查询规则; +- 无效时间返回/展示; +- 组件、连接、尺寸、任务引入信息; +- layout 节点分组、标签、散热器; +- `layout.presentation` 响应结构; +- 数据库样式变更可驱动 API 和浏览器渲染; +- 页面源码不再硬编码业务颜色/图例; +- 浏览器端历史任务快照、弹窗、导航、图例、样式渲染。 + +## 3. 服务状态 + +初始发现: + +- `GET /health` 返回 200; +- 但旧进程的 snapshot 响应没有 `layout.presentation`; +- 页面新前端等待表现层数据,导致节点无法渲染。 + +处理: + +- 已重启 `topology_api.app` 服务到当前代码; +- 重启后 `GET /health` 返回 200; +- `GET /api/v1/bases/guanghan/snapshot?mission=GHC-05` 包含 `layout.presentation`; +- 默认加压走道颜色 `#51e89c` 已恢复。 + +建议: + +- 后续完成此类前后端联动适配后,应把重启服务列为交付检查项; +- 若部署环境有进程管理器,应确认发布后自动 reload/restart。 + +## 4. 任务快照巡检 + +所有任务均已打开页面并截图。统计如下: + +| 任务 | 节点 | 连接 | 加压走道 | 散热器 | 结果 | +|---|---:|---:|---:|---:|---| +| BL-01 | 1 | 0 | 0 | 0 | 通过 | +| GHC-01 | 2 | 0 | 0 | 0 | 通过 | +| JC-01 | 2 | 0 | 0 | 0 | 通过 | +| BL-02 | 3 | 0 | 0 | 0 | 通过 | +| GHC-02 | 3 | 1 | 0 | 0 | 通过 | +| GHC-03 | 7 | 5 | 0 | 3 | 通过 | +| BL-03 | 8 | 5 | 0 | 3 | 通过 | +| GHC-04 | 9 | 11 | 0 | 4 | 通过 | +| GHC-05 | 14 | 16 | 2 | 4 | 通过 | + +GHC-05 人工视觉检查: + +- 顶部核心舱十字结构正确; +- 温室模块与吴刚二号为绿色加压走道连接; +- 居住舱#1 与电力模块北部为绿色加压走道连接; +- 电力模块十字结构正确; +- 冰轮一号/二号/三号分别位于电力模块西/南/东; +- 四个电力大分支散热器可见,未覆盖加压走道; +- 未来扩展标记未显示。 + +## 5. 页面功能巡检 + +| 功能 | 结果 | 说明 | +|---|---|---| +| 任务下拉 | 通过 | 可切换全部任务 | +| mission URL 直达 | 通过 | 每个任务 URL 均能恢复对应快照 | +| 显式时间查询 | 通过 | `at` 优先于 `mission`,页面保留任务上下文 | +| 无效时间 | 通过 | 页面显示红色错误提示,不发起错误快照冒充 | +| 浏览器后退 | 通过 | URL、下拉选中值和页面快照同步恢复 | +| 图例 | 通过 | 图例由 API 表现层数据渲染 | +| 弹窗 | 通过 | GHC-05 的 14 个可点击节点均可打开并关闭 | +| 移动端视口 | 通过 | 390×844 下布局可滚动,控件可见 | +| 控制台错误 | 通过 | 巡检期间未捕获 console error | + +## 6. 数据库表现层专项测试 + +已做两项临时数据库样式变更,并在测试后恢复: + +1. 将 `diagram_edge_styles.pressurized_passage.stroke_color` 临时改为 `#00ffaa`: + - 浏览器中加压走道颜色随之变化; + - 恢复后计算样式回到 `rgb(81, 232, 156)`。 +2. 将 `diagram_node_styles.core-card.fill_color` 临时改为 `#123456`: + - 浏览器中核心舱填充色随之变化; + - 恢复后计算样式回到 `rgb(59, 37, 13)`。 + +结论:主要视觉语义确实由数据库表现层驱动。 + +## 7. 截图 + +截图目录: + +```text +output/playwright/guanghan_topology_presentation_audit_2026-07-09/ +``` + +关键截图: + +- `ghc05_top_view.png` +- `ghc05_mid_view.png` +- `ghc05_bottom_view.png` +- `mission_bl_01.png` +- `mission_ghc_01.png` +- `mission_jc_01.png` +- `mission_bl_02.png` +- `mission_ghc_02.png` +- `mission_ghc_03.png` +- `mission_bl_03.png` +- `mission_ghc_04.png` +- `mission_ghc_05.png` +- `modal_core_cabin.png` +- `modal_wugang_2.png` +- `modal_power_module_hub.png` +- `modal_power_west_group.png` +- `modal_binglun_3.png` +- `explicit_time_query.png` +- `invalid_time_error.png` +- `back_navigation_ghc01.png` +- `legend_and_default_styles.png` +- `db_edge_color_override.png` +- `db_node_color_override.png` +- `mobile_ghc05.png` + +## 8. 待确认事项 + +没有发现必须进入修复阶段的代码问题。 + +需要你确认的只有一个运行流程建议: + +- 是否把“适配发布后必须重启/刷新 topology API 服务”作为后续交付规范写入项目流程或部署文档? + +如果你仍希望进入修复阶段,我建议修复范围限定为“补充部署/运行检查文档或脚本”,而不是改当前页面逻辑。 diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/back_navigation_ghc01.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/back_navigation_ghc01.png new file mode 100644 index 0000000..c122d03 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/back_navigation_ghc01.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/db_edge_color_override.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/db_edge_color_override.png new file mode 100644 index 0000000..5c83e6f Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/db_edge_color_override.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/db_node_color_override.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/db_node_color_override.png new file mode 100644 index 0000000..a99a1ba Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/db_node_color_override.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/explicit_time_query.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/explicit_time_query.png new file mode 100644 index 0000000..89f7988 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/explicit_time_query.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_bottom_view.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_bottom_view.png new file mode 100644 index 0000000..aae561e Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_bottom_view.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_mid_view.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_mid_view.png new file mode 100644 index 0000000..b727ecc Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_mid_view.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_top_view.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_top_view.png new file mode 100644 index 0000000..9f3bdf5 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/ghc05_top_view.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/invalid_time_error.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/invalid_time_error.png new file mode 100644 index 0000000..7e4f533 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/invalid_time_error.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/legend_and_default_styles.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/legend_and_default_styles.png new file mode 100644 index 0000000..ef83e86 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/legend_and_default_styles.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_01.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_01.png new file mode 100644 index 0000000..cb8f1c5 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_01.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_02.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_02.png new file mode 100644 index 0000000..5fcd254 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_02.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_03.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_03.png new file mode 100644 index 0000000..82c4412 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_bl_03.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_01.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_01.png new file mode 100644 index 0000000..16bad47 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_01.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_02.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_02.png new file mode 100644 index 0000000..cf603f3 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_02.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_03.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_03.png new file mode 100644 index 0000000..1182d82 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_03.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_04.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_04.png new file mode 100644 index 0000000..0c0916b Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_04.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_05.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_05.png new file mode 100644 index 0000000..1139121 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_ghc_05.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_jc_01.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_jc_01.png new file mode 100644 index 0000000..8b87f9a Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mission_jc_01.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mobile_ghc05.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mobile_ghc05.png new file mode 100644 index 0000000..d6f5292 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/mobile_ghc05.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_binglun_3.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_binglun_3.png new file mode 100644 index 0000000..85ed5b3 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_binglun_3.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_core_cabin.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_core_cabin.png new file mode 100644 index 0000000..f6e035b Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_core_cabin.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_power_module_hub.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_power_module_hub.png new file mode 100644 index 0000000..575d25e Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_power_module_hub.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_power_west_group.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_power_west_group.png new file mode 100644 index 0000000..c5f951d Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_power_west_group.png differ diff --git a/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_wugang_2.png b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_wugang_2.png new file mode 100644 index 0000000..0f05ff3 Binary files /dev/null and b/output/playwright/guanghan_topology_presentation_audit_2026-07-09/modal_wugang_2.png differ