コード例 #1
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

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

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

        self.dialer.createMultipleCallLogEntries(
            self.UTILS.general.get_config_variable("phone_number", "custom"),
            3)

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info",
                                       "Screenshot of multiple entries:",
                                       screenshot)

        self.dialer.callLog_clearSome([1, 2])
        time.sleep(5)

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info",
                                       "Screenshot of some entries removed:",
                                       screenshot)
コード例 #2
0
ファイル: test_27021.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):
        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.phone_number2 = self.UTILS.general.get_config_variable("short_phone_number", "custom")

        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number2})
        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):
        # Open the call log and add to our contact.
        self.dialer.callLog_addToContact(self.phone_number, self.test_contact["name"])

        # Verify that this contact has been modified in contacts.
        self.contacts.launch()
        self.contacts.view_contact(self.test_contact["name"])

        self.UTILS.element.waitForElements(("xpath", DOM.Contacts.view_contact_tels_xpath.format(self.phone_number)),
                                           "Telephone number {} in contact".format(self.phone_number))
コード例 #3
0
ファイル: test_26820.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

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

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

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

        self.dialer.createMultipleCallLogEntries(self.UTILS.general.get_config_variable("phone_number", "custom"), 3)

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot of multiple entries:", screenshot)

        self.dialer.callLog_clearSome([1, 2])
        time.sleep(5)

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot of some entries removed:", screenshot)
コード例 #4
0
ファイル: test_27014.py プロジェクト: owdqa/owd_test_cases
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.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):
        # Open the call log and add to our contact, cancelling the process
        self.dialer.callLog_addToContact(self.phone_number, self.test_contact["name"], cancel_process=True)

        # Check we're back in the call log.
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)
        call_info_header = self.UTILS.element.getElement(DOM.Dialer.call_info_title, "Call info header")
        self.UTILS.test.test(call_info_header.text == self.phone_number, "We are back to call info screen")
コード例 #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)
        _ = setup_translations(self)

        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.test_contact = MockContact()
        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):
        # Open the call log and add to our contact, cancelling the process
        self.dialer.callLog_addToContact(self.phone_number,
                                         self.test_contact["name"],
                                         cancel_process=True)

        # Check we're back in the call log.
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)
        call_info_header = self.UTILS.element.getElement(
            DOM.Dialer.call_info_title, "Call info header")
        self.UTILS.test.test(call_info_header.text == self.phone_number,
                             "We are back to call info screen")
コード例 #6
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")
コード例 #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)

        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)
コード例 #8
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"]))
コード例 #9
0
ファイル: test_26788.py プロジェクト: owdqa/owd_test_cases
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()
コード例 #10
0
ファイル: test_26838.py プロジェクト: owdqa/owd_test_cases
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 (...)")
コード例 #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)

        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)
コード例 #12
0
ファイル: test_28538.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.dialer = Dialer(self)

        # Get details of our test contacts.

        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 for this contact
        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):
        kepad_option = self.UTILS.element.getElement(
            DOM.Dialer.option_bar_keypad, "Keypad Option")
        kepad_option.tap()

        call_btn = self.UTILS.element.getElement(DOM.Dialer.call_number_button,
                                                 "Call button")
        call_btn.tap()

        # Make sure that after tapping, we get the last outgoing call in the call log
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number,
                                                    "Phone number field",
                                                    False)
        dialer_num = phone_field.get_attribute("value")

        self.UTILS.test.test(
            self.test_contact["tel"]["value"] in dialer_num,
            "After calling '{}', and tapping call button, phone number field contains '{}'."
            .format(self.test_contact["tel"]["value"], dialer_num))

        y = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult(
            "info", "Screen shot of the result of tapping call button", y)
コード例 #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)
        _ = 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"])
コード例 #14
0
ファイル: test_27029.py プロジェクト: owdqa/owd_test_cases
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"]))
コード例 #15
0
ファイル: test_26819.py プロジェクト: owdqa/owd_test_cases
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(
            "phone_number", "custom")

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

    def test_run(self):
        self.dialer.launch()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 4)
        self.dialer.callLog_clearAll()
コード例 #16
0
ファイル: test_26819.py プロジェクト: owdqa/owd_test_cases
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("phone_number", "custom")

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

    def test_run(self):
        self.dialer.launch()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 4)
        self.dialer.callLog_clearAll()
コード例 #17
0
ファイル: test_26817.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #18
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)
コード例 #19
0
ファイル: test_26835.py プロジェクト: owdqa/owd_test_cases
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")
コード例 #20
0
ファイル: test_27030.py プロジェクト: owdqa/owd_test_cases
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.UTILS.general.insertContact(self.test_contact)

        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_addToContact(self.phone_number, self.test_contact["name"])

        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)

        # Re-open the call log and Verify that it now shows the contact name,
        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")

        x = self.UTILS.element.getElement(("xpath", DOM.Dialer.call_log_number_xpath.format(self.phone_number)),
                                          "The call log for 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"]))
コード例 #21
0
ファイル: test_27023.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #22
0
ファイル: test_28538.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.dialer = Dialer(self)

        # Get details of our test contacts.

        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 for this contact
        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):
        kepad_option = self.UTILS.element.getElement(DOM.Dialer.option_bar_keypad, "Keypad Option")
        kepad_option.tap()

        call_btn = self.UTILS.element.getElement(DOM.Dialer.call_number_button, "Call button")
        call_btn.tap()

        # Make sure that after tapping, we get the last outgoing call in the call log
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field", False)
        dialer_num = phone_field.get_attribute("value")

        self.UTILS.test.test(self.test_contact["tel"]["value"] in dialer_num,
                             "After calling '{}', and tapping call button, phone number field contains '{}'.".
                             format(self.test_contact["tel"]["value"], dialer_num))

        y = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screen shot of the result of tapping call button", y)
コード例 #23
0
ファイル: test_27016.py プロジェクト: owdqa/owd_test_cases
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.phone_number_short = self.UTILS.general.get_config_variable("short_phone_number", "custom")

        # Remove the phone number from the contact and insert it.
        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_short, 1)

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

    def test_run(self):

        # Open the call log and add to our contact.
        self.dialer.callLog_addToContact(self.phone_number_short, self.test_contact["name"])

        # Verify that this number was added to the contact.
        self.apps.kill_all()
        time.sleep(2)
    
        self.contacts.launch()
        self.contacts.view_contact(self.test_contact["name"])

        self.UTILS.element.waitForElements(("xpath", DOM.Contacts.view_contact_tels_xpath.format(self.phone_number_short)),
                                    "New phone number {} in this contact".format(self.phone_number_short))
コード例 #24
0
ファイル: test_27022.py プロジェクト: owdqa/owd_test_cases
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()
コード例 #25
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 (...)")
コード例 #26
0
ファイル: test_26788.py プロジェクト: owdqa/owd_test_cases
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()