mozilla

Revision 393315 of Gaia UI Tests Environment Setup

  • Revision slug: Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko/gaia-ui-tests/Gaia_UI_Tests_Installation
  • Revision title: Gaia UI Tests Environment Setup
  • Revision id: 393315
  • Created:
  • Creator: ypwalter
  • Is current revision? No
  • Comment

Revision Content

本教學假設您對火狐作業系統已經有相當程度的了解。

這個頁面尚未完成。請有志一同的夥伴幫忙補充。
有任何意見都可以寄到 gaia-ui-automation@mozilla.org。

環境設定

基本設定資訊

    Gaia UI tests透過marionette客戶端程式與手機或模擬器內的marionette伺服器溝通。在接下來中,我們會依照您的需求,詳述對照的兩種安裝Gaia UI Tests的方法。

方法一: 非開發者
    如果您並非開發者,並且只是單純想要測試手機看看,您只需要輸入以下指令,在安裝完成後,就立刻可以開始使用Gaia UI tests:

easy_install gaiatest

方法二: 開發者(我們推薦的方法)
    如果您想參與Gaia UI tests的開發與改善,您可以使用這個方法:

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

    如果您不想要把Python將gaiatest程式以及其相關程式庫安裝到系統的site-packages資料夾,請遵循虛擬環境設定這章節來做設定。不然您依然可以使用以下的指令來安裝gaiatest及其相關程式庫:

cd gaia-ui-tests
python setup.py develop

    但是,請特別注意在Gaia UI Tests中,有相當的分支。請依照您個人想要開發的部份做選擇。例如:如果您是要在B2G桌面版本(B2G desktop version)上執行程式,你可能會想要使用desktop分支來作為您主要的開發分支。

    如果您並不打算去更改marionette使用者端以及伺服器端的程式,您可以跳過本段落剩下的部份,並且直接進入"執行程式"這章節

    However, if you wish to take control over marionette client or marionette server. 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.

    You can either download marionette from marionette client official distribution website or marionette client would come with your B2G code from github after excuted "config.sh". After that, you can find marionette clientside code at $B2G_HOME/gecko/testing/marionette/client. You can find marionette serverside code at $B2G_HOME/gecko/testing/marionette/. Please notice that you must config you B2G as an engineer build, or you will fail to find these codes.

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 by easy_install:

easy_install virtualenv

    Or using Ubuntu's apt tool to install virtualenv:

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

 

Go to "Running Tests" section

Revision Source

<div class="warning">
  <p>本教學假設您對火狐作業系統已經有相當程度的了解。</p>
  <p>這個頁面尚未完成。請有志一同的夥伴幫忙補充。<br />
    有任何意見都可以寄到 gaia-ui-automation@mozilla.org。</p>
</div>
<h2 id=".E7.92.B0.E5.A2.83.E8.A8.AD.E5.AE.9A">環境設定</h2>
<h3 id=".E5.9F.BA.E6.9C.AC.E8.A8.AD.E5.AE.9A.E8.B3.87.E8.A8.8A">基本設定資訊</h3>
<p>&nbsp;&nbsp;&nbsp; Gaia UI tests透過marionette客戶端程式與手機或模擬器內的marionette伺服器溝通。在接下來中,我們會依照您的需求,詳述對照的兩種安裝Gaia UI Tests的方法。</p>
<p><strong>方法一: 非開發者</strong><br />
  &nbsp;&nbsp;&nbsp; 如果您並非開發者,並且只是單純想要測試手機看看,您只需要輸入以下指令,在安裝完成後,就立刻可以開始使用Gaia UI tests:</p>
<pre>
<code>easy_install gaiatest
</code></pre>
<p><strong>方法二: 開發者(我們推薦的方法)</strong><br />
  &nbsp;&nbsp;&nbsp; 如果您想參與Gaia UI tests的開發與改善,您可以使用這個方法:</p>
<pre>
<code>git clone git://github.com/mozilla/gaia-ui-tests.git
</code></pre>
<p>&nbsp;&nbsp;&nbsp; 如果您不想要把Python將gaiatest程式以及其相關程式庫安裝到系統的site-packages資料夾,請遵循虛擬環境設定這章節來做設定。不然您依然可以使用以下的指令來安裝gaiatest及其相關程式庫:</p>
<pre style="font-size: 14px;">
<code style="font-size: 14px;">cd gaia-ui-tests
python setup.py develop</code></pre>
<p>&nbsp;&nbsp;&nbsp; 但是,請特別注意在Gaia UI Tests中,有相當的分支。請依照您個人想要開發的部份做選擇。例如:如果您是要在B2G桌面版本(B2G desktop version)上執行程式,你可能會想要使用desktop分支來作為您主要的開發分支。</p>
<div class="note">
  <p><strong>&nbsp;&nbsp;&nbsp; 如果您並不打算去更改marionette使用者端以及伺服器端的程式,您可以跳過本段落剩下的部份,並且直接進入<a href="https://developer.mozilla.org/zh-TW/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests" title="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests">"執行程式"</a>這章節</strong></p>
</div>
<p>&nbsp;&nbsp;&nbsp; However, if you wish to take control over marionette client or marionette server. 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.<br />
  <br />
  &nbsp;&nbsp;&nbsp; You can either download marionette from <a href="https://pypi.python.org/pypi/marionette_client/" title="https://pypi.python.org/pypi/marionette_client/">marionette client official distribution website</a> or 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". After that, you can find marionette clientside code at $B2G_HOME/gecko/testing/marionette/client. You can find marionette serverside code at $B2G_HOME/gecko/testing/marionette/. Please notice that you must config you B2G as an engineer build, or you will fail to find these codes.</p>
<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 by easy_install:</p>
<pre style="font-size: 14px;">
easy_install virtualenv</pre>
<p>&nbsp; &nbsp; Or using Ubuntu's apt tool to install virtualenv:</p>
<pre style="font-size: 14px;">
apt-get install python-virtualenv</pre>
<p><strong>Creating and Activating</strong></p>
<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>
  <p>&nbsp; &nbsp; You can creating more than one virtual environment for your&nbsp;purpose.<br />
    <br />
    <strong>Setup the gaiatest</strong></p>
  <p><span style="line-height: 1.572;">&nbsp; &nbsp; 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>
  <pre style="font-size: 14px;">
cd gaia-ui-tests
python setup.py develop</pre>
  <p><strong>Deactivating</strong></p>
  <p><span style="line-height: 1.572;">&nbsp; &nbsp; When you want to leave current virtual environment, input&nbsp;the command to deactivate it:</span></p>
  <div>
    <pre style="font-size: 14px;">
deactivate</pre>
  </div>
</div>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><strong>Go to <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests" title="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests">"Running Tests"</a> section</strong></p>
Revert to this revision