Configuration

Project configuration

Galen allows to configure each project separately. You just need to create a galen.config file in your test project directory or you can run this command and Galen will create a config file for you:

galen config

Global configuration

In some cases you might want to have some basic settings defined for all of your projects. Since version 2.3.2 this can be achieved with --global flag:

galen config --global

The command above will generate a basic .galen.config file in your home directory. Actually it might be handy to configure all external drivers for different browsers in a global config. For instance if you need to declare a path to a geckodriver to be able to run test in Firefox you can do it with this property in galen.config file:

$.webdriver.gecko.driver=/path/to/your/geckodriver

$. prefix means that this property should be set on a system level. You can use it for configuring other drivers as well.

$.webdriver.gecko.driver=/path/to/geckodriver $.webdriver.chrome.driver=/path/to/chromedriver $.phantomjs.binary.path=/path/to/phantomjs

Config example:

Here is the example of galen config file with all properties explained

# Range approximation # ~~~~~~~~~~~~~~~~~~~~~ # Defines the approximation value for ranges when using "~" in galen page specs # This value means how many pixels or percents should it take constructing a range # e.g. if we define approximation as 5 then the following spec: # height: ~ 50 px # will actually be replaced by Galen with this: # height: 45 to 55px galen.range.approximation=3 # Custom Listeners # ~~~~~~~~~~~~~~~~~~~~~~~ # A comma separated list of class paths to reporting listeners # The defined listeners will be picked up by Galen and used for reporting # # galen.reporting.listeners= # Headless Mode # ~~~~~~~~~~~~~~~~~~~~ # In some browsers it is possible to use a headless mode where no UI is needed at runtime. # Currently only supported on Chrome and Firefox. # galen.browser.headless = true # Full screenshots # ~~~~~~~~~~~~~~~~~~~~ # In some browsers it is not possible to create a complete screenshot of whole page. # With this property enabled Galen will scroll page and make screenshots of parts of it. # Then it will assemble it in a one big screenshot # galen.browser.screenshots.fullPage = false # the following parameters can be used in case the upper parameter is set to true # smart waiting for scroll position, but with a timeout, set to zero to turn off smart wait galen.browser.screenshots.fullPage.scrollTimeout = 50 # it sets the amount of time in milliseconds needed for a check that the page was scrolled when taking full page screenshots # hard wait during scroll galen.browser.screenshots.fullPage.scrollWait = 20 # Default browser # ~~~~~~~~~~~~~~~~~~~~~~~~ # A browser that should be used by default in case it was not specified in galen test galen.default.browser=firefox # Color scheme spec precision # ~~~~~~~~~~~~~~~~~~~~~~~~ # A value between 8 and 256 for color spectrum accuracy. spec.colorscheme.precision = 256 # Using page URLs from last checked page in HTML report # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # This property enables the use of last page URL in a page test # Needed when for some pages on the website there is no way to open it by direct URL # galen.reporting.html.useLastPageUrls = true # Color scheme spec test color range # ~~~~~~~~~~~~~~~~~~~~~~~~~ # A value between 0 and 256 which defined the range of nearby colors # in spectrum which will be picked up for calculating the percentage of usage spec.colorscheme.testrange = 6 # Running in Selenium Grid # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # You can run your tests in Selenium Grid without modifying the tests. # Just enable the "galen.browserFactory.selenium.runInGrid" property # and Galen will always choose a Selenium Grid instead of running tests against local browsers # Also make sure you provide the proper URL to grid # galen.browserFactory.selenium.runInGrid = true galen.browserFactory.selenium.grid.url = http://localhost:4444/wd/hub galen.browserFactory.selenium.grid.browser = Firefox galen.browserFactory.selenium.grid.browserVersion = 16 galen.browserFactory.selenium.grid.platform = XP # Exit with fail code in case of any failures # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ galen.use.fail.exit.code = true # Default value for tolerance in image spec galen.spec.image.tolerance = 30 # Default value for error rate in image spec galen.spec.image.error = 0px # Testing visibility of each element in every spec galen.spec.global.visibility = true # Test file extension for standard test suite runner # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ galen.test.file.ext = .test # Test file extension for JavaScript test suite runner # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ galen.test.js.file.ext = .test.js

Comments

We have moved all the discussions to Google Groups. From this moment, if you have problems with your test code or some issues with installation, please ask your questions in https://groups.google.com/forum/#!forum/galen-framework.