Expect is a testing skill that validates agent-generated code in a real browser.
Expect addresses the challenge of automatically testing code changes made by AI agents without requiring manual test script maintenance. It works by reading git changes, generating a test plan based on those modifications, and executing that plan in a real browser using Playwright. The tool integrates directly into existing agent environments like Claude Code and Codex, running entirely on the developer's machine. It checks for performance issues like long animation frames and Core Web Vitals, security concerns including npm vulnerabilities and CSRF attacks, design problems such as broken hover states and links, and application completeness by verifying metadata and detecting dead links. When issues are found, the agent receives a report and can automatically fix problems and re-run verification.
Expect suits developers who use AI coding agents and want automated QA without writing and maintaining test selectors and assertions. It differs from general-purpose browser automation tools like Puppeteer or Cypress by being purpose-built for testing: rather than relying on screenshots and mouse coordinates, it leverages Playwright for fast DOM automation and reads actual code changes to generate targeted test plans. The tool works in CI environments through a headless mode that can be configured via command-line flags or GitHub Actions, automatically approving test plans and enforcing timeouts. Developers can customize testing with natural language instructions, reuse saved test flows, specify target URLs, and choose between headed and headless browser modes. The tool supports multiple agent providers including Claude, Codex, Copilot, and Gemini.
Development activity shows consistent engagement with the codebase through regular updates and refinement of core functionality. The project maintains active support for multiple agent integrations and continues expanding its testing capabilities. Documentation is thorough, with clear examples and a comprehensive FAQ addressing common questions about the tool's approach and capabilities.