class TestLaunchApp(GaiaTestCase):
    _header_locator = (By.CSS_SELECTOR, 'h1')

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        self.homescreen = Homescreen(self.marionette)

        # Install app
        self.marionette.execute_script(
            'navigator.mozApps.install("%s")' % MANIFEST)

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()

        self.homescreen.wait_for_app_icon_present(APP_NAME)

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(self.homescreen.is_app_installed(APP_NAME),
            "App %s not found on Homescreen" % APP_NAME)

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(APP_NAME).tap_icon()
        self.wait_for_element_displayed(*self._header_locator, timeout=20)
        self.assertEqual(self.marionette.find_element(*self._header_locator).text, TITLE)

    def tearDown(self):
        self.apps.uninstall(APP_NAME)
        GaiaTestCase.tearDown(self)
Ejemplo n.º 2
0
    def test_apps_are_present(self):
        EXPECTED_APPS = (
            self._get_manifest_url_by_app_name('Phone') + '/dialer',
            self._get_manifest_url_by_app_name('Messages'),
            self._get_manifest_url_by_app_name('Contacts') + '/contacts',
            self._get_manifest_url_by_app_name('Email'),
            self._get_manifest_url_by_app_name('Camera'),
            self._get_manifest_url_by_app_name('Gallery'),
            self._get_manifest_url_by_app_name('Music'),
            self._get_manifest_url_by_app_name('VideoPlayer'),
            self._get_manifest_url_by_app_name('Marketplace'),
            self._get_manifest_url_by_app_name('Calendar'),
            self._get_manifest_url_by_app_name('Clock'),
            self._get_manifest_url_by_app_name('Settings'),
            self._get_manifest_url_by_app_name('FmRadio'),

            'https://marketplace.firefox.com/app/8d979279-a142-4fee-993b-8e7797b221a5/manifest.webapp', # BuddyUp
            self._get_manifest_url_by_app_name('BugzillaLite'),
            'https://m.facebook.com/openwebapp/manifest.webapp', # Facebook
            'https://mobile.twitter.com/cache/twitter.webapp', # Twitter
            'https://marketplace.firefox.com/app/dcdaeefc-26f4-4af6-ad22-82eb93beadcd/manifest.webapp', # Notes
            'https://marketplace.firefox.com/app/9f96ce77-5b2d-42ca-a0d9-10a933dd84c4/manifest.webapp', # Calculator
        )

        homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()
        for expected_app in EXPECTED_APPS:
            homescreen.wait_for_app_icon_present(expected_app)
Ejemplo n.º 3
0
    def test_search_and_install_app(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        marketplace.search(self.app_search)
        # Make sure All apps is chosen as search filter
        results = marketplace.filter_search_all_apps()
        first_result = results.search_results[0]
        app_name = first_result.get_app_name()
        first_result.tap_install_button()

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.assertEqual(self.apps.displayed_app.name, 'Marketplace')

        self.device.touch_home_button()

        # Check that the icon of the app is on the homescreen
        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(app_name)

        installed_app = homescreen.installed_app(app_name)
        installed_app.tap_icon()

        Wait(self.marionette).until(lambda m: m.title == self.app_title)
Ejemplo n.º 4
0
    def test_browser_bookmark(self):
        search = Search(self.marionette)
        search.launch()

        browser = search.go_to_url(self.test_url)
        browser.tap_menu_button()
        bookmark = browser.tap_add_to_home()

        bookmark.type_bookmark_title(self.bookmark_title)
        bookmark.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(self.bookmark_title)
        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)

        # Delete the bookmark
        homescreen.activate_edit_mode()
        homescreen.bookmark(self.bookmark_title).tap_delete_app().tap_confirm(bookmark=True)

        homescreen.wait_to_be_displayed()
        self.apps.switch_to_displayed_app()
        homescreen.wait_for_bookmark_icon_not_present(self.bookmark_title)

        # Check that the bookmark icon is no longer displayed on the homescreen
        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)
        self.assertFalse(self._bookmark_added, 'The bookmark %s was not successfully removed from homescreen.' % self.bookmark_title)
