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

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

        # Fill the call log with some entries
        self.dialer.launch()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 1)
        self.data_layer.set_setting("airplaneMode.enabled", True)
        self.wait_for_condition(
            lambda m: self.data_layer.get_setting("airplaneMode.enabled"),
            timeout=30,
            message="No airplane mode enabled")

    def tearDown(self):
        self.data_layer.set_setting("airplaneMode.enabled", False)
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

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

        elem = ("xpath",
                DOM.Dialer.call_log_number_xpath.format(self.phone_number))
        entry = self.UTILS.element.getElement(
            elem, "The call log for number {}".format(self.phone_number))
        entry.tap()

        warning_header = (DOM.GLOBAL.confirmation_msg_header[0],
                          DOM.GLOBAL.confirmation_msg_header[1].format(
                              _("Airplane mode activated")))

        _content = _(
            "To make a call you need to disable airplane mode in settings.")
        warning_content = (
            DOM.GLOBAL.confirmation_msg_content[0],
            DOM.GLOBAL.confirmation_msg_content[1].format(_content))

        self.UTILS.element.getElement(warning_header,
                                      "Airplane mode warning [header]")
        self.UTILS.element.getElement(warning_content,
                                      "Airplane mode warning [content]")

        ok_btn = self.UTILS.element.getElement(
            DOM.GLOBAL.confirmation_msg_ok_btn, "OK button")
        ok_btn.tap()

        self.UTILS.element.waitForElements(DOM.Dialer.call_log_filter,
                                           "Call log filter")
Beispiel #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)

        num = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': num})

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

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

        self.dialer.createMultipleCallLogEntries(
            self.test_contact["tel"]["value"], 1)
        self.dialer.open_call_log()

        _number_el = DOM.Dialer.call_log_number_xpath.format(
            self.test_contact["tel"]["value"])
        elem = ('xpath', _number_el)
        self.UTILS.element.waitForElements(
            elem, "The number {} in the call log".format(
                self.test_contact["tel"]["value"]))
        self.UTILS.element.waitForNotElements(
            ("xpath", "{}//*[text()='{}']".format(_number_el,
                                                  self.test_contact["name"])),
            "The name {} in the call log".format(self.test_contact["name"]))

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult(
            "info",
            "Call log <i>before</i> adding contact details for this number:",
            screenshot)

        self.contacts.launch()
        self.contacts.create_contact(self.test_contact)

        self.dialer.launch()
        self.dialer.open_call_log()

        self.UTILS.element.waitForElements(
            ("xpath",
             DOM.Dialer.call_log_name_xpath.format(self.test_contact["name"])),
            "The name {} in the call log".format(self.test_contact["name"]))
        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult(
            "info",
            "Call log <i>after</i> adding contact details for this number:", x)
Beispiel #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.test_num = ["666666666666", "555555555555"]
        self.test_contacts = [MockContact(tel={'type': 'Mobile',
                                                'value': self.test_num[i]}) for i in range(2)]

        self.test_contacts[0]["givenName"] = "LongGivennamexxxxxxxxxxx"
        self.test_contacts[1]["familyName"] = "LongFamilynamexxxxxxxxxxx"
        """
        This has to be done due to a MockContact malfunction. It does not
        update the name field to the specified values of givenName and familyName
        """

        for c in self.test_contacts:
            c["name"] = c["givenName"] + " " + c["familyName"]

        map(self.UTILS.general.insertContact, self.test_contacts)

        self.dialer.launch()
        self.dialer.callLog_clearAll()

        for contact in self.test_contacts:
            self.dialer.createMultipleCallLogEntries(contact["tel"]["value"], 2)
        self.dialer.open_call_log()

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

    def test_run(self):

        entries = self.UTILS.element.getElements(DOM.Dialer.call_log_numbers, "Call log entries", False)
        self.UTILS.reporting.logResult("info", "{} entries found.".format(len(entries)))

        for entry in entries:
            item = entry.find_element("xpath", "//span[@class='primary-info-main']")

            value = self.UTILS.element.get_css_value(item, "text-overflow")

            isEllipsis = self.UTILS.element.is_ellipsis_active(item)

            self.UTILS.reporting.logResult("info", "Value of css property: {}".format(value))
            self.UTILS.reporting.logResult("info", "isEllipsisActive? {}".format(isEllipsis))
            self.UTILS.test.test(
                value == "ellipsis" and isEllipsis, "Long entry in call log displays the ellipsis (...)")
