Add macOS support

This commit is contained in:
dannyward630 2026-05-17 21:05:20 -04:00
parent 143aff4bd2
commit d09200f01d
10 changed files with 240 additions and 50 deletions

View file

@ -241,3 +241,16 @@ def test_e12_linux_resolve_headless_without_xvfb_raises_clear_error(monkeypatch)
with pytest.raises(RuntimeError, match="Xvfb"):
ip._resolve_headless()
assert ip._virtual_display is None
@pytest.mark.e2e
def test_e13_darwin_resolve_headless_raises_clear_error(monkeypatch):
"""E13: macOS can launch visibly, but ``headless=True`` should fail
early with a clear message until an invisible backend exists."""
import sys as _sys
monkeypatch.setattr(_sys, "platform", "darwin")
ip = InvisiblePlaywright(seed=42, headless=True)
with pytest.raises(RuntimeError, match="headless=True is not yet supported on macOS"):
ip._resolve_headless()
assert ip._virtual_display is None