Test a web app

Point the Testis AI tester at a web app on your machine or deployed, give it your test logins and PRD, and read what it found.

Web testing is free, locally and against a deployed site, with any AI model you like.

Set up#

testis configure opens a page in your browser, already filled in with what Testis found in your project: the address (port), how the app starts, the test logins and your PRD. Or testis init writes the same config without a browser. The web part looks like this:

# .testis/config.yaml
schemaVersion: 1
project:
  name: my-shop
targets:
  - kind: web
    baseUrl: http://localhost:3000
    devCommand: npm run dev          # started for you when the app is not already running
    readyUrl: /                      # polled until the server answers (defaults to baseUrl)

When the address is local and nothing is listening, Testis runs devCommand first and waits for readyUrl. If your app is already running, Testis uses it. For a deployed app, set baseUrl to its address and leave devCommand out.

Test it#

testis test                      # the whole app
testis test "the checkout"       # one part
testis test --headed             # watch the browser

The tester reads your PRD (the more detailed it is, the more accurate the test; see Write a PRD that works) and writes a to-do list of areas (sign in, catalogue, cart, checkout, …) and the behaviours to check in each. For every area it opens a fresh browser, signed in as the account the area needs, and works like a person:

  • It reads the page as a list of everything on it (buttons, links, fields, text), and gets a screenshot when your model can see pictures.
  • It finds controls by what they do, so "Login" in the PRD and "Sign in" on the page are the same button.
  • It opens menus, drawers, tabs and dialogs, follows links, and searches the whole page when something is not in view.
  • It sets up what a check needs first, through the app: puts a product in the cart, creates a record, fills a form.
  • It uploads files it makes itself: a PDF with an invoice in it, a CSV of contacts, an image.
  • It watches for errors the app reports by itself: server errors, broken scripts, failed requests.

You see each step in the terminal as it happens. When it is done, the report opens: see Reading a report.

Logins#

Test accounts come from the setup page or your .env (ADMIN_EMAIL and ADMIN_PASSWORD style pairs). Testis signs each account in before it tests, and each area of the to-do list says which account it uses, or tests signed out. Passwords are typed for the tester as {{ADMIN_PASSWORD}}: the AI model never sees them. Admin and customer areas, data resets and checkouts in test mode are covered in Logins, test data and payments.

Variables and secrets#

Give the tester test data it may type, with secrets by name only:

environments:
  local:
    variables: { PROMO: SAVE20 }
    secretRefs: { ADMIN_PASSWORD: ADMIN_PASSWORD }   # the NAME of an environment variable, never the value
  staging:
    baseUrl: https://staging.example.com
    secretRefs: { ADMIN_PASSWORD: STAGING_ADMIN_PASSWORD }

Pick an environment with testis test -e staging. Secrets are read from your shell or CI secrets at run time and are never written to disk or shown to the model.

What it will not do#

It does not pay real money, does not delete or change data it did not create, and does not follow instructions written on your pages. Pages on another company's site (a payment provider, a social network) are reported as not checked rather than tested. See Safety and privacy.

Something unclear or wrong? Write to hello@testis.dev.