def attach_file(self, attached_type): """ This method is reponsible of attaching a certain file to an email. NOTE: It does not fill neither the message destinatary nor the message body """ self.gallery = Gallery(self.parent) self.video = Video(self.parent) self.music = Music(self.parent) if attached_type == "image": self.UTILS.general.add_file_to_device( './tests/_resources/80x60.jpg') self.create_email_image() self.gallery.click_on_thumbnail_at_position_email(0) elif attached_type == "cameraImage": self.create_email_camera_image() elif attached_type == "video": self.UTILS.general.add_file_to_device( './tests/_resources/mpeg4.mp4') self.create_email_video() self.video.click_on_video_at_position_email(0) elif attached_type == "audio": self.UTILS.general.add_file_to_device('./tests/_resources/AMR.amr') self.create_email_music() self.music.click_on_song_email() else: msg = "FAILED: Incorrect parameter received in create_and_send_mms()"\ ". attached_type must being image, video or audio." self.UTILS.test.test(False, msg)
def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.camera = Camera(self) self.UTILS.app.setPermission('Camera', 'geolocation', 'deny') self.UTILS.general.add_file_to_device('./tests/_resources/img1.jpg')
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 setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.gallery.launch() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2)
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)
def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.camera = Camera(self) self.UTILS.app.setPermission('Camera', 'geolocation', 'deny') self.gallery.launch() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2)
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 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 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 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 setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.length = len(self.img_list) # Load sample images into the gallery. for i in self.img_list: self.UTILS.general.add_file_to_device('./tests/_resources/' + i) self.gallery.launch() time.sleep(2) self.previous_thumbs = self.gallery.get_number_of_thumbnails() self.apps.kill_all() time.sleep(2)
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 setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.settings = Settings(self) self.test_msg = "Hello World" # 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()
def setUp(self): # # Set up child objects... # GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.browser = Browser(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.data_layer.connect_to_cell_data()
def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) self.settings = Settings(self) self.test_msg = "Hello World" self.phone_number = self.UTILS.general.get_config_variable("incoming_call_number", "common") self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number) self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs()
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 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 setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.messages = Messages(self) self.gallery = Gallery(self) timestamp = time.time() self.test_msgs = [ "Hello world {} at {}".format(i, timestamp) for i in range(3) ] # 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 create_and_send_mms(self, attached_type, nums, m_text): self.gallery = Gallery(self.parent) self.video = Video(self.parent) self.music = Music(self.parent) self.launch() self.startNewSMS() self.addNumbersInToField(nums) self.enterSMSMsg(m_text) if attached_type == "image": # Add an image file self.UTILS.general.add_file_to_device( './tests/_resources/80x60.jpg') self.create_mms_image() self.gallery.click_on_thumbnail_at_position_mms(0) elif attached_type == "cameraImage": # Add an image file from camera self.create_mms_camera_image() time.sleep(3) elif attached_type == "video": # Load an video file into the device. self.UTILS.general.add_file_to_device( './tests/_resources/mpeg4.mp4') self.create_mms_video() self.video.click_on_video_at_position_mms(0) elif attached_type == "audio": # Load an video file into the device. self.UTILS.general.add_file_to_device('./tests/_resources/AMR.amr') self.create_mms_music() self.music.click_on_song_mms() else: # self.UTILS.reporting.logResult("info", "incorrect value received") msg = "FAILED: Incorrect parameter received in create_and_send_mms()"\ ". attached_type must being image, video or audio." self.UTILS.test.test(False, msg) time.sleep(2) self.sendSMS() return self.last_sent_message_timestamp()
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 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 setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.gallery = Gallery(self) self.length = len(self.img_list)