class TestMoveApp(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.homescreen.wait_for_homescreen_to_load() 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.device.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)
def setUp(self): GaiaTestCase.setUp(self) # Wait for homescreen to fully load homescreen = Homescreen(self.marionette) homescreen.launch() homescreen.wait_for_homescreen_to_load() self.marionette.switch_to_frame()
def setUp(self): GaiaTestCase.setUp(self) # Wait for homescreen to fully load homescreen = Homescreen(self.marionette) homescreen.launch() homescreen.wait_for_homescreen_to_load() self.marionette.switch_to_frame()
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)
def test_launch_packaged_app_from_search_panel(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(self.app_name) results = search_panel.installed_apps self.assertEqual(results[0].name, self.app_name) results[0].tap() self.assertEqual(self.apps.displayed_app.name.lower(), self.app_name.lower())
def test_launch_packaged_app_from_search_panel(self): homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(self.app_name) results = search_panel.installed_apps self.assertEqual(results[0].name, self.app_name) results[0].tap() self.assertEqual(self.apps.displayed_app.name.lower(), self.app_name.lower())
def test_launch_everything_me_search(self): # Tests a search with a common string. # Asserts that the title and shortcuts are listed test_string = u'News' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(test_string) search_panel.wait_for_everything_me_results_to_load() self.assertGreater(len(search_panel.results), 0)
def test_launch_everything_me_app(self): app_name = 'Twitter' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(app_name) search_panel.wait_for_everything_me_results_to_load() self.assertGreater(len(search_panel.results), 0) search_panel.results[0].tap() self.assertIn(app_name, self.marionette.title)
def test_launch_everything_me_app(self): app_name = 'Twitter' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(app_name) search_panel.wait_for_everything_me_results_to_load() self.assertGreater(len(search_panel.results), 0) search_panel.results[0].tap() self.assertIn(app_name, self.marionette.title)
def test_launch_everything_me_search(self): # Tests a search with a common string. # Asserts that the title and shortcuts are listed test_string = u'News' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(test_string) search_panel.wait_for_everything_me_results_to_load() self.assertGreater(len(search_panel.results), 0)
def test_launch_everything_me_search_accented(self): # Tests a search with accented characters. # Asserts that title and shortcut results are returned correctly test_string = u'Pétanque' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(test_string) search_panel.wait_for_type('Sports') search_panel.wait_for_everything_me_results_to_load() self.assertGreater(len(search_panel.results), 0)
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_launch_everything_me_search_accented(self): # Tests a search with accented characters. # Asserts that title and shortcut results are returned correctly test_string = u'Pétanque' homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() homescreen.wait_for_homescreen_to_load() search_panel = homescreen.tap_search_bar() search_panel.wait_for_everything_me_loaded() search_panel.type_into_search_box(test_string) search_panel.wait_for_type('Sports') search_panel.wait_for_everything_me_results_to_load() self.assertGreater(len(search_panel.results), 0)
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)
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() 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): # 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() 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)
class TestEditMode(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.homescreen.wait_for_homescreen_to_load() 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.device.touch_home_button() self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")
class TestMoveApp(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.homescreen.wait_for_homescreen_to_load() 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.device.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 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() 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): # 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() 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)
class TestEditMode(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() self.homescreen.wait_for_homescreen_to_load() 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.device.touch_home_button() self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")