Installation

Prerequisites

  • Node.js 18 or later
  • npm, pnpm, or yarn package manager
  • A TestBro account with an API token

Install the CLI

Install TestBro globally using your preferred package manager:

# npm
npm install -g @testbro/cli

# pnpm
pnpm add -g @testbro/cli

# yarn
yarn global add @testbro/cli

Verify Installation

testbro --version

You should see the version number printed (e.g., 0.1.0).

Authenticate

Log in with your API token. You can generate a token from the TestBro web dashboard under Settings > API Tokens.

testbro login --token <your-api-token>

If your TestBro instance is self-hosted or running locally, specify the API URL:

testbro login --token <your-api-token> --url http://localhost:3024

Credentials are stored in ~/.testbro/config.json.

Create a Project Configuration

Initialize a project-level configuration file in your repository root:

testbro config init

This creates a test-bro.config.json file with default settings:

{
  "$schema": "https://testbro.dev/schema/config.json",
  "baseUrl": "https://your-app.com",
  "environment": "local",
  "mode": "hybrid",
  "timeout": 30000
}

Configuration Options

OptionTypeDefaultDescription
baseUrlstring--Default URL for test runs
environmentstring"local"Environment label
modestring"selector"Default execution mode (selector, ai, hybrid)
timeoutnumber30000Timeout per step in ms
projectIdstring--Default project ID
headedbooleanfalseRun browser in visible mode
deduplication.enabledbooleantrueEnable test case deduplication
deduplication.autoMergebooleanfalseAuto-merge duplicates

Environment Variables

You can also configure TestBro via environment variables:

VariableDescription
TEST_BRO_TOKENAPI token (alternative to testbro login)
OPENROUTER_API_KEYRequired for AI execution mode

These can be set in your shell profile or a .env file in your project root.

Verify Setup

Check your configuration:

testbro config show

This displays your user config, project config, and authentication status.

Next Steps