Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Tests: mac tab walk waits for the sidebar to mount before judging a pinned row (#15959)

Daniel Han37509ce4dea8
diff --git a/tests/studio/playwright_mac_tab_capabilities.py b/tests/studio/playwright_mac_tab_capabilities.py
index cac9165a7ae..6459c24a2aa 100644
--- a/tests/studio/playwright_mac_tab_capabilities.py
+++ b/tests/studio/playwright_mac_tab_capabilities.py
@@ -586,6 +586,19 @@ def stand_in_shown(page, row_id: str) -> bool:
return stand_in.count() > 0 and stand_in.first.is_visible()
+SHELL_TIMEOUT_MS = 30_000
+# Every pinned row renders in one pass, so any of them proves the sidebar has mounted.
+_SHELL_JS = """() => document.querySelector('[data-testid^="nav-row-"]') !== null"""
+
+
+def wait_for_sidebar_shell(page, timeout_ms = SHELL_TIMEOUT_MS) -> bool:
+ try:
+ page.wait_for_function(_SHELL_JS, timeout = timeout_ms)
+ return True
+ except Exception:
+ return False
+
+
def drive_tabs(page) -> None:
for route, row_id, name in TABS:
step(f"open {name} ({route})")
@@ -611,6 +624,12 @@ def drive_tabs(page) -> None:
else:
info(f"{name}: redirected to {landed} after a measured verdict (allowed)")
+ # A full navigation boots the app again: on a slow runner it can still show its "Loading..."
+ # screen after the fixed wait, with no sidebar at all. Judge rows only once the shell is up.
+ shell_up = wait_for_sidebar_shell(page)
+ if not shell_up:
+ info(f"{name}: no sidebar nav row mounted within {SHELL_TIMEOUT_MS} ms of {route}")
+
try:
_rows_seen.update(rid for rid, got in row_states(page).items() if got)
_rows_seen.update(rid for rid in ROW_STAND_INS if stand_in_shown(page, rid))
@@ -630,7 +649,10 @@ def drive_tabs(page) -> None:
f"{name}: nav row {row_id} stands down while its section shows; reached by route instead"
)
elif row_id in INLINE_ROW_IDS:
- fail(f"{name}: nav row {row_id} is pinned inline by default but did not render")
+ fail(
+ f"{name}: nav row {row_id} is pinned inline by default but did not render "
+ f"(shell mounted: {shell_up}; rows: {row_states(page)})"
+ )
else:
# Video and Export live under "More", which renders no test id.
info(f"{name}: nav row not pinned inline; reached by route instead")
diff --git a/tests/studio/test_mac_tab_capability_warm_window.py b/tests/studio/test_mac_tab_capability_warm_window.py
index ed39c0bfdec..48beac18d07 100644
--- a/tests/studio/test_mac_tab_capability_warm_window.py
+++ b/tests/studio/test_mac_tab_capability_warm_window.py
@@ -91,8 +91,12 @@ class FakePage:
row_missing: bool = False,
sections: frozenset = frozenset(),
hidden_sections: frozenset = frozenset(),
+ mounts_after_wait: dict | None = None,
) -> None:
self.rows = rows
+ # The app's boot screen: no rows until the script waits, then these mount.
+ self.mounts_after_wait = mounts_after_wait
+ self.waited_for_shell = 0
self.row_missing = row_missing
self.sections = sections
self.hidden_sections = hidden_sections
@@ -141,6 +145,18 @@ class FakePage:
def wait_for_timeout(self, ms) -> None:
pass
+ def wait_for_function(
+ self,
+ script,
+ arg = None,
+ timeout = None,
+ ) -> None:
+ self.waited_for_shell += 1
+ if self.mounts_after_wait is not None:
+ self.rows = self.mounts_after_wait
+ if not any(state is not None for state in self.rows.values()):
+ raise TimeoutError("no nav row mounted")
+
def screenshot(
self,
path = None,
@@ -343,6 +359,34 @@ def test_drive_tabs_fails_when_the_pinned_rows_never_render(tmp_path, monkeypatc
assert any(f"nav row {row_id} is pinned inline" in m for m in mod._failed), mod._failed
+def test_drive_tabs_waits_out_the_boot_screen_before_judging_the_rows(tmp_path, monkeypatch):
+ """A full navigation boots the app again, and a slow macOS runner can still show the
+ "Loading..." screen after the fixed settle wait (Library, twice on 2026-10-29). The rows
+ are judged once the sidebar has mounted, not while nothing has rendered yet."""
+ mod = _load(tmp_path, monkeypatch)
+ _health(mod, [SETTLED])
+ page = FakePage({}, mounts_after_wait = {rid: SETTLED_ENABLED for rid in mod.INLINE_ROW_IDS})
+
+ mod.drive_tabs(page)
+
+ assert page.waited_for_shell >= 1
+ assert mod._failed == []
+ assert mod._rows_seen == set(mod.INLINE_ROW_IDS)
+
+
+def test_a_row_missing_from_a_mounted_sidebar_still_fails(tmp_path, monkeypatch):
+ mod = _load(tmp_path, monkeypatch)
+ _health(mod, [SETTLED])
+ rows = {rid: SETTLED_ENABLED for rid in mod.INLINE_ROW_IDS if rid != "library"}
+ page = FakePage({}, mounts_after_wait = rows)
+
+ mod.drive_tabs(page)
+
+ failures = [m for m in mod._failed if "nav row library is pinned inline" in m]
+ assert failures, mod._failed
+ assert "shell mounted: True" in failures[0]
+
+
def test_drive_tabs_does_not_fail_on_the_rows_that_live_under_more(tmp_path, monkeypatch):
"""Video and Export render inside the More dropdown, which mounts no data-testid at
all. Their absence is the documented shape, not a miss -- asserting on it would be