Commit graph

34 commits

Author SHA1 Message Date
feder-cr
07701a901d Merge pull request #2 from christianbaumann/main
Add comprehensive test suite (270+ tests across 14 files)

- Bayesian network primitives (25 tests)
- fingerprint sampler (55 tests)
- Profile dataclass + pin system (43 tests)
- configure_proxy decision table (24 tests)
- Windows + platform-agnostic prefs (27 tests)
- CLI / download gap coverage (17 tests)
- Multi-module integration (12 tests)
- E2e launcher lifecycle (9 tests)
- launcher / headless / async_api (32 tests)
- Linux-specific prefs / headless (16 tests)
- Linux tar.gz download (4 tests)
- Linux integration pipeline (3 tests)
- Linux launcher e2e (4 tests)
- pytest markers + shared conftest

Resolves conflicts in pyproject.toml, test_prefs.py, test_proxy.py by
keeping the upstream additions and merging with the previous wheel-build
fix. 323 tests pass on Windows; 14 e2e tests deselected by default
(require patched Firefox binary).
2026-05-16 17:14:08 -07:00
feder-cr
1d77f99770 docs: add Related projects section (arkenfox, LibreWolf, Camoufox) 2026-05-16 17:09:52 -07:00
feder-cr
9872b1995a docs: collapse layer table into a link to firefox-stealth 2026-05-16 10:49:32 -07:00
feder-cr
3a96103ab6 ci: remove PyPI publish workflow (not publishing) 2026-05-16 10:43:05 -07:00
feder-cr
dd140d04ae docs: install via git+https (package not on PyPI) 2026-05-16 10:43:04 -07:00
feder-cr
abaf798896 ci: add PyPI publish workflow on tag v* (uses trusted publishing, no token) 2026-05-16 10:39:41 -07:00
feder-cr
3d303a4915 tests: add wheel regression — fail if wheel has duplicate zip entries 2026-05-16 10:39:40 -07:00
feder-cr
c60a1891b8 fix(build): remove redundant force-include that caused duplicate wheel entries (PyPI reject), add pytest slow marker 2026-05-16 10:39:39 -07:00
feder-cr
b42dc31456 tests: add/update README.md 2026-05-15 20:02:02 -07:00
feder-cr
9de222aa15 tests: add/update tests/test_prefs.py 2026-05-15 20:02:01 -07:00
feder-cr
93da245b8a tests: add/update tests/test_cli.py 2026-05-15 20:02:00 -07:00
feder-cr
280d6838e1 tests: add/update .github/workflows/tests.yml 2026-05-15 20:01:59 -07:00
feder-cr
fbfb4fc8c4 tests: add/update tests/test_launcher_config.py 2026-05-15 20:01:58 -07:00
feder-cr
03f8453398 tests: add/update tests/test_pin.py 2026-05-15 20:01:56 -07:00
feder-cr
4f38b2ec29 tests: add/update tests/test_fpforge.py 2026-05-15 20:01:55 -07:00
feder-cr
67e2824876 tests: add/update tests/test_proxy.py 2026-05-15 20:01:54 -07:00
feder-cr
508cb0f59d tests: add/update tests/test_imports.py 2026-05-15 20:01:53 -07:00
feder-cr
6185dbc078 docs: tighten technical claims (mDNS, Chromium open-source layers, competitor list, font metrics) 2026-05-15 19:52:25 -07:00
chrissbaumann
70c1ca464f test(e2e): add 4 Linux launcher-routing tests for Phase 9
E9-E12 exercise the launcher's Linux code paths without spawning a
real Firefox binary or Xvfb. They monkeypatch ``sys.platform`` and
stub ``make_virtual_display`` / ``_binary_on_path`` so the tests run
on any host:

- E9 ``_build_prefs(headless=True)`` on Linux passes
  ``virtual_display=False`` to the translator, so the Win32-only
  ``security.sandbox.gpu.level`` workaround never leaks into Linux
  prefs (Xvfb handles window hiding instead).
- E10 ``_resolve_headless`` on Linux + headless=True invokes the
  dispatcher and stores the returned object on ``self._virtual_display``.
