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('airplaneMode.enabled', True)

        # Check that we are in Airplane mode
        self.assertTrue(self.data_layer.get_setting('airplaneMode.enabled'))

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

        # Make a call
        test_phone_number = self.testvars['remote_phone_number']
        phone.keypad.dial_phone_number(test_phone_number)
        phone.keypad.tap_call_button(switch_to_call_screen=False)

        # 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
class TestDuplicatePhoneNumber(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        
        self.contact = MockContact(givenName='Test', tel=None)
        self.contact2 = MockContact(givenName=self.contact['givenName'], tel={
            'type': 'Mobile',
            'value': '123456789'})
        self.data_layer.insert_contact(self.contact)
        self.data_layer.insert_contact(self.contact2)

    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'])
    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)')
Exemplo n.º 5
0
class TestAccessibilityPhoneKeypad(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.contact = MockContact()

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

    def test_phone_keypad(self):

        # Delete is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone.keypad._keypad_delete_locator)))
        # Add contact button is disabled for the screen reader.
        self.assertTrue(self.accessibility.is_disabled(self.marionette.find_element(
            *self.phone.keypad._add_new_contact_button_locator)))

        number_to_verify = self.contact['tel']['value']

        # Screen reader dial number
        self.phone.keypad.a11y_dial_phone_number(number_to_verify)

        # Check that the number was entered correctly.
        self.assertEqual(self.phone.keypad.phone_number, number_to_verify)
        # Delete is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone.keypad._keypad_delete_locator)))
        # Call button is enabled for the screen reader.
        self.assertFalse(self.accessibility.is_disabled(self.marionette.find_element(
            *self.phone.keypad._call_bar_locator)))
        # Add contact button is enabled for the screen reader.
        self.assertFalse(self.accessibility.is_disabled(self.marionette.find_element(
            *self.phone.keypad._add_new_contact_button_locator)))
Exemplo n.º 6
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])
    def test_dialer_make_call(self):
        """https://moztrap.mozilla.org/manage/case/1298/"""

        test_phone_number = '0956820097'
        phone = Phone(self.marionette)
        phone.launch()

        call_screen = phone.keypad.call_number(test_phone_number)
Exemplo n.º 8
0
    def __init__(self, marionette):
        Phone.__init__(self, marionette)

        self.marionette.switch_to_frame()

        self.wait_for_element_present(*self._call_screen_locator, timeout=30)

        call_screen = self.marionette.find_element(*self._call_screen_locator)
        self.marionette.switch_to_frame(call_screen)
Exemplo n.º 9
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)
        self.assertEqual(attention_screen.message, self.testvars['imei'])
Exemplo n.º 10
0
class TestDialerFindContact(GaiaTestCase):

    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()

    def test_dialer_find_contact(self):

        number_to_verify = self.contact['tel']['value']

        # Dial number
        self.phone.keypad.dial_phone_number(number_to_verify[:5])

        # Assert search popup is displayed
        self.phone.keypad.wait_for_search_popup_visible()

        # Assert name and phone number are the ones in the saved contact
        self.assertEqual(self.phone.keypad.suggested_name, self.contact['name'])
        self.assertEqual(self.phone.keypad.suggested_phone_number, number_to_verify)

        # Tap search popup suggestion
        call_screen = self.phone.keypad.tap_search_popup()

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

        # 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(number_to_verify) <= 12:
            # Check the number displayed is the one we dialed
            self.assertEqual(number_to_verify, call_screen.calling_contact_information.split(', ')[1])
        else:
            self.assertEqual(number_to_verify[:2], call_screen.calling_contact_information.split(', ')[1][:2])

    def tearDown(self):
        # Switch back to main frame before Marionette loses track bug #840931
        self.marionette.switch_to_frame()

        # In case the assertion fails this will still kill the call
        # An open call creates problems for future tests
        self.data_layer.kill_active_call()

        GaiaTestCase.tearDown(self)
Exemplo n.º 11
0
    def test_clear_phone_number(self):
        """
        https://moztrap.mozilla.org/manage/case/2191/
        """
        test_phone_number = '5551234567'

        phone = Phone(self.marionette)
        phone.launch()
        phone.keypad.dial_phone_number(test_phone_number)
        self.assertEquals(phone.keypad.phone_number, test_phone_number)
        phone.keypad.clear_phone_number()
        self.assertEquals(phone.keypad.phone_number, '')
