class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.contacts = Contacts(self) # Prepare the contact we're going to insert. self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom") self.contact_1 = MockContact(tel={'type': '', 'value': self.phone_number}) self.contact_2 = MockContact(tel={'type': '', 'value': self.phone_number}) self.UTILS.general.insertContact(self.contact_1) self.UTILS.reporting.logComment("Using target telephone number " + self.contact_1["tel"]["value"]) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Launch messages app. self.messages.launch() """ Send a message to create a thread (use number, not name as this avoids some blocking bugs just now). """ self.messages.create_and_send_sms([self.contact_1["tel"]["value"]], "Test message.") self.messages.wait_for_message() # Open contacts app and modify the contact used to send the SMS in the previous step self.contacts.launch() self.UTILS.reporting.logComment("Using target telephone number " + self.contact_2["tel"]["value"]) self.contacts.edit_contact(self.contact_1["name"], self.contact_2) # Re-launch messages app. self.messages.launch() # Verify the thread now contains the name of the contact instead of the phone number self.UTILS.reporting.logComment("Trying to open the thread with name: " + self.contact_2["name"]) self.messages.openThread(self.contact_2["name"])
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.contacts = Contacts(self) # Get details of our test contacts. self.contact = MockContact() self.contact2 = MockContact() """ We're not testing adding a contact, so just stick one into the database. """ self.UTILS.general.insertContact(self.contact) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Launch contacts app. self.contacts.launch() # Edit the contact with the new details. self.contacts.edit_contact(self.contact["name"], self.contact2) # test: The 'view contact' page shows the correct details for this new contact. self.contacts.check_view_contact_details(self.contact2) # test: The 'edit contact' page shows the correct details for this new contact. self.contacts.check_edit_contact_details(self.contact2)