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) self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom") self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number) self.test_msg = "Test message for test 31727" self.UTILS.general.add_file_to_device('./tests/_resources/300x300.png') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addNumbersInToField([self.phone_number]) self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) self.messages.sendSMS() self.messages.wait_for_message() self.messages.check_last_message_contents(self.test_msg, mms=True) self.messages.verify_mms_received('img', self.phone_number)
class test_main(GaiaTestCase): test_msg = "Hello World {}".format(time.time()) def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.music = Music(self) self.video = Video(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) self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() self.expected_sizes = ["4.8", "62.3", "175.6"] self.expected_names = ["80x60.jpg", "30k_basic_AMR.amr", "mpeg4.3gp"] self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') self.UTILS.general.add_file_to_device('./tests/_resources/30k_basic_AMR.amr') self.UTILS.general.add_file_to_device('./tests/_resources/mpeg4.mp4') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addNumbersInToField([self.phone_number]) self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) self.messages.create_mms_music() self.music.click_on_song_mms() self.messages.create_mms_video() self.video.click_on_video_at_position_mms(0) # Click send and wait for the message to be received self.messages.sendSMS() last_msg = self.messages.wait_for_message() attachments = self.messages.get_mms_attachments_info(last_msg) self.UTILS.reporting.debug("*** ATTACHMENTS: {}".format(attachments)) # Check the names and sizes of all attachments are as expected for (i, att) in enumerate(attachments): self.UTILS.test.test(self.expected_names[i] == att["name"] and self.expected_sizes[i] == att["size"], "Attachment [{}] ({}kb) Expected [{}] ({}kb)".\ format(self.expected_names[i], self.expected_sizes[i], att["name"], att["size"]))
class test_main(GaiaTestCase): test_msg = "Test." def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.contacts = Contacts(self) self.gallery = Gallery(self) # Import contact (adjust to the correct number). self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom") self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num}) self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"]) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.general.add_file_to_device('./tests/_resources/imgd.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.test_num]) # 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() send_time = self.messages.last_sent_message_timestamp() """ Open contacts app and create a contact with the same phone number used to send the MMS in the previous step """ self.contacts.launch() self.contacts.create_contact(self.cont) # Switch back to the messages app. self.UTILS.home.goHome() 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.cont["name"]) self.messages.openThread(self.cont["name"]) self.messages.wait_for_message(send_time)
class test_main(GaiaTestCase): 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 sms to telephone number " + self.phone_number) self.data_layer.delete_all_sms() def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.statusbar.clearAllStatusBarNotifs() self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') # Create message. sms_message = "Test" # Launch messages app. self.messages.launch() # Create and send a new test message. self.messages.create_and_send_sms([self.phone_number], sms_message) self.messages.wait_for_message() self.messages.go_back() self.UTILS.element.waitForNotElements(DOM.Messages.mms_icon, "MMS Icon") self.messages.startNewSMS() # Insert the phone number in the To field self.messages.addNumbersInToField([self.phone_number]) # Create MMS. self.messages.enterSMSMsg(sms_message) 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.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator) self.messages.go_back() self.messages.checkMMSIcon(self.phone_number)
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) 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 sms to telephone number " + self.phone_number) self.data_layer.delete_all_sms() def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.statusbar.clearAllStatusBarNotifs() self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') # Create message. sms_message = "Test" # Launch messages app. self.messages.launch() # Create and send a new test message. self.messages.create_and_send_sms([self.phone_number], sms_message) self.messages.wait_for_message() self.messages.go_back() self.UTILS.element.waitForNotElements(DOM.Messages.mms_icon, "MMS Icon") self.messages.startNewSMS() # Insert the phone number in the To field self.messages.addNumbersInToField([self.phone_number]) # Create MMS. self.messages.enterSMSMsg(sms_message) 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.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator) self.messages.go_back() self.messages.checkMMSIcon(self.phone_number)
class test_main(GaiaTestCase): test_msg = "Test." def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.music = Music(self) self.settings = Settings(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) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Load files into the device. self.UTILS.general.add_file_to_device('./tests/_resources/imgd.jpg') self.UTILS.general.add_file_to_device('./tests/_resources/MP3.mp3') # 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) self.messages.create_mms_music() self.music.click_on_song_mms() # Click send and wait for the message to be received self.messages.sendSMS() self.messages.wait_for_message() self.messages.verify_mms_received('img', self.phone_number) self.messages.verify_mms_received('audio', self.phone_number)
class test_main(GaiaTestCase): test_msg = "Test." def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.music = Music(self) self.settings = Settings(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) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Load files into the device. self.UTILS.general.add_file_to_device('./tests/_resources/imgd.jpg') self.UTILS.general.add_file_to_device('./tests/_resources/MP3.mp3') # 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) self.messages.create_mms_music() self.music.click_on_song_mms() # Click send and wait for the message to be received self.messages.sendSMS() self.messages.wait_for_message() self.messages.verify_mms_received('img', self.phone_number) self.messages.verify_mms_received('audio', self.phone_number)
class test_main(GaiaTestCase): test_msg = "Hello World" test_subject = "My Subject" 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) 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) # add subject self.messages.addSubject(self.test_subject) # Click send and wait for the message to be received self.messages.sendSMS() self.messages.wait_for_message() # Forward a message in this case we use "mmssub" to send a mms with subject. self.messages.forwardMessage("mmssub", self.phone_number)
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.contacts = Contacts(self) self.gallery = Gallery(self) self.test_num = self.UTILS.general.get_config_variable( "phone_number", "custom") self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num}) self.UTILS.general.insertContact(self.cont) self.UTILS.general.add_file_to_device('./tests/_resources/imga.jpg') self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"]) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.enterSMSMsg("Test") self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) # Search for our contact. time.sleep(5) self.messages.selectAddContactButton() self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator) self.contacts.search(self.cont["name"]) self.contacts.check_search_results(self.cont["name"]) result = self.UTILS.element.getElements( DOM.Contacts.search_results_list, "Contacts search results") for contact in result: if contact.text == self.cont["name"]: contact.tap() break self.apps.switch_to_displayed_app() # Now check the correct name is in the 'To' list. self.messages.checkIsInToField(self.cont["name"]) self.messages.sendSMS()
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.contacts = Contacts(self) self.gallery = Gallery(self) self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom") self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num}) self.UTILS.general.insertContact(self.cont) self.UTILS.general.add_file_to_device('./tests/_resources/imga.jpg') self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"]) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.enterSMSMsg("Test") self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) # Search for our contact. time.sleep(5) self.messages.selectAddContactButton() self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator) self.contacts.search(self.cont["name"]) self.contacts.check_search_results(self.cont["name"]) result = self.UTILS.element.getElements(DOM.Contacts.search_results_list, "Contacts search results") for contact in result: if contact.text == self.cont["name"]: contact.tap() break self.apps.switch_to_displayed_app() # Now check the correct name is in the 'To' list. self.messages.checkIsInToField(self.cont["name"]) self.messages.sendSMS()
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) # 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) 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.forwardMessageToMultipleRecipients("mms", self.phone_number, self.contact["name"])
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) self.music = Music(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) # Load files into the device. self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') self.UTILS.general.add_file_to_device('./tests/_resources/AMR.amr') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addNumbersInToField([self.phone_number]) self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) time.sleep(2) self.messages.create_mms_music() self.music.click_on_song_mms() self.messages.sendSMS() self.messages.wait_for_message() self.messages.verify_mms_received("img", self.phone_number) self.messages.verify_mms_received("audio", self.phone_number)
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.test_msg = "Hello World at {}".format(time.time()) # 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) self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # 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) container = self.UTILS.element.getElement( DOM.Messages.attach_preview_img_type, "Preview of attached image") self.UTILS.test.test(container, "Image preview container found")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') self.test_msg = "This is a test message" def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Launch messages app. self.messages.launch() # Create a new SMS self.messages.startNewSMS() self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) # Open attached file options x = self.UTILS.element.getElement(DOM.Messages.attach_preview_img_type, "Open attached file options") x.tap() # Remove attached file x = self.UTILS.element.getElement(DOM.Messages.attached_opt_remove, "Remove attached file") x.tap() self.UTILS.element.waitForNotElements( DOM.Messages.attach_preview_img_type, "attached file has been removed")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.test_msg = "Hello World at {}".format(time.time()) # 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) self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # 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) container = self.UTILS.element.getElement(DOM.Messages.attach_preview_img_type, "Preview of attached image") self.UTILS.test.test(container, "Image preview container found")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') self.test_msg = "This is a test message" def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Launch messages app. self.messages.launch() # Create a new SMS self.messages.startNewSMS() self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) # Open attached file options x = self.UTILS.element.getElement(DOM.Messages.attach_preview_img_type, "Open attached file options") x.tap() # Remove attached file x = self.UTILS.element.getElement(DOM.Messages.attached_opt_remove, "Remove attached file") x.tap() self.UTILS.element.waitForNotElements(DOM.Messages.attach_preview_img_type, "attached file has been removed")
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) self.phone_number = self.UTILS.general.get_config_variable( "phone_number", "custom") self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number) self.test_msg = "Test message for test 31727" self.UTILS.general.add_file_to_device('./tests/_resources/300x300.png') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addNumbersInToField([self.phone_number]) self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) self.messages.sendSMS() self.messages.wait_for_message() self.messages.check_last_message_contents(self.test_msg, mms=True) self.messages.verify_mms_received('img', self.phone_number)
class test_main(GaiaTestCase): test_msg = "Test." def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.contacts = Contacts(self) self.gallery = Gallery(self) # Import contact (adjust to the correct number). self.test_num = self.UTILS.general.get_config_variable( "phone_number", "custom") self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num}) self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"]) def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.general.add_file_to_device('./tests/_resources/imgd.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.test_num]) # 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() send_time = self.messages.last_sent_message_timestamp() """ Open contacts app and create a contact with the same phone number used to send the MMS in the previous step """ self.contacts.launch() self.contacts.create_contact(self.cont) # Switch back to the messages app. self.UTILS.home.goHome() 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.cont["name"]) self.messages.openThread(self.cont["name"]) self.messages.wait_for_message(send_time)
class test_main(GaiaTestCase): test_msg = "Hello World {}".format(time.time()) def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.music = Music(self) self.video = Video(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) self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() self.expected_sizes = ["4.8", "62.3", "175.6"] self.expected_names = ["80x60.jpg", "30k_basic_AMR.amr", "mpeg4.3gp"] self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') self.UTILS.general.add_file_to_device( './tests/_resources/30k_basic_AMR.amr') self.UTILS.general.add_file_to_device('./tests/_resources/mpeg4.mp4') def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() self.messages.startNewSMS() self.messages.addNumbersInToField([self.phone_number]) self.messages.enterSMSMsg(self.test_msg) self.messages.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) self.messages.create_mms_music() self.music.click_on_song_mms() self.messages.create_mms_video() self.video.click_on_video_at_position_mms(0) # Click send and wait for the message to be received self.messages.sendSMS() last_msg = self.messages.wait_for_message() attachments = self.messages.get_mms_attachments_info(last_msg) self.UTILS.reporting.debug("*** ATTACHMENTS: {}".format(attachments)) # Check the names and sizes of all attachments are as expected for (i, att) in enumerate(attachments): self.UTILS.test.test(self.expected_names[i] == att["name"] and self.expected_sizes[i] == att["size"], "Attachment [{}] ({}kb) Expected [{}] ({}kb)".\ format(self.expected_names[i], self.expected_sizes[i], att["name"], att["size"]))
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.test_msg = "Hello World" # Establish which phone number to use. num1 = 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": num1}) self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"]) self.UTILS.general.insertContact(self.contact1) num2 = self.UTILS.general.get_config_variable("incoming_call_number", "common") self.contact2 = MockContact(givenName="Name 3", familyName="Surname 3", name="Name 3 Surname 3", tel={"type": "Mobile", "value": num2}) self.UTILS.reporting.logComment("Using target telephone number " + self.contact2["tel"]["value"]) self.UTILS.general.insertContact(self.contact2) self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() self.test_nums = [self.contact1["tel"]["value"], self.contact2["tel"]["value"]] def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() # Create a new SMS self.messages.startNewSMS() # Insert the phone numbers in the To field for num in self.test_nums: self.messages.addNumbersInToField([num]) # Create MMS. self.messages.enterSMSMsg(self.test_msg) # Add an image file self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') 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() send_time = self.messages.last_sent_message_timestamp() self.messages.closeThread() self.messages.openThread(self.contact1["name"]) self.messages.wait_for_message(send_time=send_time) # Obtaining file attached type img_type = self.UTILS.element.getElement(DOM.Messages.attach_preview_img_type, "preview type") typ = img_type.get_attribute("data-attachment-type") if typ != "img": self.UTILS.test.test(False, "Incorrect file type. The file must be img ") self.messages.closeThread() # Check how many elements are there self.UTILS.reporting.logResult("info", "Check how many threads are there") original_count = self.messages.countNumberOfThreads() self.UTILS.reporting.logResult("info", "Number of threads {} in list.".format(original_count)) self.UTILS.test.test(original_count == 2, "Check how many threads are there")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.test_msg = "Hello World" # Establish which phone number to use. num1 = 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": num1 }) self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"]) self.UTILS.general.insertContact(self.contact1) num2 = self.UTILS.general.get_config_variable("incoming_call_number", "common") self.contact2 = MockContact(givenName="Name 3", familyName="Surname 3", name="Name 3 Surname 3", tel={ "type": "Mobile", "value": num2 }) self.UTILS.reporting.logComment("Using target telephone number " + self.contact2["tel"]["value"]) self.UTILS.general.insertContact(self.contact2) self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() self.test_nums = [ self.contact1["tel"]["value"], self.contact2["tel"]["value"] ] def tearDown(self): self.UTILS.general.remove_files() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() # Create a new SMS self.messages.startNewSMS() # Insert the phone numbers in the To field for num in self.test_nums: self.messages.addNumbersInToField([num]) # Create MMS. self.messages.enterSMSMsg(self.test_msg) # Add an image file self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg') 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() send_time = self.messages.last_sent_message_timestamp() self.messages.closeThread() self.messages.openThread(self.contact1["name"]) self.messages.wait_for_message(send_time=send_time) # Obtaining file attached type img_type = self.UTILS.element.getElement( DOM.Messages.attach_preview_img_type, "preview type") typ = img_type.get_attribute("data-attachment-type") if typ != "img": self.UTILS.test.test(False, "Incorrect file type. The file must be img ") self.messages.closeThread() # Check how many elements are there self.UTILS.reporting.logResult("info", "Check how many threads are there") original_count = self.messages.countNumberOfThreads() self.UTILS.reporting.logResult( "info", "Number of threads {} in list.".format(original_count)) self.UTILS.test.test(original_count == 2, "Check how many threads are there")