Exemplo n.º 12
0
class TestDialerAddContact(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.contact = MockContact()

        # launch the Phone app
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_dialer_add_contact(self):

        number_to_verify = self.contact['tel'][0]['value']

        # Dial number
        self.phone.keypad.dial_phone_number(number_to_verify)

        # Assert that the number was entered correctly.
        self.assertEqual(self.phone.keypad.phone_number, number_to_verify)

        # Click Add contact button
        add_new_number = self.phone.keypad.tap_add_contact()

        # Tap on "Create New Contact"
        new_contact = add_new_number.tap_create_new_contact()

        # Enter data into fields
        new_contact.type_given_name(self.contact['givenName'][0])
        new_contact.type_family_name(self.contact['familyName'][0])

        # Click Done button
        new_contact.tap_done()

        # Switch back to keypad-view
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == self.phone.name)
        self.apps.switch_to_displayed_app()

        #Go to Contact list and Verify result
        contacts = self.phone.tap_contacts()

        # Check only one contact is created
        self.assertEqual(1, len(contacts.contacts))

        #  Tap on the new contact
        contact_details = contacts.contacts[0].tap()

        # Verify full name
        full_name = self.contact['givenName'][0] + " " + self.contact['familyName'][0]
        self.assertEqual(contact_details.full_name, full_name)

        # Verify phone number
        self.assertEqual(contact_details.phone_number, number_to_verify)
Exemplo n.º 13
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.environment.imei_numbers:
            self.assertIn(imei, attention_screen.message)
    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()
Exemplo n.º 15
0
class TestDialerAddContact(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.contact = MockContact()

        # launch the Phone app
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_dialer_add_contact(self):

        number_to_verify = self.contact['tel']['value']

        # Dial number
        self.phone.keypad.dial_phone_number(number_to_verify)

        # Assert that the number was entered correctly.
        self.assertEqual(self.phone.keypad.phone_number, number_to_verify)

        # Click Add contact button
        add_new_number = self.phone.keypad.tap_add_contact()

        # Tap on "Create New Contact"
        new_contact = add_new_number.tap_create_new_contact()

        # Enter data into fields
        new_contact.type_given_name(self.contact['givenName'])
        new_contact.type_family_name(self.contact['familyName'])

        # Click Done button, don't return Contacts because we return to Dialer
        new_contact.tap_done(return_contacts=False)

        #Go to Contact list and Verify result
        contacts = self.phone.tap_contacts()

        # Check only one contact is created
        contacts.wait_for_contacts(1)

        #  Tap on the new contact
        contact_details = contacts.contacts[0].tap()

        # Verify full name
        full_name = self.contact['givenName'] + " " + self.contact['familyName']
        self.assertEqual(contact_details.full_name, full_name)

        # Verify phone number
        self.assertEqual(contact_details.phone_number, number_to_verify)
Exemplo n.º 16
0
class TestRedialLastNumber(GaiaTestCase):

    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)

    def test_redial_last_number(self):
        """
        https://moztrap.mozilla.org/manage/case/9043/
        """
        keypad = self.phone.keypad

        # Check that there is no phone number displayed
        self.assertEqual('', keypad.phone_number)

        keypad.tap_call_button(False)
        keypad.wait_for_phone_number_ready()

        # Check that the last dialed number is displayed
        self.assertEqual(self.test_phone_number, keypad.phone_number)

        call_screen = keypad.tap_call_button()

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

        if len(self.test_phone_number) <= 12:
            # Check the number displayed is the one we dialed
            self.assertEqual(self.test_phone_number, call_screen.outgoing_calling_contact)
        else:
            self.assertEqual(self.test_phone_number[:2], call_screen.outgoing_calling_contact[:2])

    def tearDown(self):
        # Switch back to main frame before Marionette loses track bug #840931
        self.marionette.switch_to_frame()

        # In case the assertion fails this will still kill the call
        # An open call creates problems for future tests
        self.data_layer.kill_active_call()

        GaiaTestCase.tearDown(self)
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.contact = MockContact()

        # launch the Phone app
        self.phone = Phone(self.marionette)
        self.phone.launch()
Exemplo n.º 18
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))
    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.outgoing_via_sim)
        call_screen.hang_up()
Exemplo n.º 20
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()

        phone.keypad.call_number(test_phone_number)

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

        # Wait for the state to get to 'alerting' which means connection made
        phone.call_screen.wait_for_condition(lambda m: self.data_layer.active_telephony_state == "alerting", timeout=30)

        # Check the number displayed is the one we dialed
        self.assertEqual(test_phone_number, phone.call_screen.outgoing_calling_number)
