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


Python CardsView.swipe_to_previous_app方法代碼示例

本文整理匯總了Python中gaiatest.apps.system.regions.cards_view.CardsView.swipe_to_previous_app方法的典型用法代碼示例。如果您正苦於以下問題:Python CardsView.swipe_to_previous_app方法的具體用法?Python CardsView.swipe_to_previous_app怎麽用?Python CardsView.swipe_to_previous_app使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gaiatest.apps.system.regions.cards_view.CardsView的用法示例。


在下文中一共展示了CardsView.swipe_to_previous_app方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_that_app_can_be_launched_from_cards_view

# 需要導入模塊: from gaiatest.apps.system.regions.cards_view import CardsView [as 別名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import swipe_to_previous_app [as 別名]
    def test_that_app_can_be_launched_from_cards_view(self):
        """
        https://moztrap.mozilla.org/manage/case/2462/
        """

        cards_view = CardsView(self.marionette)
        self.assertFalse(cards_view.is_displayed, 'Cards view not expected to be visible')

        # Pull up the cards view
        self.device.hold_home_button()
        cards_view.wait_for_cards_view()

        # Wait for first app ready
        cards_view.cards[1].wait_for_centered()

        self.assertIn(cards_view.cards[0].manifest_url, self.calendar.manifest_url)
        self.assertTrue(cards_view.cards[0].is_displayed,
                            '%s app should be present in cards view' % cards_view.cards[1].title)
        self.assertIn(cards_view.cards[1].manifest_url, self.clock.manifest_url)
        self.assertTrue(cards_view.cards[1].is_displayed,
                            '%s app should be present in cards view' % cards_view.cards[1].title)

        cards_view.swipe_to_previous_app()

        # Wait for previous app ready
        cards_view.cards[0].wait_for_centered()
        cards_view.cards[0].tap()

        cards_view.wait_for_cards_view_not_displayed()

        self.calendar.wait_to_be_displayed()
開發者ID:Archaeopteryx,項目名稱:gaia,代碼行數:33,代碼來源:test_cards_view_with_two_apps.py

示例2: test_that_app_can_be_launched_from_cards_view

# 需要導入模塊: from gaiatest.apps.system.regions.cards_view import CardsView [as 別名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import swipe_to_previous_app [as 別名]
    def test_that_app_can_be_launched_from_cards_view(self):
        """https://moztrap.mozilla.org/manage/case/2462/"""

        cards_view = CardsView(self.marionette)
        self.assertFalse(cards_view.is_cards_view_displayed, 'Cards view not expected to be visible')

        # Pull up the cards view
        self.device.hold_home_button()
        cards_view.wait_for_cards_view()

        # Wait for first app ready
        cards_view.wait_for_card_ready(self._test_apps[1])

        for app in self._test_apps:
            self.assertTrue(cards_view.is_app_displayed(app),
                            '%s app should be present in cards view' % app)

        cards_view.swipe_to_previous_app()

        # Wait for previous app ready
        cards_view.wait_for_card_ready(self._test_apps[0])
        cards_view.tap_app(self._test_apps[0])

        cards_view.wait_for_cards_view_not_displayed()

        self.assertEqual(self.apps.displayed_app.name, self._test_apps[0])
開發者ID:AkshayTiwari,項目名稱:gaia,代碼行數:28,代碼來源:test_cards_view_with_two_apps.py

示例3: test_cards_view_with_two_apps

# 需要導入模塊: from gaiatest.apps.system.regions.cards_view import CardsView [as 別名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import swipe_to_previous_app [as 別名]
    def test_cards_view_with_two_apps(self):
        """https://moztrap.mozilla.org/manage/case/2462/"""

        cards_view = CardsView(self.marionette)
        self.assertFalse(cards_view.is_displayed, 'Cards view not expected to be visible')

        # Pull up the cards view
        self.device.hold_home_button()
        cards_view.wait_for_cards_view()
        self.take_screenshot(top_frame=True)

        # disabled per Bug 1118390
        #self.change_orientation('landscape-primary')
        #self.take_screenshot()
        #self.change_orientation('portrait-primary')
        #self.take_screenshot()

        # Wait for first app ready
        cards_view.cards[1].wait_for_centered()
        self.assertIn(cards_view.cards[0].manifest_url[:19], self.contacts.manifest_url)
        self.assertIn(cards_view.cards[1].manifest_url, self.gallery.manifest_url)
        cards_view.swipe_to_previous_app()

        # Wait for previous app ready
        cards_view.cards[0].wait_for_centered()
        # sleep inside above method is insufficient
        time.sleep(2)
        self.take_screenshot(top_frame=True)

        cards_view.cards[0].tap()
        cards_view.wait_for_cards_view_not_displayed()
        self.take_screenshot(top_frame=True) #bug 1151571 will cause blank screen capture

        self.assertTrue(self.contacts.is_displayed)
開發者ID:Archaeopteryx,項目名稱:gaia,代碼行數:36,代碼來源:test_cards_view_with_two_apps.py

示例4: test_cards_view_with_two_apps

# 需要導入模塊: from gaiatest.apps.system.regions.cards_view import CardsView [as 別名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import swipe_to_previous_app [as 別名]
    def test_cards_view_with_two_apps(self):
        """https://moztrap.mozilla.org/manage/case/2462/"""

        cards_view = CardsView(self.marionette)
        self.assertFalse(cards_view.is_displayed, 'Cards view not expected to be visible')

        # Pull up the cards view
        self.device.hold_home_button()
        cards_view.wait_for_cards_view()
        card_frame = self.marionette.get_active_frame()
        self.take_screenshot()

        # disabled per Bug 1118390
        #self.change_orientation('landscape-primary')
        #self.take_screenshot()
        #self.change_orientation('portrait-primary')
        #self.take_screenshot()

        # Wait for first app ready
        cards_view.wait_for_card_ready(self._test_apps[1])

        for app in self._test_apps:
            self.assertTrue(cards_view.is_app_displayed(app),
                            '%s app should be present in cards view' % app)
        cards_view.swipe_to_previous_app()

        # Wait for previous app ready
        cards_view.wait_for_card_ready(self._test_apps[0])
        # sleep inside above method is insufficient
        time.sleep(2)
        self.take_screenshot()
        self.marionette.switch_to_frame(frame=card_frame)

        cards_view.tap_app(self._test_apps[0])
        cards_view.wait_for_cards_view_not_displayed()
        self.take_screenshot() #bug 1151571 will cause blank screen capture

        self.assertEqual(self.apps.displayed_app.name, self._test_apps[0])
開發者ID:anubhav7495,項目名稱:gaia,代碼行數:40,代碼來源:test_cards_view_with_two_apps.py


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