Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

test(screen-context): stop the host's Accessibility grant from deciding service tests

rubenluetke10-beep5b6536dc0230
diff --git a/tests/unit/screen_context/test_service.py b/tests/unit/screen_context/test_service.py
index f0e2383b3d..f0e3d228ce 100644
--- a/tests/unit/screen_context/test_service.py
+++ b/tests/unit/screen_context/test_service.py
@@ -18,6 +18,9 @@ import io
import secrets
import threading
+import pytest
+
+from jarvis.screen_context import service as _service_module
from jarvis.screen_context.models import (
DegradationCode,
RedactionRule,
@@ -37,6 +40,17 @@ from jarvis.screen_context.service import (
settings_from_config,
)
+
[email protected](autouse=True)
+def _accessibility_granted(monkeypatch: pytest.MonkeyPatch) -> None:
+ """These tests feed fake UI text; the host's real grant must not decide them.
+
+ A macOS runner has no Accessibility grant, so the real probe withheld
+ every fake node and the redaction tests saw empty text there.
+ """
+ monkeypatch.setattr(_service_module, "accessibility_permission_error", lambda: None)
+
+
MONITORS = [
{"left": -1920, "top": 0, "width": 3840, "height": 1080, "name": "virtual"},
{"left": -1920, "top": 0, "width": 1920, "height": 1080, "name": "left"},