class test_main(GaiaTestCase): test_msg = "Hello World" def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) # Establish which phone number to use. self.phone_number = self.UTILS.general.get_config_variable( "phone_number", "custom") self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number) # Prepare the contact we're going to insert. self.contact = MockContact(tel={ 'type': '', 'value': self.phone_number }) self.UTILS.general.insertContact(self.contact) self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Load an image file into the device. self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') # Launch messages app. self.messages.launch() # Create a new SMS self.messages.startNewSMS() # Insert the phone number in the To field self.messages.addNumbersInToField([self.phone_number]) # Create MMS. self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) # Click send and wait for the message to be received self.messages.sendSMS() self.messages.wait_for_message() self.messages.forwardMessageToContact("mms", self.contact["name"])
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) # Establish which phone number to use. self.phone_number = self.UTILS.general.get_config_variable( "phone_number", "custom") self.incoming_sms_num = self.UTILS.general.get_config_variable( "sms_platform_numbers", "common").split(',') self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number) self.data_layer.delete_all_sms() # Prepare the contact we're going to insert. self.phone_number = self.UTILS.general.get_config_variable( "phone_number", "custom") self.contact = MockContact(tel={ 'type': '', 'value': self.phone_number }) self.UTILS.general.insertContact(self.contact) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.statusbar.clearAllStatusBarNotifs() # Send several messages to have something in the threads for i in range(4): sms_message = "Message {} " + "0123456789" * 5 sms_message = sms_message.format(i) self.UTILS.messages.create_incoming_sms(self.phone_number, sms_message) self.UTILS.statusbar.wait_for_notification_toaster_detail( sms_message, timeout=120) self.messages.launch() self.messages.openThread(self.incoming_sms_num[0]) self.messages.forwardMessageToContact("sms", self.contact["name"])
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) # Establish which phone number to use. self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom") self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',') self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number) self.data_layer.delete_all_sms() # Prepare the contact we're going to insert. self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom") self.contact = MockContact(tel={'type': '', 'value': self.phone_number}) self.UTILS.general.insertContact(self.contact) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.statusbar.clearAllStatusBarNotifs() # Send several messages to have something in the threads for i in range(4): sms_message = "Message {} " + "0123456789" * 5 sms_message = sms_message.format(i) self.UTILS.messages.create_incoming_sms(self.phone_number, sms_message) self.UTILS.statusbar.wait_for_notification_toaster_detail(sms_message, timeout=120) self.messages.launch() self.messages.openThread(self.incoming_sms_num[0]) self.messages.forwardMessageToContact("sms", self.contact["name"])