diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/archive/b2g_os/automated_testing | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/archive/b2g_os/automated_testing')
3 files changed, 346 insertions, 0 deletions
diff --git a/files/zh-cn/archive/b2g_os/automated_testing/gaia_performance_tests/index.html b/files/zh-cn/archive/b2g_os/automated_testing/gaia_performance_tests/index.html new file mode 100644 index 0000000000..12c0633e43 --- /dev/null +++ b/files/zh-cn/archive/b2g_os/automated_testing/gaia_performance_tests/index.html @@ -0,0 +1,109 @@ +--- +title: Gaia 性能测试 +slug: Archive/B2G_OS/Automated_testing/Gaia_performance_tests +translation_of: Archive/B2G_OS/Automated_testing/Gaia_performance_tests +--- +<div class="summary"> + <p><span class="seoSummary">本文主要讲述了有关在 Gaia 上运行性能测试以及如何创建新的测试。</span></p> +</div> +<h2 id="运行测试">运行测试</h2> +<p>The tests are run on a regular basis on <a href="https://datazilla.mozilla.org/b2g/" title="https://datazilla.mozilla.org/b2g/">Datazilla</a>; however, you can also run them yourself. To do so, you'll need an engineer build with <a href="/en-US/docs/Marionette" title="/en-US/docs/Marionette">Marionette</a> enabled and remote debugging <strong>disabled</strong>. See <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Build_System_Primer#Customizing_the_preferences" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia/Build_System_Primer#Customizing_the_preferences">Gaia Build System Primer, Customizing the preferences</a> for more information on how doing this.</p> +<h3 id="测试需求">测试需求</h3> +<p>Since <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=915156" title="FIXED: Port the performance testing framework to the new marionette runner">bug 915156</a> landed on December 6th 2013, <code>make test-perf</code> requires Node.js on the host to run the tests. The relevant modules should be installed automatically with <code>npm</code>.</p> +<p>Prior to running the test, you need to configure a runner host. The runner host is a module that will either run the test in <a href="/en-US/Firefox_OS/Using_the_B2G_desktop_client">B2G desktop</a> or on a device (real or virtual — like an <a href="/en-US/Firefox_OS/Using_the_B2G_emulators">emulator</a>). By default it runs in B2G desktop, which is not very relevant for performance. To configure the runner just edit the file <code>local.mk</code> in the Gaia top level directory (create it if it doesn't already exist) and put the following line:</p> +<pre class="brush: bash">MARIONETTE_RUNNER_HOST=marionette-device-host</pre> +<p>This will use the device host runner. The default value is <code>marionette-b2gdesktop-host</code>.</p> +<p>The alternative to this is to do:</p> +<pre class="brush: bash">MARIONETTE_RUNNER_HOST=marionette-device-host make test-perf </pre> +<div class="note"> + <p><strong>Note:</strong> only one device at a time is supported, either an emulator or real device. Make sure you have an <a href="/en-US/Firefox_OS/Platform/Gaia/Hacking">up-to-date Gaia version running on it</a>.</p> +</div> +<h3 id="输出">输出</h3> +<p>By default the test output the data in JSON format. By default it is output to <code>stdout</code> and might be mixed with error message from other commands like <code>npm</code>. This is not a very good idea for automation. So you can redirect this JSON output to a file. Just define <code>MOZPERFOUT</code> for the host runner, either on the command line as an option or in the <code>local.mk</code> file as shown above.</p> +<pre class="brush: bash">MOZPERFOUT=myfile.json</pre> +<p>There is a "spec" reporter that allow reporting the output in a more human readable format. To use it, set the environment as follow:</p> +<pre class="brush: bash">REPORTER=ConsoleMozPerf</pre> +<p>This will make the test output something easier to read. Not easier to parse. There is no real syntax.</p> +<p>For now, any other value will use the JSON reporter.</p> +<div class="note"> + <p><strong>Note:</strong> <code>MOZPERFOUT</code> will be honoured whichever reporter you select.</p> +</div> +<h3 id="对所有_app_运行测试">对所有 app 运行测试</h3> +<p>In general you can run these test on 1.4 and up from Gaia master. 1.3 might no longer be able to have the tests runs. There is an exception for 1.3t (Tarako). since <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1006064" title="FIXED: Port make test-perf to 1.3T">bug 1006064</a> landed, if you want to run the tests against Tarako (1.3t), you should run it from the Gaia 1.3t.</p> +<p>From 2.0 and onwards, we consider that you should run the test from the same Gaia tree.</p> +<pre class="brush: bash">make test-perf<span style="display: none;" id="cke_bm_264C"> </span></pre> +<h3 id="对指定的_app_运行测试">对指定的 app 运行测试</h3> +<pre class="brush: bash">APP=browser make test-perf</pre> +<h3 id="对多个_app_运行测试">对多个 app 运行测试</h3> +<pre class="brush: bash">APPS="browser communications/contacts" make test-perf</pre> +<h3 id="Setting_the_number_of_runs">Setting the number of runs</h3> +<p>By default, each test is run five times. You can change that by setting the value of <code>RUNS</code> before running the tests. For example, to run each test three times you'd use this option:</p> +<pre class="brush: bash">RUNS=3 make test-perf</pre> +<h3 id="已知问题">已知问题</h3> +<p>When running test on Buri/Hamachi (Alcatel one touch fire), you get:</p> +<pre>Not enough fields given the number of keys.</pre> +<p>You can safely ignore the warning. It is just that <code>b2g-info</code> on the device is too old as it comes from 1.2 and we only change Gecko and Gaia on these.</p> +<h2 id="Writing_new_tests">Writing new tests</h2> +<p>With the details of running the test suite out the way, let's now look at how you can write your own performance tests for Gaia.</p> +<h3 id="Startup_event_tests">Startup event tests</h3> +<p>We have setup a standard for app startup events. If you want to test the app startup, please follow the <a href="https://developer.mozilla.org/en-US/Apps/Build/Performance/Firefox_OS_app_responsiveness_guidelines">responsiveness guidelines</a>. The <code>startup_event_test.js</code> test will drive it. Make sure to whitelist your app in <code>/tests/performance/startup_events_test.js</code>, by adding it to the list specified by <code>whitelistedApps</code>. Also as a transition measure, you should add it to <code>whitelistedUnifiedApps</code> which list the apps that use that new method. Once all the apps will be migrated, then we this will disappear - if you can't find it that mean it is not needed anymore.</p> +<div class="note"> + <p><strong>Note:</strong> this is only implemented in 2.0 and later. If you code use <code>startup-path-done</code> events then it is using the old style and should be updated.</p> +</div> +<p>If you want to measure intermediate launch stages that are not part of the reponsiveness standard, you can dispatch these using the method described below. Dispatching performance events is all you need, they will be collected automatically.</p> +<h3 id="其他的_event_基础测试">其他的 event 基础测试</h3> +<p>Now if you want to test specific features in your app you can do so by sending events. The test will be in two part. The instrumentation part that lives in the app itself, and the control part that will use marionette to control the app to perform actions.</p> +<h4 id="Instrumentation">Instrumentation</h4> +<p>To record the events, all you have to do is dispatch them.</p> +<p>First, include our helper in your app:</p> +<pre class="brush: html"><script defer src='/shared/js/performance_testing_helper.js'></script> +</pre> +<div class="note"> + <p><strong>Note</strong>: If you use a module loader like RequireJS or Alameda, you might prefer to use that, which is perfectly fine.</p> +</div> +<p>You need to be cautious and make sure you adjust the <a href="/en-US/Firefox_OS/Platform/Automated_testing/Gaia_unit_tests">unit tests</a> so that the <code>PerformaceTestingHelper</code> is either loaded or shimmed. A simple shim is to put this in the unit test source file:</p> +<pre class="brush: js">var PerformanceTestingHelper = { + dispatch: function() { } +}; +</pre> +<p>The Travis CI jobs we run out of Github will error if you don't do that properly.</p> +<p>Having done that, you can use the helper to dispatch events when it seems appropriate to do so. First you should dispatch a start event. It is important as the '<code>start</code>' event is sent when we register the listeners, so for your feature you likely want to do this much later. So choose where the feature start and add the proper event dispatch.</p> +<pre class="brush: js">PerformanceTestingHelper.dispatch('my-feature-start'); +</pre> +<p>When you're ready to stop collecting data and to report the numbers, you need to send the <code>my-feature-done</code> event, also called the last event, to tell the helper to finish:</p> +<pre class="brush: js">PerformanceTestingHelper.dispatch('my-feature-done');</pre> +<p>Also you might want to send intermediate events as appropriate.</p> +<div class="note"> + <p><strong>Note:</strong> Here we use "my-feature-" as a prefix for the performance event. This is just an example. Please use an obvious name and try to use it consistently.</p> +</div> +<h4 id="Controlling_the_app">Controlling the app</h4> +<p>The second part is writing a JavaScript to the test framework to perform the test. The filename must end with <code>_test.js</code> and live in <code>apps/<myapp>/test/performance/</code>.</p> +<p>It is a lot like a marionette integration test (based on mocha), but with a few twists: in the <code>setup()</code> function you must inject the helper atom that is being used to collect the performance events.</p> +<pre class="brush: js">PerformanceHelper.injectHelperAtom(client);</pre> +<p>You must pass a <code>lastEvent</code> parameter to the <code>PerformanceHelper</code> constructor. This will be the last event on which to wait to test your feature.</p> +<p>When calling <code>performanceHelper.reportRunDurations()</code> toward the end you must pass the name of the start event you dispatched, otherwise the measurement will be from the start, ie when we inject the helper atom. An easy to figure out the error is if you see the start event in the results. And in that case you'll the the startup events as well as these will be dispatched too.</p> +<div class="note"> + <p><strong>Note:</strong> you may want to look at existing test to get a better idea.</p> +</div> +<h3 id="Collecting_memory_statistics">Collecting memory statistics</h3> +<p>You can collect the memory usage for both the b2g process and the current app. Just do</p> +<pre class="brush: js">var memUsage = performanceHelper.getMemoryUsage(app);</pre> +<p><code>app</code> is the application object. <code>memusage</code> will contain several objects enumerating the memory statistics.</p> +<h2 id="Running_tests_from_a_non-engineering_device">Running tests from a non-engineering device</h2> +<p>If you don't have an engineering build on your phone you'll have to do some additional steps:</p> +<ol> + <li>Clone B2G, and build with <code>./config.sh DEVICE-NAME</code> (e.g. <code>./config.sh keon</code>)</li> + <li>Build the Gecko part via <code>./build.sh gecko</code></li> + <li>Connect the phone and flash gecko via <code>./flash.sh gecko</code></li> + <li>Clone Gaia, and create a file <code>build/custom-prefs.js</code> with content <code>user_pref("marionette.defaultPrefs.enabled", true);</code></li> + <li>Enable <a href="/en-US/Firefox_OS/Debugging/Developer_settings#Remote_debugging">Remote Debugging</a> on the phone and run <code>make reset-gaia</code> to reset the phone (or <code>make install-gaia</code> if you trust yourself)</li> + <li>Disable Remote Debugging and verify that everything is OK by running <code>adb devices</code>. The device should show up.</li> + <li>Now running a perf test should work. Verify via <code>RUNS=1 APP=browser make test-perf</code></li> +</ol> +<h2 id="提交_bug">提交 bug</h2> +<p>Please <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20OS">file bugs in Bugzilla</a>, product "Firefox OS", component "Gaia::PerformanceTest".</p> +<h2 id="参考">参考</h2> +<ul> + <li><a href="/en-US/docs/Marionette" title="/en-US/docs/Marionette">Marionette</a></li> + <li><a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing">Testing Firefox OS</a></li> +</ul> diff --git a/files/zh-cn/archive/b2g_os/automated_testing/gaia_unit_tests/index.html b/files/zh-cn/archive/b2g_os/automated_testing/gaia_unit_tests/index.html new file mode 100644 index 0000000000..f5d1fb609c --- /dev/null +++ b/files/zh-cn/archive/b2g_os/automated_testing/gaia_unit_tests/index.html @@ -0,0 +1,113 @@ +--- +title: Gaia 单元测试 +slug: Archive/B2G_OS/Automated_testing/Gaia_unit_tests +tags: + - B2G + - Firefox OS + - Gaia + - Mobile + - tests + - 单元测试 + - 构建文档 + - 自动化 +translation_of: Archive/B2G_OS/Automated_testing/Gaia_unit_tests +--- +<div class="summary"> + <p>作为 Gaia/B2G 源码的一部分,我们已经创建了多个可运行的单元测试,来测试 Gaia 和 B2G 的不同方面。本文则讲述了如何来访问它们。</p> +</div> +<div class="note"> + <p><b>注意</b>: 本文假设您已经完全理解 Gaia 和 B2G 是如何工作的。可参考 <span class="link-https"><a href="https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia/Hacking">Hacking Gaia</a> 来开始学习 Gaia。</span></p> +</div> +<h2 id="运行单元测试">运行单元测试</h2> +<p>您可以在 <a href="/en-US/Firefox_OS/Using_the_B2G_desktop_client">B2G desktop</a> 或 <a href="http://nightly.mozilla.org/">Firefox Nightly</a> 上运行单元测试。您也需要最新的 <a href="https://github.com/mozilla-b2g/gaia/">Gaia 仓库</a>。为了能够执行绝大部分功能,您必须要安装 <a class="external" href="http://nodejs.org/" title="http://nodejs.org/">Node.js</a> 和 <a class="external" href="http://npmjs.org/" title="http://npmjs.org/">NPM</a>。</p> +<div class="note"> + <p><b>注意</b>: 当在安装 test-agent 依赖时,如果下面的命令会因为一种神秘的错误而失败,可能是由于您的 Node.js/NPM 版本太老了。请阅读 <a href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager">通过包管理器来安装 Node.js</a> 以安装最新的版本,并且将 <code>/tools/test-agent/node_modules</code> 文件夹删掉。</p> +</div> +<p>在 Gaia 仓库中有一个 bin/gaia-test 脚本文件, 可以帮助我们以简单的方式运行测试。</p> +<div class="note"> + <p><strong>小心:</strong> this script will generate a profile suited for unit tests in <code>profile-debug</code>. If you already have another profile in this directory it will be overwritten.<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=980496"> Bug 980496</a> aims to make this configurable.</p> +</div> +<h3 id="在_Firefox_中启动_test_runner">在 Firefox 中启动 test runner</h3> +<p>This will run the test server and launch your default Firefox as found in the path:</p> +<pre class="brush: bash">bin/gaia-test</pre> +<h4 id="选择_Firefox_二进制">选择 Firefox 二进制</h4> +<p>You can export the FIREFOX environment variable to your firefox binary. For example, on MacOS X:</p> +<pre class="brush: bash">export FIREFOX=/Applications/FirefoxNightly.app/Contents/MacOS/firefox</pre> +<p>Alternatively, you can pass it as argument to bin/gaia-test:</p> +<pre class="brush: bash">bin/gaia-test <gaia directory> <firefox path></pre> +<h3 id="使用_B2G_Desktop_启动_test_runner">使用 B2G Desktop 启动 test runner</h3> +<p>This will download and launch B2G Desktop:</p> +<pre class="brush: bash">bin/gaia-test -d</pre> +<h3 id="Run_the_tests_from_the_Web_Interface">Run the tests from the Web Interface</h3> +<p>You can simply click on specific tests and then the <em>Execute</em> button.</p> +<h3 id="Run_the_tests_from_the_command_line">Run the tests from the command line</h3> +<p>With the WebSocket server running, and the Test Agent app running in B2G Desktop/Firefox Nightly, run the following command:</p> +<pre>make test-agent-test +</pre> +<p>If you only want to run one app's tests you can specify which via the <code>APP</code> env variable:</p> +<pre>make test-agent-test APP=calendar +</pre> +<p>You can also optionally provide a <a class="external" href="http://visionmedia.github.com/mocha/#reporters" title="http://visionmedia.github.com/mocha/#reporters">reporter</a> to format the test output:</p> +<pre>make REPORTER=List test-agent-test +</pre> +<div class="note"> + <strong>Note:</strong> Not all reporters work, since we currently do not support Doc.</div> +<h3 id="Run_the_tests_as_you_save">Run the tests as you save</h3> +<p>When the server is running, the tests for a file are run automatically when a file is saved or even just touched:</p> +<ul> + <li>When you save a test file, the test file itself is run</li> + <li>When you save another file, it finds a matching file in the <code>test/unit</code> directory, by suffixing the file name with <code>_test.js</code>.</li> +</ul> +<div class="note"> + <p><strong>Note: </strong>It watches only existing files so if you create a new file, you have to restart the agent.</p> +</div> +<h3 id="Running_tests_like_TBPL_does">Running tests like TBPL does</h3> +<p>Gaia unit tests in TBPL are run using a separate runner; this explains how to use it. Please consult the <a href="/en-US/docs/Python/Virtualenv" title="/en-US/docs/Python/Virtualenv">virtualenv</a> docs if you're not familiar with using a Python virtualenv.</p> +<pre class="brush: bash">virtualenv venv +source venv/bin/activate +cd $GAIA/tests/python/gaia-unit-tests +python setup.py develop +cd gaia_unit_test +python main.py --binary /path/to/b2g/desktop/build --profile /path/to/gaia/profile +</pre> +<div class="note"> + <p><strong>Note</strong>: When specifying the path to the B2G desktop build, you should specify the path to <code>b2g-bin</code>, if it exists, otherwise use <code>b2g</code>.</p> +</div> +<p>The Gaia profile must be made using the following:</p> +<pre class="brush: bash">NO_LOCK_SCREEN=1 DEBUG=1 DESKTOP=0 make</pre> +<p>By default, this profile will be generated in <code>$GAIA/profile-debug</code>. <code>bin/gaia-test</code> generates the same profile so you don't need to regenerate it if you already run <code>gaia-test</code>.</p> +<h3 id="Disabling_a_gaia_unit_test_in_TBPL">Disabling a gaia unit test in TBPL</h3> +<p>TBPL uses a blacklist to exclude certain gaia unit tests from being run. To prevent a test from running in TBPL, add its path to <a href="https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-unit-tests/gaia_unit_test/disabled.json">https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-unit-tests/gaia_unit_test/disabled.json</a>.</p> +<h2 id="设置您的_Gaia_应用">设置您的 Gaia 应用</h2> +<p>Although this guide should help make things easier, the best way to learn how to write, set up, and run tests is currently still to look at the source code; in particular, take a look at the <a class="link-https" href="https://github.com/lightsofapollo/gaia/tree/master/apps/gallery/test" title="https://github.com/lightsofapollo/gaia/tree/master/apps/gallery/test">gallery tests</a>.</p> +<h2 id="Using_mocks">Using mocks</h2> +<p>TBD</p> +<h2 id="进阶_脚本在做什么?">进阶: 脚本在做什么?</h2> +<h3 id="产生一个_profile">产生一个 profile</h3> +<p>You need a profile that is generated by this command:</p> +<pre class="brush: bash">NO_LOCK_SCREEN=1 DEBUG=1 DESKTOP=0 make +</pre> +<p>This generates a debug profile in <code>gaia/profile-debug</code>, overriding a previous profile if you already have one.</p> +<ul> + <li><code>DEBUG=1</code> enables the <em>httpd.js</em> extension that makes it possible to directly use the files from the <code>apps/</code> directory.</li> + <li><code>NO_LOCK_SCREEN=1</code> disables the lock screen, which is necessary in B2G Desktop because it's not possible to unlock it using the mouse.</li> + <li><code>DESKTOP=0</code> disables the other addons we normally use in DEBUG mode to run Gaia in Firefox.</li> +</ul> +<h3 id="启动_WebSocket_服务器">启动 WebSocket 服务器</h3> +<p>Test agent (the test runner) ships with a built in WebSocket server that lets you remotely message the browser or device to queue a test run. Often you will want to develop with time saving features like a file watcher that will run your tests when a test file or implementation changes. To take advantage of these features you need to start the server:</p> +<pre class="brush: bash">make test-agent-server +</pre> +<p>Using the WebSocket server provides other tools such as a command line reporter for test results (watch the terminal you ran the command from), a Growl reporter, syntax error notifications, and more.</p> +<p>The agent also watches for modifications in files, and automatically runs the associated tests. It runs when you save the test or if you save the tested file (we use the convention where the test filename is the tested filename with <code>_test</code> appended,<code> </code>see below for more examples). It watches only existing files so if you create a new file, you have to restart the agent.</p> +<h3 id="在_Firefox_OS_Nightly_运行单元测试">在 Firefox OS Nightly 运行单元测试</h3> +<p>You can launch Gaia in Firefox Nightly with the following commands:</p> +<pre class="brush: bash">cd <path to gaia> +<path to nightly>/firefox --no-remote -profile <path to gaia>/profile-debug/ http://test-agent.gaiamobile.org:8080/</pre> +<div class="note"> + <p><strong>Note</strong>: In Mac OSX, The profile path should be absolute path</p> +</div> +<p>You can use Firebug or the integrated debugger to debug the tests; use the <code>debugger</code> keyword to break in the debugger.</p> +<h3 id="使用_B2G_Desktop_运行单元测试">使用 B2G Desktop 运行单元测试</h3> +<p>Launch Gaia and start the "Test Agent" app. From the Test gent app you can select tests to run from the UI.</p> +<h2 id="进阶_test-agent_如何工作">进阶: test-agent 如何工作?</h2> +<p>The Test Agent lives in<a href="https://github.com/mozilla-b2g/js-test-agent"> its own Github repository</a>. You can have look there to understand how it works under the hood.</p> diff --git a/files/zh-cn/archive/b2g_os/automated_testing/index.html b/files/zh-cn/archive/b2g_os/automated_testing/index.html new file mode 100644 index 0000000000..a5c2c58f11 --- /dev/null +++ b/files/zh-cn/archive/b2g_os/automated_testing/index.html @@ -0,0 +1,124 @@ +--- +title: Firefox OS 自动化测试 +slug: Archive/B2G_OS/Automated_testing +tags: + - B2G + - QA + - 测试 + - 自动化测试 +translation_of: Archive/B2G_OS/Automated_testing +--- +<p></p> +<div class="summary"> + <p>Firefox OS 仍然处在开发中,在可预见的未来中则会对新的硬件加以支持,如何对其进行测试则显得非常重要。 该页面提供的文档主要是对 Firefox OS 多方面进行测试的信息,包括运行不同的测试,自动化,获取报告以及跟踪等。 </p> +</div> +<h2 id="入门">入门</h2> +<dl> + <dt> + <a href="/en-US/Firefox_OS/Running_Tests_on_Firefox_OS_for_Developers">Firefox OS 中运行测试: 开发者指南</a></dt> + <dd> + 这是一个运行测试时入门级的快速开发指南。如果您对 Mozilla 测试和自动化系统没有什么接触,则需要从此处开始。有经验者,则可能对如何运行及怎么运行感兴趣,可以跳过该指南,去学习下面更具体的细节知识。</dd> +</dl> +<h2 id="Gaia_测试">Gaia 测试</h2> +<p>这些文章涵盖了主要的 Gaia 测试套件。</p> +<dl> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/gaia-ui-tests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/gaia-ui-tests">Gaia UI 测试</a></dt> + <dd> + 主要针对 Gaia UI 交互和特性的 Python 测试。</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Gaia_integration_tests">Gaia 集成测试</a></dt> + <dd> + 基于 Marionette, 针对 Gaia 的 JavaScript 的集成测试。</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Gaia_unit_tests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Gaia_unit_tests">Gaia 单元测试</a></dt> + <dd> + 无 UI 交互的 Gaia 单元测试; 使用 JavaScript 实现,并不基于Marionette。</dd> + <dt> + <a href="/en-US/Firefox_OS/Platform/Automated_testing/Gaia_performance_tests">Gaia 性能测试</a></dt> + <dd> + 基于内部仪器来测量 Gaia app 性能,是树状的测试框架。</dd> +</dl> +<h2 id="B2G_测试">B2G 测试</h2> +<p>下面的指南涵盖了多个不同的测试框架,用于测试 B2G 功能的各个方面。</p> +<dl> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Mochitests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Mochitests">Mochitests</a></dt> + <dd> + Gecko 功能和API 测试;基于 HTML & JS。没有与 Gaia 交互。</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Reftests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Reftests">Reftests</a></dt> + <dd> + Gecko 渲染正确性测试。</dd> + <dt> + <a href="/en-US/docs/Marionette/Marionette_JavaScript_Tests" title="/en-US/docs/Marionette/Marionette_JavaScript_Tests">WebAPI tests</a></dt> + <dd> + Gecko 基于 JS WebAPI 测试;绝大多数需要一个模拟器。</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/XPCShell" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/XPCShell">xpcshell tests</a></dt> + <dd> + Gecko XPCOM APIs 无头绪测试</dd> + <dt> + <a href="https://github.com/mozilla/b2gperf" title="https://github.com/mozilla/b2gperf">B2GPerf</a></dt> + <dd> + 基于内部仪器来测量 Gaia app 性能。</dd> + <dt> + <a href="https://wiki.mozilla.org/Project_Eideticker" title="https://github.com/mozilla/eideticker">Eideticker</a></dt> + <dd> + 提供了基于视频捕捉的 Firefox OS 性能测量。</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/endurance_tests" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/endurance_tests">耐久性测试</a></dt> + <dd> + 长期运行的重复性测试,用于发现内存泄漏和稳定性问题。</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/MTBF_tests">MTBF 测试</a></dt> + <dd> + 这是一个基于 non-restart gaia-ui-test 的测试框架。它会试图找到阻碍长时间运行测试的各种问题点。(当前,它由台湾团队来完成,仍然是一个开发中的测试框架)</dd> + <dt> + 内存测试 — 即将推出</dt> + <dd> + Repetitive tests run per-commit to mozilla-central, reporting to <a href="https://areweslimyet.com/" title="https://areweslimyet.com/">https://areweslimyet.com/</a>, designed to find problems with memory usage.</dd> +</dl> +<h2 id="辅助文档">辅助文档</h2> +<p>This section provides links to some of the supporting technologies that underpin Mozilla's tests, which you may want to find more information about.</p> +<dl> + <dt> + <a href="/en-US/docs/Marionette" title="/en-US/docs/Marionette">Marionette</a></dt> + <dd> + 基于 Selenium WebDriver 的远程测试驱动程序。</dd> + <dt> + <a href="/en-US/docs/Marionette/Marionette_JavaScript_Tools" title="/en-US/docs/Marionette/Marionette_JavaScript_Tools">Marionette JavaScript tests</a></dt> + <dd> + A node.js-based runner for Marionette.</dd> + <dt> + <a href="/en-US/docs/Marionette/Python_Marionette" title="/en-US/docs/Marionette/Python_Marionette">Marionette Python tests</a></dt> + <dd> + A Python runner for Marionette.</dd> +</dl> +<div class="note"> + <p><strong>Note</strong>: If you want to run Marionette against a production build (to run gaia integration tests, gaia-ui-tests, etc.), you can <a href="https://github.com/mozilla-b2g/marionette-extension">install Marionette as an extension</a> (this currently only works for 1.3 builds, but more support will be added soon.)</p> +</div> +<h2 id="持续性集成测试和结果报告">持续性集成测试和结果报告</h2> +<p>The following articles cover the continuous integration and result reporting mechanisms Mozilla uses to store and intepret test data.</p> +<dl> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/TBPL">TBPL</a></dt> + <dd> + Understand the tests and builds that run on TBPL.</dd> + <dt> + <a href="https://wiki.mozilla.org/QA/Execution/Web_Testing/Automation/Jenkins">Jenkins</a></dt> + <dd> + Understand the tests that are run on real devices via Jenkins.</dd> + <dt> + <a href="https://wiki.mozilla.org/B2G/Datazilla" title="https://wiki.mozilla.org/B2G/Datazilla">Datazilla</a></dt> + <dd> + Understand which performance tests are reporting to the <a href="https://datazilla.mozilla.org/b2g/" title="https://datazilla.mozilla.org/b2g/">Datazilla dashboard</a>, and what those tests measure.</dd> + <dt> + <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Automated_testing/Test_Execution_Chart" title="/en-US/docs/Mozilla/Firefox_OS/Testing/Test_Execution_Chart">Test execution chart</a></dt> + <dd> + A chart showing which tests are being run — on what devices and where — and which platforms are supported for each test.</dd> +</dl> +<dl> + <dt> + </dt> +</dl> |