Skip to main content

At a glance

  • Source of truth: your repository. Checksum writes only through pull requests.
  • Secrets: read apiKey and test-user credentials from environment variables. Never commit them.
  • Report upload: options.hostReports and options.autoHealPRs default to true only when CI=true.
  • Recovery: runMode: RunMode.Heal turns on real-time auto-recovery; RunMode.Normal is the default.
Developer guide
What’s in the repository, configuring it, and running it locally

What Checksum sets up in the repository

During onboarding, Checksum scaffolds your tests repository with npx checksumai init. Everything Checksum needs lives in one checksum/ folder: a config file, a Playwright config that’s already wired up, a login helper, and your tests.
Repository layout
The two files you’re most likely to open are checksum.config.ts, which controls how tests run, and the tests/ folder, where generated tests land. login.ts signs your test users in during runs, and the starter examples in tests/examples/ (example.checksum.spec.ts and example.checksum.md) validate your login and basic configuration.
Checksum file structure
Checksum does this for you during onboarding. To set up a checksum/ folder yourself, follow the quick start from the Checksum runtime package on npm. The folder can live in a dedicated tests repository or inside an existing repository.
1

Install the package

2

Initialize the Checksum tests folder

Go to the directory where you want the checksum/ folder, then run:
3

Set up the new checksum/ folder

  • Define CHECKSUM_API_KEY and BASE_URL in checksum/.env or your shell. The starter config reads process.env.CHECKSUM_API_KEY and process.env.BASE_URL!.
  • Update login.ts with your Playwright login flow. The npm page’s Login Function section documents the params-object API.
  • Review the starter examples in checksum/tests/examples/example.checksum.spec.ts and checksum/tests/examples/example.checksum.md.
If you run npx checksumai init again later, it adds any missing starter files and leaves the files you’ve customized alone.
4

Install Playwright dependencies

5

Run the starter test

This runs the starter .checksum.spec.ts example and checks your login setup.
6

Finish in the web app

If you haven’t already, go to app.checksum.ai to complete the configuration and generate a test. Then wait for the pull request (PR) to be created, and approve it.
Other scaffolding commands (tsconfig, eslint) are under Repository tooling.
Initialization (source: npm quick start): npm install -D checksumai (or yarn add checksumai -D) → npx checksumai init in the target directory → set CHECKSUM_API_KEY and BASE_URL in checksum/.env or the shell → edit login.ts → npx playwright install --with-deps → npx checksumai test → finish configuration and generate a test at app.checksum.ai, then approve the PR. Re-running init backfills missing starter files without overwriting customized ones. The folder can live in a dedicated tests repository or inside an existing repository.

Configure checksum.config.ts

The central configuration for your Checksum project, in the checksum/ directory. It controls project-level settings such as the base URL, browser options, and authentication flows. It has four parts:
checksum.config.ts

Complete example

Location: checksum/checksum.config.ts. Type: ChecksumConfig from @checksum-ai/runtime; RunMode is exported from the same package.

apiKey

Your Checksum API key, from Settings → Project Settings. Read it from the environment and never commit it: apiKey: process.env.CHECKSUM_API_KEY.

runMode

environments

An array of target application instances. Each environment must match one configured in the web app.

environments[].users[]

options

Fine-grained controls for test execution.

Repository tooling

A few CLI commands create or refresh the files in the checksum/ folder. Checksum runs init for you during onboarding. The others are handy after an upgrade: tsconfig refreshes the TypeScript config, eslint adds a lint config, and postinstall runs on its own after npm install.
For running tests and every test flag, see Running Tests → The Checksum CLI.

Run the suite on your machine

Checksum checks that the suite and login work before kickoff, so this is optional. To run the tests yourself, you need Node.js with npm, a clone of the tests repository, and your CHECKSUM_API_KEY (web app → Settings → Project Settings).
1

Install dependencies and browsers

2

Download your environment variables

3

Run the example test

The example test is a quick check that your login and basic configuration work. If it passes, you’re ready to run the rest of the suite. See Running Tests.
Prerequisites: Node.js with npm, a clone of the tests repository, CHECKSUM_API_KEY set in the environment.
Success: the example test passes, which confirms login and basic configuration.
i
How it works
Tests vs code repositories and the repo mirror

Tests repository vs code repository

  • Tests repository: where your Playwright tests live. Checksum writes to it by opening pull requests with generated or healed tests. Checksum creates one for every project.
  • Code repository (required): your application source. Checksum reads it to understand routes, components, and interactions, which significantly improves detection. Checksum never writes to it.
If your tests live in the same repository as your app code, connect that repository for both. Connections are managed in Git Integration.

The repo mirror

The repo mirror is the core of how Checksum works with your repository. By default, every generated or healed test arrives as a PR that you review and merge when you choose. You can also turn on auto-merge so Checksum’s PRs merge without a human review. Either way, you decide how changes reach your codebase.
Repo mirror flow

Your repo is the source of truth

The mirror works both ways: Checksum reads from your repo and writes to it via PRs. But your repository is always the source of truth. You can edit tests directly, push new tests, or change generated code, and Checksum picks up the changes on the next sync. Think of the agent as another member of your team who opens PRs like any other developer.

Reading from your repo

Checksum continuously monitors your connected repositories, so it always has an up-to-date understanding of your test suite and codebase:
  • Tracks branches and their current state
  • Knows which tests already exist, so it doesn’t generate duplicates
  • Detects changes: when your code changes, Checksum knows which tests might be affected (this powers affected-test selection)
  • Syncs automatically via webhooks whenever you push, merge, or update PRs

Configuration and .env

Your project configuration isn’t mirrored the way your tests are. Your tests read environment URLs, login URLs, test credentials, and custom variables from a .env file that Checksum maintains. Download it with the CLI:
To change its values, send the updates to your Checksum contact, then have your team download it again. Any automation that starts a Checksum test run or AI generation should download the latest .env as one of its steps.
Think of it this wayYour tests sync with Checksum automatically. Your configuration doesn’t: environments, test users, and variables added in the web app (Environments & Test Users) aren’t copied into .env or checksum.config.ts, and settings in your repository aren’t imported into the web app. Update both when something changes.

Writing to your repo

  • Each PR contains Playwright test code that you review like any other change
  • PRs include a clear description of what was generated or healed
  • You review, request changes, or merge as usual
  • Checksum tracks whether PRs are open, merged, or closed (shown as flow statuses like PR Merged)

What triggers a sync

Webhooks are set up automatically when the GitHub App is installed or GitLab is configured.

Example: generating a “User Login” test

1

Branch

Checksum creates a branch such as ChecksumAI-generated-test-20260315143022.
2

Files

It adds the .checksum.md story file and the .checksum.spec.ts test file.
3

PR

It opens a PR with a description of the test flow.
4

You

You review the code, run the tests, and merge when satisfied.
A Checksum-generated test pull request

Troubleshooting

Check the default user and login URL in Environments & Test Users, then re-run dotenv --download. Explicit shell variables override .env, so unset any stale BASE_URL/USERNAME.
Checksum only sees pushed code. Push your test to the tests repository’s default branch so the mirror picks it up.
hostReports defaults to true only when CI=true. Enable it explicitly for local uploads.

Git Integration

Repositories, permissions, and status.

Story & Test Format

What’s inside a generated test.

The Checksum CLI

Every checksumai command and flag.

Checksum runtime on npm

Quick start, starter files, and the login function API.