make test run faster

This commit is contained in:
2026-07-08 10:46:14 +08:00
parent 268483577e
commit 591e786a0d
6 changed files with 104 additions and 120 deletions

View File

@@ -30,23 +30,16 @@ class TestNavigation:
@pytest.mark.probe
def test_list_items(self, connected_bridge):
# Select window first so item model populates
connected_bridge.call_tool("selectQuickWindow", {"index": 0})
import time
time.sleep(1)
items = connected_bridge.call_tool("listQuickItems")
assert isinstance(items, list)
# May be empty if model hasn't populated yet; that's OK
if items:
assert isinstance(items[0], dict)
assert "type" in items[0]
@pytest.mark.probe
def test_list_items_with_window_count(self, connected_bridge):
"""Collect all items and verify at least some are found."""
connected_bridge.call_tool("selectQuickWindow", {"index": 0})
import time
time.sleep(1)
items = connected_bridge.call_tool("listQuickItems")
def count_all(items_list):
@@ -63,21 +56,15 @@ class TestNavigation:
@pytest.mark.probe
def test_list_scenegraph_nodes(self, connected_bridge):
connected_bridge.call_tool("selectQuickWindow", {"index": 0})
import time
time.sleep(1)
nodes = connected_bridge.call_tool("listScenegraphNodes")
assert isinstance(nodes, list)
if nodes:
assert isinstance(nodes[0], dict)
# Root should be "Root Node"
assert nodes[0].get("type") == "Root Node"
@pytest.mark.probe
def test_scenegraph_has_geometry_nodes(self, connected_bridge):
connected_bridge.call_tool("selectQuickWindow", {"index": 0})
import time
time.sleep(1)
nodes = connected_bridge.call_tool("listScenegraphNodes")
def find_geometry(items_list):
@@ -90,4 +77,4 @@ class TestNavigation:
return None
geo = find_geometry(nodes)
assert geo is not None, "No Geometry Node found in SG tree"
assert geo is not None, "No Geometry Node found in SG tree"