class test_main(GaiaTestCase): # Restart device to starting with wifi and 3g disabled. # def __init__(self, *args, **kwargs): kwargs['restart'] = True super(test_main, self).__init__(*args, **kwargs) 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. 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.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Create and Send an MMS self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg) # Verify that the MMS has been received. self.messages.wait_for_message() self.messages.verify_mms_received("img", 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.video = Video(self) # Establish which phone number to use. self.phone_number = self.UTILS.general.get_config_variable( "phone_number", "custom") self.test_msg = "Hello World" self.UTILS.reporting.logComment("Sending mms 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.messages.create_and_send_mms('video', [self.phone_number], self.test_msg) self.messages.verify_mms_received("video", 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.music = Music(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 tearDown(self): self.music.tap_play() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Create and Send an MMS with a audio attached. self.messages.create_and_send_mms("audio", [self.phone_number], self.test_msg) self.messages.wait_for_message() self.messages.verify_mms_received("audio", self.phone_number) self.messages.open_attached_file(DOM.Music.frame_locator) time.sleep(5) self.music.is_player_playing()
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.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) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Configure Auto Retrieve as "on_with_r = On with roaming option" from messaging settings self.settings.launch() self.settings.configure_mms_auto_retrieve("on_with_r") self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg) self.messages.wait_for_message() # Verify that the MMS has been received. self.messages.verify_mms_received("img", 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.video = Video(self) # Establish which phone number to use. self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom") self.test_msg = "Hello World" self.UTILS.reporting.logComment("Sending mms 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.messages.create_and_send_mms('video', [self.phone_number], self.test_msg) self.messages.verify_mms_received("video", 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" # 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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Create and Send an MMS with a image attached. self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg) self.messages.wait_for_message() self.messages.verify_mms_received("img", 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) 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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): for msg in self.test_msgs: self.messages.create_and_send_mms("image", [self.phone_number], msg) self.messages.wait_for_message() self.messages.closeThread() self.messages.openThread(self.phone_number) self.messages.deleteMessagesInThisThread()
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. 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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Create and Send an MMS with a video attached. self.messages.create_and_send_mms("video", [self.phone_number], self.test_msg) self.messages.wait_for_message() self.messages.verify_mms_received("video", 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) 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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): for msg in self.test_msgs: self.messages.create_and_send_mms("image", [self.phone_number], msg) self.messages.wait_for_message() self.messages.closeThread() self.messages.openThread(self.phone_number) self.messages.deleteMessagesInThisThread()
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.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) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Configure Auto Retrieve as "on_with_r = On with roaming option" from messaging settings self.settings.launch() self.settings.configure_mms_auto_retrieve("on_with_r") self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg) self.messages.wait_for_message() # Verify that the MMS has been received. self.messages.verify_mms_received("img", 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.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) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.create_and_send_mms('video', [self.phone_number], self.test_msg) self.messages.wait_for_message() # Verify we have received an MMS self.messages.verify_mms_received('video', 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.music = Music(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 tearDown(self): self.music.tap_play() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Create and Send an MMS with a audio attached. self.messages.create_and_send_mms("audio", [self.phone_number], self.test_msg) self.messages.wait_for_message() self.messages.verify_mms_received("audio", self.phone_number) self.messages.open_attached_file(DOM.Music.frame_locator) time.sleep(5) self.music.is_player_playing()
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_msg1 = "Hello World 1" self.test_msg2 = "Hello World 2" # 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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.statusbar.clearAllStatusBarNotifs() self.create_test_msgs([self.test_msg1, self.test_msg2]) self.messages.openThread(self.phone_number) import time time.sleep(5) self.messages.deleteMessagesInThisThread([0]) time.sleep(5) # After deleting one message, check there are three messages left msg_list = self.UTILS.element.getElements(DOM.Messages.message_list, "Remaining messages") self.UTILS.test.test( len(msg_list) == 3, "There are {} messages left (expected {})".format( len(msg_list), 3)) def create_test_msgs(self, msgs): for msg in msgs: # Create and Send a MMS. self.messages.create_and_send_mms("image", [self.phone_number], msg) self.messages.wait_for_message() self.messages.closeThread()
class test_main(GaiaTestCase): link = "www.google.com" test_msg = "Open this URL: " + link 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) # 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.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.data_layer.connect_to_cell_data() self.messages.create_and_send_mms('image', [self.phone_number], self.test_msg) self.messages.wait_for_message() last_msg = self.messages.last_message_in_this_thread() tags = last_msg.find_elements("tag name", "a") # Tap on required link. tags[0].tap() """ Give the browser time to start up, then switch to the browser frame and check the page loaded. """ time.sleep(3) self.marionette.switch_to_frame() self.browser.wait_for_page_to_load() self.UTILS.test.test(self.link in self.browser.loaded_url(), "Web page loaded correctly.")
class test_main(GaiaTestCase): # Restart device to start with wifi and 3g disabled. # def __init__(self, *args, **kwargs): kwargs['restart'] = True super(test_main, self).__init__(*args, **kwargs) 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) def tearDown(self): self.UTILS.reporting.reportResults() self.data_layer.disable_cell_data() GaiaTestCase.tearDown(self) def test_run(self): # Turn on 3g connection. self.data_layer.connect_to_cell_data() # Turn on wifi connection. self.data_layer.connect_to_wifi() # Create and Send an MMS self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg) # Verify that the MMS has been received. self.messages.wait_for_message() self.messages.verify_mms_received("img", 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.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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() # Create and Send all MMS for msg in ["Test {}".format(i) for i in range(3)]: self.messages.create_and_send_mms("image", [self.phone_number], msg) self.messages.closeThread() self.messages.openThread(self.phone_number) # Check the messages msg_list = self.UTILS.element.getElements(DOM.Messages.message_list, "Message list", False) pos = 0 for (pos, msg) in enumerate(msg_list): # Do the check for each message. self.UTILS.test.test(msg.find_element("css selector", "p span").text == "Test {}".format(pos), "The message at position {} contains the string 'Test {}'.".format(pos, pos)) self.UTILS.test.test("outgoing" in msg.get_attribute("class"), "The message at position {} is outgoing.".format(pos))
class test_main(GaiaTestCase): # Restart device to starting with wifi and 3g disabled. # def __init__(self, *args, **kwargs): kwargs['restart'] = True super(test_main, self).__init__(*args, **kwargs) 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 tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.general.connect_to_cell_data() self.data_layer.connect_to_wifi() # Configure Auto Retrieve as off from messaging settings self.settings.launch() self.settings.configure_mms_auto_retrieve("on_without_r") self.messages.create_and_send_mms("image", [self.phone_number], self.test_msg) self.messages.wait_for_message() # Verify that the MMS has been received, but it contains no attached file self.messages.verify_mms_received("img", 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) # Define target phone numbers num_prefix_plus = self.UTILS.general.get_config_variable( "phone_number", "custom") num_prefix_double_zero = num_prefix_plus.replace("+", "00") num_no_prefix = num_prefix_plus.replace("+34", "") self.target_numbers = [ num_prefix_plus, num_prefix_double_zero, num_no_prefix ] self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() for num in self.target_numbers: test_msg = "Hello World at {} for {}".format(time.time(), num) self.messages.create_and_send_mms("image", [num], test_msg) self.messages.wait_for_message() self.messages.closeThread() time.sleep(3) # Check how many elements are there count = self.messages.countNumberOfThreads() self.UTILS.reporting.logResult( "info", "Number of threads {} in list.".format(count)) self.UTILS.test.test( count == 1, "There are {} threads (expected {})".format(count, 1))
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) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.create_and_send_mms('image', [self.phone_number], self.test_msg) self.messages.wait_for_message() self.messages.verify_mms_received('img', 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) # Define target phone numbers num_prefix_plus = self.UTILS.general.get_config_variable("phone_number", "custom") num_prefix_double_zero = num_prefix_plus.replace("+", "00") num_no_prefix = num_prefix_plus.replace("+34", "") self.target_numbers = [num_prefix_plus, num_prefix_double_zero, num_no_prefix] self.data_layer.delete_all_sms() self.UTILS.statusbar.clearAllStatusBarNotifs() def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.messages.launch() for num in self.target_numbers: test_msg = "Hello World at {} for {}".format(time.time(), num) self.messages.create_and_send_mms("image", [num], test_msg) self.messages.wait_for_message() self.messages.closeThread() time.sleep(3) # Check how many elements are there count = self.messages.countNumberOfThreads() self.UTILS.reporting.logResult("info", "Number of threads {} in list.".format(count)) self.UTILS.test.test(count == 1, "There are {} threads (expected {})".format(count, 1))