Files
camoufox/tests
Jake WriterandClaude Opus 5 41ba997799 build: stage bundled fonts into unpackaged builds
`mach build` leaves dist/bin/fonts holding only TwemojiMozilla.ttf -- the font
bundles and fontconfig are staged by scripts/package.py, so they exist only in
packaged builds. Anything launching the objdir binary through the Python
wrapper therefore starts a browser with no usable content font, because the
wrapper sets FONTCONFIG_FILE to a file that is not there.

It fails confusingly: the browser chrome still has system fonts, so the only
symptom is tofu boxes in page content, and through AsyncCamoufox it surfaces as
a TargetClosedError with no indication of the cause. That cost real time while
writing the tests/patches scripts, hence the note in their docstrings.

`make stage-fonts` copies them in. Idempotent, and a no-op when nothing is
built yet. Not needed by `make run` or `make tests`, which launch the binary
directly and fall back to the system fontconfig.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 14:32:42 -06:00
..
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00
2024-11-03 06:14:39 -06:00

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.evaluate only 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