# AI end-to-end testing for web apps, APIs and CLIs

Source: https://testis.dev/qa/ai-end-to-end-testing

> How end-to-end testing with AI works across a browser, an API and a command-line tool, with honest numbers on how long it takes and what it costs.

End-to-end (E2E) testing checks a whole application the way a user meets it, from the screen down through the database and back. It catches what unit tests miss, and it has a reputation for being slow to write and painful to maintain. AI changes the maintenance part, because the tester works out the steps itself.

## What E2E testing with AI looks like

You describe the app; the tester does the rest:

1. It reads your PRD and the app, then writes a list of behaviours to check.
2. It opens a real browser, API client or terminal for each area, and signs in as the right role.
3. It creates the data each check needs through the app itself.
4. It acts, looks at what happened, and judges the result.
5. You get a report with steps and proof for each bug.

## Web apps

A real browser matters, since that is where hydration, overlays and custom dropdowns go wrong. Testis uses real Chromium and reads the page through its accessibility tree, plus a screenshot if your model can see pictures. It can open menus and dialogs, upload real files it makes (a PDF, a CSV, an image), inspect cookies, and test phone-size screens. It also watches for errors the app reports along the way, such as server errors and failed requests. See [test a web app](/docs/web-testing).

## APIs

An API test is end-to-end when it follows a real flow: sign in, create something, read it back, try it as the wrong role. Testis reads your OpenAPI file, chains the ids from earlier responses, and keeps tokens out of what it records. See [test an HTTP API](/docs/api-testing).

## Command-line tools

CLIs are rarely tested end to end, even though users depend on their output and exit codes. Testis runs your program in a sandbox folder with no shell and no inherited secrets, including interactive programs in a real terminal. See [test a command-line program](/docs/cli-app-testing).

## What to expect, honestly

- **It takes minutes, not seconds.** In our scored run a whole real store took 13 to 42 minutes.
- **It costs a little per run.** That run used 1.3 to 4.3 million tokens, roughly $0.30 to $1 on a low-cost model.
- **It can be wrong.** In the same measurement it found 2 of 3 planted bugs and raised 2 false alarms in 67 checks. See [how we measure](/#bench).
- **Better requirements give better results.** See [writing a PRD](/docs/writing-a-prd).

## Common questions

### What is the difference between end-to-end and integration testing?

Integration tests check that some parts work together, often without a real interface. End-to-end tests use the whole system as a user would. Both are useful, and E2E is the closest to what a customer experiences.

### Can AI write my Playwright tests instead?

Coding assistants can, and for flows you want pinned that is a fine choice. You then own and maintain those tests. Testis does not generate scripts: it tests the app directly on each run.

### Can I test only one part of the app?

Yes: `testis test "the checkout"` tests just that, and takes less time and fewer tokens. In CI, it can test only what a pull request changed.
