Running Tests from the CLI

Learn how to use the CLI to execute individual tests, run groups, and features.

Installing the CLI

With Rainforest’s Command Line Interface (CLI) tool, you can start a test without the need to log into Rainforest directly. Follow these steps to enable the CLI:

  1. Install the CLI. For more information, see How to Install the CLI.
  2. In your Rainforest account, navigate to the Integrations page under Settings to retrieve your API token. Note that the token is unique for each user in your team’s account.

How to Start an Individual Test from the CLI

  1. Open a command or terminal window.
  2. Use the following command, replacing the API token and test ID with the ones from your own account:
rainforest run <test_id> --token <token>

How to Start Run Groups from the CLI

The CLI uses the configuration defined in the Run Group settings (environment, browsers, crowd, location) unless different parameters are passed.

  1. Open a command or terminal window.
  2. To get a list of your run groups and their IDs, use the following command:
rainforest run-groups --token <token>
  1. Once you have noted the IDs of the run group you want to start, use the following command to execute the run group:
rainforest run --run-group <run_group_id> --token <token>
  1. Optionally, set the parameters --environment-id, --browsers, and --crowd if you want to use different settings for the run.

How to Run a Feature from the CLI

  1. Open a command or terminal window.
  2. Get a list of your features and their IDs using the following command:
rainforest features --token <token>
  1. Once you have the ID of the feature which you want to run, use the following command to start all tests included in the feature:
rainforest run --feature <feature_id> --token <token>

How to Run All Tests from the CLI

  1. Open a command or terminal window.
  2. Use the following command to start all tests in your Rainforest account:
rainforest run all --token <token>

👍

CLI Reference

For more information on CLI commands and their usage, see our GitHub page.


If you have any questions, reach out to us at [email protected] or via the chat bubble below.


Did this page help you?