Exemplo n.º 1
0
    def test_dialer_make_call(self):
        """https://moztrap.mozilla.org/manage/case/1298/"""

        test_phone_number = self.testvars['remote_phone_number']

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

        self.assertEqual('normal', self.data_layer.current_audio_channel)

        call_screen = phone.keypad.call_number(test_phone_number)

        # Wait for call screen to be dialing
        call_screen.wait_for_outgoing_call()
        self.assertEqual('telephony', self.data_layer.current_audio_channel)
        call_screen.switch_to_call_screen_frame()

        # Wait for the state to get to at least 'dialing'
        active_states = ('dialing', 'alerting', 'connecting', 'connected')
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state in active_states,
            timeout=30)

        if len(test_phone_number) <= 12:
            # Check the number displayed is the one we dialed
            self.assertEqual(test_phone_number,
                             call_screen.outgoing_calling_contact)
        else:
            self.assertEqual(test_phone_number[:2],
                             call_screen.outgoing_calling_contact[:2])
    def test_dialer_airplane_mode(self):
        # https://moztrap.mozilla.org/manage/case/2282/

        # Disable the device radio, enable Airplane mode
        self.data_layer.set_setting('ril.radio.disabled', True)

        # Check that we are in Airplane mode
        self.assertTrue(self.data_layer.get_setting('ril.radio.disabled'))

        # Launch the device dialer
        phone = Phone(self.marionette)
        phone.launch()

        # Make a call
        test_phone_number = self.testvars['remote_phone_number']
        phone.keypad.call_number(test_phone_number)

        # Check for the Airplane mode dialog
        phone.wait_for_confirmation_dialog()

        # Verify the correct dialog text for the case
        self.assertEqual("Airplane mode activated",
                         phone.confirmation_dialog_text)

        # Verify that there is no active telephony state; window.navigator.mozTelephony.active is null
        self.assertRaises(
            JavascriptException, self.marionette.execute_script,
            "return window.navigator.mozTelephony.active.state;")
Exemplo n.º 3
0
    def setUp(self):

        GaiaTestCase.setUp(self)

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

        current_time = repr(time.time()).replace('.', '')
        self.phone_number_1 = '555%s' % current_time[-7:]
        self.phone_number_2 = '444%s' % current_time[-7:]

        self.yesterday_date = date.fromordinal(date.today().toordinal() - 1)
        self.past_date_1 = date(2014, 12, 01)
        self.past_date_2 = date(2013, 12, 01)

        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_1))
        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_2))

        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_1,
                     date=self.yesterday_date))

        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_1, date=self.past_date_1))
        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_2, date=self.past_date_1))
        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_2, date=self.past_date_1))

        self.data_layer.insert_call_entry(
            MockCall(phone_number=self.phone_number_1, date=self.past_date_2))
Exemplo n.º 4
0
    def test_dialer_make_call(self):
        """https://moztrap.mozilla.org/manage/case/1298/"""

        test_phone_number = self.testvars['remote_phone_number']

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

        # FIXME: Bug 1011000: will need to switch it on
        # Assert that the channel has been switched to telephony
        # channel_change_call = self.data_layer.wait_for_audio_channel_changed()

        call_screen = phone.keypad.call_number(test_phone_number)

        # Wait for call screen to be dialing
        call_screen.wait_for_outgoing_call()

        # FIXME: Bug 1011000: will need to switch it on
        # Assert that the channel has been switched back to normal
        # channel_change_hang = self.data_layer.wait_for_audio_channel_changed()

        # Wait for the state to get to at least 'dialing'
        active_states = ('dialing', 'alerting', 'connecting', 'connected')
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state in active_states,
            timeout=30)

        if len(test_phone_number) <= 12:
            # Check the number displayed is the one we dialed
            self.assertEqual(test_phone_number,
                             call_screen.outgoing_calling_contact)
        else:
            self.assertEqual(test_phone_number[:2],
                             call_screen.outgoing_calling_contact[:2])
Exemplo n.º 5
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.contact = MockContact()

        # launch the Phone app
        self.phone = Phone(self.marionette)
        self.phone.launch()
Exemplo n.º 6
0
    def setUp(self):

        GaiaTestCase.setUp(self)

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

        self.data_layer.insert_call_entry(MockCall())
        self.data_layer.insert_call_entry(MockCall(call_type='dialing'))
Exemplo n.º 7
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # delete any existing call log entries - call log needs to be loaded
        self.phone = Phone(self.marionette)
        self.phone.launch()
        self.phone.tap_call_log_toolbar_button()
        self.data_layer.delete_all_call_log_entries()
        # switch back to keypad for the test
        self.phone.tap_keypad_toolbar_button()
Exemplo n.º 8
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.test_phone_number = self.testvars['remote_phone_number']

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

        mock_call = MockCall(self.test_phone_number, 'dialing')
        self.data_layer.insert_call_entry(mock_call)
Exemplo n.º 9
0
    def test_MMI_code_IMEI(self):

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

        # Dial the code
        phone.keypad.phone_number = IMEI_CODE

        attention_screen = AttentionScreen(self.marionette)
        self.assertEqual(attention_screen.message, self.testvars['imei'])
