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:
@@ -5,8 +5,8 @@ from cloakbrowser import launch
|
||||
|
||||
|
||||
@patch("cloakbrowser.browser.ensure_binary")
|
||||
@patch("cloakbrowser.browser._import_sync_playwright")
|
||||
def test_extension_loading(mock_playwright_import, mock_ensure_binary):
|
||||
@patch("playwright.sync_api.sync_playwright")
|
||||
def test_extension_loading(mock_sync_playwright, mock_ensure_binary):
|
||||
mock_ensure_binary.return_value = "/fake/chrome"
|
||||
|
||||
mock_browser = MagicMock()
|
||||
@@ -14,10 +14,7 @@ def test_extension_loading(mock_playwright_import, mock_ensure_binary):
|
||||
mock_pw = MagicMock()
|
||||
mock_pw.chromium.launch.return_value = mock_browser
|
||||
|
||||
mock_pw_manager = MagicMock()
|
||||
mock_pw_manager.return_value.start.return_value = mock_pw
|
||||
|
||||
mock_playwright_import.return_value = mock_pw_manager
|
||||
mock_sync_playwright.return_value.start.return_value = mock_pw
|
||||
|
||||
launch(extension_paths=["./ext"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user