mirror of
https://github.com/daijro/camoufox.git
synced 2026-09-05 16:00:41 +00:00
Two harness defects, both of which silently destroyed coverage rather than reporting anything useful: * conftest's session `event_loop` fixture called asyncio.get_event_loop() with no running loop. That is deprecated on 3.12 and raises on 3.14, and because it is a fixture every async test errored at setup: a full run reported 1151 errors and 0 passes in 10s, which reads like a catastrophic browser failure and is not. Allocate and install a fresh loop instead. * async/test_page_route.py imported playwright._impl._glob.glob_to_regex, which Playwright renamed to glob_to_regex_pattern (now returning the pattern string rather than a compiled regex). A module-level ImportError dropped all 43 route tests from collection -- the tests covering exactly the code path the routed-header fix touches. Shim it, keeping the old helper's semantics. Collection goes from 1182 tests + 1 error to 1225 tests, and the suite runs under both 3.12 and 3.14. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Camoufox Tests
Ensures that Playwright functionality is not broken.
This directory is based on the original Playwright-Python tests.
It has been modified to skip tests that use the following features:
- Injecting JavaScript into the page or writing to DOM. Camoufox's
page.evaluateonly supports reading values, not executing within the page context. - Overriding the User-Agent.
- Any tests specific to Chromium or Webkit.
Usage
Setting up the environment
Cd to this directory and run the following command to setup the venv and install the dependencies:
bash setup-venv.sh
Running the tests
Run via the shell script:
bash run-tests.sh --headful --executable-path /path/to/camoufox-bin
Or through the Makefile:
make tests headful=true