feat: refine vehicle console and self-repair workflow
This commit is contained in:
@@ -95,6 +95,17 @@ class TestSelfRepairApi:
|
||||
assert len(state["scenarios"]) == 6
|
||||
assert state["hardware"]["connector_enabled_count"] == 21
|
||||
|
||||
with urllib.request.urlopen(
|
||||
self.request(
|
||||
"/api/self-repair/runtime",
|
||||
method="POST",
|
||||
payload={"active": True, "execution_mode": "shadow"},
|
||||
),
|
||||
timeout=3,
|
||||
) as response:
|
||||
runtime = json.loads(response.read().decode("utf-8"))["runtime"]
|
||||
assert runtime["active"] is True
|
||||
|
||||
with urllib.request.urlopen(
|
||||
self.request(
|
||||
"/api/self-repair/healing/start",
|
||||
@@ -135,26 +146,37 @@ class TestSelfRepairApi:
|
||||
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-17", timeout=3
|
||||
f"{self.base_url}/self-repair.js?v=repair-20", timeout=3
|
||||
) as response:
|
||||
script = response.read().decode("utf-8")
|
||||
script = response.read().decode("utf-8").replace("\r\n", "\n")
|
||||
with urllib.request.urlopen(
|
||||
f"{self.base_url}/self-repair.css?v=repair-17", timeout=3
|
||||
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-17", timeout=3
|
||||
f"{self.base_url}/self-repair-seat3d.js?v=repair-18", timeout=3
|
||||
) as response:
|
||||
seat3d = response.read().decode("utf-8")
|
||||
with urllib.request.urlopen(
|
||||
f"{self.base_url}/console-v2.js?v=desktop-refactor-28", timeout=3
|
||||
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-17"' in html
|
||||
assert 'src="/self-repair.js?v=repair-17"' in html
|
||||
assert 'src="/self-repair-seat3d.js?v=repair-17"' in html
|
||||
assert "量产故障用例" in script
|
||||
assert 'href="/self-repair.css?v=repair-21"' in html
|
||||
assert 'src="/self-repair.js?v=repair-20"' 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-18"' 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
|
||||
@@ -163,10 +185,15 @@ class TestSelfRepairApi:
|
||||
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 timeline"' in styles
|
||||
assert "background: color-mix(in srgb, var(--v2-accent-soft) 82%, white)" 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
|
||||
@@ -175,7 +202,7 @@ class TestSelfRepairApi:
|
||||
assert 'cssThemeColor("--v2-accent", "#315eaa")' in seat3d
|
||||
assert 'viewer.addEventListener("pointerdown"' in seat3d
|
||||
assert 'window.addEventListener("pointermove"' in seat3d
|
||||
assert 'window.addEventListener("self-repair-seat-reset"' in seat3d
|
||||
assert "window.addEventListener(resetEvent" in seat3d
|
||||
assert '["self-calibration", "self-repair"].includes(module)' in console_script
|
||||
assert 'roleSelect.disabled = ui.activeModule === "self-repair"' in console_script
|
||||
|
||||
|
||||
Reference in New Issue
Block a user