Ejemplo n.º 5
0
class TestLaunchApp(GaiaTestCase):
    _header_locator = (By.CSS_SELECTOR, 'h1')

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        self.homescreen = Homescreen(self.marionette)
        self.homescreen.switch_to_homescreen_frame()

        # Install app
        self.marionette.switch_to_frame()
        self.marionette.execute_script('navigator.mozApps.install("%s")' %
                                       MANIFEST)

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()
        self.homescreen.switch_to_homescreen_frame()
        self.homescreen.wait_for_app_icon_present(APP_NAME)

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(self.homescreen.is_app_installed(APP_NAME),
                        "App %s not found on Homescreen" % APP_NAME)

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(APP_NAME).tap_icon()
        self.wait_for_element_displayed(*self._header_locator, timeout=20)
        self.assertEqual(
            self.marionette.find_element(*self._header_locator).text, TITLE)

    def tearDown(self):
        self.apps.uninstall(APP_NAME)
        GaiaTestCase.tearDown(self)
Ejemplo n.º 6
0
 def test_spark_apps_are_present(self):
     homescreen = Homescreen(self.marionette)
     self.apps.switch_to_displayed_app()
     for expected_app in ('Customizer', 'Hackerplace', 'Studio', 'Sharing', 'Webmaker', 'Bugzilla Lite', 'Facebook',
                          'Twitter', 'RunWhatsApp (Preview)', 'BuddyUp', 'Notes', 'Calculator', 'SWOOOP',
                          'Firesea IRC'):
         homescreen.wait_for_app_icon_present(expected_app)
Ejemplo n.º 7
0
    def test_apps_are_present(self):
        EXPECTED_APPS = (
            self._get_manifest_url_by_app_name('Phone') + '/dialer',
            self._get_manifest_url_by_app_name('Messages'),
            self._get_manifest_url_by_app_name('Contacts') + '/contacts',
            self._get_manifest_url_by_app_name('Email'),
            self._get_manifest_url_by_app_name('Camera'),
            self._get_manifest_url_by_app_name('Gallery'),
            self._get_manifest_url_by_app_name('Music'),
            self._get_manifest_url_by_app_name('VideoPlayer'),
            self._get_manifest_url_by_app_name('Marketplace'),
            self._get_manifest_url_by_app_name('Calendar'),
            self._get_manifest_url_by_app_name('Clock'),
            self._get_manifest_url_by_app_name('Settings'),
            self._get_manifest_url_by_app_name('FmRadio'),
            'https://marketplace.firefox.com/app/8d979279-a142-4fee-993b-8e7797b221a5/manifest.webapp',  # BuddyUp
            self._get_manifest_url_by_app_name('BugzillaLite'),
            'https://m.facebook.com/openwebapp/manifest.webapp',  # Facebook
            'https://mobile.twitter.com/cache/twitter.webapp',  # Twitter
            'https://marketplace.firefox.com/app/dcdaeefc-26f4-4af6-ad22-82eb93beadcd/manifest.webapp',  # Notes
            'https://marketplace.firefox.com/app/9f96ce77-5b2d-42ca-a0d9-10a933dd84c4/manifest.webapp',  # Calculator
        )

        homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()
        for expected_app in EXPECTED_APPS:
            homescreen.wait_for_app_icon_present(expected_app)
Ejemplo n.º 8
0
 def test_spark_apps_are_present(self):
     homescreen = Homescreen(self.marionette)
     self.apps.switch_to_displayed_app()
     for expected_app in ('Customizer', 'Hackerplace', 'Studio', 'Sharing',
                          'Webmaker', 'Bugzilla Lite', 'Facebook',
                          'Twitter', 'RunWhatsApp (Preview)', 'BuddyUp',
                          'Notes', 'Calculator', 'SWOOOP', 'Firesea IRC'):
         homescreen.wait_for_app_icon_present(expected_app)
class TestDeleteApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name':
            'packagedapp1',
            'url':
            self.marionette.absolute_url('webapps/packaged1/manifest.webapp'),
            'title':
            'Packaged app1'
        }

        # Install app so we can delete it
        self.marionette.execute_script(
            'navigator.mozApps.installPackage("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_delete_app(self):
        """https://moztrap.mozilla.org/manage/case/6117/"""
        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(
            self.test_data['name']).tap_delete_app().tap_confirm()

        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()
        self.homescreen.tap_edit_done()
        self.homescreen.wait_for_app_icon_not_present(self.test_data['name'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.test_data['name'])

    def tearDown(self):
        self.apps.uninstall(self.test_data['name'])

        GaiaTestCase.tearDown(self)
Ejemplo n.º 10
0
class TestDeleteApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'Mozilla QA WebRT Tester',
            'url': 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp'}

        if not self.apps.is_app_installed(self.test_data['name']):
            self.connect_to_network()

            if self.device.is_desktop_b2g or self.data_layer.is_wifi_connected():
                self.test_data['url'] = self.marionette.absolute_url(
                    'webapps/mozqa.com/manifest.webapp')

            # Install app so we can delete it
            self.marionette.execute_script(
                'navigator.mozApps.install("%s")' % self.test_data['url'])

            # Confirm the installation and wait for the app icon to be present
            confirm_install = ConfirmInstall(self.marionette)
            confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_delete_app(self):

        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(self.test_data['name']).tap_delete_app().tap_confirm()

        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(self.test_data['name'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.test_data['name'])
Ejemplo n.º 11
0
class TestBrowserBookmark(GaiaMtbfTestCase):

    _bookmark_added = False

    def setUp(self):
        GaiaMtbfTestCase.setUp(self)
        self.connect_to_network()

        self.test_url = 'http://mozqa.com/data/firefox/layout/mozilla.html'

        curr_time = repr(time.time()).replace('.', '')
        self.bookmark_title = 'gaia%s' % curr_time[10:]

        self.homescreen = Homescreen(self.marionette)
        self.browser = Browser(self.marionette)
        self.browser.launch()

    def test_browser_bookmark(self):
        self.wait_for_element_displayed(*self.browser._awesome_bar_locator)
        self.marionette.find_element(*self.browser._awesome_bar_locator).clear()

        self.browser.go_to_url(self.test_url)
        self.browser.tap_bookmark_button()

        bookmark = self.browser.tap_add_bookmark_to_home_screen_choice_button()
        self.wait_for_element_displayed(*bookmark._bookmark_title_input_locator)
        bookmark.type_bookmark_title(self.bookmark_title)
        bookmark.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        self.wait_for_element_displayed('id', 'bookmark-title')
        self.homescreen.wait_for_app_icon_present(self.bookmark_title)
        self._bookmark_added = self.homescreen.is_app_installed(self.bookmark_title)
        if self.find_element('id', 'edit-button').is_displayed():
            self.find_element('id', 'edit-button').tap()

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)

    def tearDown(self):
        # make sure it goes back to the top for activating editing mode
        self.device.touch_home_button()
        self.device.touch_home_button()

        # delete the bookmark
        self.apps.switch_to_displayed_app()
        self.homescreen.activate_edit_mode()
        self.confirm_dialog = self.homescreen.installed_app(self.bookmark_title).tap_delete_app()
        self.confirm_dialog.tap_confirm()

        self.data_layer.disable_wifi()
        GaiaMtbfTestCase.tearDown(self)
Ejemplo n.º 12
0
class TestDeleteApp(GaiaTestCase):

    regular_app = {
        'name': 'Mozilla QA WebRT Tester',
        'partial_url': 'webapps/mozqa.com/manifest.webapp'
    }
    packaged_app = {
        'name': 'packagedapp1',
        'partial_url': 'webapps/packaged1/manifest.webapp',
        'title': 'Packaged app1'
    }

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def parameterized_set_up(self, app_to_delete, install_method):
        self.app_to_delete = app_to_delete
        self.app_to_delete['url'] = self.marionette.absolute_url(
            self.app_to_delete['partial_url'])

        self.marionette.execute_script('navigator.mozApps.{}("{}")'.format(
            install_method, self.app_to_delete['url']))

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.app_to_delete['url'])

    @parameterized('regular_app', regular_app, 'install')
    @parameterized('packaged_app', packaged_app, 'installPackage')
    def test_delete(self, app_to_delete, install_method):
        # We can't pass parameters to the setUp(). Bug # to be filed
        self.parameterized_set_up(app_to_delete, install_method)

        self.homescreen.delete_app(self.app_to_delete['url']).tap_confirm()
        self.homescreen.wait_to_be_displayed()
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(
            self.app_to_delete['url'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.app_to_delete['url'])

    def tearDown(self):
        self.apps.uninstall(self.app_to_delete['url'])
        GaiaTestCase.tearDown(self)
Ejemplo n.º 13
0
class TestDeleteApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name':
            'packagedapp1',
            'url':
            self.marionette.absolute_url('webapps/packaged1/manifest.webapp'),
            'title':
            'Packaged app1'
        }

        # Install app so we can delete it
        self.marionette.execute_script(
            'navigator.mozApps.installPackage("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_delete_app(self):
        """https://moztrap.mozilla.org/manage/case/6117/"""
        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(
            self.test_data['name']).tap_delete_app().tap_confirm()

        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(self.test_data['name'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.test_data['name'])
Ejemplo n.º 14
0
class TestDeleteApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name':
            'Mozilla QA WebRT Tester',
            'url':
            self.marionette.absolute_url('webapps/mozqa.com/manifest.webapp')
        }

        # Install app so we can delete it
        self.marionette.execute_script('navigator.mozApps.install("%s")' %
                                       self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_delete_app(self):

        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(
            self.test_data['name']).tap_delete_app().tap_confirm()

        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(self.test_data['name'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.test_data['name'])
Ejemplo n.º 15
0
class TestLaunchApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name':
            'packagedapp1',
            'manifest':
            self.marionette.absolute_url('webapps/packaged1/manifest.webapp'),
            'title':
            'Packaged app1'
        }

        # Install app
        self.marionette.execute_script(
            'navigator.mozApps.installPackage("%s")' %
            self.test_data['manifest'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['manifest'])

    def test_launch_app(self):
        """https://moztrap.mozilla.org/manage/case/6116/"""
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['manifest']),
            'App %s not found on homescreen' % self.test_data['manifest'])

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data['manifest']).tap_icon()
        Wait(self.marionette).until(
            lambda m: m.title == self.test_data['title'])

    def tearDown(self):
        self.apps.uninstall(self.test_data['name'])

        GaiaTestCase.tearDown(self)
Ejemplo n.º 16
0
class TestDeleteApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'Mozilla QA WebRT Tester',
            'url': self.marionette.absolute_url('webapps/mozqa.com/manifest.webapp')}

        # Install app so we can delete it
        self.marionette.execute_script(
            'navigator.mozApps.install("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_delete_app(self):

        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(self.test_data['name']).tap_delete_app().tap_confirm()

        self.homescreen.wait_to_be_displayed()
        self.apps.switch_to_displayed_app()
        self.homescreen.tap_edit_done()
        self.homescreen.wait_for_app_icon_not_present(self.test_data['name'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.test_data['name'])

    def tearDown(self):
        self.apps.uninstall(self.test_data['name'])

        GaiaTestCase.tearDown(self)
Ejemplo n.º 17
0
class TestDeleteApp(GaiaTestCase):

    MANIFEST = 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp'
    APP_NAME = 'Mozilla QA WebRT Tester'
    APP_INSTALLED = False

    def setUp(self):
        GaiaTestCase.setUp(self)

        if self.apps.is_app_installed(self.APP_NAME):
            self.apps.uninstall(self.APP_NAME)

        self.connect_to_network()

        self.homescreen = Homescreen(self.marionette)

    def test_delete_app(self):

        # Install app
        self.marionette.execute_script('navigator.mozApps.install("%s")' %
                                       self.MANIFEST)

        # Confirm the installation
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()

        # Wait for the app to be installed
        self.homescreen.wait_for_app_icon_present(self.APP_NAME)

        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(self.homescreen.is_app_installed(self.APP_NAME),
                        "App %s not found on Homescreen" % self.APP_NAME)

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(
            self.APP_NAME).tap_delete_app().tap_confirm()

        self.wait_for_condition(
            lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(self.APP_NAME)

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.APP_NAME)
Ejemplo n.º 18
0
class TestDeleteApp(GaiaTestCase):

    regular_app = {
        'name': 'Mozilla QA WebRT Tester',
        'partial_url': 'webapps/mozqa.com/manifest.webapp'
    }
    packaged_app = {
        'name': 'packagedapp1',
        'partial_url': 'webapps/packaged1/manifest.webapp',
        'title': 'Packaged app1'
    }

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def parameterized_set_up(self, app_to_delete, install_method):
        self.app_to_delete = app_to_delete
        self.app_to_delete['url'] = self.marionette.absolute_url(self.app_to_delete['partial_url'])

        self.marionette.execute_script('navigator.mozApps.{}("{}")'.format(install_method, self.app_to_delete['url']))

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.app_to_delete['url'])

    @parameterized('regular_app', regular_app, 'install')
    @parameterized('packaged_app', packaged_app, 'installPackage')
    def test_delete(self, app_to_delete, install_method):
        # We can't pass parameters to the setUp(). Bug # to be filed
        self.parameterized_set_up(app_to_delete, install_method)

        self.homescreen.delete_app(self.app_to_delete['url']).tap_confirm()
        self.homescreen.wait_to_be_displayed()
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(self.app_to_delete['url'])

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.app_to_delete['url'])

    def tearDown(self):
        self.apps.uninstall(self.app_to_delete['url'])
        GaiaTestCase.tearDown(self)
