Skip to main content
A TestSprite tunnel lets the project’s agent and the cloud test runner use a frontend app on your machine. Start the app and keep it running while the agent explores it and until the execution finishes. Your key needs permission to run tests and open tunnels. Authentication Local testing is for web apps. A backend project’s environment must point at a publicly deployed API, and the CLI refuses a local address for one.

A project for a local-only app

Create a frontend project. Copy its projectId, then save the address where your app listens as an environment. The address may include the app’s entry path, such as http://localhost:3000/app.
--local 3000 is shorthand for --url http://localhost:3000.

Plan against the running app

In another terminal, start a tunnel and leave it running. The agent’s browser opens your app through it. Without a tunnel, the agent stops and asks for one: start it, then run testsprite reply "The tunnel is running.".
Back in the first terminal, ask for tests. From the Git checkout, --diff attaches your change and --file adds a requirements file.
The agent explores the project’s default environment. If local-dev is not the default, name it in your request, such as ”… on the local-dev environment”. Review the proposed tests and their assertions. Once the plan matches what you want, save it. apply prints the command that runs what it saved. You can also run the project against the local environment.

Automatic tunnel

A run on a saved loopback environment opens its own tunnel and waits for the verdict. Omit --env when the local environment is the project’s default.
A run takes its address from the environment: run --local, run --local-host and run --target-url were removed in CLI 0.18.0. Backend tests need a publicly deployed API environment. The CLI normally checks the listener before dispatch, waits for the verdict, and closes the tunnel on exit. --skip-preflight skips the listener check. An owned tunnel requests cancellation of its unfinished executions on Ctrl-C or timeout. --no-wait on an environment that requires an automatic tunnel is refused. A CLI-run loopback environment supports public access or username/password sign-in. Cancelling a Run

Several tests

Named or project launches share a tunnel and use a server dispatch limit per execution. For tunneled project or named tests the default is five, the maximum is 15, and the default wait deadline is 1200 seconds. Saved lists use their environment mappings, a separate tunnel cap of 10, and a default deadline of 600 seconds. The wait deadline covers the whole invocation.

Long-lived tunnels

To reuse one tunnel across runs, start it in a separate terminal. It prints a client ID and stays in the foreground. It is the same tunnel the agent uses while it plans.
Use that ID from a second terminal. The process that started the tunnel owns it. End that process with Ctrl-C when you finish.

Tunnel limit

If a launch reaches the binding limit (exit 11), run testsprite tunnel list. Reuse a connected binding or stop an unused one with testsprite tunnel stop "$CLIENT_ID". Stopping a binding disconnects any run relying on it.

Read a local result

The launch prints the same run and result IDs as a public run. Select the execution’s failed or blocked cases, then download a result by its ID. To confirm a fix, keep the updated app running and launch the same case against the local environment again. Reading Results