About Automation Test Used for Firefox OS

From MozillaWiki
Jump to: navigation, search

About Automatic Test Used for Firefox OS

Gaia unit test is executed every time when a pull request set. A Travis server on VM will fetch and merge the pull request and tested. All the pull request now has passed all the unit test on Travis server to be merged into main base.

gaia-ui-test is an enhancement of Marionette test automation framework. As we installed Marionette server inside the devices, we can have it trigger the Firefox OS and simulate the user behavior on screen.

Marionette is a test automation framework used to drive the UI and JS/XPCOM layer of remote or local instances.

The Marionette client includes the harness which runs Marionette and mochitest-browser-chrome tests. It will give you similar functionality as Selenium for Firefox builds, but with built in chrome support as well. With it, you can send commands to chrome or content on demand, allowing you to coordinate large scope tests like communicating to multiple remote gecko processes (useful for testing things like SMS messaging for WebAPI for example).

This is currently being used to test B2G, but can work with any gecko platform.

Mochitest uses JavaScript to test features. Anything piece that has its functionality exposed in JavaScript can theoretically be tested with Mochitest. "Plain" mochitest should be used to test DOM APIs and other pieces of functionality exposed to web content (i.e. requiring no special permissions).

xpcshell are console JavaScript tests. There is no chrome, no content, no window. xpcshell is useful for testing low-level things, such as XPCOM components. If you don't need a window, use this. xpcshell is particularly useful for testing low-level objects that are exposed to JavaScript.

reftest verifies that two web pages are rendered identically to test layout and graphics correctness, taking advantage of the fact that there is generally more than one way to achieve any given visual effect in a browser. For each test, Reftest will take two sample pages that try to produce the same effect (normally one with a simple markup, and one using more complex markup) and verify that they produce the same visual construct.

[Automated_testing on MDN]