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/
        """
        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['local_phone_numbers'][0].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        call_screen.reject_call()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None

        self.assertTrue(self.device.is_locked)
    def test_receive_call(self):
        """Make a phone call from Plivo to the phone."""
        PLIVO_TIMEOUT = 30

        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['carrier']['phone_number'].replace(
                '+', ''),
            timeout=PLIVO_TIMEOUT)

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()
        call_screen.answer_call()

        # Wait for Plivo to report the call as connected
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_connected(self.call_uuid),
            message='The call was not connected.')

        # Wait for the state to be connected
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state == 'connected',
            timeout=30)

        call_screen.hang_up()

        # Wait for Plivo to report the call as completed
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_completed(self.call_uuid),
            message='The call was not completed.')
        self.call_uuid = None
    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)
    def test_call_log_all_calls(self):
        """
        https://moztrap.mozilla.org/manage/case/1306/
        """
        test_phone_number = self.testvars['remote_phone_number']

        # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756
        plivo_phone_number = self.testvars['plivo']['phone_number'][1:]

        # Make a call so it will appear in the call log
        self.phone.make_call_and_hang_up(test_phone_number)

        # Wait for fall back to phone app
        self.phone.wait_to_be_displayed()
        self.apps.switch_to_displayed_app()

        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.environment.phone_numbers[0].replace('+', ''))
        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        self.plivo.hangup_call(self.call_uuid)
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None

        self.phone.wait_to_be_displayed()
        self.apps.switch_to_displayed_app()
        call_log = self.phone.tap_call_log_toolbar_button()

        # Check all calls tab
        call_log.tap_all_calls_tab()
        self.assertTrue(call_log.is_all_calls_tab_selected)

        self.wait_for_condition(lambda m: len(call_log.call_list) == 2)
        call_list = call_log.call_list

        # Check that the calls displayed are for the calls we made/received
        self.assertIn(plivo_phone_number, call_list[0].phone_number)
        self.assertEqual('incoming', call_list[0].call_type)
        self.assertIn(test_phone_number, call_list[1].phone_number)
        self.assertEqual('dialing', call_list[1].call_type)

        # Check missed calls tab
        call_log.tap_missed_calls_tab()
        self.assertTrue(call_log.is_missed_calls_tab_selected)

        self.wait_for_condition(lambda m: len(call_log.call_list) == 1)
        call_list = call_log.call_list

        # Check that the calls displayed are for the calls we received
        self.assertIn(plivo_phone_number, call_list[0].phone_number)
        self.assertEqual('incoming', call_list[0].call_type)
Example #6
0
    def test_call_log_all_calls(self):
        """
        https://moztrap.mozilla.org/manage/case/1306/
        """
        test_phone_number = self.testvars['remote_phone_number']

        # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756
        plivo_phone_number = self.testvars['plivo']['phone_number'][1:]

        # Make a call so it will appear in the call log
        self.phone.make_call_and_hang_up(test_phone_number)

        # Wait for fall back to phone app
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.phone.name)
        self.apps.switch_to_displayed_app()

        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.environment.phone_numbers[0].replace('+', ''))
        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        self.plivo.hangup_call(self.call_uuid)
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None

        self.apps.switch_to_displayed_app()
        call_log = self.phone.tap_call_log_toolbar_button()

        # Check all calls tab
        call_log.tap_all_calls_tab()
        self.assertTrue(call_log.is_all_calls_tab_selected)

        self.wait_for_condition(lambda m: len(call_log.call_list) == 2)
        call_list = call_log.call_list

        # Check that the calls displayed are for the calls we made/received
        self.assertIn(plivo_phone_number, call_list[0].phone_number)
        self.assertEqual('incoming', call_list[0].call_type)
        self.assertIn(test_phone_number, call_list[1].phone_number)
        self.assertEqual('dialing', call_list[1].call_type)

        # Check missed calls tab
        call_log.tap_missed_calls_tab()
        self.assertTrue(call_log.is_missed_calls_tab_selected)

        self.wait_for_condition(lambda m: len(call_log.call_list) == 1)
        call_list = call_log.call_list

        # Check that the calls displayed are for the calls we received
        self.assertIn(plivo_phone_number, call_list[0].phone_number)
        self.assertEqual('incoming', call_list[0].call_type)
Example #7
0
    def test_dialer_clear_miss_call_notification(self):
        """
        Pre-requisites:
        Have a voicemail in the notification bar and a missed call notification

        Repro Steps:
        1) Open the notification panel and tap the missed call notification.
        2) After the call log appears, drop down the notification panel again.
        3) The notification for the call that was just tapped is no longer present.
        """
        PLIVO_TIMEOUT = 30
        plivo_phone_number = self.testvars["plivo"]["phone_number"]

        # Create a missed call notification
        from gaiatest.utils.plivo.plivo_util import PlivoUtil

        self.plivo = PlivoUtil(
            self.testvars["plivo"]["auth_id"], self.testvars["plivo"]["auth_token"], 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()
        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

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

        # Open the notification panel
        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
        notifications = utility_tray.notifications
        self.assertEqual(len(notifications), 2)
        self.assertEqual(notifications[0].title, "Missed call")
        # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756
        self.assertTrue(plivo_phone_number[1:] in notifications[0].content)
        self.assertEqual(notifications[1].title, "Voicemail")

        notifications[0].tap_notification()

        self.marionette.switch_to_frame()
        system.open_utility_tray()
        notifications = utility_tray.notifications
        self.assertEqual(len(notifications), 1)
        self.assertEqual(notifications[0].title, "Voicemail")
    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_receive_call(self):
        """Make a phone call from Plivo to the phone."""
        PLIVO_TIMEOUT = 30

        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['carrier']['phone_number'].replace('+', ''),
            timeout=PLIVO_TIMEOUT)

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()
        call_screen.answer_call()

        # Wait for Plivo to report the call as connected
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_connected(self.call_uuid),
            message='The call was not connected.')

        # Wait for the state to be connected
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state == 'connected',
            timeout=30)

        call_screen.hang_up()

        # Wait for Plivo to report the call as completed
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_completed(self.call_uuid),
            message='The call was not completed.')
        self.call_uuid = None
Example #10
0
    def test_call_log_all_calls(self):
        """
        https://moztrap.mozilla.org/manage/case/1306/
        """

        test_phone_number = self.testvars['remote_phone_number']
        plivo_phone_number = self.testvars['plivo']['phone_number']

        # Make a call so it will appear in the call log
        self.phone.make_call_and_hang_up(test_phone_number)

        # Wait for fall back to phone app
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.phone.name)
        self.apps.switch_to_displayed_app()

        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['carrier']['phone_number'].replace('+', ''),
            timeout=30)

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

        self.apps.switch_to_displayed_app()
        call_log = self.phone.tap_call_log_toolbar_button()

        # Check all calls tab
        call_log.tap_all_calls_tab()
        self.assertTrue(call_log.is_all_calls_tab_selected)

        call_list = call_log.call_list
        self.assertEqual(len(call_list), 2)

        # Check that the calls displayed are for the calls we made/received
        self.assertIn(plivo_phone_number, call_list[0].phone_number)
        self.assertEqual('incoming', call_list[0].call_type)
        self.assertIn(test_phone_number, call_list[1].phone_number)
        self.assertEqual('dialing', call_list[1].call_type)

        # Check missed calls tab
        call_log.tap_missed_calls_tab()
        self.assertTrue(call_log.is_missed_calls_tab_selected)

        call_list = call_log.call_list
        self.assertEqual(len(call_list), 1)

        # Check that the calls displayed are for the calls we received
        self.assertIn(plivo_phone_number, call_list[0].phone_number)
        self.assertEqual('incoming', call_list[0].call_type)
    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_clear_miss_call_notification(self):
        """
        Pre-requisites:
        Have a voicemail in the notification bar and a missed call notification

        Repro Steps:
        1) Open the notification panel and tap the missed call notification.
        2) After the call log appears, drop down the notification panel again.
        3) The notification for the call that was just tapped is no longer present.
        """
        plivo_phone_number = self.testvars['plivo']['phone_number']

        # Create a missed call notification
        from gaiatest.utils.plivo.plivo_util import PlivoUtil
        self.plivo = PlivoUtil(
            self.testvars['plivo']['auth_id'],
            self.testvars['plivo']['auth_token'],
            plivo_phone_number,
        )
        self.call_uuid = self.plivo.make_call(
            to_number=self.testvars['local_phone_numbers'][0].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        self.plivo.hangup_call(self.call_uuid)
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None

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

        # Open the notification panel
        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
        notifications = utility_tray.notifications
        self.assertEqual(len(notifications), 2)
        self.assertEqual(notifications[0].title, 'Missed call')
        # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756
        self.assertTrue(plivo_phone_number[1:] in notifications[0].content)
        self.assertEqual(notifications[1].title, 'Voicemail')

        notifications[0].tap_notification()

        self.marionette.switch_to_frame()
        system.open_utility_tray()
        notifications = utility_tray.notifications
        self.assertEqual(len(notifications), 1)
        self.assertEqual(notifications[0].title, 'Voicemail')
Example #13
0
    def test_dialer_clear_miss_call_notification(self):
        """
        Pre-requisites:
        Have a voicemail in the notification bar and a missed call notification

        Repro Steps:
        1) Open the notification panel and tap the missed call notification.
        2) After the call log appears, drop down the notification panel again.
        3) The notification for the call that was just tapped is no longer present.
        """
        plivo_phone_number = self.testvars['plivo']['phone_number']

        # Create a missed call notification
        from gaiatest.utils.plivo.plivo_util import PlivoUtil
        self.plivo = PlivoUtil(
            self.testvars['plivo']['auth_id'],
            self.testvars['plivo']['auth_token'],
            plivo_phone_number,
        )
        self.call_uuid = self.plivo.make_call(
            to_number=self.environment.phone_numbers[0].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        self.plivo.hangup_call(self.call_uuid)
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None

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

        # Open the notification panel
        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
        notifications = utility_tray.notifications
        self.assertEqual(len(notifications), 2)
        self.assertEqual(notifications[0].title, 'Missed call')
        # Remove the first digit (country code) which is not displayed for AT&T/USA - Bug 1088756
        self.assertTrue(plivo_phone_number[1:] in notifications[0].content)
        self.assertEqual(notifications[1].title, 'Voicemail')

        notifications[0].tap_notification()

        self.marionette.switch_to_frame()
        system.open_utility_tray()
        notifications = utility_tray.notifications
        self.assertEqual(len(notifications), 1)
        self.assertEqual(notifications[0].title, 'Voicemail')
    def test_dialer_miss_call_from_known_contact_notification(self):
        """
        https://moztrap.mozilla.org/manage/case/9294/
        """
        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.environment.phone_numbers[0].replace("+", ""))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        self.plivo.hangup_call(self.call_uuid)
        self.plivo.wait_for_call_completed(self.call_uuid)
        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)
Example #15
0
    def test_dsds_receive_call_on_both_sims(self, sim_value, sim_name):
        """Make a phone call from Plivo to each SIM."""

        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.environment.phone_numbers[sim_value].replace(
                '+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.answer_call()
        self.plivo.wait_for_call_connected(self.call_uuid)
        Wait(self.marionette).until(
            lambda m: self.data_layer.active_telephony_state == 'connected')

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.hang_up()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
    def test_dialer_receive_call_with_contact_photo(self):
        """
        https://moztrap.mozilla.org/manage/case/1544/
        """
        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('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()
        self.assertIn('background-image:',
                      call_screen.contact_background_style)
    def test_set_up_conference_call(self):
        """Set up a conference between the remote phone and Plivo."""

        test_phone_number = self.testvars['remote_phone_number']
        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.is_in_conference_call = False
        self.is_in_regular_call = False

        phone = Phone(self.marionette)
        phone.launch()

        call_screen = phone.keypad.call_number(test_phone_number)
        call_screen.wait_for_outgoing_call()
        self.is_in_regular_call = True
        call_screen.wait_for_condition(lambda m: self.data_layer.active_telephony_state == 'connected')

        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_while_on_call()
        call_screen.answer_call_while_on_call()

        # Wait for Plivo to report the call as connected
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_connected(self.call_uuid),
            message='The call was not connected.')

        call_screen.merge_calls()
        self.is_in_regular_call = False
        self.is_in_conference_call = True
        self.assertEqual(call_screen.conference_label, 'Conference (2)')

        call_screen.hang_up()
        self.is_in_conference_call = False

        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
Example #18
0
 def tap_phone_number(self):
     call_button = self.marionette.find_element(
         *self._call_phone_number_button_locator)
     self.wait_for_condition(lambda m: call_button.is_enabled())
     call_button.tap()
     from gaiatest.apps.phone.regions.call_screen import CallScreen
     return CallScreen(self.marionette)
Example #19
0
 def tap_call_button(self, switch_to_call_screen=True):
     element = Wait(self.marionette).until(
         expected.element_present(*self._call_bar_locator))
     Wait(self.marionette).until(expected.element_enabled(element))
     element.tap()
     if switch_to_call_screen:
         return CallScreen(self.marionette)
    def test_dialer_receive_call_with_contact_photo(self):
        """
        https://moztrap.mozilla.org/manage/case/1544/
        """
        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('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()
        self.assertIn('background-image:', call_screen.contact_background_style)
Example #21
0
 def tap_phone_number(self):
     self.wait_for_element_displayed(
         *self._call_phone_number_button_locator)
     self.marionette.find_element(
         *self._call_phone_number_button_locator).tap()
     from gaiatest.apps.phone.regions.call_screen import CallScreen
     return CallScreen(self.marionette)
Example #22
0
 def tap_phone_number(self):
     call = self.marionette.find_element(
         *self._call_phone_number_button_locator)
     Wait(self.marionette).until(expected.element_enabled(call))
     call.tap()
     from gaiatest.apps.phone.regions.call_screen import CallScreen
     return CallScreen(self.marionette)
    def test_dsds_receive_call_on_both_sims(self, sim_value, sim_name):
        """Make a phone call from Plivo to each SIM."""

        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'][sim_value].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.answer_call()
        self.plivo.wait_for_call_connected(self.call_uuid)
        Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected')

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.hang_up()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
    def test_set_up_conference_call(self):
        """Set up a conference between the remote phone and Plivo."""

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

        phone = Phone(self.marionette)
        phone.launch()

        call_screen = phone.keypad.call_number(test_phone_number)
        call_screen.wait_for_outgoing_call()
        call_screen.wait_for_condition(lambda m: self.data_layer.active_telephony_state == 'connected')

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

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call_while_on_call()
        call_screen.answer_call_while_on_call()

        # Wait for Plivo to report the call as connected
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_connected(call_uuid),
            message='The call was not connected.')

        call_screen.merge_calls()
        self.assertEqual(call_screen.conference_label, 'Conference (2)')
    def test_dsds_receive_call_on_both_sims(self, sim_value, sim_name):
        """Make a phone call from Plivo to each SIM."""
        PLIVO_TIMEOUT = 30

        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'][sim_value].replace(
                '+', ''),
            timeout=PLIVO_TIMEOUT)

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.answer_call()

        # Wait for Plivo to report the call as connected
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_connected(self.call_uuid),
            message='The call was not connected.')

        # Wait for the state to be connected
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state == 'connected',
            timeout=30)

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.hang_up()

        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
Example #26
0
    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/
        """
        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.environment.phone_numbers[0].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        call_screen.reject_call()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None

        self.assertTrue(self.device.is_locked)
