See Hacking Gaia to get started with Gaia.
This document covers running and writing integration tests for Gaia apps. It covers the information in the README.md.
You need the gaia repository and B2G desktop.
(December 21st, 2012) Note: We're currently using the b2g18 nightly builds for B2G desktop which are located here: http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g18/
Running all the tests
First, you need to generate a profile. If you specify
NOFTU=1, then it'll generate a profile without the First Time User dialogs when it starts up. This reduces some of the pain of running integration tests for the first time with that profile:
Second, launch B2G Desktop.
Third, run the command line:
That will run all the integration tests for all the apps.
You can run specific tests or groups of tests by specifying options.
To run tests for a specific app:
make test-integration APP=<APP>
To run tests for a specific file:
make test-integration TESTS=<PATH/TO/TESTFILE.js>
You can also optionally provide a reporter to use to format the test output. For example:
make test-integration REPORTER=List
Setting up your Gaia app
Although this guide should help make things easier, the best way to learn how to write, set up, and run tests is currently still to look at the source code; in particular, take a look at the calendar tests.
FIXME: Email app has tests coming, too.
Writing integration tests
It's highly recommended that you read though the mocha site, since all tests are really mocha tests. The documentation here is focused on getting you started, and about our special integrations with test-integration and Gaia.
It's also important to note that we add special functions (like
requireApp()) to make writing tests easier. Helper and scaffolding code can be found in the
Integration tests are located in the