当前位置: 首页>>代码示例>>Python>>正文


Python CardsView.close_app方法代码示例

本文整理汇总了Python中gaiatest.apps.system.regions.cards_view.CardsView.close_app方法的典型用法代码示例。如果您正苦于以下问题:Python CardsView.close_app方法的具体用法?Python CardsView.close_app怎么用?Python CardsView.close_app使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gaiatest.apps.system.regions.cards_view.CardsView的用法示例。


在下文中一共展示了CardsView.close_app方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GaiaEnduranceTestCase

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [as 别名]
class GaiaEnduranceTestCase(GaiaTestCase, EnduranceTestCaseMixin, MemoryEnduranceTestCaseMixin):

    def __init__(self, *args, **kwargs):
        GaiaTestCase.__init__(self, *args, **kwargs)
        EnduranceTestCaseMixin.__init__(self, *args, **kwargs)
        MemoryEnduranceTestCaseMixin.__init__(self, *args, **kwargs)
        kwargs.pop('iterations', None)
        kwargs.pop('checkpoint_interval', None)

    def close_app(self):
        from gaiatest.apps.system.regions.cards_view import CardsView
        self.cards_view = CardsView(self.marionette)

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

        # Wait for first app ready
        self.cards_view.wait_for_card_ready(self.app_under_test.lower())

        # Close the current apps from the cards view
        self.cards_view.close_app("search")

        # Sleep a bit
        time.sleep(5)
开发者ID:adrm,项目名称:gaia,代码行数:27,代码来源:gaia_test.py

示例2: TestCardsViewTwoApps

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [as 别名]
class TestCardsViewTwoApps(GaiaTestCase):

    _test_apps = ["Clock", "Gallery"]

    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)
            # Let's wait a bit for the app to fully launch
            time.sleep(2)

    def test_kill_app_from_cards_view(self):
        """https://moztrap.mozilla.org/manage/case/1917/"""

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

        # Close the current apps from the cards view
        self.cards_view.close_app(self._test_apps[1])
        self.cards_view.close_app(self._test_apps[0])

        # If successfully killed, the apps should no longer appear in the cards view and the "No recent apps" message should be displayed
        self.assertFalse(self.cards_view.is_app_present(self._test_apps[1]),
                         "Killed app not expected to appear in cards view")

        self.assertFalse(self.cards_view.is_app_present(self._test_apps[0]),
                         "Killed app not expected to appear in cards view")
开发者ID:Bharatpattani,项目名称:gaia,代码行数:33,代码来源:test_cards_view_kill_apps_with_two_apps.py

示例3: TestCardsView

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [as 别名]
class TestCardsView(GaiaTestCase):

    _app_under_test = "Clock"

    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_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")
开发者ID:AaronMT,项目名称:gaia,代码行数:33,代码来源:test_cards_view_kill_app.py

示例4: test_sms_auto_save_draft

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [as 别名]
    def test_sms_auto_save_draft(self):
        """
        https://moztrap.mozilla.org/manage/case/7806/
        """
        _text_message_content = "Automated Test %s" % str(time.time())

        # launch messages app
        messages = Messages(self.marionette)
        messages.launch()

        # click new message
        new_message = messages.tap_create_new_message()

        self.marionette.switch_to_frame()
        Wait(self.marionette).until(lambda m: new_message.keyboard.is_keyboard_displayed)
        self.apps.switch_to_displayed_app()

        new_message.type_message(_text_message_content)
        self.assertEqual(new_message.message, _text_message_content)

        # close message app and leave cards view
        self.device.hold_home_button()
        from gaiatest.apps.system.regions.cards_view import CardsView
        cards_view = CardsView(self.marionette)
        cards_view.wait_for_cards_view()

        # wait for first app ready
        cards_view.wait_for_card_ready('sms')
        cards_view.close_app('sms')
        self.assertFalse(cards_view.is_app_present('sms'),
                         "Killed app not expected to appear in cards view")

        # wait for homescreen to be displayed
        Homescreen(self.marionette).wait_to_be_displayed()

        # re-open messages app
        messages.launch()
        self.assertTrue(messages.draft_threads[0].is_draft_icon_displayed)
        new_message = messages.draft_threads[0].open()

        # check that last message draft is shown correctly
        self.assertEqual(new_message.message, _text_message_content)
开发者ID:DouglasSherk,项目名称:gaia,代码行数:44,代码来源:test_sms_auto_save_draft.py

示例5: TestCardsViewTwoApps

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [as 别名]
class TestCardsViewTwoApps(GaiaImageCompareTestCase):

    _test_apps = ["Contacts", "Gallery"]

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)
        self.cards_view = CardsView(self.marionette)

        # Launch the test apps
        for app in self._test_apps:
            self.apps.launch(app)

            # 10 seconds for the actual user using the app a bit, and going back to homescreen
            time.sleep(10)
            self.device.touch_home_button()

    def test_cards_view_kill_apps_with_two_apps(self):
        """https://moztrap.mozilla.org/manage/case/1917/"""

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

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

        # Close the current apps from the cards view
        self.cards_view.close_app(self._test_apps[1])
        self.take_screenshot()
        self.cards_view.close_app(self._test_apps[0])
        self.take_screenshot()

        # If successfully killed, the apps should no longer appear in the cards view
        # and the "No recent apps" message should be displayed
        self.assertFalse(self.cards_view.is_app_present(self._test_apps[1]),
                         "Killed app not expected to appear in cards view")

        self.assertFalse(self.cards_view.is_app_present(self._test_apps[0]),
                         "Killed app not expected to appear in cards view")
开发者ID:AaskaShah,项目名称:gaia,代码行数:42,代码来源:test_cards_view_kill_apps_with_two_apps.py

示例6: TestCardsViewThreeApps

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [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_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 the cards view
        self.cards_view.close_app(self._test_apps[2])

        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._test_apps[2]),
            "Killed app not expected to appear in cards view")

        # Check if the remaining 2 apps are visible in the cards view
        self.assertTrue(self.cards_view.is_app_displayed(self._test_apps[0]),
            "First opened app should 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")
开发者ID:AaronMT,项目名称:gaia,代码行数:41,代码来源:test_cards_view_kill_app_with_three_apps.py

示例7: TestCardsViewTwoApps

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [as 别名]
class TestCardsViewTwoApps(GaiaTestCase):

    _test_apps = ["Clock", "Gallery"]

    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_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 apps from the cards view
        self.cards_view.close_app(self._test_apps[1])
        self.cards_view.close_app(self._test_apps[0])

        self.marionette.switch_to_frame()

        # Pull up the cards view again
        self.cards_view.open_cards_view()

        # If successfully killed, the apps should no longer appear in the cards view and the "No recent apps" message should be displayed
        self.assertFalse(self.cards_view.is_app_present(self._test_apps[1]),
                         "Killed app not expected to appear in cards view")

        self.assertFalse(self.cards_view.is_app_present(self._test_apps[0]),
                         "Killed app not expected to appear in cards view")

        self.assertEqual(self.cards_view.no_recent_apps_message, "No recent apps")
开发者ID:Allios,项目名称:gaia,代码行数:40,代码来源:test_cards_view_kill_apps_with_two_apps.py

示例8: TestCardsView

# 需要导入模块: from gaiatest.apps.system.regions.cards_view import CardsView [as 别名]
# 或者: from gaiatest.apps.system.regions.cards_view.CardsView import close_app [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")
开发者ID:BReduardokramer,项目名称:gaia,代码行数:69,代码来源:test_cards_view_with_one_app.py


注:本文中的gaiatest.apps.system.regions.cards_view.CardsView.close_app方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。