Gemini configuration

In the following example gemini is configured using .gemini.yml file at the root of the project. But you can use one of the files specified in configuring section.

Complete example with all available settings looks like this, but you'll need to specify only a few settings specific for your project:

rootUrl: https://example.com/root
gridUrl: http://webdriver.example.com
desiredCapabilities:
  commonThing: value
calibrate: false
tolerance: 3.5
antialiasingTolerance: 0,
compareOpts:
  stopOnFirstFail: true
httpTimeout: 5000
sessionRequestTimeout: 60000
sessionQuitTimeout: 5000
screenshotsDir: ./screens
windowSize: 1600x1080
sessionsPerBrowser: 2
suitesPerSession: 100

browsers:
  chrome-latest:
    desiredCapabilities:
      version: "37.0"
      browserName: chrome
      platform: LINUX

  firefox-latest:
    rootUrl: https://example.com/special-for-ff
    screenshotsDir: ./ff-screens
    calibrate: true
    desiredCapabilities:
      version: "31.0"
      browserName: firefox
      platform: LINUX

sets:
  ff:
    files:
     - gemini/ff
    browsers:
     - firefox-latest
  chrome:
    files:
     - gemini/chrome
    browsers:
     - chrome-latest

system:
  projectRoot: ../project
  sourceRoot: ../project/src
  tempDir: ./temp-images
  exclude:
    - node_modules/**
  plugins:
    teamcity: true
  debug: true
  parallelLimit: 3
  diffColor: '#ff0000'
  coverage:
    enabled: true
    exclude:
     - libs/**
     - "*.blocks/**/*.tests/blocks/**"
     - "*.blocks/**/*.tests/*.blocks/**"
    html: false

System settings

There is a system section in the config file, which contains global gemini settings. These settings can not be set per-browser.

exclude:
  - node_modules/**
  - gemini/helpers/**
  - foo/{bar,baz}/*.js

yaml plugins: teamcity: true saucelabs: username: user password: pass

Each plugin should be an installed npm package.

Browsers settings

These settings specify the configuration of each browser used for tests. Each setting can be specified in two ways:

  1. At the top level of a config file. This way it affects all browsers.
  2. Inside the browsers section. This way it will affect only one browser and override top level value.

Format of the browsers section:

yaml browsers: <browser-id>: <setting>: <value> <setting>: <value>

<browser-id> value is used for browser identification in test reports and for constructing screens file names.

Settings list:

Note that the same test never be performed in the same browser session.

:warning: Option does not work in Opera@12.16.

This is useful when the page has elements which are animated.

Sets

You can link some set of tests with certain browsers using sets.

Format of the sets section:

sets:
  <set-name>:
    files:
     - <dir-with-test-files>
     ...
    browsers:
     - <browser-id-to-test-in>
     ...

If sets are not specified in config, all files from gemini directory will be launched in all browsers specified in a config.

You can specify sets to run using CLI option --set.

Overriding settings

All options can also be overridden via command-line flags or environment variables. Priorities are the following:

To override config setting with CLI option, convert full option path to --kebab-case. For example, if you want to run tests against different root URL, call:

gemini test --root-url http://example.com

To save screenshots for IE9 to different location (considering you have browser with ie9 id in the config):

gemini update --browsers-ie-9-screenshots-dir ./ie9-screens

To override setting with environment variable, convert its full path to snake_case and add gemini_ prefix. Above examples can be rewritten to use environment variables instead of CLI options:

gemini_root_url=http://example.com gemini test
gemini_browsers_ie9_screenshots_dir=./ie9-screens gemini update