CLI Reference ​
Complete reference for TestBeats command-line interface and programmatic usage.
Commands ​
testbeats publish
​
Publish test results to configured targets.
testbeats init
​
Initialize a new TestBeats configuration file.
Installation Methods ​
NPX (Recommended) ​
bash
npx testbeats@latest [command]
Download Executable ​
bash
curl https://raw.githubusercontent.com/test-results-reporter/testbeats/main/scripts/download-latest.sh | bash
./testbeats-[os] [command]
NPM Package ​
bash
npm install testbeats -g
testbeats [command]
Programmatic Usage ​
bash
npm install testbeats
javascript
const { publish, defineConfig } = require('testbeats');
const config = defineConfig({
// configuration
});
publish(config);
Global Options ​
These options are available for all commands:
Option | Description | Default |
---|---|---|
-h, --help | Display help information | - |
-v, --verbose | Enable verbose logging | false |
--version | Display version information | - |
--config | Path to configuration file | ./testbeats.config.json |
--api-key | TestBeats API key | - |
--run | Test run Name | - |
--project | Project Name | - |
--slack | Slack webhook URL | - |
--teams | Microsoft Teams webhook URL | - |
--chat | Google Chat webhook URL | - |
--junit | JUnit XML file | - |
--mocha | Mocha JSON file | - |
--cucumber | Cucumber JSON file | - |
--testng | TestNG XML file | - |
--xunit | XUnit XML file | - |
--mstest | MSTest XML file | - |
--nunit | NUnit XML file | - |
--ci-info | CI/CD information | - |
--chart-test-summary | Chart test summary | - |
Environment Variables ​
Variable | Description | Example |
---|---|---|
TEST_BEATS_API_KEY | TestBeats API key | api-key |
TEST_BEATS_PROJECT | TestBeats project name | my-project |
TEST_BEATS_RUN | TestBeats run name | my-run |
Quick Reference ​
Publish to Slack ​
bash
testbeats publish --slack "webhook-url" --junit "results/*.xml"
Publish with Configuration ​
bash
testbeats publish -c testbeats.config.json
Multiple Targets ​
bash
testbeats publish --slack "url1" --teams "url2" --junit "results/*.xml"
With Extensions ​
bash
testbeats publish --ci-info --chart-test-summary --slack "url" --junit "results/*.xml"
See Also ​
- Configuration Reference - Complete configuration schema
- Targets Reference - Communication platforms
- Extensions Reference - Available extensions