Beispiel #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)

        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()
Beispiel #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.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.test_contact = MockContact(tel={
            'type': 'Mobile',
            'value': self.phone_number
        })

        self.UTILS.general.insertContact(self.test_contact)

        # 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):
        self.dialer.open_call_log()

        self.dialer.callLog_long_tap(self.test_contact["tel"]["value"])
        call_info = self.UTILS.element.getElement(
            DOM.Dialer.call_log_numtap_call_info, "Call information button")
        call_info.tap()

        call_info_header = self.UTILS.element.getElement(
            DOM.Dialer.call_info_title, "Call info title")
        self.UTILS.test.test(
            call_info_header.text == self.test_contact['name'],
            'Header title matches with contact')

        go_to_contact_details_button = self.UTILS.element.getElement(
            DOM.Dialer.call_info_contact_go_to_contact_details,
            "Go to contact detail")

        self.UTILS.element.waitForElements(("xpath", "//button[contains(@class,'remark') and @data-tel='{}']".\
                                            format(self.test_contact["tel"]["value"])), "Highlighted number")

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Final screenshot:", screenshot)
Beispiel #6
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)

        num = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': num})

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

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

        self.dialer.createMultipleCallLogEntries(self.test_contact["tel"]["value"], 1)
        self.dialer.open_call_log()

        _number_el = DOM.Dialer.call_log_number_xpath.format(self.test_contact["tel"]["value"])
        elem = ('xpath', _number_el)
        self.UTILS.element.waitForElements(elem,
                                           "The number {} in the call log".format(self.test_contact["tel"]["value"]))
        self.UTILS.element.waitForNotElements(("xpath", "{}//*[text()='{}']".
                                               format(_number_el, self.test_contact["name"])),
                                              "The name {} in the call log".format(self.test_contact["name"]))

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult(
            "info", "Call log <i>before</i> adding contact details for this number:", screenshot)

        self.contacts.launch()
        self.contacts.create_contact(self.test_contact)

        self.dialer.launch()
        self.dialer.open_call_log()

        self.UTILS.element.waitForElements(("xpath", DOM.Dialer.call_log_name_xpath.format(self.test_contact["name"])),
                                           "The name {} in the call log".format(self.test_contact["name"]))
        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Call log <i>after</i> adding contact details for this number:", x)
Beispiel #7
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.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")

        # Create a call log entry
        self.dialer.launch()
        self.dialer.callLog_clearAll()

        self.dialer.createMultipleCallLogEntries(self.phone_number, 2)

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

    def test_run(self):

        # Open the call log and select Add to Contact.
        self.dialer.open_call_log()

        edit_btn = self.UTILS.element.getElement(DOM.Dialer.call_log_edit_btn,
                                                 "Edit button")
        edit_btn.tap()

        # Now tap the number and verify that we're not taken to the menu,
        entry = self.UTILS.element.getElement(
            ("xpath", DOM.Dialer.call_log_number_xpath.format(
                self.phone_number)),
            "The call log for number {}".format(self.phone_number))
        entry.tap()

        self.UTILS.reporting.logResult(
            "info", "Checking that the call to [{}] is not set up".format(
                self.phone_number))
        self.apps.switch_to_displayed_app()
        self.UTILS.element.waitForNotElements(DOM.Dialer.hangup_bar_locator,
                                              "Not calling in edit mode",
                                              timeout=10)
Beispiel #8
0
class test_main(GaiaTestCase):

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

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

        # Fill the call log with some entries
        self.dialer.launch()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 1)
        self.data_layer.set_setting("airplaneMode.enabled", True)
        self.wait_for_condition(lambda m: self.data_layer.get_setting("airplaneMode.enabled"),
                                timeout=30, message="No airplane mode enabled")

    def tearDown(self):
        self.data_layer.set_setting("airplaneMode.enabled", False)
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

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

        elem = ("xpath", DOM.Dialer.call_log_number_xpath.format(self.phone_number))
        entry = self.UTILS.element.getElement(elem, "The call log for number {}".format(self.phone_number))
        entry.tap()

        warning_header = (DOM.GLOBAL.confirmation_msg_header[0],
                            DOM.GLOBAL.confirmation_msg_header[1].format(_("Airplane mode activated")))

        _content = _("To make a call you need to disable airplane mode in settings.")
        warning_content = (DOM.GLOBAL.confirmation_msg_content[0],
                            DOM.GLOBAL.confirmation_msg_content[1].format(_content))

        self.UTILS.element.getElement(warning_header, "Airplane mode warning [header]")
        self.UTILS.element.getElement(warning_content, "Airplane mode warning [content]")
    
        ok_btn = self.UTILS.element.getElement(DOM.GLOBAL.confirmation_msg_ok_btn, "OK button")
        ok_btn.tap()

        self.UTILS.element.waitForElements(DOM.Dialer.call_log_filter, "Call log filter")
