npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

autopilot-web

v3.5.0

Published

Web backend for AutoPilot — runs the same declarative JSON plans against a browser via Playwright. A test runner AND a demo/screencast driver.

Downloads

183

Readme

autopilot-web

The web backend for AutoPilot — runs the same declarative JSON test plans against a browser, via Playwright. It is a first-class test backend (headless, for CI parity, like the macOS/iOS/Android backends) and a demo/screencast driver (headed, with on-page highlight/caption overlays and paced typing).

AutoPilot plans are plain JSON, designed to be authored by hand or by an AI agent. The same plan the native runners execute drives the browser here — the JSON plan schema is the single cross-platform contract. This runner reimplements the plan-execution loop over Playwright, exactly as the Android runner reimplements it over UiAutomator and the iOS runner over XCUITest.

AutoPilot is a web testing tool. (Earlier AutoPilot docs said it was not — that is no longer true; web is a supported platform.)

What runs on web, and what is skipped

Everything with a browser equivalent is exercised and asserted:

  • Actions: launch (open the URL), click, doubleClick, rightClick, press, type (with clear/commit/paced typing), setValue, keyPress, scroll, drag, waitFor, screenshot, wait, assert, and the demo actions highlight / caption / pace.
  • Assert properties: value, title, enabled, focused, marked (checkbox/ radio), position, size, count — with ops equals / notEquals / contains / matches / exists / notExists / greaterThan / lessThan.

Steps with no web equivalent are skipped (reported as skipped, never failed — the same "skip-don't-branch" contract the mobile backends use):

  • menu (native menu bar), assertPixel / assertRegion / snapshot (native pixel capture), exec (host command), and the assert properties clipboard / stdout / stderr / exitCode.

Prerequisites — install Node.js (18+)

You need Node.js 18 or newer. Install it for your OS:

  • Debian: sudo apt-get update && sudo apt-get install -y nodejs npm (for a current version, use NodeSource: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt-get install -y nodejs)
  • Ubuntu: same as Debian (NodeSource recommended for a current version).
  • RHEL / Fedora: sudo dnf install -y nodejs npm (or NodeSource: curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash - && sudo dnf install -y nodejs)
  • Windows: download the LTS installer from https://nodejs.org/ and run it, or winget install OpenJS.NodeJS.LTS.
  • macOS: brew install node, or download the installer from https://nodejs.org/.

Verify: node --version (should print v18… or higher) and npm --version.

Install

From the repo directory:

npm install                      # install dependencies (Playwright + TypeScript)
npx playwright install chromium  # download the Chromium browser Playwright drives
npm run build                    # compile the TypeScript to dist/

Run a plan

# Headless (the normal test path) against the bundled TestHost page:
node dist/src/index.js run plans/test-web-capabilities.json --url testhost/index.html

# Against a live site:
node dist/src/index.js run plans/my-plan.json --url https://example.com

# Print the report as JSON (for tooling / CI):
node dist/src/index.js run plans/my-plan.json --url https://example.com --json

--url accepts an http(s):// URL or a local file path (a bare path is opened as a file:// URL). A plan may also set target.url; the --url flag overrides it.

The process exits non-zero if the plan does not pass, so CI can gate on it.

Demo / screencast mode

# Headed browser, with on-page highlight + caption overlays and paced typing,
# recording a video of the run:
node dist/src/index.js run plans/my-plan.json --url https://example.com \
  --headed --demo --record ./recordings
  • --headed shows the browser window (omit for headless).
  • --demo renders highlight/caption overlays and applies pace cadence (per-char typing + post-step delays). Without --demo, the demo actions are passing no-ops — a plan runs as a fast, clean test.
  • --record <dir> writes a .webm video of the run into <dir>.

Test (the CI parity gate)

npm test

This builds, then runs the web-capabilities plan against the bundled testhost/index.html and asserts the expected pass/skip counts — the gate that makes web a real test backend. It uses Node's built-in test runner (node:test); no extra test framework is required.

Layout

  • src/planModel.ts — the Plan/Step/Selector/Assert types, mirroring the core schema.
  • src/runner.ts — the plan-execution loop over Playwright (selector mapping, actions, assertions, demo overlays, skip-don't-branch).
  • src/index.ts — the CLI.
  • testhost/index.html — the web TestHost (mirrors the native TestHostApp surface).
  • plans/test-web-capabilities.json — the plan run by the parity gate.
  • test/runner.test.ts — the parity-gate tests.

Selector mapping

AutoPilot selectors map onto Playwright locators:

| AutoPilot selector | Playwright locator | | --- | --- | | identifier: "foo" | page.locator('#foo') | | role: "button", title: "Save" | page.getByRole('button', { name: 'Save' }) | | role: "list" | page.getByRole('list') | | title: "Save" (no role) | page.getByText('Save') | | index: 2 | .nth(2) | | within: {...} | resolve the parent, then locate the child inside it |

Native AX roles (e.g. AXButton, AXTextField) are mapped to their ARIA equivalents (button, textbox); plain ARIA roles pass through unchanged.