Gaia UI Tests Introduction

  • Revision slug: Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests
  • Revision title: gaia-ui-tests
  • Revision id: 390059
  • 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

    Gaia UI tests will utilize marionette client to communicate with marionette server on device/emulator. We will elaborate about the different ways to install different components for gaia-ui-tests later.

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

Route 1 - for test executor

If you only want to run the tests without developing anything, just the command below in command line. It should

easy_install gaiatest

Route 2 - for developers (suggested option)

If you anticipate in modifying gaiatest, you can do this instead:

git clone git://github.com/mozilla/gaia-ui-tests.git

    If you do not want to install gaiatest and dependencies into system's site-packages, follow the Virtual Environment Setup section's steps.
Or you can just setup gaiatest by setup.py:

cd gaia-ui-tests
python setup.py develop

Virtual Environment Setup

    The virtualenv can let you install gaiatest and all package dependencies into the virtual environment without affecting your system's site-packages. 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 Ubuntu:

sudo apt-get install python-virtualenv

Creating and Activating

    Then create your virtual environment for Python and activate it:

virtualenv <ENV_NAME>
source <ENV_NAME>/bin/activate
    After activating the virtual environment, the prompt will looks like this:
(<ENV_NAME>)user@host:~$  
    You can creating more than one virtual environment for your purpose.

Setup the gaiatest

    Usually, you just only need to follow the steps to install dependencies for gaiatest into virtual environment.

 

cd gaia-ui-tests
python setup.py develop

 

Deactivating

    When you want to leave current virtual environment, input the command to deactivate it:
deactivate

 

 

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; Gaia UI tests will utilize marionette client to communicate with marionette server on device/emulator. We will elaborate about the different ways to install different components for gaia-ui-tests later.</p>
<p>&nbsp;&nbsp;&nbsp; There are two different ways to install gaia-ui-tests depending on your needs.</p>
<h4>Route 1 - for test executor</h4>
<p>If you only want to run the tests without developing anything, just the command below in command line. It should</p>
<pre>
<code>easy_install gaiatest
</code></pre>
<h4>Route 2 - for developers (suggested option)</h4>
<p>If you anticipate in modifying gaiatest, you can do this instead:</p>
<pre>
<code>git clone git://github.com/mozilla/gaia-ui-tests.git
</code></pre>
<p>&nbsp;&nbsp;&nbsp; If you do not want to install gaiatest and dependencies into system's site-packages, follow the <strong>Virtual Environment Setup</strong> section's steps.<br />
  Or you can just setup gaiatest by setup.py:</p>
<pre style="font-size: 14px;">
<code style="font-size: 14px;">cd gaia-ui-tests
python setup.py develop</code></pre>
<h3 id="Virtual_Environment_Setup">Virtual Environment Setup</h3>
<p>&nbsp;&nbsp;&nbsp; The virtualenv can let you install gaiatest and all package dependencies into the virtual environment without affecting your system's site-packages.&nbsp;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 Ubuntu:</p>
<pre style="font-size: 14px;">
sudo apt-get install python-virtualenv</pre>
<h4 id="Creating_and_Activating">Creating and Activating</h4>
<p>&nbsp; &nbsp; Then create your virtual environment for Python&nbsp;and activate it:</p>
<pre style="font-size: 14px;">
virtualenv &lt;ENV_NAME&gt;
source &lt;ENV_NAME&gt;/bin/activate</pre>
<div>
  &nbsp; &nbsp; After activating the virtual environment, the prompt will looks like this:</div>
<div>
  <pre style="font-size: 14px;">
(&lt;ENV_NAME&gt;)user@host:~$ &nbsp;</pre>
  &nbsp; &nbsp; You can creating more than one virtual environment for your&nbsp;purpose.<br />
  <h4 id="Setup_the_gaiatest">Setup the gaiatest</h4>
  <p>&nbsp; &nbsp;&nbsp;<span style="line-height: 1.572;">Usually, you just only need to follow the steps to install&nbsp;</span><span style="line-height: 1.572;">dependencies for gaiatest into virtual environment.</span></p>
  <p>&nbsp;</p>
  <pre style="font-size: 14px;">
cd gaia-ui-tests
python setup.py develop</pre>
  <p>&nbsp;</p>
  <h4 id="Deactivating">Deactivating</h4>
  <div>
    &nbsp; &nbsp; When you want to leave current virtual environment, input&nbsp;the command to deactivate it:</div>
  <div>
    <pre style="font-size: 14px;">
deactivate</pre>
    <p>&nbsp;</p>
  </div>
</div>
<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