From MozillaWiki
Jump to: navigation, search


As an essential part of Boot2Gecko (Mozilla Firefox OS), the WebAPIs provide access to the device OS, thus allowing html applications to use mobile phone features. For example, a B2G html application can send SMS messages via javascript using the WebSMS WebAPI.

In order to ensure the functionality of the WebAPIs, an extensive WebAPI test suite must be developed. Both the Mochitest and Marionette automation frameworks will be used in the development and execution of the WebAPI tests, which ultimately will be executed on the B2G device emulator on a per-check-in basis.

Name: WebAPI tests
Leads: Rob Wood, Henrik Skupin, Dave Hunt
Contributors: n/a
API specs:

Sub Projects

Priority Feature Status Owner QA testplan
P1 WebTelephony Active Rob Wood B2G/QA/WebAPI_Test_Plan/WebTelephony
P1 WebSMS Active Rob Wood B2G/QA/WebAPI_Test_Plan/WebSMS
P1 Screen Orientation Active Henrik Skupin B2G/QA/WebAPI_Test_Plan/Screen_Orientation
P1 Battery Status No started TBD B2G/QA/WebAPI_Test_Plan/Battery_Status


For each of the WebAPIs that are testable on the B2G device emulator:

  • Review the implementation details
  • Review existing tests
  • Identify new test cases to be developed, in order to ensure full API test coverage
  • When reviewing existing mochitests, determine if additional test coverage can be achieved by adding marionette tests that access emulator features
  • Develop new tests using the appropriate automation framework:
    • Default to using mochitest; unless:
    • If direct access to the B2G device emulator 'hardware' commands is required, use the marionette framework.


For more information about the B2G WebAPI, building B2G, running the tests, etc. please see the links mentioned below.

Specifications and Architecture

General Firefox OS announcement:

Firefox OS on MDN:

B2G Wiki:

B2G architecture overview:

Details and specifications for the WebAPIs planned for B2G V1:

Building B2G

Building and installing B2G:

Running the WebAPI Tests

Using the B2G device emulator:

Mochitest overview:

B2G Mochitest:

Marionette overview:

B2G Marionette:

Running B2G Marionette tests:

Marionette Command Line

You may want to create a shell script to quickly launch your WebAPI Marionette test right from your workspace folder. Create a new shell script and copy/paste the line of code below, and put the script in your path. Then with the emulator already running, you can use the script to easily execute your WebAPI test.

python $B2G_HOME/gecko/testing/marionette/client/marionette/ --emulator arm --address localhost:2828 --homedir $B2G_HOME $1

Emulator (Android Console) Commands

Emulator commands:

General emulator info: