How to use the gaiatest.GaiaTestCase function in gaiatest

To help you get started, we’ve selected a few gaiatest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / high-fidelity / test / marionette / test_search.py View on Github external
def setUp(self):
        """Open Podcasts and activate the search tab before every test."""
        GaiaTestCase.setUp(self)

        # Launch the app!
        self.app = self.apps.launch('Podcasts')

        # Wait for search tab to load and activate it.
        self.wait_for_element_displayed(*self.search_tab_link)
        self.search_tab_link_element = self.marionette.find_element(
            *self.search_tab_link)
        self.marionette.tap(self.search_tab_link_element)
github mozilla / high-fidelity / test / marionette / test_app.py View on Github external
from unittest import skip

from gaiatest import GaiaTestCase


class TestApp(GaiaTestCase):
    """Test standard app functionality like menu bar and tab-switching."""
    popular_tab = ('css selector', '#popular-tab-container')
    popular_tab_link = ('css selector', '#popular-tab a')

    search_input = ('id', 'podcast-search')
    search_tab = ('css selector', '#search-tab-container')
    search_tab_link = ('css selector', '#search-tab a')

    def setUp(self):
        """Run the standard Gaia setUp and open Podcasts for every test."""
        GaiaTestCase.setUp(self)

        # Launch the app!
        self.app = self.apps.launch('Podcasts')

    # Popular podcasts are on hold while we look for a new API.
github mozilla / high-fidelity / test / marionette / test_app.py View on Github external
def setUp(self):
        """Run the standard Gaia setUp and open Podcasts for every test."""
        GaiaTestCase.setUp(self)

        # Launch the app!
        self.app = self.apps.launch('Podcasts')
github mozilla / high-fidelity / test / marionette / test_search.py View on Github external
urllib2.urlopen('http://74.125.113.99', timeout=1)
        return True
    except urllib2.URLError:
        pass
    return False


# If this variable is true, we don't run any tests that rely on a network
# connection, i.e. downloads, search API tests, etc. Doesn't apply to local
# resources, so download procedures can still be tested using a
# manually-added RSS feed with local files.
SKIP_NETWORK_TEST = (env_variable('INTERNET') or env_variable('NETWORK') or
                     network_connectivity is False)


class TestSearch(GaiaTestCase):
    """Test podcasts search, currently using Apple's iTunes Store API."""
    search_button = ('id', 'podcast-search-submit')
    search_input = ('id', 'podcast-search')
    search_results = ('css selector', '#search-results .search-result')
    search_tab = ('css selector', '#search-tab-container')
    search_tab_link = ('css selector', '#search-tab a')

    def setUp(self):
        """Open Podcasts and activate the search tab before every test."""
        GaiaTestCase.setUp(self)

        # Launch the app!
        self.app = self.apps.launch('Podcasts')

        # Wait for search tab to load and activate it.
        self.wait_for_element_displayed(*self.search_tab_link)
github mozilla-b2g / gaia / tests / python / gaia-ui-tests / gaiatest / runtests.py View on Github external
def __init__(self, **kwargs):
        BaseMarionetteTestRunner.__init__(self, **kwargs)
        GaiaTestRunnerMixin.__init__(self, **kwargs)
        HTMLReportingTestRunnerMixin.__init__(self, name='gaiatest-v1.3', version=__version__, **kwargs)
        self.test_handlers = [GaiaTestCase]
github mozilla / b2gperf / b2gperf / profile_setup / test_populate.py View on Github external
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


from gaiatest import GaiaTestCase
import json
import os


class TestPopulateData(GaiaTestCase):
    """
    This 'test' just populates a device with contacts/photos/music files
    needed for gaia app startup performance tests.

    To run, install https://github.com/mozilla/gaia-ui-tests, then:
        adb forward tcp:2828 tcp:2828
        gaiatest --address localhost:2828 test_populate.py
    """

    _loading_overlay = ('id', 'loading-overlay')

    def add_contacts(self, count=1):
        self.marionette.switch_to_frame()

        print 'adding contacts'
github mozilla-b2g / gaia / tests / python / gaia-ui-tests / gaiatest / runtests.py View on Github external
def register_handlers(self):
        self.test_handlers.extend([GaiaTestCase])