feat(web-console): rebuild intelligent cockpit sync interface
This commit is contained in:
@@ -142,74 +142,24 @@ class TestSelfRepairApi:
|
||||
assert result["ok"] is True
|
||||
assert result["self_test"]["result"] == "PASS"
|
||||
|
||||
def test_frontend_assets_and_role_transition_are_served(self) -> None:
|
||||
def test_frontend_assets_and_role_transition_are_removed(self) -> None:
|
||||
with urllib.request.urlopen(f"{self.base_url}/", timeout=3) as response:
|
||||
html = response.read().decode("utf-8")
|
||||
with urllib.request.urlopen(
|
||||
f"{self.base_url}/self-repair.js?v=repair-21", timeout=3
|
||||
) as response:
|
||||
script = response.read().decode("utf-8").replace("\r\n", "\n")
|
||||
with urllib.request.urlopen(
|
||||
f"{self.base_url}/self-repair.css?v=repair-21", timeout=3
|
||||
) as response:
|
||||
styles = response.read().decode("utf-8")
|
||||
with urllib.request.urlopen(
|
||||
f"{self.base_url}/self-repair-seat3d.js?v=repair-21", timeout=3
|
||||
) as response:
|
||||
seat3d = response.read().decode("utf-8")
|
||||
with urllib.request.urlopen(
|
||||
f"{self.base_url}/console-v2.js?v=desktop-refactor-31", timeout=3
|
||||
) as response:
|
||||
console_script = response.read().decode("utf-8")
|
||||
|
||||
assert 'href="/self-repair.css?v=repair-21"' in html
|
||||
assert 'src="/self-repair.js?v=repair-21"' in html
|
||||
assert 'class="v2-module-heading"' in script
|
||||
assert 'SELF-REPAIR' in script
|
||||
assert 'padding: var(--v2-module-title-block) 0 0' in styles
|
||||
assert 'margin-inline: var(--v2-module-title-inline)' in styles
|
||||
assert 'src="/self-repair-seat3d.js?v=repair-21"' in html
|
||||
assert "量产故障注入" in script
|
||||
assert "运行与自修复日志" in script
|
||||
assert "启动座椅运行" in script
|
||||
assert "开始正常任务" not in script
|
||||
assert 'id="repairSeatCanvas"' in script
|
||||
assert 'id="repairSeatViewer"' in script
|
||||
assert "self-repair-seat-reset" in script
|
||||
assert "seat-healing-state" in script
|
||||
assert 'id="repairConfirmDialog"' in script
|
||||
assert "confirmAction(" in script
|
||||
assert "window.confirm" not in script
|
||||
assert 'hardware.link?.adapter === "OK"' in script
|
||||
assert 'PASSED: ["21针通过", "online"]' in script
|
||||
assert "connectorRows" in script
|
||||
assert "Polling refreshes data only" in script
|
||||
assert "renderRecords();\n showView(activeView);" not in script
|
||||
assert 'let latest = fallbackState();' in script
|
||||
assert 'renderAll();\n window.lucide?.createIcons' in script
|
||||
assert '"WDT复位后失能"' in script
|
||||
assert "--repair-deep-blue" in styles
|
||||
assert '.console-v2[data-module="self-repair"] .section-kicker' in styles
|
||||
assert 'grid-template-areas: "twin cases logs"' in styles
|
||||
assert ".v2-repair-event-stream" in styles
|
||||
assert "background: rgba(255, 255, 255, 0.94)" in styles
|
||||
assert "border-color: color-mix(in srgb, var(--v2-accent) 18%, white)" in styles
|
||||
assert ".v2-repair-toolbar button.primary:hover:not(:disabled)" in styles
|
||||
assert "color: #fff;" in styles
|
||||
assert "seat-healing-state" in seat3d
|
||||
assert "function backrestShape" in seat3d
|
||||
assert "new THREE.CapsuleGeometry" in seat3d
|
||||
assert 'cssThemeColor("--v2-accent", "#315eaa")' in seat3d
|
||||
assert 'viewer.addEventListener("pointerdown"' in seat3d
|
||||
assert 'window.addEventListener("pointermove"' in seat3d
|
||||
assert "window.addEventListener(resetEvent" in seat3d
|
||||
assert "function viewerHasLayout(viewer)" in seat3d
|
||||
assert "function deferSeat3dUntilVisible(viewer, options)" in seat3d
|
||||
assert "if (!viewerHasLayout(viewer))" in seat3d
|
||||
assert 'window.addEventListener("cognitive-agent:module-change"' in seat3d
|
||||
assert 'canvas.addEventListener("webglcontextlost"' in seat3d
|
||||
assert '["self-calibration", "self-repair"].includes(module)' in console_script
|
||||
assert 'roleSelect.disabled = ui.activeModule === "self-repair"' in console_script
|
||||
assert "self-repair" not in html
|
||||
assert '"admin"' not in console_script
|
||||
for path in (
|
||||
"/self-repair.js",
|
||||
"/self-repair.css",
|
||||
"/self-repair-seat3d.js",
|
||||
):
|
||||
with pytest.raises(urllib.error.HTTPError) as missing_asset:
|
||||
urllib.request.urlopen(f"{self.base_url}{path}", timeout=3)
|
||||
assert missing_asset.value.code == 404
|
||||
|
||||
|
||||
def test_self_repair_bridge_uses_the_backend_runtime_directory() -> None:
|
||||
|
||||
Reference in New Issue
Block a user