diff --git a/tests/cdp_native_scrollbar_test.py b/tests/cdp_native_scrollbar_test.py index 37a10c89..8f3a87b6 100644 --- a/tests/cdp_native_scrollbar_test.py +++ b/tests/cdp_native_scrollbar_test.py @@ -9,6 +9,12 @@ Flow: 2. SendInput: move real mouse cursor to scrollbar, click-and-drag 3. CDP: verify scrollTop changed, flag lifecycle, content integrity """ +import sys +import pytest +pytest.importorskip("websockets") +if sys.platform != "win32": + pytest.skip("Windows-only (SendInput)", allow_module_level=True) + import ctypes import ctypes.wintypes import json @@ -265,7 +271,7 @@ async def run(): })() """) - print(f"\n=== RESULTS ===") + print("\n=== RESULTS ===") print(f" Total scroll delta: {total_delta}px") print(f" Monotonic steps: {increasing}/{steps-1}") print(f" Reversals: {reversals}") diff --git a/tests/cdp_scrollbar_behavioral.py b/tests/cdp_scrollbar_behavioral.py index 220d10a5..4d358782 100644 --- a/tests/cdp_scrollbar_behavioral.py +++ b/tests/cdp_scrollbar_behavioral.py @@ -3,6 +3,9 @@ Tests the actual deployed code on localhost:8787 via Chrome DevTools Protocol. Verifies flag lifecycle, event handler wiring, and render suppression. """ +import pytest +pytest.importorskip("websockets") + import json import asyncio import urllib.request @@ -255,7 +258,7 @@ async def run_tests(): })() """) if result.get("has_children") == True: - print(f" PASS: content rendered after drag release") + print(" PASS: content rendered after drag release") passed += 1 else: print(f" FAIL: {result}")