Ejemplo n.º 19
0
class TestLaunchApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'Mozilla QA WebRT Tester',
            'url': 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp',
            'title': 'Index of /data'
        }

        if self.device.is_desktop_b2g or self.data_layer.is_wifi_connected():
            self.test_data['url'] = self.marionette.absolute_url(
                'webapps/mozqa.com/manifest.webapp')
            self.test_data['title'] = 'Directory listing for /'

        if not self.apps.is_app_installed(self.test_data['name']):
            # Install app
            self.marionette.execute_script('navigator.mozApps.install("%s")' %
                                           self.test_data['url'])

            # Confirm the installation and wait for the app icon to be present
            confirm_install = ConfirmInstall(self.marionette)
            confirm_install.tap_confirm()

            # Wait for the notification to disappear
            system = System(self.marionette)
            system.wait_for_system_banner_displayed()
            system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data['name']).tap_icon()
        Wait(self.marionette).until(
            lambda m: m.title == self.test_data['title'])
Ejemplo n.º 20
0
class TestDeleteApp(GaiaTestCase):

    MANIFEST = "http://mozqa.com/data/webapps/mozqa.com/manifest.webapp"
    APP_NAME = "Mozilla QA WebRT Tester"
    APP_INSTALLED = False

    def setUp(self):
        GaiaTestCase.setUp(self)

        if self.apps.is_app_installed(self.APP_NAME):
            self.apps.uninstall(self.APP_NAME)

        self.connect_to_network()

        self.homescreen = Homescreen(self.marionette)

    def test_delete_app(self):

        # Install app
        self.marionette.execute_script('navigator.mozApps.install("%s")' % self.MANIFEST)

        # Confirm the installation
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.apps.switch_to_displayed_app()

        # Wait for the app to be installed
        self.homescreen.wait_for_app_icon_present(self.APP_NAME)

        # Verify that the app is installed i.e. the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.APP_NAME), "App %s not found on Homescreen" % self.APP_NAME
        )

        # Activate edit mode
        self.homescreen.activate_edit_mode()

        # Tap on the (x) to start delete process and tap on the confirm delete button
        self.homescreen.installed_app(self.APP_NAME).tap_delete_app().tap_confirm()

        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.homescreen.name)
        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_not_present(self.APP_NAME)

        # Check that the app is no longer available
        with self.assertRaises(AssertionError):
            self.apps.launch(self.APP_NAME)
