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.
Running all the tests
First, you need to generate a 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