class TestMoveApp(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() def test_move_app_position(self): """ Verify the user can move an application around on the homescreen. https://moztrap.mozilla.org/manage/case/1317/ """ # Go to app page self.homescreen.go_to_next_page() first_app_before_move = self.homescreen.visible_apps[0].name # Activate edit mode self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active") self.homescreen.activate_edit_mode() self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active") # Move first app to position 12 self.homescreen.move_app_to_position(0, 12) # Exit edit mode self.homescreen.touch_home_button() self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active") # Check the app order and that the app on position 12 is the right one first_app_after_move = self.homescreen.visible_apps[0].name self.assertNotEqual(first_app_before_move, first_app_after_move) self.assertEqual(first_app_before_move, self.homescreen.visible_apps[12].name)
class TestMoveApp(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.homescreen.launch() def test_move_app_position(self): """ Verify the user can move an application around on the homescreen. https://moztrap.mozilla.org/manage/case/1317/ """ # Go to app page self.homescreen.go_to_next_page() first_app_before_move = self.homescreen.visible_apps[0].name # Activate edit mode self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active") self.homescreen.activate_edit_mode() self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active") # Move first app to position 12 self.homescreen.move_app_to_position(0, 12) # Exit edit mode self.homescreen.touch_home_button() self.homescreen.switch_to_homescreen_frame() self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active") # Check the app order and that the app on position 12 is the right one first_app_after_move = self.homescreen.visible_apps[0].name self.assertNotEqual(first_app_before_move, first_app_after_move) self.assertEqual(first_app_before_move, self.homescreen.visible_apps[12].name)
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)
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)
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)
class TestEditMode(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.homescreen.launch() def test_access_and_leave_edit_mode(self): self.homescreen.go_to_next_page() # Go to edit mode self.homescreen.activate_edit_mode() # Verify that edit mode is active self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active") # Tap home button and verify that edit mode is no longer active self.homescreen.touch_home_button() self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")
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)
class TestEditMode(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() def test_access_and_leave_edit_mode(self): self.homescreen.go_to_next_page() # Go to edit mode self.homescreen.activate_edit_mode() # Verify that edit mode is active self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active") # Tap home button and verify that edit mode is no longer active self.homescreen.touch_home_button() self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")