Exemplo n.º 10
0
    def setUp(self):
        GaiaTestCase.setUp(self)
        # Seed the contact with the remote phone number so we don't call random people
        self.contact = MockContact(tel={
            'type': 'Mobile',
            'value': "%s" % self.testvars['remote_phone_number']})
        self.data_layer.insert_contact(self.contact)

        # launch the Phone app
        self.phone = Phone(self.marionette)
        self.phone.launch()
Exemplo n.º 11
0
    def setUp(self):

        try:
            self.testvars['plivo']
        except KeyError:
            raise SkipTest('Plivo account details not present in test variables')

        GaiaTestCase.setUp(self)

        # delete any existing call log entries - call log needs to be loaded
        self.phone = Phone(self.marionette)
        self.phone.launch()
Exemplo n.º 12
0
    def test_MMI_code_IMEI(self):

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

        # Dial the code
        phone.keypad.dial_phone_number(IMEI_CODE)

        attention_screen = AttentionScreen(self.marionette)

        # Go through all expected IMEIs and check they are in the message
        for imei in self.testvars['imei']:
            self.assertIn(imei, attention_screen.message)
    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
    def test_dialer_dsds_make_phone_call_with_default_sim(self, default_sim):
        """
        Place a phone call with the default SIM.
        """
        self.data_layer.set_setting('ril.telephony.defaultServiceId',
                                    default_sim - 1)
        remote_phone_number = self.testvars['remote_phone_number']

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

        call_screen = phone.keypad.call_number(remote_phone_number)
        call_screen.wait_for_outgoing_call()

        self.assertIn(str(default_sim), call_screen.via_sim)
        call_screen.hang_up()
    def test_dialer_dsds_make_phone_call_with_default_sim(self, default_sim_value, default_sim_name):
        """
        Place a phone call with the default SIM.
        """
        self.data_layer.set_setting('ril.telephony.defaultServiceId', default_sim_value)
        remote_phone_number = self.testvars['remote_phone_number']

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

        call_screen = phone.keypad.call_number(remote_phone_number)
        call_screen.wait_for_outgoing_call()

        # TODO Replace the following line by a check on the l10n ID
        # once bug 1104667 lands
        self.assertTrue(default_sim_name in call_screen.via_sim)
        call_screen.hang_up()
Exemplo n.º 16
0
    def test_dialer_make_call(self):
        # https://moztrap.mozilla.org/manage/case/1298/

        test_phone_number = self.testvars['remote_phone_number']

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

        call_screen = phone.keypad.call_number(test_phone_number)

        # Wait for call screen to be dialing
        call_screen.wait_for_outgoing_call()

        # Wait for the state to get to 'dialing' which means dialer app has initiated telephony
        call_screen.wait_for_condition(
            lambda m: self.data_layer.active_telephony_state == "dialing",
            timeout=30)

        # Check the number displayed is the one we dialed
        self.assertEqual(test_phone_number,
                         call_screen.outgoing_calling_contact)
Exemplo n.º 17
0
    def test_duplicate_phone_number(self):
        self.phone = Phone(self.marionette)
        self.phone.launch()

        number_to_add = self.contact2['tel']['value']
        self.phone.keypad.dial_phone_number(number_to_add)

        add_number = self.phone.keypad.tap_add_contact()
        contacts_app = add_number.tap_add_to_existing_contact()
        contacts_app.wait_for_contacts(2)
    
        edit_contact = contacts_app.contacts[0].tap(return_class='EditContact')
        duplicate_contact_found = edit_contact.tap_update(return_class='Merge')
        merge_contact = duplicate_contact_found.tap_on_merge()

        self.device.touch_home_button()

        contacts = Contacts(self.marionette)
        contacts.launch()
        contacts.wait_for_contacts(1)

        self.assertEqual(contacts_app.contacts[0].name, self.contact['givenName'])
Exemplo n.º 18
0
    def launch_app(self):
        phone = Phone(self.device.marionette)
        phone.launch()
        phone.tap_call_log_toolbar_button()

        time.sleep(30)  # FIXME: wait for call log loading modal to be gone
        self.log('Done waiting for call log loading modal to be gone')

        call_log_container = self.device.marionette.find_element(
            'id', 'call-log-container')
        call_log_location = call_log_container.location
        call_log_swipe_padding = 8

        scroll_x1 = call_log_location[
            'x'] + call_log_container.size['width'] / 2
        scroll_y1 = call_log_location['y'] + (
            call_log_container.size['height'] - call_log_swipe_padding)
        scroll_y2 = call_log_location['y'] + call_log_swipe_padding

        self.cmds = []

        for i in range(int(self.scrolldown_amount)):
            self.cmds.append(
                ['drag', scroll_x1, scroll_y1, scroll_x1, scroll_y2, 100, 10])
Exemplo n.º 19
0
 def setUp(self):
     # Start application in Phone App
     GaiaTestCase.setUp(self)
     self.phone = Phone(self.marionette)
     self.phone.launch()
Exemplo n.º 20
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        # delete any existing call log entries - call log needs to be loaded
        self.phone = Phone(self.marionette)
        self.phone.launch()
Exemplo n.º 21
0
 def setUp(self):
     GaiaTestCase.setUp(self)
     self.phone = Phone(self.marionette)
     self.phone.launch()
Exemplo n.º 22
0
    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)
        self.contact = MockContact()

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