Skip to content

chaselee/rainforest-cli

 
 

Repository files navigation

Build Status

Rainforest-cli

A command line interface to interact with RainforestQA.

This is the easiest way to integrate Rainforest with your deploy scripts or CI server. See our documentation on the subject.

Installation

You can install rainforest-cli with the gem utility.

gem install rainforest-cli

Alternatively, you can add to your Gemfile if you're in a ruby project. This is not recommended for most users. The reason being that we update this gem frequently and you usually want to ensure you have the latest version.

gem "rainforest-cli", require: false

Basic Usage

To use the cli client, you'll need your API token from a test settings page from inside Rainforest.

Run all of your tests

rainforest run all --token YOUR_TOKEN_HERE

Run all in the foreground and report

rainforest run all --fg --token YOUR_TOKEN_HERE

Run all tests with tag 'run-me' and abort previous in-progress runs.

rainforest run --tag run-me --fg --conflict abort --token YOUR_TOKEN_HERE

Options

General

Required:

  • --token <your-rainforest-token> - you must supply your token (get it from any tests API tab)

Running Tests

The most popular options are:

  • --browsers ie8 or --browsers ie8,chrome - specficy the browsers you wish to run against. This overrides the test own settings. Valid browsers are ie8, ie9, chrome, firefox and safari.
  • --tag run-me - only run tests which have this tag (recommended if you have lots of test-steps)!)
  • --site-id - only run tests for a specific site. Get in touch with us for help on getting that you site id if you are unable to.
  • --environment-id - run your tests using this environment. Otherwise it will use your default environment
  • --conflict OPTION - use the abort option to abort any runs in progress in the same environment as your new run. use the abort-all option to abort all runs in progress.
  • --fg - results in the foreground - rainforest-cli will not return until the run is complete. This is what you want to make the build pass / fail dependent on rainforest results
  • --fail-fast - fail the build as soon as the first failed result comes in. If you don't pass this it will wait until 100% of the run is done. Use with --fg.
  • --custom-url - use a custom url for this run. Example use case: an ad-hoc QA environment with Fourchette. You will need to specify a site_id too for this to work. Note that we will be creating a new environment for this particular run.
  • --git-trigger - only trigger a run when the last commit (for a git repo in the current working directory) has contains @rainforest and a list of one or more tags. E.g. "Fix checkout process. @rainforest #checkout" would trigger a run for everything tagged checkout. This over-rides --tag and any tests specified. If no @rainforest is detected it will exit 0.
  • --description "CI automatic run" - add an arbitrary description for the run.

More detailed info on options can be found here.

Support

Email help@rainforestqa.com if you're having trouble using this gem or need help to integrate Rainforest in your CI or deployment flow.

Contributing

  1. Fork it
  2. Make sure you init the submodules (git submodule init && git submodule update)
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

About

Command line interface to Rainforest

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%