- E11 ``_teardown`` stops the Linux virtual display, clears the
  reference, and is idempotent on a second call.
- E12 With Xvfb missing from PATH, ``_resolve_headless`` raises a
  clear ``RuntimeError`` mentioning ``Xvfb`` instead of a cryptic
  FileNotFoundError.

Suite on Linux/WSL: 286 passed, 5 skipped (4 binary-gated E2E
lifecycle tests + 1 Win32 ctypes test). Binary-gated E1/E2/E5/E8
remain ready to run on Linux once the patched Firefox tar.gz is
fetched locally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 14:07:03 +02:00
chrissbaumann
b8139c2873 test(integration): add 3 Linux pipeline tests for Phase 8
IT11–IT13 mirror IT10 on the Linux platform branch, verifying:
- Xvfb workarounds coexist with SOCKS5 proxy mutation
- MSAA pin propagates through prefs translation on Linux
- _LINUX_GENERIC_FONT_FACTORS is prepended to per-font metrics

Tests use monkeypatch on sys.platform so they run on any host OS.
Verified green on Linux/WSL alongside the existing Windows tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 13:53:24 +02:00
chrissbaumann
a3353fc861 test(download): add 4 Linux tar.gz download tests for Phase 7
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 13:40:42 +02:00
chrissbaumann
d392ca2971 test(prefs, headless): add 16 Linux-specific tests for Phase 6 + 10
Cover the Linux branches in prefs.py that previously had no tests
(font metrics, GPU spoofing, MSAA from profile, canvas noise mask
per renderer, WebGL extension preservation, Xvfb workarounds,
virtual_display no-op) and add construction smoke tests for
_LinuxVirtualDisplay. Also fix two host-platform-dependent tests
so the suite stays green on both Windows and Linux.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 13:21:17 +02:00
chrissbaumann
4f6254469e test(launcher, headless, async_api): add 32 Phase 10 gap-coverage tests
Final sweep adds unit tests for the modules left at 0% direct coverage
after Phases 1-9:

- launcher._tz_env: 7 tests covering the IANA -> POSIX mapping
  including the Phoenix / Honolulu no-DST regression cases
- launcher._humanize_max_seconds, _default_context_kwargs: 11 tests
  on the constructor-side helpers (no browser launch)
- _headless.make_virtual_display dispatcher + _WindowsVirtualDesktop
  init/teardown: 8 tests (Linux dispatch branch covered without
  spawning Xvfb, since __init__ does no I/O)
- async_api.InvisiblePlaywright constructor parity with sync: 8 tests
  guarding against drift between the two APIs

Suite: 230 -> 264 passing. Pyramid stays clean: 243 unit / 12
integration / 9 e2e.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:59:47 +02:00
chrissbaumann
234fe7e406 test(e2e): add 9 launcher lifecycle tests for Phase 9
Five test the constructor only (seed handling, eager profile build,
fail-fast pin validation) and always run. Four spin up the patched
Firefox and exercise the full `with InvisiblePlaywright(...)` lifecycle,
gated on a locally cached binary so CI without the binary skips
cleanly. All 230 tests pass on Windows with the binary fetched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:52:46 +02:00
chrissbaumann
9c8d24408b test(integration): add 12 multi-module pipeline tests for Phase 8
Covers profile->prefs end-to-end, SOCKS/HTTP proxy + prefs composition,
pin propagation, seed determinism/variation, font whitelist passthrough,
dark/light theme palette overlay, and a Windows-specific virtual_display
+ SOCKS combo. Linux-specific branches stay covered by their unit tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:44:46 +02:00
chrissbaumann
ca8d815216 test(cli, download): add 17 gap-coverage tests for Phase 7
CLI: clear-cache (existing + missing), path (ok + error), fetch happy
path, no/unknown subcommand error paths. Calls cli.main() directly
instead of subprocess to keep tests fast and capture stderr cleanly.

