Chapter 13. Running Thucydides tests from the command line

13.1. Providing your own Firefox profile

You typically run Thucydides as part of the build process (either locally or on a CI server). In addition to the webdriver.driver option discussed about, you can also pass a number of parameters in as system properties to customize the way the tests are run. The full list is shown here:

An example of using these parameters is shown here:

$ mvn test -Dwebdriver.driver=iexplorer -Dwebdriver.base.url=http://myapp.staging.acme.com

This will run the tests against the staging server using Internet Explorer.

$ mvn test -Dwebdriver.firefox.profile=/Users/johnsmart/Library/Application\ Support/Firefox/Profiles/2owb5g1d.default

On Windows, it would be something like:

C:\Projects\myproject>mvn test -Dwebdriver.firefox.profile=C:\Users\John Smart\AppData\Roaming\Mozilla\Firefox\Profiles\mvxjy48u.default
-Dfirefox.preferences="browser.download.folderList=2;browser.download.manager.showWhenStarting=false;browser.download.dir=c:\downloads"

Integer and boolean values will be converted to the corresponding types in the Firefox preferences; all other values will be treated as Strings. You can set a boolean value to true by simply specifying the property name, e.g. -Dfirefox.preferences=app.update.silent.

A complete reference to Firefox’s configuration settings is given here.

If you want to set default values for some of these properties for your own development environment (e.g. to always activate the Firebugs plugin on your development machine), create a file called thucydides.properties in your home directory (or any property file as defined by setting the system property properties), and set any default values here. These values will still be overridden by any values defined in the environment variables. An example is shown here:

thucydides.activate.firebugs = true
thucydides.browser.width = 1200