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_purchase_app(self): pin = '1234' account = self.create_firefox_account() marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) home_page = marketplace.launch() home_page.login(account.email, account.password) search_results_page = self.tap_install_button_of_first_paid_app() payment = Payment(self.marionette) payment.create_pin(pin) payment.wait_for_buy_app_section_displayed() self.assertIn(self.app_name, payment.app_name) payment.tap_buy_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, search_results_page.install_notification_message) marketplace.switch_to_marketplace_frame() app = search_results_page.search_results[0] self.assertEqual('Open app', app.install_button_text)
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 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 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 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 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_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 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_purchase_app(self): APP_NAME = 'Test Zippy With Me' PIN = '1234' username = self.testvars['marketplace']['username'] password = self.testvars['marketplace']['password'] if self.apps.is_app_installed(APP_NAME): self.apps.uninstall(APP_NAME) marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) marketplace.launch() marketplace.login(username, password) marketplace.set_region('United States') details_page = marketplace.navigate_to_app(APP_NAME) payment = details_page.tap_purchase_button() payment.create_pin(PIN) payment.wait_for_buy_app_section_displayed() self.assertIn(APP_NAME, payment.app_name) payment.tap_buy_button() # 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' % APP_NAME, marketplace.install_notification_message) marketplace.switch_to_marketplace_frame() self.assertEqual('Launch', details_page.install_button_text)
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() # 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, marketplace.install_notification_message) 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))
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() # 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.apps.switch_to_displayed_app() # 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 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'), '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_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)
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 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 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"), "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 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'])
def install_link(self): element = Wait(self.marionette, timeout=20, interval=1).until( expected.element_present(*self._addon_install_locator)) Wait(self.marionette).until(expected.element_displayed(element)) element.tap() confirm_install = ConfirmInstall(self.marionette) confirm_install.tap_confirm() system = System(self.marionette) system.wait_for_system_banner_displayed() system.wait_for_system_banner_not_displayed() self.apps.switch_to_displayed_app()
def install_link(self): element = Wait(self.marionette, timeout=20, interval=1).until( expected.element_present(*self._addon_install_locator)) Wait(self.marionette).until(expected.element_displayed(element)) element.tap() confirm_install = ConfirmInstall(self.marionette) confirm_install.tap_confirm() system = System(self.marionette) system.wait_for_system_banner_displayed() system.wait_for_system_banner_not_displayed() 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'])
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))
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 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_install_and_execute_bing_map(self): marketplace = Marketplace(self.marionette) marketplace.launch() results = marketplace.search(self.app_search) first_result = results.search_results[0] first_result.tap_install_button() confirm_install = ConfirmInstall(self.marionette) confirm_install.tap_confirm() results = marketplace.get_current_displayed_result() first_result = results.search_results[0] first_result.tap_open_app_button(self.app_title, self._map_locator) self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_in_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_in_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_in_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) # move around GaiaImageCompareTestCase.scroll(self.marionette, 'right', 100, locator=self._map_locator) self.take_screenshot(prewait=self.draw_wait_time) GaiaImageCompareTestCase.scroll(self.marionette, 'down', 100, locator=self._map_locator) self.take_screenshot(prewait=self.draw_wait_time) # zoom out self.marionette.find_element(*self._zoom_out_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_out_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_out_locator).tap() self.take_screenshot(prewait=self.draw_wait_time)
def setUp(self): GaiaTestCase.setUp(self) self.homescreen = Homescreen(self.marionette) self.apps.switch_to_displayed_app() 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 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 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_install_and_execute_bing_map(self): marketplace = Marketplace(self.marionette) marketplace.launch() results = marketplace.search(self.app_search) first_result = results.search_results[0] first_result.tap_install_button() confirm_install = ConfirmInstall(self.marionette) confirm_install.tap_confirm() results = marketplace.get_current_displayed_result() first_result = results.search_results[0] first_result.tap_open_app_button(self._map_locator) self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_in_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_in_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_in_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) # move around GaiaImageCompareTestCase.scroll(self.marionette, 'right', 100, locator=self._map_locator) self.take_screenshot(prewait=self.draw_wait_time) GaiaImageCompareTestCase.scroll(self.marionette, 'down', 100, locator=self._map_locator) self.take_screenshot(prewait=self.draw_wait_time) # zoom out self.marionette.find_element(*self._zoom_out_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_out_locator).tap() self.take_screenshot(prewait=self.draw_wait_time) self.marionette.find_element(*self._zoom_out_locator).tap() self.take_screenshot(prewait=self.draw_wait_time)
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 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
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()
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()