How do I run the browser harness against the environment?
Table of Contents
The harness is the check side of the UX cluster: it drives the running ores.web in a browser and asserts the rules of the Record screen standard by their identifiers. It lives in projects/ores.web/packages/harness and reads the checkout's .env for the web port, as compass open-as does.
1. Question
How do I run the browser harness against the environment, and where do I look when a test fails?
2. Answer
The environment must be up and the Acme tenant provisioned (see How do I ready up an environment). Then, from the web component:
cd projects/ores.web
npm run harness
The harness signs in as the tenant administrator with the shared Acme password, the same facts compass open-as holds, and runs every spec under packages/harness/tests against http://localhost:$ORES_WEB_PORT/. Set ORES_HARNESS_URL to drive another host. The config runs one worker; the baseline runs used -- --workers 4, which takes about twenty minutes over every screen, and the shared environment stood it. Add --headed through npm run harness:headed --workspace @ores/harness to watch the browser.
A failing test leaves its screenshot, a page snapshot and a trace under projects/ores.web/.runtime/harness/results/<test>/, which git ignores. Open the trace with npx playwright show-trace <trace.zip>. The HTML report is under .runtime/harness/report.
The browsers come from Playwright, not from the repository: playwright install chromium once per machine, with the global playwright CLI or npx playwright.
3. Script
projects/ores.web/packages/harness/playwright.config.ts reads the port through src/env.ts; src/signIn.ts is the fixture every spec signs in with; src/acme.ts names the seeded people and the shared password.
4. Tested by
Run npm run harness in projects/ores.web with the environment up; the first spec signs in, opens the currencies list, searches a code and opens its record page.
5. See also
- How do I open the web as an Acme user? — the same sign-in, by hand in Chrome.
- Screen review checklist — the lines the harness answers and the ones a person still walks.