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")
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")
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))
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"]))
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))