Gaia UI Tests Introduction

  • Revision slug: Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests
  • Revision title: gaia-ui-tests
  • Revision id: 390043
  • Created:
  • Creator: ypwalter
  • Is current revision? No
  • Comment

Revision Content

This page has not yet finished. Your feed back to gaia-ui-automation@mozilla.org would be greatly appreciated.

Introduction

    Gaiatest is a Python package based on Marionette, which is designed specifically for writing tests against Gaia. It's like a mobile phone version of Selenium Webdriver in python version. Basically, it's using python to communicate with device/emulator, and it would execute javascript inside device/emulator

    The main repository is currently in github: Mozilla/gaia-ui-tests. Due to Taiwan's local test needs, we also have another repository synchronized with main repository: Mozilla-TWQA/gaia-ui-tests.

 

Installation

Basic information

    You will need to install most-up-to date marionette client  or matching marionette client version since gaia-ui-tests is using marionette client to communicate  between marionette server inside device/emulator. Usually, marionette client would come with your B2G code from github after excuted "config.sh" ({B2G HOME DIRECTORY}/gecko/testing/marionette/client).

    There are two different ways to install gaia-ui-tests depending on your needs.

Route 1: If you only want to do the tests, just the command below in command line. It should

easy_install gaiatest

Route 2: If you anticipate in modifying gaiatest, you can instead:

git clone git://github.com/mozilla/gaia-ui-tests.git
cd gaia-ui-tests
python setup.py develop

Virtual environment setup

    In case you want to switch back and forth with marionette clients version, setting up virtual environment might be a cleaner way to do so. You sometimes need to go back and forth to know if it's a device/emulator changes or a change in gaia-ui-tests/marionette-client. You could find the tutorial on virtualenv official website, or you can reference the tutorial down below:

    First of all, get the virtualenv installed in linux:

pip install virtualenv

   

 

Running Tests

Testing on a device

 

Testing on emulator

Automatically launched emulator

 

Mannually launched emulator

 

Testing on desktop B2G

 

 

Test Types

 

Test Variables

 

Test Data Prerequisites

 

How to Contribute

Get your github account

 

Fork it and clone it

 

Branch out

 

Take issues and send pull requests

 

Writing Tests

Test guidelines and examples

 

Functions reference

 

Formatting

 

Debugging

 

CSS Locators and XPath Locators Resources

 

Revision Source

