import pytest playwright = pytest.importorskip("playwright.sync_api") from auto_reverse.browser import Browser # noqa: E402 @pytest.fixture def browser(): try: b = Browser(proxy_port=None, headless=True) b.start() except Exception as exc: # browser binary missing, etc. pytest.skip(f"browser unavailable: {exc}") yield b b.stop() def test_navigate_and_snapshot(browser, fixture_site): browser.navigate(fixture_site + "/") snap = browser.snapshot() assert snap["url"].endswith("/") assert "title" in snap