Ejemplo n.º 21
0
class TestLaunchApp(GaiaTestCase):

    MANIFEST = 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp'
    APP_NAME = 'Mozilla QA WebRT Tester'
    TITLE = 'Index of /data'

    _header_locator = (By.CSS_SELECTOR, 'h1')

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        if not self.apps.is_app_installed(self.APP_NAME):

            # Install app
            self.marionette.execute_script('navigator.mozApps.install("%s")' %
                                           self.MANIFEST)

            # Confirm the installation and wait for the app icon to be present
            confirm_install = ConfirmInstall(self.marionette)
            confirm_install.tap_confirm()

            # Wait for the notification to disappear
            system = System(self.marionette)
            system.wait_for_system_banner_displayed()
            system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.APP_NAME)

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(self.homescreen.is_app_installed(self.APP_NAME),
                        "App %s not found on Homescreen" % self.APP_NAME)

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.APP_NAME).tap_icon()
        self.wait_for_element_displayed(*self._header_locator, timeout=20)
        self.assertEqual(
            self.marionette.find_element(*self._header_locator).text,
            self.TITLE)
Ejemplo n.º 22
0
class TestLaunchApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission("Smart Collections", "geolocation", "deny")

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            "name": "Mozilla QA WebRT Tester",
            "url": "http://mozqa.com/data/webapps/mozqa.com/manifest.webapp",
            "title": "Index of /data",
        }

        if self.device.is_desktop_b2g or self.data_layer.is_wifi_connected():
            self.test_data["url"] = self.marionette.absolute_url("webapps/mozqa.com/manifest.webapp")
            self.test_data["title"] = "Directory listing for /"

        if not self.apps.is_app_installed(self.test_data["name"]):
            # Install app
            self.marionette.execute_script('navigator.mozApps.install("%s")' % self.test_data["url"])

            # Confirm the installation and wait for the app icon to be present
            confirm_install = ConfirmInstall(self.marionette)
            confirm_install.tap_confirm()

            # Wait for the notification to disappear
            system = System(self.marionette)
            system.wait_for_system_banner_displayed()
            system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data["name"])

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data["name"]),
            "App %s not found on homescreen" % self.test_data["name"],
        )

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data["name"]).tap_icon()
        Wait(self.marionette).until(lambda m: m.title == self.test_data["title"])
