Skip to content

Configuration Options

MauravdL edited this page Sep 13, 2010 · 6 revisions

Configuration settings can be defined in several different ways.

Rake command line

> rake spec BROWSER=firefox

Environment variables

> set BROWSER=firefox

The config files config\config.yml or config\environments.yml

browser:  firefox

Options set in the environments.yml file will be selected based on the ENVIRONMENTS setting (default is TEST).

In the first two cases, you should use all caps for the name of the config option. You should use lower case in the yaml files. Values should always be lower case, regardless of location.

Options

The framework supports these options:

  • browser
  • environment

See Browser Configuration for more options

Trumpage

What happens if the same configuration setting is defined in more than one location? The locations at the top of this list will trump those listed below them.

  1. Rake command line settings
  2. Environment variables
  3. config/config.yml
  4. config/environment.yml

Custom Options

You can define your own options. When you do this, you can set them in either the config\config.yml or the config\environments.yml. If set in the environments.yml file, they will be selected based on the value of ENVIRONMENTS (just like other configuration settings).

You can access any options (including custom options) from your tests. This setting in your environments.yml

username:   admin

can be accessed in your scripts:

site.config[:username]
Clone this wiki locally