Skip to content
  • There are no suggestions because the search field is empty.

TestMonitor CLI

Use the TestMonitor CLI to manage test tasks and automate result submissions directly from your terminal or CI/CD pipeline

About TestMonitor CLI

The TestMonitor CLI is a command-line tool for submitting automated test results directly to TestMonitor. Easily installable via NPM, it works seamlessly across Linux, Windows, macOS, and all common CI/CD environments.

Features

The CLI tool supports:
  • Creating JUnit XML test cases, along with their associated results and execution run in TestMonitor.

Future releases of the CLI will add advanced features for test run management, authentication, and more.

Prerequisites

Before you begin, ensure you have:
  • Access to a TestMonitor instance
  • NodeJS 18+ installed

When these requirements are met, you can proceed with installing the CLI tool.

Installation

Install the CLI globally using NPM:

$ npm install -g @testmonitor/testmonitor-cli

To upgrade to the latest version later on, run:

$ npm update -g @testmonitor/testmonitor-cli
After installation, you can verify the installed version with:
$ testmonitor-cli --version

Getting Started

To begin using the CLI, follow these steps:

  1. Go to your project settings in TestMonitor.
  2. Enable the JUnit XML integration under the Integrations menu.
  3. Copy the Token.
  4. Run the following command:
$ testmonitor-cli junit submit -d domain.testmonitor.com -t <token> -f ./junit.xml

 Replace <token> with your actual integration ID.

Command Reference

This section lists all available commands grouped by functionality.

JUnit

Commands for managing JUnit-style test reports.

Submit

Submit a JUnit XML report and create a new test run in your TestMonitor project.

$ testmonitor-cli junit submit [options]
 
Option Description
-d, --domain TestMonitor domain (required)
-t, --token JUnit token (required)
-f, --file Path to JUnit XML file (required)
-a, --automation-type Test type (e.g. playwright, selenium)
-n, --name Custom test run name
-m, --milestone-id Target milestone ID
-o, --milestone-name Milestone name to find or create
-e, --test-environment-id Target test environment ID
-p, --preserve-names Preserve original test case names
-s, --skip-root-suite Skip root test suite nesting
-v, --verbose Output debug information

Troubleshooting

“Unsupported Node.js version” error

The CLI requires Node.js 18 or newer, but you’re running an older version. Check your Node.js version:

$ node -v

If below 18, download the latest version from nodejs.org.

“Permission denied” during installation

Global installs may require elevated privileges. Use nvm or another Node version manager. Alternatively, try installing with sudo (Linux/macOS):

$ sudo npm install -g @testmonitor/testmonitor-cli

“Command not found” after installation

The CLI binary may not be linked properly, or npm installed the package in a location that isn’t in your system’s PATH. Ensure you installed the CLI globally:

$ npm install -g @testmonitor/testmonitor-cli

Check if your npm global bin directory is in your PATH:

$ npm bin -g

Add the output directory to your PATH if it isn’t already.

“Network error” or CLI hangs when fetching data

The CLI relies on an active internet connection. Network restrictions, proxies, or firewalls may block requests. Test your connection (replace "mydomain" with your TestMonitor domain):

$ curl https://mydomain.testmonitor.com

Contact support

If these solutions do not resolve your issue, feel free to reach out to our support team for additional assistance.