- How to integrate Rainforest into your CI process
- How to write, upload, and run tests using the Rainforest CLI
The Rainforest CLI
In addition to our web app, Rainforest can be accessed via one's Command Line Interface (CLI). The main benefits of the Rainforest CLI are (details follow):
- Unlocks a new workflow for developers to access and interact with Rainforest without going to the UI (Learn more)
- With a simple script, users can hook Rainforest into any Continuous Integration (CI) tool to kick off Rainforest as part of your release process (Learn more)
- Anyone from your team can use the CLI to kick off specific test suite runs without needing to go into the Rainforest app (learn more below)
If you're interested in learning how your development team can leverage the Rainforest CLI, please contact support or your CSM and we'll assist you.
Installing and using the Rainforest CLI
Once you have installed the Rainforest CLI (instructions below), the Rainforest CLI allows you to:
- Start and monitor runs without going to the UI
- List various things from your account
- Create, edit, download, and upload Rainforest tests (Learn more)
How to Install the Rainforest CLI
We support Mac, Windows and Linux. The project behind it is open-source.
Mac - homebrew
If you use homebrew, then you can simply run:
brew install rainforestapp/public/rainforest-cli
If you don't use homebrew, then you can download and install the cli binary directly.
curl -O https://bin.equinox.io/c/htRtQZagtfg/rainforest-cli-stable-darwin-amd64.zip
unzip rainforest-cli-stable-darwin-amd64.zip -d /usr/local/bin
Download the zipped binary for your system here:
You can download and install the binary directly here:
curl -O https://bin.equinox.io/c/htRtQZagtfg/rainforest-cli-stable-linux-amd64.tgz
tar -xzf rainforest-cli-stable-linux-amd64.tgz
mv rainforest /usr/local/bin
chmod +x /usr/local/bin/rainforest
Running Rainforest tests from the CLI
Let's run a test from the CLI to see how fast and easy it is. Follow these directions after installing the CLI:
- Retrieve your API token. In your Rainforest account, go to the Integrations page under Settings. Write down and copy your API token. This token is unique to each user in your team’s account.
- Run a test from your CLI. Go to your CLI terminal and try the following basic command where you’ll replace 123456 with one of your tests’ IDs (the number next to any test title in the web app) and xyz with your API token.
rainforest run 123456 --token xyz
Voilà! You ran your first test from the CLI. You can see the result in the UI as well! To perform other commands, check out the CLI documentation on our GitHub page or type in rainforest help into the CLI.