@webtestingsuite/agent
v2.0.1
Published
Web Testing Suite self-hosted agent: lets Web Testing Suite test staging, intranet and localhost sites through an outbound tunnel
Readme
@webtestingsuite/agent
Test sites Web Testing Suite cannot reach from the internet: staging, intranet and localhost in CI. The agent runs inside your network or
CI job and connects out to Web Testing Suite. When a run for its pool starts, it opens an encrypted tunnel through which Web Testing Suite's
test engine reaches the addresses you allow, and nothing else. The tests run in Web Testing Suite's cloud; the agent runs no tests and
accepts no incoming connections. Available on Pro (1 agent), Teams (5) and Enterprise (unlimited).
Set up
- In Web Testing Suite, open Settings > Agents, create a pool with the addresses it may test, and create a registration token (shown once, valid for an hour).
- Register the agent:
The credential is saved tonpx @webtestingsuite/agent register --token wtsr_...~/.wts-agent/config.json, readable only by you. Or keep it in a secret and passWTS_AGENT_CREDENTIAL. - Start it, listing what it may let Web Testing Suite reach:
Or run the container imageWTS_AGENT_TARGETS="staging.internal,localhost:3000,10.0.4.0/24" npx @webtestingsuite/agent startghcr.io/prozentechnologies/webtestingsuite-agent:2.0.0with the same variables (WTS_AGENT_CREDENTIAL,WTS_AGENT_TARGETS) and the commandstart.
Runs for the pool now start from Web Testing Suite (New Run > Run on: agent pool), the API (agentPool on POST /api/v1/scans) or the CLI.
In CI (one run, then exit)
npm start & # your app on localhost:3000
WTS_API_KEY=${{ secrets.WTS_API_KEY }} WTS_AGENT_CREDENTIAL=${{ secrets.WTS_AGENT_CREDENTIAL }} WTS_AGENT_TARGETS=localhost:3000 \
npx @webtestingsuite/agent run --once --url http://localhost:3000It starts a run for the agent's pool, keeps the tunnel open while Web Testing Suite tests through it, and exits: 0 when the run completed, 1 when it failed. Nothing runs between CI jobs.
Local commands (mutation testing and other reports)
A run can ask the agent to run a command it knows by name, for example your mutation tests. You decide the command; Web Testing Suite only sends the name:
WTS_AGENT_COMMANDS='mutation:"<your mutation test command>"' WTS_AGENT_WORKDIR=/path/to/repo WTS_AGENT_TARGETS=localhost:3000 \
npx @webtestingsuite/agent run --once --url http://localhost:3000 --commands mutationThe report (reports/mutation/mutation.json for mutation; set WTS_AGENT_COMMAND_FILES for other places) is sent before the run starts
and scored by the run's code-level testing. A name you have not configured is skipped and shown on the run.
What Web Testing Suite may reach through the agent
WTS_AGENT_TARGETS is the control, and only you set it. The agent checks every connection Web Testing Suite asks for:
- the run's address must be on the list, or the agent refuses the run;
- connections may go to listed targets and to public internet addresses (scripts from a CDN, say);
- never to another private address on your network or to a cloud metadata address. A public name is resolved by the agent and the connection goes to the address it checked.
Encrypted (HTTPS) traffic stays encrypted end to end between Web Testing Suite's test engine and your site. A listed target counts as your consent for write requests, load and fuzzing, since a private host cannot be verified by DNS.
What differs from a cloud run
- Run-minutes: browser testing counts 1.3 run-minutes a minute and API testing 0.33 (the tunnel adds relay and network cost); load testing counts as in the cloud. Local commands are not counted: they run on your machine.
- Load testing is capped at 50 virtual users for 5 minutes, because every request crosses your own connection twice. Real-browser load is not available.
- Not available through an agent: signed-in runs with a stored login, setup and teardown hooks, API collection runs and consumer contract tests (these two run in an isolated service that cannot reach your network).
Environment
| Variable | Meaning |
|---|---|
| WTS_AGENT_TARGETS | Required. Hosts, host:port or IPv4 ranges, separated by commas |
| WTS_AGENT_CREDENTIAL | The agent's credential, instead of the saved file |
| WTS_API_URL | Default https://webtestingsuite.com |
| WTS_API_KEY | run --once only: an API key with scan:write |
| WTS_AGENT_CONFIG | Where register saves the credential |
| WTS_AGENT_COMMANDS, WTS_AGENT_COMMAND_FILES, WTS_AGENT_WORKDIR | Local commands (above) |
Polling: every 2 seconds right after a run, doubling to once a minute when idle, and every 5 minutes after an hour without runs. A revoked agent, or one older than the minimum version, stops with exit code 2 and says what to do.
License
Commercial software. Copyright (c) 2026 Prozen Technologies OPC Pvt Ltd. All rights reserved. Web Testing Suite is a product of Prozen Technologies OPC Pvt Ltd. Use is governed by the LICENSE file included with this package and the Terms of Service.