Download: cache hit skips HTTP, tar.gz extraction, comment/blank
checksum lines, unknown archive format, missing entry after extract,
unsupported platform. Also covers pure helpers _parse_owner_repo,
_sha256_file, and _github_token env precedence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:35:57 +02:00
chrissbaumann
54ae310bf2 test(prefs): add 27 Windows + platform-agnostic gap tests
Covers _accept_language, _font_metrics_for_platform, Windows GPU/MSAA
clearing, Windows canvas noise mask (intel path), Windows WebGL extension
clearing, timezone handling, extra_prefs overlay (add/delete/override/no-op),
dark-theme system colors palette, locale normalization, Xvfb-key absence on
Windows, virtual_display sandbox workaround, and seed-derived LAN IP.

Linux-specific branches are intentionally not covered in this commit per
scoping instruction; they remain available in the plan for a follow-up
pass when running on Linux.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:30:46 +02:00
chrissbaumann
074b4b3274 test(proxy): add 24 unit tests for configure_proxy decision table
Covers every input partition: None/empty/direct, SOCKS4/5/default,
HTTP/HTTPS passthrough, case-insensitive scheme detection, malformed
inputs, mutation contract, and edge cases (IPv6 brackets, whitespace,
non-numeric ports).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 12:24:57 +02:00
chrissbaumann
38ae41289d test(profile): add 43 unit tests for Profile dataclass and pin system
Covers _validate_pin_key (all groups + negatives), _apply_pins_to_raw
(fonts list/tuple/typeerror, multi-pin, no-mutation, unknown-key guard),
and generate_profile (determinism, seed coercion, pin propagation through
to_prefs_dict, frozen-instance, dark_theme bool coercion, fonts list
roundtrip, int31 boundary). Includes a guard test that every dotted pin
key has a _PIN_TO_RAW mapping.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:46:09 +02:00
chrissbaumann
3286123b11 test(sampler): add 55 unit tests for fingerprint Bayesian sampler
Covers classify_gpu (decision-table over 28 GPU strings inc. boundary
values for AMD Radeon number ranges), _screen_tier resolution
classification, derive_font_prefs / derive_font_whitelist coherence and
determinism, and the public Forge / sample entry points (locked
identity, key set, type correctness, seed determinism).

One plan deviation: the original plan claimed `AMD FirePro W7100` →
`workstation`, but the workstation regex requires a `Radeon` prefix,
so FirePro alone falls through to the `mid_range` fallback. Test
asserts the actual behaviour.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:35:24 +02:00
chrissbaumann
8709ef77d2 test(network): add 25 unit tests for Bayesian network primitives
Covers _weighted_pick, _parent_key, _topsort, Node.sample, Network.sample
following ECP, BVA, and error-guessing techniques from the plan.
2026-05-14 11:24:57 +02:00
chrissbaumann
957f84d9a5 test: add pytest markers, conftest, fix Windows-incompatible existing tests
- Add tests/conftest.py with deterministic_rng + sample_profile fixtures
- Register unit/integration/e2e markers in pyproject.toml
- Mark existing 14 tests as @pytest.mark.unit
- Fix test_cli.py: use 'invisible_playwright' (underscore) for 'python -m'
- Fix test_translate_includes_gpu_renderer: assert Windows behavior (empty renderer)
2026-05-14 11:21:10 +02:00
Federico
c690dbfd33
Update README.md 2026-05-12 22:35:39 -07:00
feder-cr
7a983e99c5 feat: initial public release
invisible-playwright: a patched Firefox 150.0.1 for browser-fingerprint
stealth, shipped as a Playwright-compatible Python wrapper.

  * Sync + async InvisiblePlaywright launcher (firefox_user_prefs, virtual
    desktop on Windows, SOCKS5 auth via patched nsProtocolProxyService)
  * fpforge: Bayesian fingerprint sampler over GPU / audio / fonts /
    screen / ~400 other navigator fields
  * WebRTC stealth: srflx address swap, synthetic srflx fallback,
    private-LAN host candidates. No real public IP leak via STUN.
  * GPU sandbox fix for FF150 alt-desktop regression
  * Bezier-curve mouse motion baked into Juggler

Targets Windows x86_64 + Linux x86_64. Binary fetched on first run from
GitHub Release "firefox-1".
2026-05-12 22:32:58 -07:00