mirror of
https://github.com/daijro/camoufox.git
synced 2026-09-09 08:01:15 +00:00
The suite in tests/async is upstream Playwright's conformance suite, so it asserts upstream semantics: tests read globals their own page scripts defined and pass element handles into evaluate(). Under Camoufox's isolated world about 59 of them fail on "X is not defined" for a global the page really did set. The "mw:" prefix cannot stand in -- it refuses handles by design (Runtime.js) and much of this suite needs them -- so this adds a disableWorldIsolation config key that makes the default world the page's own, and turns it on for this suite only. The flag gives up the property this fork exists for: automation JS becomes visible to the page again. It is a conformance-suite mode, not a scraping mode. Camoufox's isolation keeps its own coverage in tests/patches/isolated-evaluate.py, which must go on passing without the flag. Measured on beta.30 with Playwright 1.62: 73 failed/1023 passed -> 14 failed/1082 passed, with no test failing that was not already failing. 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