invisible_playwright/tests
feder-cr 3d8ba0b82c feat: deterministic reCAPTCHA cookie pre-seed via Bayesian browsing history
Adds opt-in helper that auto-injects coherent cookie history into every
BrowserContext created via new_context(). Content is fully deterministic
from the persona seed so a given seed always presents the same cookies
across sessions.

Composition (per persona, all derived from seed):
  - 5 cookies on .google.com (NID, CONSENT, SOCS, _GRECAPTCHA, ENID).
    Excludes 1P_JAR which was deprecated by Google in 2022. CONSENT
    `lang+region` token derived from the persona's IANA timezone
    (Europe/Rome -> it+IT, America/* -> en+FX, etc.). NID prefix
    broadened to 100-540 to cover historical versions.
  - Per-site cookies on 13-25 "visited" everyday domains, sampled from a
    Bayesian network conditioned on gpu_class - workstation/high_end
    personas trend toward dev/tech sites, low_end/integrated_old trend
    toward shop/news/reference. Each site contributes 1-7 cookies based
    on a `cookie_profile` tag. Cookie pool includes _ga, _gid, _clck,
    _clsk, __cf_bm, OneTrust/CookieYes consent, _fbp (Facebook Pixel),
    _dc_gtm_<id> (Tag Manager helper), __hssrc (HubSpot helper).

API:
    Stealthfox(seed=42, prep_recaptcha=True)

No per-call configuration: visited-sites + cookie composition all derived
from the persona seed via the Bayesian sampler.

Gated server-side: forced False if profile_dir is set (persistent profile
owns its own state). All expiries capped to 395 days per Chrome/Firefox
400-day RFC 6265bis-15 limit.

Bayesian integration:
  - New `derive_browsing_history(gpu_class, rng)` in _fpforge/_sampler.py
    (parallel to `derive_font_prefs`).
  - New data files: browsing_pool.json (50 site entries) and
    cpt_browsing_given_class.json (per-class probabilities).
  - Profile dataclass exposes `browsing_history` field.
  - _recaptcha_seed.py consumes Profile.browsing_history; receives
    timezone separately to derive CONSENT lang+region.

Also drops a dead Chromium-only e2e test that always skipped on our
Firefox-only wrapper.

Test coverage: 29 unit tests covering composition, profile recipes
(minimal/ga_only/ga_cf/ga_consent/ga_consent_clarity), determinism,
Chrome 400-day cap, Playwright field requirements, CONSENT lang
mapping (IT/DE/US/default), helper-cookie probability distributions,
end-to-end with real fpforge Profile.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 20:01:26 -07:00
..
conftest.py test: add pytest markers, conftest, fix Windows-incompatible existing tests 2026-05-14 11:21:10 +02:00
test_async_api.py test(launcher, headless, async_api): add 32 Phase 10 gap-coverage tests 2026-05-14 12:59:47 +02:00
test_build.py tests: add wheel regression — fail if wheel has duplicate zip entries 2026-05-16 10:39:40 -07:00
test_cli.py tests: add/update tests/test_cli.py 2026-05-15 20:02:00 -07:00
test_constants.py test: fortress coverage for download + constants + e2e 2026-05-20 12:20:11 -07:00
test_cross_origin_iframe.py release: 0.1.8 - fix #20 cross-origin iframe regression (pref-only) 2026-05-23 10:05:02 -07:00
test_download.py test: fortress coverage for download + constants + e2e 2026-05-20 12:20:11 -07:00
test_e2e.py test(e2e): add 4 Linux launcher-routing tests for Phase 9 2026-05-14 14:07:03 +02:00
test_fingerprint_consistency.py feat: deterministic reCAPTCHA cookie pre-seed via Bayesian browsing history 2026-05-24 20:01:26 -07:00
test_fingerprint_surface.py test: fingerprint surface + consistency e2e tests 2026-05-21 13:47:14 -07:00
test_fpforge.py tests: add/update tests/test_fpforge.py 2026-05-15 20:01:55 -07:00
test_headless.py test(prefs, headless): add 16 Linux-specific tests for Phase 6 + 10 2026-05-14 13:21:17 +02:00
test_imports.py tests: add/update tests/test_imports.py 2026-05-15 20:01:53 -07:00
test_integration.py test(integration): add 3 Linux pipeline tests for Phase 8 2026-05-14 13:53:24 +02:00
test_launcher_config.py feat: persistent profile dir + C7 closure (firefox-5 / 0.1.6) 2026-05-21 12:19:38 -07:00
test_launcher_helpers.py test(launcher, headless, async_api): add 32 Phase 10 gap-coverage tests 2026-05-14 12:59:47 +02:00
test_mouse.py fix: every mouse action failed on FF150 — jugglerSendMouseEvent was never landed (#9) 2026-05-18 14:45:01 -07:00
test_network.py test(network): add 25 unit tests for Bayesian network primitives 2026-05-14 11:24:57 +02:00
test_pin.py tests: add/update tests/test_pin.py 2026-05-15 20:01:56 -07:00
test_prefs.py Merge pull request #2 from christianbaumann/main 2026-05-16 17:14:08 -07:00
test_profile.py test(profile): add 43 unit tests for Profile dataclass and pin system 2026-05-14 11:46:09 +02:00
test_proxy.py tests: add/update tests/test_proxy.py 2026-05-15 20:01:54 -07:00
test_recaptcha_seed.py feat: deterministic reCAPTCHA cookie pre-seed via Bayesian browsing history 2026-05-24 20:01:26 -07:00
test_release_e2e.py test: fortress coverage for download + constants + e2e 2026-05-20 12:20:11 -07:00
test_sampler.py test(sampler): add 55 unit tests for fingerprint Bayesian sampler 2026-05-14 11:35:24 +02:00
test_service_worker.py test: unblock pre-push hook collection 2026-05-21 20:21:12 -07:00