Gaia (Firefox OS) UI Automation: Web QA's Effort

| No Comments

Intended Audience

The aim here is for a high-level overview of our effort, with enough detail that developers and other automation/QA engineers can hopefully become involved at some level, too


(Before, or at least in addition to reading this, it makes sense to read Andrew Halberdstat's post, "A Tired Developer's non-Illustrated Primer to B2G Testing.)"

Known to many, but certainly not all, of Mozilla, is that Web QA has been leading the Gaia UI Tests automation effort, on real devices, in an effort to support both the B2G QA team, and also development at large.

The original intent and driving force was automation of the daily QA smoketest suite, run manually, on each build. Although that's still squarely in our sight, we're not limiting our automation targets to just those pre-identified tests, now - we've added and continue to add critical-path tests as well as areas that are highly prone to regression or just need more coverage. We're using the Marionette framework to drive these tests.

It's definitely been a long road to get here, so let me chronicle (at a high level) what it's taken to get here, and where "here" is, too.

Our Infrastructure/Architecture - Continuous Integration Jobs

It probably makes sense to talk about what we test or provide infrastructure to test, first.

Below is a screenshot of all our (Web QA + A-team) B2G jobs running in our Jenkins instance.

The test suites you see listed there (click on the image to view it at full resolution), are as follows:

  1. *.download.pvtbuilds, *.download.pvtbuilds.flashzip, and *.download.releases are build-download jobs for their corresponding UI testing, update testing, and performance testing, respectively
  2. *.master.mozperftest is a new prototype of performance-testing job
  3. *.master.perf is a "regular" perf job
  4. *.master.perf.fps intends to measure scrolling performance (frames per second)
  5. *.master.ui runs Web QA's UI-testing suite against the master branch of Gaia
  6. *.master.ui.xfail are the tests with known failures, which we run periodically and restore to the master.ui job when passing/known good
  7. *.v1-train.perf are the performance tests for the v1-train branch
  8. *.v1-train.run_adhoc_tests
  9. - we use this job to plug in pull requests and single-out tests we'd like to run in isolation, for instance
  10. *.v1-train.ui is our suite of Gaia UI tests, run against the v1-train branch
  11. *.v1-train.xfail is our xfailed tests -- ones with known failures
  12. *.update.tests will be running Marshall's update tests (again, native Unagi)

Hardware/Software Stack

We've scaled out to a currently supported configuration of 7 Mac Minis/7 Unagis; the pairing is intended :-)

Originally, we made do with two -- one pair for running the UI tests, and the other for running performance tests; we then added additional branches, needed more capacity to be able to run concurrent builds, and also added more performance test-suites too.

Each Unagi is connected to a single Mac Mini, formatted and configured to run Ubuntu 12.04 LTS, also running a Jenkins slave agent, and adp port-forwarding to/from Unagi/Mac Mini.

Because we do real, on-device tests (dialer, SMS, etc.) each Unagi (sans the two that run the performance tests exclusively) has a SIM card -- for each of those, we maintain a JSON file (in a private GitHub repo) which contains all the necessary info the test runners needs to run tests on that device. Our Gaia UI Tests README has the info on that.

How We Run Gaia UI Tests (v1-train, and over-simplified)

Now, I'd like to zero-in on the main job Web QA supports, which for the foreseeable future is v1-train.ui.

  • First, a job in Jenkins automatically grabs that latest daily Unagi engineering build (
  • Next, we do a make-reset gaia, and check out and build the v1-train branch from the Gaia repo in GitHub
  • A metric ton of Python-package installs happen next inside a virtualenv
  • Then we: push to the Gaia profile, setting needed preferences, and pull in the JSON file that's specific to that Unagi (its phone #, IMEI #, etc.)
  • Finally, when we listen on the right adb ports, and start sending commands to gaiatest to run all tests marked for inclusion, from one primary manifest.ini file, which itself imports from others
  • Also part of the manifest is a list of potential attributes, to let us know both device-types and capabilities (e.g. bluetooth, camera, wifi, lan, panda for Panda boards) so we can run tests against the appropriate environments
  • To keep our tests isolated from potential other problems, we restart the B2G process in-between tests (takes ~ 18 seconds)
  • In addition to test results, we get a full logcat for the run, as well as screenshots for failures


As of this post, we have 85 total tests, consisting of 67 UI tests, and 18 unit tests (which make sure we're setting ourselves up for success in the later run).

We launch apps, test the keyboard, take photos, videos, make and receive calls, send and receive SMS messages, test IMEI numbers, play music, tune the radio app, make calendar appointments, install and delete apps both from the Firefox Marketplace as well as, and much, much more.

There are limitations, though, as both Gaia and Marionette are under very active development -- for the latter, we're tracking that in bug 801898 - Get GaiaTest UI smoke tests running reliably in Jenkins CI.

Get Involved

As I mentioned, we try to map as closely as possible (unless limited by bugs or not-yet-implemented features in Marionette, which we track) to the QA smoketests, but we've also added a plethora of high-risk/need-coverage areas in our GitHub Issues -- take a look, and reach out to us in #mozwebqa or comment in an issue if you're interested in taking one!

Other Blog Posts on the UI Tests

Leave a comment

About this Entry

This page contains a single entry by Stephen Donner published on March 12, 2013 5:04 PM.

Helping cover (browser) Identity with Selenium: Mozilla Web QA, BrowserID, and Sauce Labs was the previous entry in this blog.

Find recent content on the main index or look in the archives to find all content.


Powered by Movable Type 5.12