expect README

The project's README from github.com/millionco/expect. As one markdown file: README.md.

Expect

version downloads

Expect is a skill for testing your agent's code in a real browser.

Demo →

Getting Started

  1. Ask your agent to Fetch https://www.expect.dev/ and run init script
  2. Run /expect inside Claude Code, Codex, and more
  3. Expect spawns subagents simulating real logged-in users to find issues and regressions
  4. Your agent will fix any issues Expect finds, then re-run to verify

FAQ

1. What is Expect?

A skill that reads your git changes, generates a test plan, and runs it in a real browser with Playwright. It hooks into your existing agent (Claude Code, Codex, Cursor) and runs entirely on your machine. It checks for performance (long animation frames, INP, LCP), security (npm deps, CSRF attacks, vulns), design tweaks (broken hover states, links, buttons), and app completeness (missing metadata, dead links).

2. Why not just use Puppeteer, Playwright, or Cypress?

Instead of writing scripts, maintaining selectors, and wiring up assertions, Expect reads your code changes and tests them in a real browser automatically. It's like giving your agent QA superpowers.

3. How is this different from computer-use agents?

General-purpose browser tools rely on screenshots and mouse coordinates. Expect is purpose-built for testing: it uses Playwright for fast DOM automation, reads your code changes, generates a test plan, and runs it with your real cookies, then reports back what's broken so the agent can fix it.

4. Does it work in CI?

Yes. Use --ci or the add github-action command to set up a workflow that tests every PR. In CI mode it runs headless, skips cookie extraction, auto-approves the plan, and enforces a 30-minute timeout.

5. Does it support mobile testing?

Coming soon.

6. Is there a hosted or enterprise version?

Coming soon. Email [email protected] if you have questions or ideas.

Options

Flag Description Default
-m, --message <instruction> Natural language instruction for what to test -
-f, --flow <slug> Reuse a saved flow by its slug -
-y, --yes Run immediately without confirmation -
-a, --agent <provider> Agent provider (claude, codex, copilot, gemini, cursor, opencode, droid) auto-detect
-t, --target <target> What to test: unstaged, branch, or changes changes
-u, --url <urls...> Base URL(s) for the dev server (skips port picker) -
--browser-mode <mode> Browser mode: headed or headless headed
--cdp <url> Connect to an existing Chrome via CDP WebSocket URL -
--profile <name> Reuse a Chrome profile by name (e.g. Default) -
--no-cookies Skip system browser cookie extraction -
--ci Force CI mode: headless, no cookies, auto-yes, 30-min timeout -
--timeout <ms> Execution timeout in milliseconds -
--output <format> Output format: text or json text
--verbose Enable verbose logging -
-v, --version Print version -
-h, --help Display help -

Supported Agents

Expect works with the following coding agents. It auto-detects which agents are installed on your PATH. If multiple are available, it defaults to the first one found. Use -a <provider> to pick a specific agent.

Agent Flag Install
Claude Code -a claude npm install -g @anthropic-ai/claude-code
Codex -a codex npm install -g @openai/codex
GitHub Copilot -a copilot npm install -g @github/copilot
Gemini CLI -a gemini npm install -g @google/gemini-cli
Cursor -a cursor cursor.com
OpenCode -a opencode npm install -g opencode-ai
Factory Droid -a droid npm install -g droid

Resources & Contributing Back

Want to try it out? Check out our demo.

Find a bug? Head over to our issue tracker and we'll do our best to help. We love pull requests, too!

We expect all contributors to abide by the terms of our Code of Conduct.

→ Start contributing on GitHub

Acknowledgements

Expect wouldn't exist without the ideas and work of others:

License

FSL-1.1-MIT © Million Software, Inc.

expect (millionco/expect)

Searching Database…

What is this?Expect is a testing tool that runs your AI agent's code against a real browser, so you can verify your agent behaves correctly in an actual browser environment instead of relying on mocks.
Is this a CLI tool or a library I import into my code?It ships as a CLI, living in the apps/cli package of the repo's Turborepo monorepo, rather than being a library you import directly.
Does Expect test more than just browser-based agent behavior?Based on the description, Expect's focus is specifically on verifying agent code against a real browser, so non-browser agent paths don't appear to be its target use case.
Who is this built for?It's aimed at developers building AI agents that act inside web browsers and who need automated, real-browser end-to-end checks of that behavior.
Why test in a real browser instead of just mocking it?Agent behavior like DOM interactions, rendering, and timing can only be reliably verified against an actual browser instance, not a simplified mock.
What does the name 'Expect' hint at?The name suggests assertion-style 'expect' checks, similar to common testing libraries, used to verify an agent's actions in the browser.
Is the project built as a single package or a monorepo?It's a Turborepo-based monorepo with a dedicated CLI app and shared build, lint, and test pipelines managed through pnpm and Turbo scripts.
Does the project have CI in place?Yes, the repo runs code-quality, end-to-end, and release workflows via GitHub Actions, including a dedicated e2e.yml pipeline.
Creator
millionco
Size
61.1 MB
Stars
3.6K
Age
8mo
Commits · 90 Days