本文整理汇总了Python中gaiatest.apps.homescreen.regions.confirm_install.ConfirmInstall类的典型用法代码示例。如果您正苦于以下问题:Python ConfirmInstall类的具体用法?Python ConfirmInstall怎么用?Python ConfirmInstall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfirmInstall类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_purchase_app
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)
示例2: test_search_and_install_app
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)
示例3: setUp
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)
示例4: test_search_and_install_app
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))
开发者ID:bobsilverberg,项目名称:marketplace-tests-gaia,代码行数:35,代码来源:test_marketplace_search_and_install_app.py
示例5: setUp
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'])
示例6: setUp
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'])
示例7: test_purchase_app
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)
示例8: test_delete_app
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)
示例9: setUp
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'])
示例10: parameterized_set_up
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'])
示例11: install_link
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()
示例12: test_search_and_install_app
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))
示例13: setUp
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)
示例14: setUp
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)
示例15: setUp
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'])