class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) # Prepare the contact we're going to insert. self.contact = MockContact(givenName="Name", familyName="Surname", name="Name Surname") self.UTILS.general.insertContact(self.contact) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addContactToField(self.contact["name"]) self.UTILS.reporting.logResult("info", "Correct name is in the 'To' list.")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) # Import contact (adjust to the correct number). self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom") self.contact1 = MockContact(givenName="Name 1", familyName="Surname 1", name="Name 1 Surname 1", tel={"type": "Mobile", "value": self.test_num}) self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"]) self.UTILS.general.insertContact(self.contact1) self.call_number = self.UTILS.general.get_config_variable("incoming_call_number", "common") self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() _ = setup_translations(self) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addContactToField(self.contact1["name"]) # Insert the phone number in the To field self.messages.addNumbersInToField([self.call_number]) search_str = _("2 recipients") self.UTILS.element.headerCheck(search_str) # Enter the message. self.UTILS.reporting.logResult("info", "Enter the message.") self.messages.enterSMSMsg("Test 29911") # Send the message. self.messages.sendSMS() self.UTILS.statusbar.wait_for_notification_toaster_title(self.contact1["name"]) self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator) # Verify the number is shown in the header as there is no contact name self.messages.openThread(self.call_number) self.messages.checkThreadHeader(self.call_number) self.UTILS.reporting.logResult("info", "Verify the number is shown in the header as there is no contact name") # Return to main SMS page. self.messages.closeThread() # Verify the thread now contains the name of the contact instead of the phone number self.UTILS.reporting.logResult("info", "Trying to open the thread with name: " + self.contact1["name"]) self.messages.openThread(self.contact1["name"]) self.messages.checkThreadHeaderWithNameSurname(self.contact1["name"])
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) # Prepare the contact we're going to insert. self.contacts = [] for i in range(3): given_name = "Name {}".format(i) family_name = "Surname {}".format(i) contact = MockContact(givenName=given_name, familyName=family_name, name="{} {}".format(given_name, family_name)) self.contacts.append(contact) self.UTILS.general.insertContact(contact) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() for c in self.contacts: self.messages.addContactToField(c["name"]) # Remove it. self.messages.removeContactFromToField(self.contacts[1]["name"]) # Verify the contact name is not present after removal self.messages.checkIsInToField(self.contacts[1]["name"], False) self.UTILS.reporting.logResult("info", "It is not the 'To' list.")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) # Import contact (adjust to the correct number). self.test_num = self.UTILS.general.get_config_variable( "phone_number", "custom") self.contact1 = MockContact(givenName="Name 1", familyName="Surname 1", name="Name 1 Surname 1", tel={ "type": "Mobile", "value": self.test_num }) self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"]) self.UTILS.general.insertContact(self.contact1) self.call_number = self.UTILS.general.get_config_variable( "incoming_call_number", "common") self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() _ = setup_translations(self) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addContactToField(self.contact1["name"]) # Insert the phone number in the To field self.messages.addNumbersInToField([self.call_number]) search_str = _("2 recipients") self.UTILS.element.headerCheck(search_str) # Enter the message. self.UTILS.reporting.logResult("info", "Enter the message.") self.messages.enterSMSMsg("Test 29911") # Send the message. self.messages.sendSMS() self.UTILS.statusbar.wait_for_notification_toaster_title( self.contact1["name"]) self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator) # Verify the number is shown in the header as there is no contact name self.messages.openThread(self.call_number) self.messages.checkThreadHeader(self.call_number) self.UTILS.reporting.logResult( "info", "Verify the number is shown in the header as there is no contact name" ) # Return to main SMS page. self.messages.closeThread() # Verify the thread now contains the name of the contact instead of the phone number self.UTILS.reporting.logResult( "info", "Trying to open the thread with name: " + self.contact1["name"]) self.messages.openThread(self.contact1["name"]) self.messages.checkThreadHeaderWithNameSurname(self.contact1["name"])