gitmyhub

shortest

TypeScript ★ 5.6k updated 1mo ago

QA via natural language AI tests

Shortest is a testing framework that lets developers write automated checks for web apps using plain English instead of code. Normally, end-to-end tests (tests that drive a real browser through a sequence of actions) require writing detailed scripts that click buttons, fill forms, and verify results step by step. Shortest replaces most of that scripting with a sentence describing what should happen, then uses an AI model to figure out how to carry it out.

For example, instead of writing twenty lines of code to test a login flow, a developer writes one line: "Login to the app using email and password." The framework sends that instruction along with the live state of the browser to an AI model (Claude from Anthropic), which reads the page and decides what to click and type. The test passes if the AI completes the described goal without errors.

The framework is built on Playwright, an existing browser automation library used widely in the industry. Shortest adds the AI layer on top. Tests are written in TypeScript files ending in .test.ts, and they can be chained together so one test picks up where another left off. Developers can also add callback functions that run after the AI finishes, so they can verify database state or other side effects that the AI cannot check by itself.

Shortest supports API testing as well as browser testing, GitHub login with two-factor authentication, and integration with Mailosaur for email verification steps. It runs in CI/CD pipelines with a headless mode so tests can run on a server without a visible browser window.

Setup requires an Anthropic API key, which is used to call the AI model for each test run. The README walks through installation, a configuration file, and example test files. The project is maintained by Antiwork.