<h4 id="This_page_has_not_yet_finished._Your_feed_back_to_gaia-ui-automation.40mozilla.org_would_be_greatly_appreciated.">This page has not yet finished. Your feed back to <span class="Object" id="OBJ_PREFIX_DWT5536_com_zimbra_email"><span class="Object" id="OBJ_PREFIX_DWT5537_com_zimbra_email">gaia-ui-automation@mozilla.org would be greatly appreciated.</span></span></h4>
<h2 id="Introduction">Introduction</h2>
<p>&nbsp;&nbsp;&nbsp; Gaiatest is a Python package based on <a href="https://developer.mozilla.org/en-US/docs/Marionette" title="https://developer.mozilla.org/en-US/docs/Marionette">Marionette</a>, which is designed specifically for writing tests against <a href="https://github.com/mozilla-b2g/gaia" title="https://github.com/mozilla-b2g/gaia">Gaia</a>. It's like a mobile phone version of <a href="http://docs.seleniumhq.org/projects/webdriver/" title="http://docs.seleniumhq.org/projects/webdriver/">Selenium Webdriver</a> in python version. Basically, it's using python to communicate with device/emulator, and it would execute javascript inside device/emulator</p>
<p>&nbsp;&nbsp;&nbsp; The main repository is currently in github:<a href="https://github.com/mozilla/gaia-ui-tests" title="https://github.com/mozilla/gaia-ui-tests"> Mozilla/gaia-ui-tests</a>. Due to Taiwan's local test needs, we also have another repository synchronized with main repository: <a href="https://github.com/Mozilla-TWQA/gaia-ui-tests" title="/Mozilla-TWQA/gaia-ui-tests">Mozilla-TWQA/gaia-ui-tests</a>.</p>
<p>&nbsp;</p>
<h2 id="Installation">Installation</h2>
<h3 id="Basic_information">Basic information</h3>
<p>&nbsp;&nbsp;&nbsp; You will need to install most-up-to date <a href="https://pypi.python.org/pypi/marionette_client/" title="https://pypi.python.org/pypi/marionette_client/">marionette client</a>&nbsp; or matching marionette client version since gaia-ui-tests is using marionette client to communicate&nbsp; between marionette server inside device/emulator. Usually, marionette client would come with your<a href="https://github.com/mozilla-b2g/B2G" title="https://github.com/mozilla-b2g/B2G"> B2G code from github</a> after excuted "config.sh" ({B2G HOME DIRECTORY}/gecko/testing/marionette/client).</p>
<p>&nbsp;&nbsp;&nbsp; There are two different ways to install gaia-ui-tests depending on your needs.</p>
<p>Route 1: If you only want to do the tests, just the command below in command line. It should</p>
<pre>
<code>easy_install gaiatest
</code></pre>
<p>Route 2: If you anticipate in modifying gaiatest, you can instead:</p>
<pre>
<code>git clone git://github.com/mozilla/gaia-ui-tests.git
cd gaia-ui-tests
python setup.py develop</code></pre>
<h3 id="Virtual_environment_setup">Virtual environment setup</h3>
<p>&nbsp;&nbsp;&nbsp; In case you want to switch back and forth with marionette clients version, setting up virtual environment might be a cleaner way to do so. You sometimes need to go back and forth to know if it's a device/emulator changes or a change in gaia-ui-tests/marionette-client. You could find the tutorial on <a href="https://pypi.python.org/pypi/virtualenv" title="https://pypi.python.org/pypi/virtualenv">virtualenv official website</a>, or you can reference the tutorial down below:</p>
<p>&nbsp;&nbsp;&nbsp; First of all, get the virtualenv installed in linux:</p>
<pre>
pip install virtualenv</pre>
<p>&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;</p>
<h2 id="Running_Tests">Running Tests</h2>
<h3 id="Testing_on_a_device">Testing on a device</h3>
<p>&nbsp;</p>
<h3 id="Testing_on_emulator">Testing on emulator</h3>
<h4 id="Automatically_launched_emulator">Automatically launched emulator</h4>
<p>&nbsp;</p>
<h4 id="Mannually_launched_emulator">Mannually launched emulator</h4>
<p>&nbsp;</p>
<h3 id="Testing_on_desktop_B2G">Testing on desktop B2G</h3>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2 id="Test_Types">Test Types</h2>
<p>&nbsp;</p>
<h2 id="Test_Variables">Test Variables</h2>
<p>&nbsp;</p>
<h2 id="Test_Data_Prerequisites">Test Data Prerequisites</h2>
<p>&nbsp;</p>
<h2 id="How_to_Contribute">How to Contribute</h2>
<h3 id="Get_your_github_account">Get your github account</h3>
<p>&nbsp;</p>
<h3 id="Fork_it_and_clone_it">Fork it and clone it</h3>
<p>&nbsp;</p>
<h3 id="Branch_out">Branch out</h3>
<p>&nbsp;</p>
<h3 id="Take_issues_and_send_pull_requests">Take issues and send pull requests</h3>
<p>&nbsp;</p>
<h2 id="Writing_Tests">Writing Tests</h2>
<h3 id="Test_guidelines_and_examples">Test guidelines and examples</h3>
<p>&nbsp;</p>
<h3 id="Functions_reference">Functions reference</h3>
<p>&nbsp;</p>
<h3 id="Formatting">Formatting</h3>
<p>&nbsp;</p>
<h3 id="Debugging">Debugging</h3>
<p>&nbsp;</p>
<h3 id="CSS_Locators_and_XPath_Locators_Resources">CSS Locators and XPath Locators Resources</h3>
<p>&nbsp;</p>
Revert to this revision