Skip to content

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 ​

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:

OptionDescriptionDefault
-h, --helpDisplay help information-
-v, --verboseEnable verbose loggingfalse
--versionDisplay version information-
--configPath to configuration file./testbeats.config.json
--api-keyTestBeats API key-
--runTest run Name-
--projectProject Name-
--slackSlack webhook URL-
--teamsMicrosoft Teams webhook URL-
--chatGoogle Chat webhook URL-
--junitJUnit XML file-
--mochaMocha JSON file-
--cucumberCucumber JSON file-
--testngTestNG XML file-
--xunitXUnit XML file-
--mstestMSTest XML file-
--nunitNUnit XML file-
--ci-infoCI/CD information-
--chart-test-summaryChart test summary-

Environment Variables ​

VariableDescriptionExample
TEST_BEATS_API_KEYTestBeats API keyapi-key
TEST_BEATS_PROJECTTestBeats project namemy-project
TEST_BEATS_RUNTestBeats run namemy-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 ​

Released under the MIT License.