本文整理汇总了Python中gaiatest.apps.system.regions.cards_view.CardsView.exit_cards_view方法的典型用法代码示例。如果您正苦于以下问题:Python CardsView.exit_cards_view方法的具体用法?Python CardsView.exit_cards_view怎么用?Python CardsView.exit_cards_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.system.regions.cards_view.CardsView
的用法示例。
在下文中一共展示了CardsView.exit_cards_view方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestCardsViewThreeApps
# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import exit_cards_view [as 别名]
class TestCardsViewThreeApps(GaiaTestCase):
_test_apps = ["Clock", "Gallery", "Calendar"]
def setUp(self):
GaiaTestCase.setUp(self)
self.cards_view = CardsView(self.marionette)
# Launch the test apps
for app in self._test_apps:
self.apps.launch(app)
def test_cards_view(self):
# https://moztrap.mozilla.org/manage/case/1909/
# Switch to top level frame before dispatching the event
self.marionette.switch_to_frame()
self.assertFalse(self.cards_view.is_cards_view_displayed, "Cards view not expected to be visible")
# Pull up the cards view
self.cards_view.open_cards_view()
self.assertFalse(self.cards_view.is_app_displayed(self._test_apps[0]),
"First opened app should not be visible in cards view")
self.assertTrue(self.cards_view.is_app_displayed(self._test_apps[1]),
"Second app opened should be visible in cards view")
self.assertTrue(self.cards_view.is_app_displayed(self._test_apps[2]),
"Third app opened should be visible in cards view")
self.cards_view.exit_cards_view()
示例2: TestCardsView
# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import exit_cards_view [as 别名]
class TestCardsView(GaiaTestCase):
_app_under_test = "Clock"
_clock_frame_locator = (By.CSS_SELECTOR, "iframe[mozapp^='app://clock'][mozapp$='manifest.webapp']")
def setUp(self):
GaiaTestCase.setUp(self)
self.cards_view = CardsView(self.marionette)
# Launch the Clock app as a basic, reliable
# app to test against in Cards View
self.app = self.apps.launch(self._app_under_test)
def test_cards_view(self):
# https://moztrap.mozilla.org/manage/case/1909/
# Switch to top level frame before dispatching the event
self.marionette.switch_to_frame()
# Check that cards view is not displayed
self.assertFalse(self.cards_view.is_cards_view_displayed, "Cards view not expected to be visible")
# Pull up the cards view
self.cards_view.open_cards_view()
self.assertTrue(self.cards_view.is_app_displayed(self._app_under_test),
"%s app expected to be visible in cards view" % self._app_under_test)
self.cards_view.exit_cards_view()
def test_that_app_can_be_launched_from_cards_view(self):
# https://github.com/mozilla/gaia-ui-tests/issues/98
# Switch to top level frame before dispatching the event
self.marionette.switch_to_frame()
# Find the cards frame html element
clock_frame = self.marionette.find_element(*self._clock_frame_locator)
# Pull up the cards view
self.cards_view.open_cards_view()
self.assertFalse(clock_frame.is_displayed(), "Clock frame not expected to be displayed")
# Launch the app from the cards view
self.cards_view.tap_app(self._app_under_test)
self.cards_view.wait_for_cards_view_not_displayed()
self.assertTrue(clock_frame.is_displayed(), "Clock frame expected to be displayed")
def test_kill_app_from_cards_view(self):
# https://moztrap.mozilla.org/manage/case/1917/
# Switch to top level frame before dispatching the event
self.marionette.switch_to_frame()
# Pull up the cards view
self.cards_view.open_cards_view()
# Close the current app from cards view
self.cards_view.close_app(self._app_under_test)
self.marionette.switch_to_frame()
# Pull up the cards view again
self.cards_view.open_cards_view()
# If successfully killed, the app should no longer appear in the cards view.
self.assertFalse(self.cards_view.is_app_present(self._app_under_test),
"Killed app not expected to appear in cards view")