Tests and development artifacts #
Run all Node commands from the repository root so fixture, extension, and output paths resolve correctly.
Layout #
test_*.mjs: regression checks and browser test scripts.inspect_*.mjs: interactive browser/DOM inspection scripts.test_helper.mjs: shared browser launch and sign-in helper.fixtures/: OCR input images and the English language model for the HTML test.screenshots/: generated browser screenshots, ignored by Git.artifacts/: saved page HTML and session data, ignored by Git.profiles/chrome/andprofiles/firefox/: persistent local browser profiles.browsers/chrome/: downloaded Chrome for Testing installation.
Profiles and browser downloads are local resources. The Chrome scripts that use
the downloaded browser expect version mac_arm-153.0.8010.36 under
test/browsers/chrome/; the shared helper uses the installed Google Chrome app.
Firefox tests use the installed Firefox app, with a FIREFOX_PATH override.
Commands #
# LLM request/permission/error tests (stubbed providers)
npm run test:llm
# React composer regression tests in headless Chrome
npm run test:composer
# Unpacked Chrome extension, real OCR and intercepted LLM provider response
npm run test:extension
# Firefox fixture-based regression check
npm run test:firefox
# Firefox source validation (also runs during build:firefox)
node test/test_firefox_validation.mjs
# Build and package Firefox, then verify reviewer-source reproducibility
npm run build:firefox
npm run source:firefox
node test/test_firefox_build.mjs
# Live browser checks
npm run test:firefox -- --live
node test/test_e2e_all_features.mjs
# Example inspection script
node test/inspect_composer.mjs
For test_browser_ocr.html, serve the repository root over HTTP and open
/test/test_browser_ocr.html. The page loads dependencies from node_modules/
and its inputs from test/fixtures/.
The composer tests use the real React GalleryItem props contract, including the
ALT editor's persistent draft. They verify submitted image state, no modal opens,
correct-image matching, reorder/removal/crop/edit races, empty and failed results,
endpoint visibility, and narrow layouts. test:extension additionally exercises
isolated content scripts, the page-world bridge, offscreen Tesseract, popup saving,
and the background HTTP request. The provider response is intercepted; these
checks neither publish posts nor call an external model provider.