Ejemplo n.º 23
0
class TestLaunchApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name':
            'Mozilla QA WebRT Tester',
            'url':
            self.marionette.absolute_url('webapps/mozqa.com/manifest.webapp')
        }
        self.logger.info('Test data: %s' % self.test_data)

        # Install app
        self.marionette.execute_script('navigator.mozApps.install("%s")' %
                                       self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data['name']).tap_icon()
        Wait(
            self.marionette).until(lambda m: m.title == self.test_data['name'])

    def tearDown(self):
        self.apps.uninstall(self.test_data['name'])

        GaiaTestCase.tearDown(self)
class TestLaunchApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'packagedapp1',
            'url': self.marionette.absolute_url('webapps/packaged1/manifest.webapp'),
            'title': 'Packaged app1'}

        # Install app
        self.marionette.execute_script(
            'navigator.mozApps.installPackage("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_launch_app(self):
        """https://moztrap.mozilla.org/manage/case/6116/"""
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data['name']).tap_icon()
        Wait(self.marionette).until(
            lambda m: m.title == self.test_data['title'])

    def tearDown(self):
        self.apps.uninstall(self.test_data['name'])

        GaiaTestCase.tearDown(self)
Ejemplo n.º 25
0
class TestLaunchApp(GaiaTestCase):

    MANIFEST = 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp'
    APP_NAME = 'Mozilla QA WebRT Tester'
    TITLE = 'Index of /data'

    _header_locator = (By.CSS_SELECTOR, 'h1')

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        if not self.apps.is_app_installed(self.APP_NAME):

            # Install app
            self.marionette.execute_script(
                'navigator.mozApps.install("%s")' % self.MANIFEST)

            # Confirm the installation and wait for the app icon to be present
            confirm_install = ConfirmInstall(self.marionette)
            confirm_install.tap_confirm()

            # Wait for the notification to disappear
            system = System(self.marionette)
            system.wait_for_system_banner_displayed()
            system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.APP_NAME)

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(self.homescreen.is_app_installed(self.APP_NAME),
            "App %s not found on Homescreen" % self.APP_NAME)

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.APP_NAME).tap_icon()
        self.wait_for_element_displayed(*self._header_locator, timeout=20)
        self.assertEqual(self.marionette.find_element(*self._header_locator).text, self.TITLE)
Ejemplo n.º 26
0
 def test_spark_apps_are_present(self):
     homescreen = Homescreen(self.marionette)
     self.apps.switch_to_displayed_app()
     for expected_app in ({'name': 'Customizer', 'manifest': 'app://customizer-launcher.gaiamobile.org/manifest.webapp'},
                          {'name': 'Hackerplace', 'manifest': 'app://directory.gaiamobile.org/manifest.webapp'},
                          {'name': 'Studio', 'manifest': 'app://studio.gaiamobile.org/manifest.webapp'},
                          {'name': 'Sharing', 'manifest': 'app://sharing.gaiamobile.org/manifest.webapp'},
                          {'name': 'Webmaker', 'manifest': 'http://webmaker.fxosapps.org/manifest.webapp'},
                          {'name': 'Bugzilla Lite', 'manifest': 'https://www.bzlite.com/manifest.webapp'},
                          {'name': 'Facebook', 'manifest': 'https://m.facebook.com/openwebapp/manifest.webapp'},
                          {'name': 'Twitter', 'manifest': 'https://mobile.twitter.com/cache/twitter.webapp'},
                          {'name': 'RunWhatsApp (Preview)', 'manifest': 'https://marketplace.firefox.com/app/f2ed31a0-05ed-416b-ac0d-0f26db063839/manifest.webapp'},
                          {'name': 'BuddyUp', 'manifest': 'https://marketplace.firefox.com/app/8d979279-a142-4fee-993b-8e7797b221a5/manifest.webapp'},
                          {'name': 'Notes', 'manifest': 'https://marketplace.firefox.com/app/dcdaeefc-26f4-4af6-ad22-82eb93beadcd/manifest.webapp'},
                          {'name': 'Calculator', 'manifest': 'https://marketplace.firefox.com/app/9f96ce77-5b2d-42ca-a0d9-10a933dd84c4/manifest.webapp'},
                          {'name': 'SWOOOP', 'manifest': 'https://marketplace.firefox.com/app/be9138a3-9672-4796-9c27-0f27aaced70a/manifest.webapp'},
                          {'name': 'Firesea IRC', 'manifest': 'http://operatorvariant.fxosapps.org/manifest.webapp'}):
         homescreen.wait_for_app_icon_present(expected_app['manifest'])
