Repolode
antiwork

antiwork/shortest

AI-powered end-to-end testing framework where tests are written as plain-language descriptions, built on Playwright and Anthropic Claude.

Stars
5,698
Forks
341
Open issues
2
Last commit
3 months ago

What is it?

Shortest is an end-to-end testing framework that lets you describe a browser test in natural language instead of writing selectors and step-by-step scripts. Each test is a plain-language string passed to a shortest() call, and an AI model driven by the Anthropic Claude API carries out the steps in a browser built on Playwright.

The framework is installed through an init command that adds the package as a dev dependency, creates a shortest.config.ts file, and sets up placeholders for the Anthropic API key in .env.local. Tests are picked up by a configurable file pattern and run from the command line, optionally by file or line number, and can be run headless in CI. Callback functions run after the browser session, so you can add assertions such as database checks. Lifecycle hooks, chained test flows and API endpoint testing are also supported.

The project includes built-in helpers for GitHub login with two-factor authentication and for email validation through Mailosaur. It is written in TypeScript and targets Next.js applications, with examples in the examples directory.

Key features

  • 01Write tests as natural language descriptions instead of selector-based scripts.
  • 02Uses the Anthropic Claude API to execute test steps in the browser.
  • 03Built on Playwright, with configurable browser context options.
  • 04Supports GitHub login including two-factor authentication.
  • 05Validates login emails through Mailosaur.
  • 06Provides lifecycle hooks, chained tests and API endpoint testing.

Use cases

  • Adding end-to-end coverage to a Next.js app without maintaining brittle selectors.
  • Testing login flows, including GitHub login with 2FA.
  • Running browser tests headlessly in a CI/CD pipeline.
  • Combining UI checks with database assertions in a callback.

Quick start

  1. 1

    Initialize Shortest in your project with the init command

    npx @antiwork/shortest init
  2. 2

    Add your Anthropic API key to .env.local (ANTHROPIC_API_KEY)

  3. 3

    Write a plain-language test file such as app/login.test.ts

  4. 4

    Run all tests

    pnpm shortest

Things to know

  • Every test run calls the Anthropic Claude API, so you need an API key and usage costs apply.
  • Test results depend on AI execution, so outcomes may vary between runs.
  • Some features such as GitHub 2FA and email validation require extra third-party services.

In collections

Topics

FAQ

What is shortest?
AI-powered end-to-end testing framework where tests are written as plain-language descriptions, built on Playwright and Anthropic Claude. Shortest is an end-to-end testing framework that lets you describe a browser test in natural language instead of writing selectors and step-by-step scripts. Each test is a plain-language string passed to a shortest() call, and an AI model driven by the Anthropic Claude API carries out the steps in a browser built on Playwright.
Is shortest free to use? What license does it have?
shortest is open source under the MIT license. Check the license terms before using it in commercial products.
Is shortest still maintained?
Updated within 6 months. The last commit to shortest was on Aug 6, 2026.
What can I use shortest for?
Adding end-to-end coverage to a Next.js app without maintaining brittle selectors. Testing login flows, including GitHub login with 2FA. Running browser tests headlessly in a CI/CD pipeline. Combining UI checks with database assertions in a callback.
How do I install shortest?
Initialize Shortest in your project with the init command: npx @antiwork/shortest init Add your Anthropic API key to .env.local (ANTHROPIC_API_KEY) Write a plain-language test file such as app/login.test.ts Run all tests: pnpm shortest
Where can I get shortest?
The source code and installation instructions are on GitHub: https://github.com/antiwork/shortest

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects