本文整理汇总了Python中marketplacetests.marketplace.app.Marketplace.switch_to_marketplace_frame方法的典型用法代码示例。如果您正苦于以下问题:Python Marketplace.switch_to_marketplace_frame方法的具体用法?Python Marketplace.switch_to_marketplace_frame怎么用?Python Marketplace.switch_to_marketplace_frame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marketplacetests.marketplace.app.Marketplace
的用法示例。
在下文中一共展示了Marketplace.switch_to_marketplace_frame方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_purchase_app
# 需要导入模块: from marketplacetests.marketplace.app import Marketplace [as 别名]
# 或者: from marketplacetests.marketplace.app.Marketplace import switch_to_marketplace_frame [as 别名]
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_marketplace_login_from_app_details_page
# 需要导入模块: from marketplacetests.marketplace.app import Marketplace [as 别名]
# 或者: from marketplacetests.marketplace.app.Marketplace import switch_to_marketplace_frame [as 别名]
def test_marketplace_login_from_app_details_page(self):
account = self.create_firefox_account()
marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME)
home_page = marketplace.launch()
app_name = home_page.first_free_app['name']
details_page = home_page.navigate_to_app(app_name)
ff_accounts = details_page.tap_write_review(logged_in=False)
ff_accounts.login(account.email, account.password)
# switch back to Marketplace
marketplace.switch_to_marketplace_frame()
details_page.wait_for_login_success_notification()
current_time = str(time.time()).split('.')[0]
rating = random.randint(1, 5)
body = 'This is a test %s' % current_time
review_page = AddReview(self.marionette)
details_page = review_page.write_a_review(rating, body)
details_page.wait_for_review_posted_notification()
# Check if review was added correctly
self.assertEqual(details_page.first_review_rating, rating)
self.assertEqual(details_page.first_review_body, body)
开发者ID:davehunt,项目名称:marketplace-tests-gaia,代码行数:30,代码来源:test_marketplace_login_from_app_details_page.py
示例3: test_login_marketplace
# 需要导入模块: from marketplacetests.marketplace.app import Marketplace [as 别名]
# 或者: from marketplacetests.marketplace.app.Marketplace import switch_to_marketplace_frame [as 别名]
def test_login_marketplace(self):
# https://moztrap.mozilla.org/manage/case/4134/
marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME)
home_page = marketplace.launch()
account = self.create_firefox_account()
home_page.login(account.email, account.password)
# switch back to Marketplace
marketplace.switch_to_marketplace_frame()
# wait for the expected notification, and for user to be signed in
home_page.wait_for_login_success_notification()
settings = home_page.show_menu().tap_settings()
settings.wait_for_sign_out_button()
# Verify that user is logged in
self.assertEqual(account.email, settings.email)
# Sign out, which should return to the Marketplace home screen
settings.tap_sign_out()
# Verify that user is signed out
settings.wait_for_sign_in_displayed()
示例4: test_purchase_app
# 需要导入模块: from marketplacetests.marketplace.app import Marketplace [as 别名]
# 或者: from marketplacetests.marketplace.app.Marketplace import switch_to_marketplace_frame [as 别名]
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)
示例5: test_search_and_install_app
# 需要导入模块: from marketplacetests.marketplace.app import Marketplace [as 别名]
# 或者: from marketplacetests.marketplace.app.Marketplace import switch_to_marketplace_frame [as 别名]
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))
示例6: test_purchase_app
# 需要导入模块: from marketplacetests.marketplace.app import Marketplace [as 别名]
# 或者: from marketplacetests.marketplace.app.Marketplace import switch_to_marketplace_frame [as 别名]
def test_purchase_app(self):
APP_NAME = 'Test Zippy With Me'
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.set_region('United States')
details_page = marketplace.navigate_to_app(APP_NAME)
ff_accounts = details_page.tap_purchase_button(is_logged_in=False)
ff_accounts.login(username, password)
# Switch back to the Marketplace frame and wait for the install button to update
marketplace.switch_to_marketplace_frame()
Wait(marionette=self.marionette, ignored_exceptions=StaleElementException)\
.until(lambda m: details_page.install_button_text == 'Purchasing')
开发者ID:bobsilverberg,项目名称:marketplace-tests-gaia,代码行数:24,代码来源:test_marketplace_login_during_purchase.py