Example #27
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_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_dsds_receive_call_on_both_sims(self, sim_value, sim_name):
        """Make a phone call from Plivo to each SIM."""
        PLIVO_TIMEOUT = 30

        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'][sim_value].replace('+', ''),
            timeout=PLIVO_TIMEOUT)

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.answer_call()

        # Wait for Plivo to report the call as connected
        Wait(self.plivo, timeout=PLIVO_TIMEOUT).until(
            lambda p: p.is_call_connected(self.call_uuid),
            message='The call was not connected.')

        # Wait for the state to be connected
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state == 'connected',
            timeout=30)

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(sim_name in call_screen.incoming_via_sim)

        call_screen.hang_up()

        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
    def test_set_up_conference_call(self):
        """Set up a conference between the remote phone and Plivo."""

        test_phone_number = self.testvars['remote_phone_number']
        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.is_in_conference_call = False
        self.is_in_regular_call = False

        phone = Phone(self.marionette)
        phone.launch()

        call_screen = phone.keypad.call_number(test_phone_number)
        call_screen.wait_for_outgoing_call()
        self.is_in_regular_call = True
        Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected')

        self.call_uuid = self.plivo.make_call(
            to_number=self.environment.phone_numbers[0].replace('+', ''))
        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call_while_on_call()

        call_screen.answer_call_while_on_call()
        self.plivo.wait_for_call_connected(self.call_uuid)

        call_screen.merge_calls()
        self.is_in_regular_call = False
        self.is_in_conference_call = True
        self.assertEqual(call_screen.conference_label, 'Conference (2)')

        call_screen.hang_up()
        self.is_in_conference_call = False
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
    def test_receive_call(self):
        """Make a phone call from Plivo to the phone."""

        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('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        call_screen.answer_call()
        self.plivo.wait_for_call_connected(self.call_uuid)
        Wait(self.marionette).until(
            lambda m: self.data_layer.active_telephony_state == 'connected')

        call_screen.hang_up()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
Example #32
0
    def test_dsds_receive_call_on_both_sims(self, sim_number):
        """Make a phone call from Plivo to each SIM."""

        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.environment.phone_numbers[sim_number -
                                                     1].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()
        self.assertIn(str(sim_number), call_screen.via_sim)

        call_screen.answer_call()
        self.plivo.wait_for_call_connected(self.call_uuid)
        Wait(self.marionette).until(
            lambda m: self.data_layer.active_telephony_state == 'connected')
        self.assertIn(str(sim_number), call_screen.via_sim)

        call_screen.hang_up()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
    def test_receive_call(self):
        """Make a phone call from Plivo to the phone."""

        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('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()

        call_screen.answer_call()
        self.plivo.wait_for_call_connected(self.call_uuid)
        Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected')

        call_screen.hang_up()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
    def test_dsds_receive_call_on_both_sims(self, sim_number):
        """Make a phone call from Plivo to each SIM."""

        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.environment.phone_numbers[sim_number - 1].replace('+', ''))

        call_screen = CallScreen(self.marionette)
        call_screen.wait_for_incoming_call()
        self.assertIn(str(sim_number), call_screen.via_sim)

        call_screen.answer_call()
        self.plivo.wait_for_call_connected(self.call_uuid)
        Wait(self.marionette).until(lambda m: self.data_layer.active_telephony_state == 'connected')
        self.assertIn(str(sim_number), call_screen.via_sim)

        call_screen.hang_up()
        self.plivo.wait_for_call_completed(self.call_uuid)
        self.call_uuid = None
Example #35
0
File: app.py Project: txtdrive/gaia
 def call_screen(self):
     from gaiatest.apps.phone.regions.call_screen import CallScreen
     return CallScreen(self.marionette)
Example #36
0
 def tap_search_popup(self):
     self.marionette.find_element(*self._search_popup_locator).tap()
     return CallScreen(self.marionette)
Example #37
0
 def a11y_click_call_button(self, switch_to_call_screen=True):
     self.accessibility.click(self.marionette.find_element(*self._call_bar_locator))
     if switch_to_call_screen:
         return CallScreen(self.marionette)
Example #38
0
 def tap_call_button(self, switch_to_call_screen=True):
     self.marionette.find_element(*self._call_bar_locator).tap()
     if switch_to_call_screen:
         return CallScreen(self.marionette)
Example #39
0
 def tap_call_button(self):
     call_button = self.marionette.find_element(*self._call_bar_locator)
     self.marionette.tap(call_button)
     return CallScreen(self.marionette)