MDN’s new design is in Beta! A sneak peek:

Setting Up Marionette for B2G Redirect 2

Setting up the Marionette client

The Marionette client is a Python package with which you can run Marionette tests: both Python tests, and JavaScript WebAPI tests. You'll need to set this up on your machine before using it.

To do so, you should clone a Gecko tree; either the Gecko tree inside a Firefox OS clone, or a standalone Gecko clone (e.g., mozilla-central) will work. For example, supposing this is the first time you clone the Gecko tree:

Install Mercurial first, if it's not installed yet. This is how you can do it in Mac if you have Homebrew installed. Other package managers will differ:

$ brew install mercurial

Change to your work directory (e.g. ~/code) and type this to actually start the cloning process:

$ hg clone $GECKO_DIR

... where $GECKO_DIR can be any valid directory name, e.g. mozilla-central. That will take a while (about 10 minutes with a fast connection).

See Building and installing Firefox OS for details on how to set up a Firefox OS build environment and pull the code.

$ cd $GECKO_DIR/testing/marionette/client

$ python develop

It is recommended that you use a virtualenv. Quick virtualenv setup:

$ pip install virtualenv

$ virtualenv $MARIONETTE_ENV

Again, $MARIONETTE_ENV can be any valid directory name. Now you should be able to run the steps above but in the new virtual environment with:

$ cd $GECKO_DIR/testing/marionette/client

$ $MARIONETTE_ENV/bin/python develop

To verify Marionette is installed:

$ $MARIONETTE_ENV/bin/python
>>> from marionette import Marionette

See Running Marionette tests for information on how to run tests after Marionette is set up.

Document Tags and Contributors

 Last updated by: Sheppy,