Beispiel #9
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.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number})

        self.UTILS.general.insertContact(self.test_contact)

        # 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):
        self.dialer.open_call_log()

        self.dialer.callLog_long_tap(self.test_contact["tel"]["value"])
        call_info = self.UTILS.element.getElement(DOM.Dialer.call_log_numtap_call_info, "Call information button")
        call_info.tap()

        call_info_header = self.UTILS.element.getElement(DOM.Dialer.call_info_title, "Call info title")
        self.UTILS.test.test(call_info_header.text == self.test_contact['name'], 'Header title matches with contact')

        go_to_contact_details_button = self.UTILS.element.getElement(DOM.Dialer.call_info_contact_go_to_contact_details, "Go to contact detail")

        self.UTILS.element.waitForElements(("xpath", "//button[contains(@class,'remark') and @data-tel='{}']".\
                                            format(self.test_contact["tel"]["value"])), "Highlighted number")

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Final screenshot:", screenshot)
Beispiel #10
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)

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

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

        self.dialer.open_call_log()

        x = self.UTILS.element.getElement(DOM.Dialer.call_log_edit_btn, "Edit button", False)
        #Try with attribute aria-disabled
        self.UTILS.test.test(x.get_attribute("aria-disabled"), "The edit button is disabled.") 
Beispiel #11
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)

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

    def test_run(self):

        # Enter a number in the dialer.
        self.dialer.launch()

        self.dialer.open_call_log()

        time.sleep(2)
        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot of call log:", x)
Beispiel #12
0
class test_main(GaiaTestCase):

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

        self.phone_number = self.UTILS.general.get_config_variable("target_call_number", "common")
        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 tap on the phone_number.
        self.dialer.open_call_log()
        self.dialer.callLog_call(self.phone_number)
        time.sleep(3)
        self.dialer.hangUp()
Beispiel #13
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)

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

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

        self.dialer.open_call_log()

        x = self.UTILS.element.getElement(DOM.Dialer.call_log_edit_btn,
                                          "Edit button", False)
        #Try with attribute aria-disabled
        self.UTILS.test.test(x.get_attribute("aria-disabled"),
                             "The edit button is disabled.")
Beispiel #14
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()
Beispiel #15
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

        self.test_num = ["666666666666", "555555555555"]
        self.test_contacts = [
            MockContact(tel={
                'type': 'Mobile',
                'value': self.test_num[i]
            }) for i in range(2)
        ]

        self.test_contacts[0]["givenName"] = "LongGivennamexxxxxxxxxxx"
        self.test_contacts[1]["familyName"] = "LongFamilynamexxxxxxxxxxx"
        """
        This has to be done due to a MockContact malfunction. It does not
        update the name field to the specified values of givenName and familyName
        """

        for c in self.test_contacts:
            c["name"] = c["givenName"] + " " + c["familyName"]

        map(self.UTILS.general.insertContact, self.test_contacts)

        self.dialer.launch()
        self.dialer.callLog_clearAll()

        for contact in self.test_contacts:
            self.dialer.createMultipleCallLogEntries(contact["tel"]["value"],
                                                     2)
        self.dialer.open_call_log()

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

    def test_run(self):

        entries = self.UTILS.element.getElements(DOM.Dialer.call_log_numbers,
                                                 "Call log entries", False)
        self.UTILS.reporting.logResult(
            "info", "{} entries found.".format(len(entries)))

        for entry in entries:
            item = entry.find_element("xpath",
                                      "//span[@class='primary-info-main']")

            value = self.UTILS.element.get_css_value(item, "text-overflow")

            isEllipsis = self.UTILS.element.is_ellipsis_active(item)

            self.UTILS.reporting.logResult(
                "info", "Value of css property: {}".format(value))
            self.UTILS.reporting.logResult(
                "info", "isEllipsisActive? {}".format(isEllipsis))
            self.UTILS.test.test(
                value == "ellipsis" and isEllipsis,
                "Long entry in call log displays the ellipsis (...)")