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


Python CallScreen.wait_for_incoming_call_with_locked_screen方法代码示例

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


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

示例1: test_receive_call_with_locked_screen

# 需要导入模块: from gaiatest.apps.phone.regions.call_screen import CallScreen [as 别名]
# 或者: from gaiatest.apps.phone.regions.call_screen.CallScreen import wait_for_incoming_call_with_locked_screen [as 别名]
    def test_receive_call_with_locked_screen(self):
        """
        Verify that the User can receive a call whilst the device is locked
        https://moztrap.mozilla.org/manage/case/1300/
        """
        PLIVO_TIMEOUT = 30
        self.call_uuid = False

        from gaiatest.utils.plivo.plivo_util import PlivoUtil
        self.plivo = PlivoUtil(
            self.testvars['plivo']['auth_id'],
            self.testvars['plivo']['auth_token'],
            self.testvars['plivo']['phone_number']
        )

        self.device.lock()
        self.call_uuid = self.plivo.make_call(
            to_number=self.testvars['carrier']['phone_number'].replace('+', ''),
            timeout=PLIVO_TIMEOUT)

        # Wait for the incoming call screen to show up
        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call_with_locked_screen()

        # Reject the call
        call_screen.reject_call()

        # Check that the screen is still locked
        self.assertTrue(self.device.is_locked)
开发者ID:4gh,项目名称:gaia,代码行数:31,代码来源:test_dialer_receive_call_with_locked_screen.py

示例2: test_receive_call_with_locked_screen

# 需要导入模块: from gaiatest.apps.phone.regions.call_screen import CallScreen [as 别名]
# 或者: from gaiatest.apps.phone.regions.call_screen.CallScreen import wait_for_incoming_call_with_locked_screen [as 别名]
    def test_receive_call_with_locked_screen(self):
        """Make a phone call from Plivo to the phone."""
        PLIVO_TIMEOUT = 30
        self.call_uuid = False

        self.plivo = PlivoUtil(
            self.testvars['plivo']['auth_id'],
            self.testvars['plivo']['auth_token'],
            self.testvars['plivo']['phone_number']
        )

        self.device.lock()
        self.call_uuid = self.plivo.make_call(
            to_number=self.testvars['carrier']['phone_number'].replace('+', ''),
            timeout=PLIVO_TIMEOUT)

        # Wait for the incoming call screen to show up
        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call_with_locked_screen()

        # Reject the call
        call_screen.reject_call()

        # Check that the screen is still locked
        self.assertTrue(self.device.is_locked)
开发者ID:AkshayTiwari,项目名称:gaia,代码行数:27,代码来源:test_dialer_receive_call_with_locked_screen.py

示例3: test_dialer_miss_call_from_known_contact_notification

# 需要导入模块: from gaiatest.apps.phone.regions.call_screen import CallScreen [as 别名]
# 或者: from gaiatest.apps.phone.regions.call_screen.CallScreen import wait_for_incoming_call_with_locked_screen [as 别名]
    def test_dialer_miss_call_from_known_contact_notification(self):
        """
        https://moztrap.mozilla.org/manage/case/9294/
        """
        PLIVO_TIMEOUT = 30

        self.device.lock()

        from gaiatest.utils.plivo.plivo_util import PlivoUtil
        self.plivo = PlivoUtil(
            self.testvars['plivo']['auth_id'],
            self.testvars['plivo']['auth_token'],
            self.testvars['plivo']['phone_number']
        )
        self.call_uuid = self.plivo.make_call(
            to_number=self.testvars['local_phone_numbers'][0].replace('+', ''),
            timeout=PLIVO_TIMEOUT)

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call_with_locked_screen()
        self.plivo.hangup_call(self.call_uuid)

        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_completed(self.call_uuid),
            message="Plivo didn't report the call as completed")
        self.call_uuid = None

        lock_screen = LockScreen(self.marionette)
        lock_screen.switch_to_frame()
        lock_screen.wait_for_notification()

        # Check if the screen is turned on
        self.assertTrue(self.device.is_screen_enabled)

        # Verify the user sees a missed call notification message
        # and the known contacts info is shown.
        self.assertTrue(lock_screen.notifications[0].is_visible)
        self.assertEqual(lock_screen.notifications[0].title, 'Missed call')
        self.assertTrue(self.contact.givenName in lock_screen.notifications[0].content)

        self.device.unlock()

        system = System(self.marionette)
        system.wait_for_notification_toaster_not_displayed()

        # Expand the notification bar
        system.wait_for_status_bar_displayed()
        utility_tray = system.open_utility_tray()
        utility_tray.wait_for_notification_container_displayed()

        # Verify the user sees the missed call event in the notification center
        # and the known contacts info is shown.
        notifications = utility_tray.notifications
        self.assertEqual(notifications[0].title, 'Missed call')
        self.assertTrue(self.contact.givenName in notifications[0].content)
开发者ID:6a68,项目名称:gaia,代码行数:57,代码来源:test_dialer_miss_call_from_known_contact_notification.py


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