Run browser tests locally: Playwright 1.64.1 in .venv, scripts switch to it on their own

The browser tests and screenshot tools now work with plain python3 on a machine whose
system Python refuses pip installs: tools/use_venv.py re-runs them with the repo's .venv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 16:50:15 -04:00
co-authored by Claude Opus 5.5
parent 3f971a94c2
commit cab9343b26
13 changed files with 64 additions and 9 deletions
+8 -2
View File
@@ -34,10 +34,16 @@ The controls are in the in-game notebook (N) under Controls. The basics:
You need Node (tested with 22), Python 3, and Playwright for the browser tests and screenshots:
```sh
pip install -r requirements.txt
python3 -m playwright install chromium
uv venv .venv
uv pip install --python .venv/bin/python -r requirements.txt
.venv/bin/python -m playwright install chromium
```
If uv is not installed, `python3 -m venv .venv` and
`.venv/bin/pip install -r requirements.txt` also work; then install Chromium as above.
After that, plain `python3` works for every command below; the browser scripts switch to
`.venv` on their own.
```sh
python3 build.py # build dist/index.html
python3 test/run_all.py # headless test suites