Light to install
One npm package, a 51 kB download, with no npm dependencies to audit: it's built on Node's own modules. It drives the Chrome you already have; brokit install-chrome fetches one if you don't.
Free, open-source CLI and Node.js library
brokit opens your pages in a headless Chrome, uses them as a person would (clicks, typing, touch), checks what they show and compares screenshots. On your computer, in CI, or run by your AI agent.
$ npx brokit run index.htmlNeeds Node.js 22.4+ and Chrome, Chromium or Edge · no npm dependencies · MIT or Apache-2.0
$ brokit run signup.html --steps steps.json brokit run http://127.0.0.1:45541/signup.html ready (load + network idle) in 609 ms ✓ click #email ✓ type "ana@example.com" ✓ key Enter ✓ expect greeting.textContent equals "Welcome, ana" ✓ screenshot signed-in → brokit-out/signed-in.png (1280×800) ok in 0.8 s
At a glance
brokit install-chrome gets one. Installing brokit adds one package, a 51 kB download (about 160 kB on disk): it has no npm dependencies.npm install --save-dev brokit. Until it's published there, from GitHub: npm install --save-dev github:radufarcas10/brokit, or from a clone (how). Free and open source, under MIT or Apache-2.0.npx brokit doctor checks your setup, npx brokit run index.html opens a page; the docs cover steps, checks, baselines and CI.One npm package, a 51 kB download, with no npm dependencies to audit: it's built on Node's own modules. It drives the Chrome you already have; brokit install-chrome fetches one if you don't.
Mouse, wheel, keys, touch and input methods go through Chrome's own input pipeline. Your page can't tell them from a person's, so what passes here works there.
Pages on your computer only, unless you name a host. A throwaway profile, Chrome's sandbox on, and every file it reads treated as untrusted.
Steps
A check is a short JSON list: click here, type this, press that, look. A teammate can review it, and an AI agent can write it without learning an API.
expect waits for the page to catch up.eval or expect any expression; its value lands in the report.[ { "click": { "selector": "#email" } }, { "type": "ana@example.com" }, { "key": "Enter" }, { "expect": "greeting.textContent", "equals": "Welcome, ana" }, { "screenshot": "signed-in" } ]
Any page
brokit doesn't care what made the page. If Chrome can show it, brokit can click it, read it and take its picture.
Point at a file and brokit serves its folder, or point at your dev server.
brokit run index.html
No DOM to query? Click a spot inside the canvas and read the pixels it drew.
"from": "document.querySelector('canvas')"
Screen size, pixel density, touch, taps, swipes and flicks, the notch, dark mode.
--size 393x852 --dpr 3 --mobile
Input methods compose and commit as they do for Japanese, Chinese or Korean users.
{ "ime": "かな" }
Pixel diffs
A new price, and a button three pixels lower and one shade darker, which pushes the card's edge down with it. Easy to miss by eye, impossible to miss here.



$ brokit diff before.png after.png diff.png before.png vs after.png 760×940, 714400 pixels compared identical 87.298 % ≤2 4.968 % ≤8 0.347 % ≤32 5.431 % >32 1.956 % mean 4.2574, worst 243 difference image → diff.png FAILED: 90745 pixels differ (up to 243)
Allow what doesn't matter: --tolerance '{"max": 2}' for antialiasing, '{">8": "0.1%"}' for a few stray pixels, --ignore for a clock.
Checks
brokit check runs every *.check.json in your project in one Chrome. Screenshots marked as baselines are compared with the approved ones, kept next to your checks and reviewed in git like code.
--update approves them. In CI, a missing baseline fails instead of quietly passing.$ brokit check brokit check: 3 scenarios, Chrome 155.0.8059.39, software drawing ✗ checks/card 1 step, 1.1 s ✗ screenshot card → brokit-out/checks/card/card.png (760×940) 391 ms differs from checks/baselines/card/card.png: 55252 pixels differ by more than 2 (up to 243) difference → brokit-out/checks/card/card.diff.png ✓ checks/signup-phone 5 steps, 0.4 s ✓ checks/signup 5 steps, 0.3 s 3 scenarios: 2 passed, 1 FAILED in 1.7 s
CI & agents
Every run ends in an exit code your CI understands and, with --json, a result a script or an AI agent can read: each step, its value, the console, every error.
--gpu software draws identically on a laptop and a CI runner.{ "url": "http://127.0.0.1:44993/signup.html", "ok": true, "ready": { "by": "load + network idle", "ms": 618 }, "steps": [ { "label": "click #email", "ok": true, "ms": 33 }, { "label": "expect greeting.textContent equals \"Welcome, ana\"", "ok": true, "value": "Welcome, ana", "ms": 1 } ], "console": [], "errors": [] }
Install
brokit comes from npm. It needs Node.js 22.4 or newer, and Chrome, Chromium or Edge, which it finds on its own (or brokit install-chrome downloads one).
$ npm install --save-dev brokit$ npx brokit doctor$ npx brokit run index.html --out shot.png$ npx brokit run index.html --steps steps.json$ npx brokit checkNot on npm yet. Until it is, add it from GitHub instead, and the rest works the same: npm install --save-dev github:radufarcas10/brokit. To run it from a clone, see Before brokit is on npm.
Read the docs every step, expectations, baselines, CI and containers