Ejemplo n.º 27
0
class TestLaunchApp(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            "name": "Mozilla QA WebRT Tester",
            "manifest": self.marionette.absolute_url("webapps/mozqa.com/manifest.webapp"),
        }
        self.logger.info("Test data: %s" % self.test_data)

        # Install app
        self.marionette.execute_script('navigator.mozApps.install("%s")' % self.test_data["manifest"])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data["manifest"])

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data["manifest"]),
            "App %s not found on homescreen" % self.test_data["manifest"],
        )

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data["manifest"]).tap_icon()
        Wait(self.marionette).until(lambda m: m.title == self.test_data["name"])

    def tearDown(self):
        self.apps.uninstall(self.test_data["name"])

        GaiaTestCase.tearDown(self)
Ejemplo n.º 28
0
    def test_browser_bookmark(self):
        search = Search(self.marionette)
        search.launch()

        browser = search.go_to_url(self.test_url)
        browser.tap_menu_button()
        bookmark = browser.tap_add_to_home()

        bookmark.type_bookmark_title(self.bookmark_title)
        bookmark.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(self.bookmark_title)
        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)
Ejemplo n.º 29
0
class TestLaunchApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_network()

        # Turn off geolocation prompt for smart collections
        self.apps.set_permission('Smart Collections', 'geolocation', 'deny')

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'Mozilla QA WebRT Tester',
            'url': self.marionette.absolute_url('webapps/mozqa.com/manifest.webapp'),
            'title': 'Directory listing for /'}

        # Install app
        self.marionette.execute_script(
            'navigator.mozApps.install("%s")' % self.test_data['url'])

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['name'])

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['name']),
            'App %s not found on homescreen' % self.test_data['name'])

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data['name']).tap_icon()
        Wait(self.marionette).until(
            lambda m: m.title == self.test_data['title'])
Ejemplo n.º 30
0
 def test_spark_apps_are_present(self):
     homescreen = Homescreen(self.marionette)
     self.apps.switch_to_displayed_app()
     for expected_app in ({'name': 'Customizer', 'manifest': 'app://customizer-launcher.gaiamobile.org/manifest.webapp'},
                          {'name': 'Hackerplace', 'manifest': 'app://directory.gaiamobile.org/manifest.webapp'},
                          {'name': 'Studio', 'manifest': 'app://studio.gaiamobile.org/manifest.webapp'},
                          {'name': 'Sharing', 'manifest': 'app://sharing.gaiamobile.org/manifest.webapp'},
                          {'name': 'Webmaker', 'manifest': 'http://webmaker.fxosapps.org/manifest.webapp'},
                          {'name': 'Bugzilla Lite', 'manifest': 'https://www.bzlite.com/manifest.webapp'},
                          {'name': 'Facebook', 'manifest': 'https://m.facebook.com/openwebapp/manifest.webapp'},
                          {'name': 'Twitter', 'manifest': 'https://mobile.twitter.com/cache/twitter.webapp'},
                          {'name': 'RunWhatsApp (Preview)', 'manifest': 'https://marketplace.firefox.com/app/f2ed31a0-05ed-416b-ac0d-0f26db063839/manifest.webapp'},
                          {'name': 'BuddyUp', 'manifest': 'https://marketplace.firefox.com/app/8d979279-a142-4fee-993b-8e7797b221a5/manifest.webapp'},
                          {'name': 'Notes', 'manifest': 'https://marketplace.firefox.com/app/dcdaeefc-26f4-4af6-ad22-82eb93beadcd/manifest.webapp'},
                          {'name': 'Calculator', 'manifest': 'https://marketplace.firefox.com/app/9f96ce77-5b2d-42ca-a0d9-10a933dd84c4/manifest.webapp'},
                          {'name': 'SWOOOP', 'manifest': 'https://marketplace.firefox.com/app/be9138a3-9672-4796-9c27-0f27aaced70a/manifest.webapp'},
                          {'name': 'Firesea IRC', 'manifest': 'http://operatorvariant.fxosapps.org/manifest.webapp'},
                          {'name': 'MozSpeech', 'manifest': 'app://customizer.gaiamobile.org/manifest.webapp'},
                          {'name': 'Foxfooding', 'manifest': 'https://foxfooding.github.io/manifest.webapp'}):
         homescreen.wait_for_app_icon_present(expected_app['manifest'])
    def install_in_app_payments_test_app(self, app_name):

        homescreen = Homescreen(self.marionette)

        # Remove the app if already installed
        if self.apps.is_app_installed(app_name):
            raise Exception('The app %s is already installed.' % app_name)

        marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME)
        home_page = marketplace.launch()
        details_page = home_page.navigate_to_app(app_name)
        details_page.tap_install_button()
        self.wait_for_downloads_to_finish()

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.device.touch_home_button()
        self.apps.switch_to_displayed_app()
        homescreen.wait_for_app_icon_present(app_name)
        return homescreen
class TestLaunchApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.connect_to_local_area_network()

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

        self.test_data = {
            'name': 'Mozilla QA WebRT Tester',
            'manifest': self.marionette.absolute_url('webapps/mozqa.com/manifest.webapp')
        }

        self.apps.install(self.test_data['manifest'])

        # Wait for the notification to disappear
        system = System(self.marionette)
        system.wait_for_system_banner_displayed()
        system.wait_for_system_banner_not_displayed()

        self.apps.switch_to_displayed_app()
        self.homescreen.wait_for_app_icon_present(self.test_data['manifest'])

    def test_launch_app(self):
        # Verify that the app icon is visible on one of the homescreen pages
        self.assertTrue(
            self.homescreen.is_app_installed(self.test_data['manifest']),
            'App %s not found on homescreen' % self.test_data['manifest'])

        # Click icon and wait for h1 element displayed
        self.homescreen.installed_app(self.test_data['manifest']).tap_icon()
        Wait(self.marionette).until(
            lambda m: m.title == self.test_data['name'])

    def tearDown(self):
        self.apps.uninstall(self.test_data['manifest'])

        GaiaTestCase.tearDown(self)
Ejemplo n.º 33
0
    def test_browser_bookmark(self):
        search = Search(self.marionette)
        search.launch()

        browser = search.go_to_url(self.test_url)
        browser.tap_menu_button()
        bookmark = browser.tap_add_to_home()

        bookmark.type_bookmark_title(self.bookmark_title)
        bookmark.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(self.bookmark_title)
        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)

        self.assertTrue(
            self._bookmark_added,
            'The bookmark %s was not found to be installed on the home screen.'
            % self.bookmark_title)
Ejemplo n.º 34
0
    def test_install_and_execute_bing_map(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        results = marketplace.search(self.app_search)
        first_result = results.search_results[0]
        app_name = first_result.get_app_name()
        first_result.tap_install_button()

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.assertEqual(self.apps.displayed_app.name, 'Marketplace')

        self.device.touch_home_button()

        # Check that the icon of the app is on the homescreen
        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(app_name)

        installed_app = homescreen.installed_app(app_name)
        installed_app.tap_icon()

        Wait(self.marionette).until(lambda m: m.title == self.app_title)
        bingmap = self.marionette.find_element(*self._map_locator)
        Wait(self.marionette).until(lambda m: bingmap.is_displayed())
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # once the map is completely loaded, use the UI to render different views
        # zoom in
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # move around
        self.scroll(self._map_locator, 'right', 100)
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.scroll(self._map_locator, 'down', 100)
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # zoom out
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
    def test_install_and_execute_bing_map(self):

        marketplace = Marketplace(self.marionette)
        marketplace.launch()

        results = marketplace.search(self.app_search)
        first_result = results.search_results[0]
        app_name = first_result.get_app_name()
        first_result.tap_install_button()

        # Confirm the installation and wait for the app icon to be present
        confirm_install = ConfirmInstall(self.marionette)
        confirm_install.tap_confirm()

        self.assertEqual(self.apps.displayed_app.name, 'Marketplace')

        self.device.touch_home_button()

        # Check that the icon of the app is on the homescreen
        homescreen = Homescreen(self.marionette)
        homescreen.wait_for_app_icon_present(app_name)

        installed_app = homescreen.installed_app(app_name)
        installed_app.tap_icon()

        Wait(self.marionette).until(lambda m: m.title == self.app_title)
        bingmap = self.marionette.find_element(*self._map_locator)
        Wait(self.marionette).until(lambda m: bingmap.is_displayed())
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # once the map is completely loaded, use the UI to render different views
        # zoom in
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_in_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # move around
        GaiaImageCompareTestCase.scroll(self.marionette, 'right',
                                        100, locator=self._map_locator)

        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        GaiaImageCompareTestCase.scroll(self.marionette, 'down',
                                        100, locator=self._map_locator)

        time.sleep(self.draw_wait_time)
        self.take_screenshot()

        # zoom out
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()
        self.marionette.find_element(*self._zoom_out_locator).tap()
        time.sleep(self.draw_wait_time)
        self.take_screenshot()