Running AMO Tests with moz-grid-config

This post contains the instructions for a workshop that is part of the addons.mozilla.org automation testday.

 

For running the AMO tests, it’s good to use our moz-grid-config repo to run selenium because it allows you to get around some issues like setting up a separate firefox profile for accepting certificates and it contains both the standalone version of selenium rc as well as what you’ll need to run selenium grid.

 

If you’d like to know more about how grid works, you can check out this page.

 

Here is the url for the repo which includes a readme.

 

Once you’ve cloned the moz-grid-config repo using
git clone git@github.com:mozilla/moz-grid-config.git

You can try starting it up.  There are 2 commands for this which will each need to be running in their own terminal window:
ant launch-hub
ant launch-remote-control  -Drc.environment=”environment name”

 

The value from the -Drc.environment parameter comes from the grid_configurations.yaml file.  If you have a look in the file, you’ll see options for other environments including Firefox 6 and the Aurora channel.

 

It’s also worth noting that the selenium jars are in the vendor directory.

 

Once you’ve got grid up and running, and forked the AMO test repository, you can run some AMO tests with this type of command line

 

py.test -n 5 –browser-name=”Firefox 5 on Mac OS X” -q test_search.py -k test_that_searching_with_substrings_returns_results

-n 5 is xdist telling py.test to run 5 instances at a time.  Note that you need to have multiple terminals going with ant launch-remote on different ports to use this option.  If you don’t specify a port number when you run “ant launch-remote” it will launch on 5555
–browser-name=”Firefox 5 on Mac OS X” is specified in the grid_configuration.yaml of moz-grid-config
-q test_search.py is telling py.test to run the file test_search.py
-k test_that_searching_with_substrings_returns_results

 

-k is a keyword parameter.  In this example it’s used for a testname, but we could also specify -k substrings to run any tests with substring in the testname.

If you get stuck or if something isn’t working with your environment, feel free to stop by the testday irc channel:  irc.mozilla.org #testday.  (Note, I probably won’t be watching twitter as much today since I’ll be in the irc channel)