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)
    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)
    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)
Пример #4
0
    def test_receive_call_with_locked_screen(self):
        """Make a phone call from Plivo to the phone."""
        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)
    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)
    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)