예제 #1
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)
        _ = setup_translations(self)

        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.test_contact = MockContact()

        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 1)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.dialer.callLog_createContact(self.phone_number)

        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'],
                                  self.test_contact["givenName"])
        self.contacts.replace_str(contFields['familyName'],
                                  self.test_contact["familyName"])

        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button,
                                                    "'Done' button")
        done_button.tap()

        # Verify that the contacts app is closed and we are returned to the call log.
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(
            ("xpath", "//iframe[contains(@{}, '{}')]".format(
                DOM.Contacts.frame_locator[0], DOM.Contacts.frame_locator[1])),
            "Contacts frame")
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)

        header = ('xpath', DOM.GLOBAL.app_head_specific.format(_("Call log")))
        self.UTILS.element.waitForElements(header, "Call log header")

        # Verify that the call log now shows the contact name,
        x = self.UTILS.element.getElement(
            ("xpath", DOM.Dialer.call_log_number_xpath.format(
                self.phone_number)),
            "The call log for phone_number {}".format(self.phone_number))

        self.UTILS.test.test(
            self.test_contact["name"] in x.text,
            "Call log now shows '{}'.".format(self.test_contact["name"]))
예제 #2
0
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)

        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': "665666666"})

        # Generate an entry in the call log
        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(self.test_contact["tel"]["value"], 1)

        # Create contact with image
        self.UTILS.general.add_file_to_device('./tests/_resources/contact_face.jpg')
        self.dialer.callLog_createContact(self.test_contact["tel"]["value"])

        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'], self.test_contact["givenName"])
        self.contacts.replace_str(contFields['familyName'], self.test_contact["familyName"])

        self.contacts.add_gallery_image_to_contact(0)
        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
        done_button.tap()

        time.sleep(1)
        self.apps.kill_all()
        time.sleep(2)

    def tearDown(self):
        self.UTILS.general.remove_files()
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.dialer.launch()
        self.dialer.open_call_log()

        entry = self.UTILS.element.getElement(("xpath",
                                               DOM.Dialer.call_log_number_xpath.format(self.test_contact["tel"]["value"])),
                                              "The call log for number {}".format(self.test_contact["tel"]["value"]))
        entry.tap()

        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.UTILS.element.waitForElements(("xpath", DOM.Dialer.outgoing_call_numberXP.format(self.test_contact["name"])),
                                           "Outgoing call found with number matching {}".format(self.test_contact["name"]))
        time.sleep(2)
        self.dialer.hangUp()
예제 #3
0
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)
        _ = setup_translations(self)

        self.contact_1 = MockContact()
        self.phone_number = "0034" + self.UTILS.general.get_config_variable("target_call_number", "common")

        # Generate an entry in the call log
        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 1)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Open the call log and create a contact for our number.
        self.dialer.callLog_createContact(self.phone_number)

        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'], self.contact_1["givenName"])
        self.contacts.replace_str(contFields['familyName'], self.contact_1["familyName"])

        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
        done_button.tap()

        # Verify that the contacts app is closed and we are returned to the call log.
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@{}, '{}')]".
                                               format(DOM.Contacts.frame_locator[0], DOM.Contacts.frame_locator[1])),
                                              "Contacts frame")
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)

        header = ('xpath', DOM.GLOBAL.app_head_specific.format(_("Call log")))
        self.UTILS.element.waitForElements(header, "Call log header")

        # Verify that this contact has been created in contacts.
        self.apps.kill_all()
        self.contacts.launch()
        self.contacts.view_contact(self.contact_1["name"])
예제 #4
0
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)
        _ = setup_translations(self)

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.test_contact = MockContact()

        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 1)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.dialer.callLog_createContact(self.phone_number)

        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'], self.test_contact["givenName"])
        self.contacts.replace_str(contFields['familyName'], self.test_contact["familyName"])

        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
        done_button.tap()

        # Verify that the contacts app is closed and we are returned to the call log.
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@{}, '{}')]".
                                               format(DOM.Contacts.frame_locator[0], DOM.Contacts.frame_locator[1])),
                                              "Contacts frame")
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)

        header = ('xpath', DOM.GLOBAL.app_head_specific.format(_("Call log")))
        self.UTILS.element.waitForElements(header, "Call log header")

        # Verify that the call log now shows the contact name,
        x = self.UTILS.element.getElement(("xpath", DOM.Dialer.call_log_number_xpath.format(self.phone_number)),
                                          "The call log for phone_number {}".format(self.phone_number))

        self.UTILS.test.test(self.test_contact["name"] in x.text, "Call log now shows '{}'.".
                             format(self.test_contact["name"]))
예제 #5
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)

        self.test_contact = MockContact(tel={
            'type': 'Mobile',
            'value': "665666666"
        })

        # Generate an entry in the call log
        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(
            self.test_contact["tel"]["value"], 1)

        # Create contact with image
        self.UTILS.general.add_file_to_device(
            './tests/_resources/contact_face.jpg')
        self.dialer.callLog_createContact(self.test_contact["tel"]["value"])

        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'],
                                  self.test_contact["givenName"])
        self.contacts.replace_str(contFields['familyName'],
                                  self.test_contact["familyName"])

        self.contacts.add_gallery_image_to_contact(0)
        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button,
                                                    "'Done' button")
        done_button.tap()

        time.sleep(1)
        self.apps.kill_all()
        time.sleep(2)

    def tearDown(self):
        self.UTILS.general.remove_files()
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.dialer.launch()
        self.dialer.open_call_log()

        entry = self.UTILS.element.getElement(
            ("xpath",
             DOM.Dialer.call_log_number_xpath.format(
                 self.test_contact["tel"]["value"])),
            "The call log for number {}".format(
                self.test_contact["tel"]["value"]))
        entry.tap()

        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.UTILS.element.waitForElements(
            ("xpath",
             DOM.Dialer.outgoing_call_numberXP.format(
                 self.test_contact["name"])),
            "Outgoing call found with number matching {}".format(
                self.test_contact["name"]))
        time.sleep(2)
        self.dialer.hangUp()