• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. Automated Testing of B2G OS
  5. Gaia UI Tests Introduction

Gaia UI Tests Introduction

In This Article
  1. Getting started with Gaia UI tests
  2. Advanced topics
  3. See also
  4. Questions/Comments/Concerns

Next ยป

Gaia-ui-tests is Mozilla's test suite for running end-to-end UI test cases against Gaia, the UI of Firefox OS. All the tests are written in Python with some JavaScript used for interacting with Firefox OS's APIs. This set of tutorial articles explains how to set up the environment to write and run tests.

Gaia-ui-tests uses Gaiatest, a Python package based around Marionette. Gaiatest is designed to wrap HTML locators, Marionette calls and API calls together for interoperable communication and functionality. Marionette is based on the W3C standard developed for the Selenium WebDriver a programming interface for browser automation. If you have used WebDriver and page/app objects before then you will find using Marionette and gaiatest easy.

Getting started with Gaia UI tests

For those keen to get started with automated testing on Gaia/Firefox OS we have a tutorial series that will help you go from nothing to writing your own tests. Once you've completed this tutorial you'll have enough knowledge of testing, Firefox OS and Marionette to get started as a Mozilla tests contributor. It is highly recommended that you complete this tutorial if you wish to become a contributor.

Part 1: Getting started with Marionette and Firefox OS
This article covers installing the tools you need to get started with running tests, such as B2G Desktop, Python and Marionette.
Part 2: Basic interactions with Firefox OS using Marionette
An overview of the basic commands you will use to manipulate Firefox OS via Marionette.
Part 3: Upgrading our code into a reusable test
Moving on, in this article we will assemble some basic commands into a simple test inside a Python file so they can all be run as a single entity.
Part 4: Re-using commands to set up Firefox OS
Here we look at moving some of the commands into Python methods to promote code reuse.
Part 5: Introducing a test runner
A test runner is a central feature of any good test suite, allowing you to run multiple tests and report and aggregate results. In this article we will explore the basics of Python's unittest runner.
Part 6: Using tuples, and Marionette's By class
This time around we explain how to further reduce duplication of code, by storing repeated locators in tuples and simplifying the syntax with Marionette's By class.
Part 7: Writing your own tests
Now the basics and behind you, and it is time to start to writing your own tests! Here we give you some tool recommendations to make the work easier, and suggest some tests to try your hand at writing.
Part 8: Using a base class
In its current state, our test file contains all the test runner code. This is ok for now, but as soon as you start to run many test files it will mean a lot of duplication. Here we solve this problem by abstracting the test runner code into a separate Python class.
Part 9: Reducing duplication with app objects
As a final improvement to the code's maintainability, in this article we explore abstracting code that handles interaction with specific Firefox OS apps out into Python app objects.

Advanced topics

Once you've got the basics of writing and running tests under your belt, you may want to move on to some more involved or advanced work, such as running the full gaia-ui-tests tests suite, or logging power draw as the result of a test.

Running the gaia-ui-tests
Guides to running the gaia-ui-tests suite against real Firefox OS devices and B2G Desktop in a variety of configurations.

See also

Gaia-ui-tests main repository

Questions/Comments/Concerns

This project is at a fairly early stage, and your feedback would be greatly appreciated:

  • Send mails to the gaia-ui-automation@mozilla.org list.
  • Alternatively, find us on Mozilla IRC at channels #fxosqa, #fxos-automation, and #moztpeqa.

Document Tags and Contributors

Tags: 
  • Build documentation
  • Firefox OS
  • Gaia
  • gaia-ui-test
  • gaiatest
  • Guide
  • Mobile
  • Testing
 Contributors to this page: chrisdavidmills, sousmangoosta, Uemmra3, aoitan, zac_c, __Vinz__, lj.ditrapani, teoli, kscarfone, ypwalter, Askeing, WilliamH
 Last updated by: chrisdavidmills, Feb 27, 2017, 3:02:09 AM
See also
  1. Build and install
    1. Build and install overview
    2. B2G OS build process summary
    3. Build prerequisites
    4. Preparing for your first build
    5. Building B2G OS
    6. B2G installer add-on
    7. Building B2G OS for Flame on Mac OS X
    8. Choosing how to run Gaia or B2G OS
    9. Compatible Devices
    10. Installing B2G OS on a mobile device
    11. Creating and applying B2G OS update packages
    12. Building and installing FOTA community builds
    13. B2G build variables reference sheet
  2. Porting B2G OS
    1. Porting overview
    2. Porting basics
    3. Porting on CyanogenMod
  3. Developing Gaia
    1. Developing Gaia overview
    2. Running the Gaia codebase
    3. Run Gaia on desktop using Mulet
    4. Understanding the Gaia codebase
    5. Making Gaia code changes
    6. Testing Gaia code changes
    7. Submitting a Gaia patch
    8. Gaia build system primer
    9. Different ways to run Gaia
    10. Make options reference
    11. Gaia tools reference
  4. B2G OS APIs