mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
refactor: remove optional patchright backend
Patchright scored identically to plain Playwright on reCAPTCHA v3 (the binary handles stealth at C++ level) while breaking proxy auth and add_init_script (#27). Removed the backend param, CLOAKBROWSER_BACKEND env var, the patchright extra, and the two backend-specific tests. Stock Playwright is now the only backend.
This commit is contained in:
+24
-1
@@ -1,10 +1,33 @@
|
||||
"""Basic launch tests for cloakbrowser."""
|
||||
|
||||
import pytest
|
||||
from cloakbrowser import launch, launch_async, binary_info
|
||||
from cloakbrowser import (
|
||||
launch,
|
||||
launch_async,
|
||||
launch_context,
|
||||
launch_persistent_context,
|
||||
binary_info,
|
||||
)
|
||||
from cloakbrowser.config import get_chromium_version
|
||||
|
||||
|
||||
@pytest.mark.parametrize("env", [None, "patchright"])
|
||||
def test_removed_backend_kwarg_raises(env, monkeypatch):
|
||||
"""The removed `backend` parameter raises a clear TypeError before any
|
||||
launch side effects, regardless of the (also removed) CLOAKBROWSER_BACKEND
|
||||
env var. Guards the patchright removal."""
|
||||
if env is None:
|
||||
monkeypatch.delenv("CLOAKBROWSER_BACKEND", raising=False)
|
||||
else:
|
||||
monkeypatch.setenv("CLOAKBROWSER_BACKEND", env)
|
||||
with pytest.raises(TypeError, match="backend"):
|
||||
launch(backend="patchright")
|
||||
with pytest.raises(TypeError, match="backend"):
|
||||
launch_context(backend="patchright")
|
||||
with pytest.raises(TypeError, match="backend"):
|
||||
launch_persistent_context("/tmp/cloakbrowser-test-profile", backend="patchright")
|
||||
|
||||
|
||||
def test_binary_info():
|
||||
"""binary_info() returns expected structure."""
|
||||
info = binary_info()
|
||||
|
||||
Reference in New Issue
Block a user