mozilla
Your Search Results

    Gaia UI テストの導入

    Gaia-ui-tests は、Gaia(Firefox OSのUI)を隅から隅までUIテスト実行するMozillaのテストスイートです。全てのテストはPythonで書かれ、Firefox OSのAPI操作に使うJavaScriptもいくらか混じっています。このチュートリアル記事では、テストを書いて実行する環境のセットアップ方法を説明します。

    Gaia-ui-tests は Gaiatestという、Marionetteあたりを元にしたPythonパッケージを使っています。 Gaiatest はHTML ロケータや、Marionette呼び出しやAPI呼び出しを一緒にして、コミュニケーションと機能を相互作用できるように設計されています。

    Marionette は、Selenium WebDriver (ブラウザ自動化のプログラミングインターフェイス)用に開発されたW3C標準に基いています。WebDriver と page/app オブジェクトを以前使った事がある場合、Marionette と gaiatest を使うのは楽に感じるでしょう。

    Gaia UI を開始する

    For those keen to get started with automated testing on Gaia/Firefox OS we have a tutorial series that will help you go from nothing to writing your own tests. Once you've completed this tutorial you'll have enough knowledge of testing, Firefox OS and Marionette to get started as a Mozilla tests contributor. It is highly recommended that you complete this tutorial if you wish to become a contributor.

    Part 1: Getting started with Marionette and Firefox OS
    This article covers installing the tools you need to get started with running tests, such as B2G Desktop, Python and Marionette.
    Part 2: Basic interactions with Firefox OS using Marionette
    An overview of the basic commands you will use to manipulate Firefox OS via Marionette.
    Part 3: Upgrading our code into a reusable test
    Moving on, in this article we will assemble some basic commands into a simple test inside a Python file so they can all be run as a single entity.
    Part 4: Re-using commands to set up Firefox OS
    Here we look at moving some of the commands into Python methods to promote code reuse.
    Part 5: Introducing a test runner
    A test runner is a central feature of any good test suite, allowing you to run multiple tests and report and aggregate results. In this article we will explore the basics of Python's unittest runner.
    Part 6: Using tuples, and Marionette's By class
    This time around we explain how to further reduce duplication of code, by storing repeated locators in tuples and simplifying the syntax with Marionette's By class.
    Part 7: Writing your own tests
    Now the basics and behind you, and it is time to start to writing your own tests! Here we give you some tool recommendations to make the work easier, and suggest some tests to try your hand at writing.
    Part 8: Using a base class
    In its current state, our test file contains all the test runner code. This is ok for now, but as soon as you start to run many test files it will mean a lot of duplication. Here we solve this problem by abstracting the test runner code into a separate Python class.
    Part 9: Reducing duplication with app objects
    As a final improvement to the code's maintainability, in this article we explore abstracting code that handles interaction with specific Firefox OS apps out into Python app objects.

    上級トピック

    One you've got the basics of writing and running tests under your belt, you way want to move on to some more involved or advanced work, such as running the full gaia-ui-tests tests suite, or logging power draw as the result of a test.

    Running the gaia-ui-tests
    Guides to running the gaia-ui-tests suite against real Firefox OS devices and B2G Desktop in a variety of configurations.
    Gathering Power Draw
    How to use gaiatest to log power draw while a test is running.

    See also

    Gaia-ui-tests main repository

    質問/コメント/関心事

    This project is at a fairly early stage, and your feedback would be greatly appreciated:

    ドキュメントのタグと貢献者

    Contributors to this page: aoitan, Uemmra3, chrisdavidmills
    最終更新者: aoitan,
    サイドバーを隠す