Stealth Chromium that passes every bot detection test. Drop-in Playwright replacement with source-level fingerprint patches. 50+ tests passed.
Python ai-agentsanti-detectantidetect-browserbot-detectionbrowser-automationcaptcha-bypasschromiumcloudflarecloudflare-bypassfingerprintheadless-browserplaywrightpuppeteerpythonrecaptchaseleniumstealth-browserundetectedweb-scrapingwebscraping
ci: give the python job a license key, make claim tests display-independent
CloakHQa9e75db85c1e
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 1ba0f35..ca08be7 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -9,6 +9,9 @@ on:jobs:python:runs-on: ubuntu-latest+ # real_browser tests launch the binary, which needs a key (see javascript-browser).+ env:+ CLOAKBROWSER_LICENSE_KEY: ${{ secrets.CLOAKBROWSER_CI_KEY }}steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0@@ -17,7 +20,11 @@ jobs:- name: Install dependenciesrun: pip install -e ".[dev]" pytest pytest-asyncio- name: Run tests- run: pytest tests/ -v -m "not slow"+ # Fork PRs get no secrets: run everything except the real-browser tests there.+ run: |+ if [ -n "$CLOAKBROWSER_LICENSE_KEY" ]; then pytest tests/ -v -m "not slow"+ else echo "::notice::Real-browser tests skipped: no license key (PRs from forks get no secrets)."+ pytest tests/ -v -m "not slow and not real_browser"; fijavascript:runs-on: ubuntu-latestdiff --git a/tests/test_free_claim.py b/tests/test_free_claim.pyindex 3892c0d..cc12e2a 100644--- a/tests/test_free_claim.py+++ b/tests/test_free_claim.py@@ -203,6 +203,7 @@ def test_no_key_in_terminal_menu_default_gets_free_key(cache, monkeypatch, capsymonkeypatch.setattr(lic, "check_claim", lambda code: next(answers))monkeypatch.setattr(lic.time, "sleep", lambda s: None)monkeypatch.setattr(download, "_isatty", lambda s: True)+ monkeypatch.setattr(download, "_has_display", lambda: True) # CI runners have noneseen = _valid_launch(monkeypatch)with mock.patch("builtins.input", return_value="") as ask, \mock.patch("webbrowser.open", return_value=True) as opened:diff --git a/tests/test_login.py b/tests/test_login.pyindex 4270f5a..0a8f535 100644--- a/tests/test_login.py+++ b/tests/test_login.py@@ -68,6 +68,7 @@ def test_login_no_key_non_interactive_exits(cache_dir):def test_login_enter_claims_free_key_by_email(cache_dir):"""ENTER opens this install's claim link, waits for the key, then saves it."""with mock.patch("cloakbrowser.download._isatty", return_value=True), \+ mock.patch("cloakbrowser.download._has_display", return_value=True), \mock.patch("builtins.input", return_value=""), \mock.patch("webbrowser.open") as opened, \mock.patch("cloakbrowser.license.check_claim", side_effect=[None, "cb_claimed"]), \