當前位置: 首頁>>代碼示例>>Python>>正文


Python Marketplace.switch_to_marketplace_frame方法代碼示例

本文整理匯總了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)
開發者ID:bobsilverberg,項目名稱:marketplace-tests-gaia,代碼行數:34,代碼來源:test_marketplace_purchase_app.py

示例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()
開發者ID:davehunt,項目名稱:marketplace-tests-gaia,代碼行數:27,代碼來源:test_marketplace_login.py

示例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)
開發者ID:davehunt,項目名稱:marketplace-tests-gaia,代碼行數:30,代碼來源:test_marketplace_purchase_app.py

示例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))
開發者ID:smwentum,項目名稱:marketplace-tests-gaia,代碼行數:50,代碼來源:test_marketplace_search_and_install_app.py

示例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


注:本文中的marketplacetests.marketplace.app.Marketplace.switch_to_marketplace_frame方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。