Exemplo n.º 21
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.º 22
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.º 23
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.º 24
0
class TestPhoneSelectToolbars(GaiaImageCompareTestCase):

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_phone_select_toolbars(self):

        # Screen reader activated call log button click.
        self.phone.a11y_click_call_log_toolbar_button()

        # Keypad is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_locator)))
        # Contacts is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_toolbar_locator)))
        # Call log is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_locator)))

        self.take_screenshot()

        # Screen reader activated contacts button click.
        self.phone.a11y_click_contacts()
        self.apps.switch_to_displayed_app()

        # Keypad is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_locator)))
        # Contacts is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_toolbar_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_locator)))
        self.take_screenshot()

        # Screen reader activated keypad button click.
        self.phone.a11y_click_keypad_toolbar_button()

        # Keypad is visible to the screen reader.
        self.assertFalse(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_locator)))
        # Contacts is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_toolbar_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_locator)))
        self.take_screenshot()
class TestCallLogAllCalls(GaiaMtbfTestCase):

    def setUp(self):
        GaiaMtbfTestCase.setUp(self)

        # delete any existing call log entries - call log needs to be loaded
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_call_log_all_calls(self):
        """https://moztrap.mozilla.org/manage/case/1306/"""

        call_log = self.phone.tap_call_log_toolbar_button()
        self.wait_for_element_displayed("css selector", "div.view-body")
        current_calls_count = call_log.all_calls_count
        numbers = self.marionette.find_elements("css selector", "div.view-body article ol li:first-child")
        if len(numbers) > 0:
            verification_bit = 1
            if self.testvars['remote_phone_number'] in numbers[0].text:
                verification_bit = 0

        test_phone_number = self.testvars['remote_phone_number']

        self.phone.tap_keypad_toolbar_button()

        # 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()

        call_log = self.phone.tap_call_log_toolbar_button()
        call_log.tap_all_calls_tab()

        # Check that 'All calls' tab is selected
        self.assertTrue(call_log.is_all_calls_tab_selected)

        # Now check that one call appears in the call log
        self.wait_for_condition(lambda m: call_log.all_calls_count > 0)
        self.assertEqual(call_log.all_calls_count, current_calls_count+verification_bit)

        # Check that the call displayed is for the call we made
        self.assertIn(test_phone_number, call_log.first_all_call_text)

    def tearDown(self):

        # In case the assertion fails this will still kill the call
        # An open call creates problems for future tests
        self.data_layer.kill_active_call()

        GaiaMtbfTestCase.tearDown(self)
Exemplo n.º 26
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.º 27
0
class TestAccessibilityPhoneEditContact(GaiaTestCase):

    def setUp(self):
        # Start application in Phone App
        GaiaTestCase.setUp(self)
        self.phone = Phone(self.marionette)
        self.phone.launch()

    def test_a11y_phone_edit_contact(self):

        # Add a random contact
        contacts = self.phone.a11y_click_contacts()

        # Add new contact
        new_contact_form = contacts.a11y_click_new_contact()

        # Enter data into fields
        contact = MockContact()
        new_contact_form.type_given_name(contact['givenName'])

        # Save new contact
        new_contact_form.a11y_click_done()
        self.wait_for_condition(lambda m: len(contacts.contacts) == 1)

        # Edit the contact
        contact_item = contacts.contact(contact['givenName'])
        contact_item_detail = contact_item.a11y_click()
        contact_item_edit = contact_item_detail.a11y_click_edit()

        self.apps.switch_to_displayed_app()
        # Now check if toolbar is visible by Screen Reader

        # Keypad is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._keypad_toolbar_button_locator)))
        # Contacts is visible to the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._contacts_view_locator)))
        # Call log is hidden from the screen reader.
        self.assertTrue(self.accessibility.is_hidden(self.marionette.find_element(
            *self.phone._call_log_toolbar_button_locator)))
Exemplo n.º 28
0
class TestCallLogAllCalls(GaiaTestCase):

    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()

    def test_call_log_all_calls(self):
        """https://moztrap.mozilla.org/manage/case/1306/"""

        test_phone_number = self.testvars['remote_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()

        call_log = self.phone.tap_call_log_toolbar_button()

        call_log.tap_all_calls_tab()

        # Check that 'All calls' tab is selected
        self.assertTrue(call_log.is_all_calls_tab_selected)

        # Now check that one call appears in the call log
        self.assertEqual(call_log.all_calls_count, 1)

        # Check that the call displayed is for the call we made
        self.assertIn(test_phone_number, call_log.first_all_call_text)

    def tearDown(self):

        # In case the assertion fails this will still kill the call
        # An open call creates problems for future tests
        self.data_layer.kill_active_call()

        GaiaTestCase.tearDown(self)
Exemplo n.º 29
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.º 30
0
    def launch_app(self):
        phone = Phone(self.device.marionette)
        phone.launch()
        phone.tap_call_log_toolbar_button()

        time.sleep(30)  # FIXME: actually 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])