def test_everythingme_add_collection(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() contextmenu = homescreen.open_context_menu() collection_activity = contextmenu.tap_add_collection() collection_list = collection_activity.collection_name_list # Choose the second option to avoid 'Custom' collection = collection_list[1] collection_activity.select(collection) self.wait_for_condition(lambda m: self.apps.displayed_app.name == homescreen.name) self.apps.switch_to_displayed_app() self.assertTrue(homescreen.is_app_installed(collection), "Collection '%s' not found on Homescreen" % collection) collection = homescreen.tap_collection(collection) app = collection.applications[0] app_name = app.name app.long_tap_to_install() add_link = app.tap_save_to_home_screen() add_link.switch_to_add_bookmark_frame() add_link.tap_add_bookmark_to_home_screen_dialog_button() # Switch to Home Screen to look for app self.device.touch_home_button() self.assertTrue(homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_rocketbar_add_collection(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() contextmenu = homescreen.open_context_menu() collection_activity = contextmenu.tap_add_collection() collection_list = collection_activity.collection_name_list # Choose the second option to avoid 'Custom' collection = collection_list[1] collection_activity.select(collection) self.wait_for_condition( lambda m: self.apps.displayed_app.name == homescreen.name) self.apps.switch_to_displayed_app() self.assertTrue(homescreen.is_app_installed(collection), "Collection '%s' not found on Homescreen" % collection) collection = homescreen.tap_collection(collection) app = collection.applications[0] app_name = app.name app.long_tap_to_install() add_link = app.tap_save_to_home_screen() add_link.tap_add_bookmark_to_home_screen_dialog_button() # Switch to Home Screen to look for app self.device.touch_home_button() self.assertTrue( homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
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)
def test_search_and_install_app(self): marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) marketplace.launch() self.app_name = marketplace.popular_apps[0].name app_author = marketplace.popular_apps[0].author results = marketplace.search(self.app_name) self.assertGreater(len(results.search_results), 0, 'No results found.') first_result = results.search_results[0] self.assertEquals(first_result.name, self.app_name, 'First app has the wrong name.') self.assertEquals(first_result.author, app_author, 'First app has the wrong author.') # Find and click the install button to the install the web app self.assertEquals(first_result.install_button_text, 'Free', 'Incorrect button label.') first_result.tap_install_button() self.confirm_installation() self.APP_INSTALLED = True # Check that the icon of the app is on the homescreen homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() self.assertTrue(homescreen.is_app_installed(self.app_name))
def test_search_and_install_app(self): marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) marketplace.launch() self.app_name = marketplace.popular_apps[0].name app_author = marketplace.popular_apps[0].author results = marketplace.search(self.app_name) self.assertGreater(len(results.search_results), 0, 'No results found.') first_result = results.search_results[0] self.assertEquals(first_result.name, self.app_name, 'First app has the wrong name.') self.assertEquals(first_result.author, app_author, 'First app has the wrong author.') # Find and click the install button to the install the web app self.assertEquals(first_result.install_button_text, 'Free', 'Incorrect button label.') first_result.tap_install_button() self.confirm_installation() self.APP_INSTALLED = True # Press Home button self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));") # Check that the icon of the app is on the homescreen homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.assertTrue(homescreen.is_app_installed(self.app_name))
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)
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)
def test_browser_bookmark(self): # https://github.com/mozilla/gaia-ui-tests/issues/452 browser = Browser(self.marionette) browser.launch() browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html') browser.tap_bookmark_button() browser.tap_add_bookmark_to_home_screen_choice_button() browser.type_bookmark_title(self.bookmark_title) browser.dismiss_keyboard() browser.tap_add_bookmark_to_home_screen_dialog_button() # Switch to Home Screen to look for bookmark homescreen = Homescreen(self.marionette) self.marionette.execute_script( "window.wrappedJSObject.dispatchEvent(new Event('home'));") homescreen.switch_to_homescreen_frame() 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)
def test_search_and_install_app(self): marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) marketplace.launch() self.app_name = marketplace.popular_apps[0].name app_author = marketplace.popular_apps[0].author results = marketplace.search(self.app_name) self.assertGreater(len(results.search_results), 0, 'No results found.') first_result = results.search_results[0] self.assertEquals(first_result.name, self.app_name, 'First app has the wrong name.') self.assertEquals(first_result.author, app_author, 'First app has the wrong author.') # Find and click the install button to the install the web app self.assertEquals(first_result.install_button_text, 'Free', 'Incorrect button label.') first_result.tap_install_button() self.confirm_installation() marketplace.wait_for_notification_message_not_displayed() self.APP_INSTALLED = True # Check that the icon of the app is on the homescreen homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() self.assertTrue(homescreen.is_app_installed(self.app_name))
def test_installing_everything_me_app(self): # https://github.com/mozilla/gaia-ui-tests/issues/67 homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() self.assertGreater(homescreen.collections_count, 0) collection = homescreen.tap_collection('Social') collection.wait_for_collection_screen_visible() app = collection.applications[0] app_name = app.name app.long_tap_to_install() app.tap_save_to_home_screen() notification_message = collection.notification_message self.assertEqual(notification_message, '%s added to Home Screen' % app_name) homescreen = collection.tap_exit() # return to home screen self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));") homescreen.switch_to_homescreen_frame() self.assertTrue(homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_installing_everything_me_app(self): # https://github.com/mozilla/gaia-ui-tests/issues/67 homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() self.assertGreater(homescreen.collections_count, 0) collection = homescreen.tap_collection('Social') collection.wait_for_collection_screen_visible() app = collection.applications[0] app_name = app.name app.long_tap_to_install() app.tap_save_to_home_screen() notification_message = collection.notification_message self.assertEqual(notification_message, '%s added to Home Screen' % app_name) homescreen = collection.tap_exit() # return to home screen self.marionette.execute_script( "window.wrappedJSObject.dispatchEvent(new Event('home'));") homescreen.switch_to_homescreen_frame() self.assertTrue( homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_everythingme_add_collection(self): homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() contextmenu = homescreen.open_context_menu() contextmenu.tap_add_collection() homescreen.select('Autos') self.assertTrue(homescreen.is_app_installed('Autos'), "App %s not found on Homescreen" % 'Autos')
def test_everythingme_add_collection(self): homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() contextmenu = homescreen.open_context_menu() contextmenu.tap_add_collection() homescreen.select('Autos') self.assertTrue(homescreen.is_app_installed('Autos'), "App %s not found on Homescreen" % 'Autos')
class TestDeleteApp(GaiaTestCase): MANIFEST = "http://mozqa.com/data/webapps/mozqa.com/manifest.webapp" APP_NAME = "Mozilla QA WebRT Tester" APP_INSTALLED = False # App install popup _confirm_install_button_locator = (By.ID, "app-install-install-button") _notification_banner_locator = (By.ID, "system-banner") 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) self.homescreen.launch() def test_delete_app(self): # Install app self.marionette.switch_to_frame() self.marionette.execute_script('navigator.mozApps.install("%s")' % self.MANIFEST) # Confirm the installation self.wait_for_element_displayed(*self._confirm_install_button_locator) self.marionette.find_element(*self._confirm_install_button_locator).tap() # Wait for the app to be installed and the notification banner to be available self.wait_for_element_displayed(*self._notification_banner_locator) self.wait_for_element_not_displayed(*self._notification_banner_locator) self.homescreen.switch_to_homescreen_frame() # 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.homescreen.wait_for_app_icon_not_present(self.APP_NAME) # Return to normal mode self.homescreen.touch_home_button() # Check that the app is no longer available with self.assertRaises(AssertionError): self.apps.launch(self.APP_NAME)
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)
class TestDeleteApp(GaiaTestCase): MANIFEST = 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp' APP_NAME = 'Mozilla QA WebRT Tester' APP_INSTALLED = False # App install popup _notification_banner_locator = (By.ID, 'system-banner') 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) self.homescreen.launch() def test_delete_app(self): # Install app self.marionette.switch_to_frame() self.marionette.execute_script('navigator.mozApps.install("%s")' % self.MANIFEST) # Confirm the installation confirm_install = ConfirmInstall(self.marionette) confirm_install.tap_confirm() # Wait for the app to be installed and the notification banner to be available self.wait_for_element_displayed(*self._notification_banner_locator) self.wait_for_element_not_displayed(*self._notification_banner_locator) self.homescreen.switch_to_homescreen_frame() # 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.homescreen.wait_for_app_icon_not_present(self.APP_NAME) # Return to normal mode self.homescreen.touch_home_button() # Check that the app is no longer available with self.assertRaises(AssertionError): self.apps.launch(self.APP_NAME)
def test_everythingme_add_collection(self): collection = 'Weather' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() contextmenu = homescreen.open_context_menu() contextmenu.tap_add_collection() homescreen.select(collection) self.assertTrue(homescreen.is_app_installed(collection), "Collection '%s' not found on Homescreen" % collection)
def test_everythingme_add_collection(self): collection = 'Weather' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() contextmenu = homescreen.open_context_menu() contextmenu.tap_add_collection() homescreen.select(collection) self.assertTrue(homescreen.is_app_installed(collection), "Collection '%s' not found on Homescreen" % collection)
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'])
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'])
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)
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'])
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)
def test_everythingme_add_collection(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() contextmenu = homescreen.open_context_menu() contextmenu.tap_add_collection() collection_list = contextmenu.collection_name_list collection = random.choice(collection_list[1:]) homescreen.select(collection) self.assertTrue(homescreen.is_app_installed(collection), "Collection '%s' not found on Homescreen" % collection)
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)
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'])
def test_search_and_install_app(self): marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) home_page = marketplace.launch() # Find a free app to install app = home_page.first_free_app self.app_name = app["name"] if self.apps.is_app_installed(self.app_name): raise Exception("The app %s is already installed." % self.app_name) marketplace.switch_to_marketplace_frame() results_page = home_page.search(self.app_name) results = results_page.search_results self.assertGreater(len(results), 0, "No results found.") first_result = results[0] self.assertEquals(first_result.name, self.app_name, "First app has the wrong name.") self.assertEquals( first_result.author, app["author"], "First app has the wrong author. Found %s but expected %s." % (first_result.author, app["author"]), ) # Find and click the install button to the install the web app self.assertEquals(first_result.install_button_text, "Install for free", "Incorrect button label.") first_result.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.assertEqual("%s installed" % self.app_name, results_page.install_notification_message) # Press Home button self.device.touch_home_button() # Check that the icon of the app is on the homescreen homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.assertTrue(homescreen.is_app_installed(self.app_name))
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)
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"])
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): 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)
def test_marketplace_launch(self): app_name = 'Marketplace' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.assertTrue(homescreen.is_app_installed(app_name)) marketplace = homescreen.installed_app(app_name) marketplace.tap_icon() self.wait_for_element_not_displayed(*self._loading_fragment_locator) iframe = self.marionette.find_element(*self._marketplace_iframe_locator) self.marionette.switch_to_frame(iframe) self.wait_for_element_displayed(*self._site_header_locator)
class TestDeleteApp(GaiaTestCase): MANIFEST = 'http://mozqa.com/data/webapps/mozqa.com/manifest.webapp' APP_NAME = 'Mozilla QA WebRT Tester' def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.homescreen.wait_for_homescreen_to_load() if not self.apps.is_app_installed(self.APP_NAME): self.connect_to_network() # Install app so we can delete it 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() self.apps.switch_to_displayed_app() self.homescreen.wait_for_app_icon_present(self.APP_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.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)
def test_marketplace_launch(self): marketplace = Marketplace(self.marionette) homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.assertTrue(homescreen.is_app_installed(marketplace.manifest_url)) marketplace_icon = homescreen.installed_app(marketplace.manifest_url) marketplace_icon.tap_icon() Wait(self.marionette, timeout=60).until(expected.element_present(*self._marketplace_iframe_locator)) iframe = self.marionette.find_element(*self._marketplace_iframe_locator) self.marionette.switch_to_frame(iframe) Wait(self.marionette).until(expected.element_displayed(*self._site_header_locator))
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)
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)
def test_browser_bookmark(self): browser = Browser(self.marionette) browser.launch() browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html') browser.tap_bookmark_button() bookmark = browser.tap_add_bookmark_to_home_screen_choice_button() 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) 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)
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)
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)
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'])
def test_browser_bookmark(self): browser = Browser(self.marionette) browser.launch() browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html') browser.tap_bookmark_button() bookmark = browser.tap_add_bookmark_to_home_screen_choice_button() bookmark.switch_to_add_bookmark_frame() 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) 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)
def test_browser_bookmark(self): # https://github.com/mozilla/gaia-ui-tests/issues/452 browser = Browser(self.marionette) browser.launch() browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html') browser.tap_bookmark_button() browser.tap_add_bookmark_to_home_screen_choice_button() browser.type_bookmark_title(self.bookmark_title) browser.tap_add_bookmark_to_home_screen_dialog_button() # Switch to Home Screen to look for bookmark homescreen = Homescreen(self.marionette) self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));") homescreen.switch_to_homescreen_frame() 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)
def test_installing_everything_me_app(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.assertGreater(homescreen.collections_count, 0) collection = homescreen.tap_collection('Social') collection.wait_for_collection_screen_visible() app = collection.applications[0] app_name = app.name app.long_tap_to_install() app.tap_save_to_home_screen() notification_message = collection.notification_message self.assertEqual(notification_message, '%s added to Home Screen' % app_name) homescreen = collection.tap_exit() self.assertTrue(homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_installing_everything_me_app(self): # https://github.com/mozilla/gaia-ui-tests/issues/67 homescreen = Homescreen(self.marionette) homescreen.switch_to_homescreen_frame() search_panel = homescreen.tap_search_bar() search_panel. wait_for_categories_to_load() self.assertGreater(search_panel.categories_count, 0) search_panel.categories[0].tap() search_panel.wait_for_app_icons_displayed() app_name = search_panel.results[0].name search_panel.results[0].tap_to_install() # return to home screen self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));") homescreen.switch_to_homescreen_frame() self.assertTrue(homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_installing_everything_me_app(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() self.assertGreater(homescreen.collections_count, 0) collection = homescreen.tap_collection('Social') collection.wait_for_collection_screen_visible() app = collection.applications[0] app_name = app.name app.long_tap_to_install() add_link = app.tap_save_to_home_screen() add_link.switch_to_add_bookmark_frame() add_link.tap_add_bookmark_to_home_screen_dialog_button() # Switch to Home Screen to look for app self.device.touch_home_button() self.assertTrue(homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_installing_everything_me_app(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() self.assertGreater(homescreen.collections_count, 0) collection = homescreen.tap_collection('Social') collection.wait_for_collection_screen_visible() app = collection.applications[0] app_name = app.name app.long_tap_to_install() app.tap_save_to_home_screen() notification_message = collection.notification_message self.assertEqual(notification_message, '%s added to Home Screen' % app_name) homescreen = collection.tap_exit() self.assertTrue(homescreen.is_app_installed(app_name), 'The app %s was not found to be installed on the home screen.' % app_name)
def test_browser_bookmark(self): browser = Browser(self.marionette) browser.launch() browser.go_to_url(self.test_url) browser.tap_bookmark_button() bookmark = browser.tap_add_bookmark_to_home_screen_choice_button() 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) 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)
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)
def test_browser_bookmark(self): # https://github.com/mozilla/gaia-ui-tests/issues/452 browser = Browser(self.marionette) browser.launch() browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html') browser.tap_bookmark_button() browser.tap_add_bookmark_to_home_screen_choice_button() browser.type_bookmark_title(self.bookmark_title) browser.tap_add_bookmark_to_home_screen_dialog_button() # Switch to Home Screen to look for bookmark homescreen = Homescreen(self.marionette) homescreen.touch_home_button() 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)
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)