# How Testis works

Source: https://testis.dev/docs/how-it-works

> What the AI tester does when it tests your app, what it needs from you, and why you can trust what it reports.

## It uses your app like a person

Testis is an AI tester. You tell it where your app runs and how to sign in, give it your PRD (what the app should do), and it tests the app the way a careful person would: it opens pages, reads them, clicks, types, signs in, fills forms, uploads files it makes itself, and looks at what happened after every action. For an API it sends requests and reads the answers; for a command-line program it runs it and reads the output.

There are no scripts to write and no exact button names to match. The tester finds controls by what they do, so a PRD that says "Login" and a page that says "Sign in" mean the same button.

## What happens when you run `testis test`

| Step | What the tester does |
| --- | --- |
| Look | Opens the app's front door (the home page, the API's route list, each program's `--help`) and reads your PRD. |
| Plan | Writes its own to-do list: areas of the app, and in each the behaviours your PRD promises, including wrong input, empty states, limits and who may do what. |
| Test | Works through each area with a fresh browser (or API client, or terminal), signed in as the account the area needs. It sets up what a check needs first (an item in the cart, a record) through the app itself. |
| Record | For every behaviour: it works, it is broken, or it cannot be checked from inside the app (an email inbox, another company's payment page). |
| Report | Writes `.testis/runs/<id>/report.html` (and `report.md`): bugs first, each with what should happen, what happened, where, the steps and a screenshot, then what works, then what was not checked. |

## Why a result is worth believing

The tester's reports are held to rules in code, not only in instructions to the model:

- **A bug needs proof.** It must quote text that was really on the screen (or an error the app reported). A quote that was never shown is sent back.
- **A bug gets a second look.** Before a bug is recorded the tester checks it is not its own mistake (a skipped step, the wrong product or quantity) and tries once more.
- **No claims before looking.** A result sent in the same breath as the actions it depends on is held until the tester has seen what those actions did.
- **"Cannot be checked" is not an escape.** It is only accepted after the tester confirms the check truly needs something outside the app.
- **The same thing said differently is not a bug.** Another wording, `www.` or a trailing `/` on an address, a phone number with its country code, an amount in another format.

What it did is recorded step by step, so every bug comes with the steps to reproduce it.

## Results depend on the model

Testis runs on the AI model you choose (bring your own key, or use Testis credits). A stronger model finds more and gets confused less; a model that can see pictures also gets a screenshot every step. See [AI models](/docs/ai-models).

## What runs where

- **The tester runs on your machine or in your CI.** Your code is not uploaded to Testis.
- **The AI model you choose reads the pages, responses and output the tester sees, and your PRD**, because it needs them to test. Secrets you give as variables are typed for it and never shown to it.
- **The cloud is optional.** If you sign in, results, the report and the screenshots of bugs are uploaded to your dashboard. See [Account, dashboard and plans](/docs/cloud-account).

More detail: [Safety and privacy](/docs/safety-privacy).
