コード例 #1
0
ファイル: test_27737.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        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.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search("Knot A Match")
        self.contacts.check_search_results("Knot A Match", False)
コード例 #2
0
ファイル: test_29909.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.contact = MockContact(givenName="Name", familyName="Surname", name="Name Surname")
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.messages.launch()

        self.messages.startNewSMS()

        self.messages.addContactToField(self.contact["name"])

        self.UTILS.reporting.logResult("info", "Correct name is in the 'To' list.")
コード例 #3
0
ファイル: test_29911.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Import contact (adjust to the correct number).
        self.test_num = 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": self.test_num})
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"])
        self.UTILS.general.insertContact(self.contact1)

        self.call_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()
        _ = setup_translations(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        self.messages.startNewSMS()

        self.messages.addContactToField(self.contact1["name"])

        # Insert the phone number in the To field
        self.messages.addNumbersInToField([self.call_number])

        search_str = _("2 recipients")
        self.UTILS.element.headerCheck(search_str)

        # Enter the message.
        self.UTILS.reporting.logResult("info", "Enter the message.")
        self.messages.enterSMSMsg("Test 29911")

        # Send the message.
        self.messages.sendSMS()
        self.UTILS.statusbar.wait_for_notification_toaster_title(self.contact1["name"])
        self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)

        # Verify the number is shown in the header as there is no contact name
        self.messages.openThread(self.call_number)
        self.messages.checkThreadHeader(self.call_number)

        self.UTILS.reporting.logResult("info", "Verify the number is shown in the header as there is no contact name")

        # Return to main SMS page.
        self.messages.closeThread()

        # Verify the thread now contains the name of the contact instead of the phone number
        self.UTILS.reporting.logResult("info", "Trying to open the thread with name: " + self.contact1["name"])
        self.messages.openThread(self.contact1["name"])
        self.messages.checkThreadHeaderWithNameSurname(self.contact1["name"])
コード例 #4
0
ファイル: test_31716.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #5
0
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)
        self.contact = MockContact(tel=[{'type': 'Mobile', 'value': '111111111'},
                                        {'type': 'Mobile', 'value': '222222222'}])

        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search(self.contact['name'])
        self.contacts.select_search_result_several_phones(self.contact['name'],
                                                          self.contact['tel'][0]['value'], cancel=True)
コード例 #6
0
ファイル: test_27750.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    test_str = "abcdefghijklmnopqrstuvwxyz"

    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.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Launch messages app.
        self.messages.launch()
        """
        Type a message containing the required string 
        (the test is already included in 'enterSMSMsg' because it uses 'typeThis()').
        """

        self.messages.startNewSMS()

        self.messages.enterSMSMsg(self.test_str, False)

        self.UTILS.debug.screenShot("5968")
コード例 #7
0
ファイル: test_27745.py プロジェクト: owdqa/owd_test_cases
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.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Launch messages app.
        self.messages.launch()

        # Start a new sms.
        self.messages.startNewSMS()

        # Enter a message the message area.
        x = self.messages.enterSMSMsg("Test text.")

        # Check the 'Send button isn't enabled yet.
        x = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
        self.UTILS.test.test(not x.is_enabled(), 
                        "Send button is not enabled after message supplied, but target still empty.")
コード例 #8
0
ファイル: test_26406.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        # Import contact (adjust the correct number).
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Start a new SMS and add the message and contact name.
        self.messages.startNewSMS()
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.view_contact(self.contact["givenName"], False)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.checkIsInToField(self.contact["name"], True)

        # Remove it.
        self.messages.removeContactFromToField(self.contact["name"])

        # Verify the contact name is no longer present before removing it.
        self.messages.checkIsInToField(self.contact["name"], False)
コード例 #9
0
ファイル: test_29909.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.contact = MockContact(givenName="Name",
                                   familyName="Surname",
                                   name="Name Surname")
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.messages.launch()

        self.messages.startNewSMS()

        self.messages.addContactToField(self.contact["name"])

        self.UTILS.reporting.logResult("info",
                                       "Correct name is in the 'To' list.")
コード例 #10
0
ファイル: test_31727.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #11
0
class test_main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        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.UTILS.reporting.logComment("Using target telephone number " +
                                        self.contact["tel"]["value"])

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search("Knot A Match")
        self.contacts.check_search_results("Knot A Match", False)
コード例 #12
0
ファイル: test_31730.py プロジェクト: owdqa/owd_test_cases
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"]))
コード例 #13
0
ファイル: test_26845.py プロジェクト: owdqa/owd_test_cases
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)

        # 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"])

        self.data_layer.delete_all_sms()

    def tearDown(self):
        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.test_num])

        # Create SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send and wait for the message to be received
        self.messages.sendSMS()
        self.messages.wait_for_message()
        self.messages.go_back()
        """
        Open contacts app and create a contact with the same phone number used to send the SMS in the
        previous step
        """

        self.contacts.launch()
        self.contacts.create_contact(self.cont)

        # Switch back to the messages app.
        # self.UTILS.app.switchToApp("Messages")
        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"])
コード例 #14
0
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)
コード例 #15
0
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"])
コード例 #16
0
ファイル: test_31720.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #17
0
ファイル: test_26845.py プロジェクト: owdqa/owd_test_cases
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)

        # 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"])

        self.data_layer.delete_all_sms()

    def tearDown(self):
        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.test_num])

        # Create SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send and wait for the message to be received
        self.messages.sendSMS()
        self.messages.wait_for_message()
        self.messages.go_back()
        """
        Open contacts app and create a contact with the same phone number used to send the SMS in the
        previous step
        """

        self.contacts.launch()
        self.contacts.create_contact(self.cont)

        # Switch back to the messages app.
        # self.UTILS.app.switchToApp("Messages")
        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"])
コード例 #18
0
ファイル: test_26863.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.target_num = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.test_msg = "Test."
        self.data_layer.delete_all_sms()

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        self.UTILS.statusbar.toggleViaStatusBar('airplane')

    def test_run(self):

        # Create a new SMS
        self.messages.launch()
        self.messages.startNewSMS()

        # Insert the phone number in the To field
        self.messages.addNumbersInToField([self.target_num])

        # Create SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()

        # Wait for the SMS to arrive.
        self.messages.wait_for_message(send_time=send_time)

        self.UTILS.home.goHome()

        # Put the phone into airplane mode.
        self.UTILS.statusbar.toggleViaStatusBar('airplane')

        self.UTILS.reporting.debug("*** Launching messages again!!!")
        self.messages.launch()

        # Open sms app and go to the previous thread
        self.messages.openThread(self.target_num)

        # Create another SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()

        # Check that popup appears.
        self.messages.checkAirplaneModeWarning()
コード例 #19
0
ファイル: test_26863.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.target_num = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.test_msg = "Test."
        self.data_layer.delete_all_sms()

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        self.UTILS.statusbar.toggleViaStatusBar('airplane')

    def test_run(self):

        # Create a new SMS
        self.messages.launch()
        self.messages.startNewSMS()

        # Insert the phone number in the To field
        self.messages.addNumbersInToField([self.target_num])

        # Create SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()

        # Wait for the SMS to arrive.
        self.messages.wait_for_message(send_time=send_time)

        self.UTILS.home.goHome()

        # Put the phone into airplane mode.
        self.UTILS.statusbar.toggleViaStatusBar('airplane')

        self.UTILS.reporting.debug("*** Launching messages again!!!")
        self.messages.launch()

        # Open sms app and go to the previous thread
        self.messages.openThread(self.target_num)

        # Create another SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()

        # Check that popup appears.
        self.messages.checkAirplaneModeWarning()
コード例 #20
0
ファイル: test_31717.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #21
0
ファイル: test_31572.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #22
0
ファイル: test_31717.py プロジェクト: owdqa/owd_test_cases
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)
コード例 #23
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.keyboard = Keyboard(self.marionette)

        # 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)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Launch messages app.
        self.messages.launch()

        # Start a new sms.
        self.messages.startNewSMS()

        # Enter a number in the target field.
        self.messages.addNumbersInToField([self.phone_number])

        # Enter a message the message area.
        test_msg = "test message"
        self.messages.enterSMSMsg(test_msg)

        # Check the 'Send' button is now enabled.
        send_btn = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
        self.UTILS.test.test(send_btn.is_enabled(), "Send button is enabled when everything's filled in.")
        """
        Delete the text (we should already be in the message area with the
        keyboard present, but we need to 'manually' use the keyboard for this).
        """

        for i in range(len(test_msg)):
            self.keyboard.tap_backspace()
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)

        msg_area = self.UTILS.element.getElement(DOM.Messages.input_message_area, "Message area")
        self.UTILS.test.test(msg_area.text == "", "Message area is clear after deleting all characters in it.")

        # Check the Send button isn't enabled any more.
        send_btn = self.UTILS.element.getElement(DOM.Messages.send_message_button, "Send message button")
        self.UTILS.test.test(not send_btn.is_enabled(), 
                        "Send button is not enabled after target number is supplied, but message still empty.")
コード例 #24
0
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()
コード例 #25
0
ファイル: test_26993.py プロジェクト: owdqa/owd_test_cases
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)
        self.Dialer = Dialer(self)

        phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        prefix = "0034"
        self.num1 = prefix + phone_number if not phone_number.startswith(
            "+34") else prefix + phone_number[3:]
        self.num2 = phone_number[3:] if phone_number.startswith(
            "+34") else phone_number

        self.contact = MockContact(tel={'type': 'Mobile', 'value': self.num1})
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Create and send a new test message to this contact.
        self.messages.startNewSMS()
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.view_contact(self.contact["givenName"], False)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.checkIsInToField(self.contact["name"], True)

        self.messages.enterSMSMsg("Test message.")
        self.messages.sendSMS()

        self.messages.wait_for_message()

        # Tap the header to call.
        self.messages.header_call()

        # Dialler is started with the number already filled in.
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number,
                                                    "Phone number")
        self.UTILS.test.test(
            self.num2 in phone_field.get_attribute("value"),
            "The phone number contains '{}' (it was '{}').".format(
                self.num1, phone_field.get_attribute("value")))
コード例 #26
0
class test_main(GaiaTestCase):
    def setUp(self):
        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 = MockContact(tel={
            'type': '',
            'value': self.phone_number
        })

        self.UTILS.general.insertContact(self.contact)
        self.UTILS.reporting.logComment("Using target telephone number " +
                                        self.contact["tel"]["value"])

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        # Launch messages app.
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search(self.contact["name"])
        self.contacts.check_search_results(self.contact["name"])

        contact_list = self.UTILS.element.getElements(
            DOM.Contacts.search_results_list, "Contacts search results")
        for c in contact_list:
            if c.text == self.contact["name"]:
                c.tap()
                break

        # Switch back to the sms iframe.
        self.apps.switch_to_displayed_app()

        # Now check the correct name is in the 'To' list.
        self.messages.checkIsInToField(self.contact["name"])
        self.messages.sendSMS()
コード例 #27
0
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.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")

        # Put the phone into airplane mode.
        self.data_layer.set_setting('airplaneMode.enabled', True)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

    def tearDown(self):
        self.data_layer.set_setting('airplaneMode.enabled', False)
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        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 SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()

        time.sleep(3)

        # Check that popup appears.
        self.messages.checkAirplaneModeWarning()

        # Check an error indication is shown in message
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        msg = self.messages.last_message_in_this_thread()
        indication = msg.get_attribute("class").index("error") != -1
        self.UTILS.test.test(indication == True, "An indication error was found")
コード例 #28
0
ファイル: test_31719.py プロジェクト: owdqa/owd_test_cases
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()
コード例 #29
0
ファイル: test_31571.py プロジェクト: owdqa/owd_test_cases
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"])
コード例 #30
0
ファイル: test_26992.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    test_msg = "Test message."

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)
        self.Dialer = Dialer(self)

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom").split("+34")[-1]
        self.contact = MockContact(tel={'type': 'Mobile', '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.messages.launch()

        # Create and send a new test message.
        self.messages.startNewSMS()
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.view_contact(self.contact["givenName"], False)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.checkIsInToField(self.contact["name"], True)

        self.messages.enterSMSMsg("Test message.")
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()

        self.messages.wait_for_message(send_time=send_time)

        # Tap the header to call.
        self.messages.header_call()

        # Dialer is started with the number already filled in.
        time.sleep(2)
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field", False)
        dialer_num = phone_field.get_attribute("value")

        self.UTILS.test.test(self.phone_number == dialer_num,
                        "The phone is '{}' (expected '{}').".\
                        format(dialer_num, self.phone_number))
コード例 #31
0
ファイル: test_26993.py プロジェクト: owdqa/owd_test_cases
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)
        self.Dialer = Dialer(self)

        phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        prefix = "0034"
        self.num1 = prefix + phone_number if not phone_number.startswith("+34") else prefix + phone_number[3:]
        self.num2 = phone_number[3:] if phone_number.startswith("+34") else phone_number

        self.contact = MockContact(tel={'type': 'Mobile', 'value': self.num1})
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Create and send a new test message to this contact.
        self.messages.startNewSMS()
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.view_contact(self.contact["givenName"], False)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.checkIsInToField(self.contact["name"], True)

        self.messages.enterSMSMsg("Test message.")
        self.messages.sendSMS()

        self.messages.wait_for_message()

        # Tap the header to call.
        self.messages.header_call()

        # Dialler is started with the number already filled in.
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number")
        self.UTILS.test.test(self.num2 in phone_field.get_attribute("value"),
                        "The phone number contains '{}' (it was '{}').".format(self.num1, phone_field.get_attribute("value")))
コード例 #32
0
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)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")

    def tearDown(self):
        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)

        # Add subject
        self.messages.addSubject(self.test_subject)

        # Check convert notice appears
        convert_notice = self.marionette.find_element(*DOM.Messages.message_convert_notice)
        self.UTILS.test.test(convert_notice.text, "Converting to multimedia message.", True)

        # Delete subject
        self.messages.deleteSubject(self.test_subject)

        # Check convert notice appears
        convert_notice = self.marionette.find_element(*DOM.Messages.message_convert_notice)
        self.UTILS.test.test(convert_notice.text, "Converting to text message.", True)
コード例 #33
0
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)
コード例 #34
0
ファイル: test_27765.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):
        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 = MockContact(tel={'type': '', 'value': self.phone_number})

        self.UTILS.general.insertContact(self.contact)
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        # Launch messages app.
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search(self.contact["name"])
        self.contacts.check_search_results(self.contact["name"])

        contact_list = self.UTILS.element.getElements(DOM.Contacts.search_results_list, "Contacts search results")
        for c in contact_list:
            if c.text == self.contact["name"]:
                c.tap()
                break

        # Switch back to the sms iframe.
        self.apps.switch_to_displayed_app()

        # Now check the correct name is in the 'To' list.
        self.messages.checkIsInToField(self.contact["name"])
        self.messages.sendSMS()
コード例 #35
0
ファイル: test_31564.py プロジェクト: owdqa/owd_test_cases
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)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")

    def tearDown(self):
        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)

        # Add subject
        self.messages.addSubject(self.test_subject)

        # Press cancel options button
        self.messages.cancelSettings()

        # Review settings options button
        self.UTILS.reporting.logResult("info", "Cliking on messages options button")
        options_btn = self.UTILS.element.getElement(DOM.Messages.messages_options_btn,
            "Messages option button is displayed")

        self.UTILS.test.test(options_btn, "Settings options.", True)
コード例 #36
0
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)

        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.UTILS.general.add_file_to_device('./tests/_resources/mpeg4.mp4')
        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):

        # 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_video()
        self.video.click_on_video_at_position_mms(0)
        container = self.UTILS.element.getElement(
            DOM.Messages.attach_preview_video_audio_type, "Video container")
        self.UTILS.test.test(
            container.get_attribute("data-attachment-type") == "video",
            "Video container found")
コード例 #37
0
ファイル: test_27761.py プロジェクト: owdqa/owd_test_cases
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 = MockContact(tel={
            'type': '',
            'value': self.phone_number
        })

        self.UTILS.general.insertContact(self.contact)
        self.UTILS.reporting.logComment("Using target telephone number " +
                                        self.contact["tel"]["value"])

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        # Launch messages app.
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)

        # Press the back button.
        self.contacts.go_back()

        self.apps.switch_to_displayed_app()

        # Check 'Send' button is not enabled.
        send_message_button = self.UTILS.element.getElement(
            DOM.Messages.send_message_button, "Send button")
        self.UTILS.test.test(not send_message_button.is_enabled(),
                             "Send button is not enabled.")
コード例 #38
0
ファイル: test_27744.py プロジェクト: owdqa/owd_test_cases
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.UTILS.reporting.logComment("Sending sms 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):

        # Launch messages app.
        self.messages.launch()

        # Start a new sms.
        self.messages.startNewSMS()

        # Enter a number in the target field.
        self.messages.addNumbersInToField([self.phone_number])

        # Enter a message the message area.
        self.messages.enterSMSMsg("xxx")

        # Click the back button.
        self.messages.go_back()

        # Check for the save/discard popup.
        discard_btn = self.UTILS.element.getElement(DOM.Messages.discard_msg_btn, "Discard button")
        discard_btn.tap()

        # Verify that we're now in the correct place.
        self.UTILS.element.headerCheck("Messages")
        threads = self.UTILS.element.getElement(DOM.Messages.no_threads_message, "No threads message")
        self.UTILS.test.test(threads, "There are no threads, as expected")
コード例 #39
0
ファイル: test_29924.py プロジェクト: owdqa/owd_test_cases
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")
コード例 #40
0
ファイル: test_29918.py プロジェクト: owdqa/owd_test_cases
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")
コード例 #41
0
ファイル: test_29919.py プロジェクト: owdqa/owd_test_cases
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)

        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.UTILS.general.add_file_to_device('./tests/_resources/mpeg4.mp4')
        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):

        # 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_video()
        self.video.click_on_video_at_position_mms(0)
        container = self.UTILS.element.getElement(DOM.Messages.attach_preview_video_audio_type, "Video container")
        self.UTILS.test.test(container.get_attribute("data-attachment-type") == "video", "Video container found")
コード例 #42
0
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)

        # Put the phone into airplane mode.
        self.data_layer.set_setting('airplaneMode.enabled', True)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Open sms app
        self.messages.launch()

        # Create a new SMS
        self.messages.startNewSMS()

        # Insert the phone number in the To field
        self.messages.addNumbersInToField(
            [self.UTILS.general.get_config_variable("phone_number", "custom")])

        # Create SMS.
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()
        time.sleep(3)

        # Check that popup appears.
        self.messages.checkAirplaneModeWarning()
コード例 #43
0
class test_main(GaiaTestCase):

    test_msg = "Test."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(givenName = '', familyName = '', name = '', 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):

        # Clear out any current messages.
        self.messages.launch()

        # Create SMS.
        self.messages.startNewSMS()
        self.messages.addNumbersInToField([ self.contact["tel"]["value"] ])
        self.messages.enterSMSMsg(self.test_msg)

        # Click send.
        self.messages.sendSMS()

        # Wait for the last message in this thread to be a 'received' one.
        self.messages.wait_for_message()

        # Verify the number is shown in the header as there is no contact name
        self.messages.checkThreadHeader(str(self.contact["tel"]["value"]))
コード例 #44
0
ファイル: test_29918.py プロジェクト: owdqa/owd_test_cases
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")
コード例 #45
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.contacts = []
        for i in range(3):
            given_name = "Name {}".format(i)
            family_name = "Surname {}".format(i)
            contact = MockContact(givenName=given_name,
                                  familyName=family_name,
                                  name="{} {}".format(given_name, family_name))
            self.contacts.append(contact)
            self.UTILS.general.insertContact(contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.messages.launch()

        self.messages.startNewSMS()

        for c in self.contacts:
            self.messages.addContactToField(c["name"])

        # Remove it.
        self.messages.removeContactFromToField(self.contacts[1]["name"])

        # Verify the contact name is not present after removal
        self.messages.checkIsInToField(self.contacts[1]["name"], False)

        self.UTILS.reporting.logResult("info", "It is not the 'To' list.")
コード例 #46
0
ファイル: test_29910.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.contacts = []
        for i in range(3):
            given_name = "Name {}".format(i)
            family_name = "Surname {}".format(i)
            contact = MockContact(givenName=given_name, familyName=family_name,
                                       name="{} {}".format(given_name, family_name))
            self.contacts.append(contact)
            self.UTILS.general.insertContact(contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.messages.launch()

        self.messages.startNewSMS()

        for c in self.contacts:
            self.messages.addContactToField(c["name"])

        # Remove it.
        self.messages.removeContactFromToField(self.contacts[1]["name"])

        # Verify the contact name is not present after removal
        self.messages.checkIsInToField(self.contacts[1]["name"], False)

        self.UTILS.reporting.logResult("info", "It is not the 'To' list.")
コード例 #47
0
ファイル: test_27759.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(tel={'type': '', 'value': ''})
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)

        # Search the contacts list for our contact.
        contact_list = self.UTILS.element.getElements(DOM.Contacts.view_all_contact_list, "Contacts list")
        for c in contact_list:
            if c.text == self.contact["name"]:
                self.UTILS.reporting.logResult("info", "Tapping ...")
                c.tap()
                break

        time.sleep(2)
        self.apps.switch_to_displayed_app()
        self.messages.checkIsInToField("", True)
コード例 #48
0
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)
コード例 #49
0
ファイル: test_99999.py プロジェクト: owdqa/OWD_TEST_TOOLKIT
class test_main(GaiaTestCase):

    test_msg = "Welcome to the September Checkpoint. See this: https://www.youtube.com/watch?v=jAHlQ77lm10"
    video_container_locator = (By.CSS_SELECTOR,
                               'div[style^="background-image"]')
    video_element_locator = (By.TAG_NAME, 'video')

    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 tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        #
        # Load files into the device.
        #
        self.UTILS.general.addFileToDevice('./tests/_resources/300x300.png',
                                           destination='DCIM/100MZLLA')

        #
        # 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.createMMSImage()
        self.gallery.clickThumbMMS(0)

        #
        # Click send and wait for the message to be received
        #
        self.messages.sendSMS()

        self.UTILS.statusbar.wait_for_notification_toaster_detail(
            self.test_msg, timeout=120)
        self.UTILS.statusbar.click_on_notification_detail(
            self.test_msg, DOM.Messages.frame_locator)

        text = self.UTILS.element.getElement(
            DOM.Messages.last_message_mms_text, "Message text").text
        last_msg = self.messages.lastMessageInThisThread()
        self.UTILS.element.scroll_into_view(last_msg)
        self.UTILS.test.TEST(
            text == self.test_msg,
            u"[{}] received. Expected [{}]".format(text, self.test_msg), True)

        url = self.marionette.find_element("css selector",
                                           "a[data-url*=youtube]",
                                           id=last_msg.id)
        url.tap()

        #
        # Tap the video container
        #
        self.UTILS.iframe.switchToFrame(*DOM.Browser.frame_locator)
        self.browser.switch_to_content()
        self.wait_for_element_present(*self.video_container_locator,
                                      timeout=30)
        self.marionette.find_element(*self.video_container_locator).tap()

        #
        # Wait HTML5 player appear
        #
        self.wait_for_element_present(*self.video_element_locator, timeout=30)
        video = self.marionette.find_element(*self.video_element_locator)

        #
        # Check that video is playing
        #
        time.sleep(5)
        player = HTML5Player(self.marionette, video)
        player.wait_for_video_loaded()
        self.assertTrue(player.is_video_playing())
コード例 #50
0
ファイル: test_27754.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        # Establish which phone number to use and set up the contacts.
        self.nums = [
            self.UTILS.general.get_config_variable("phone_number", "custom"),
            self.UTILS.general.get_config_variable("short_phone_number",
                                                   "custom")
        ]

        self.test_contacts = [
            MockContact(tel={
                'type': 'Mobile',
                'value': self.nums[i]
            }) for i in range(2)
        ]
        map(self.UTILS.general.insertContact, self.test_contacts)
        self.data_layer.delete_all_sms()

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        # Now create and send a SMS to both contacts.
        self.messages.launch()
        self.messages.startNewSMS()

        for i in range(len(self.test_contacts)):
            self.messages.selectAddContactButton()
            self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
            self.contacts.view_contact(self.test_contacts[i]["name"], False)
            self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
            self.messages.checkIsInToField(self.test_contacts[i]["name"], True)

        test_msg = "Test message."
        self.messages.enterSMSMsg(test_msg)
        self.messages.sendSMS()

        # Since the destination number is the own, we will only receive one message, so we check it once
        self.UTILS.statusbar.wait_for_notification_toaster_detail(test_msg,
                                                                  timeout=120)

        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)

        # We will also check there is one thread for each contact in the To field
        name_xpath = DOM.Messages.thread_selector_xpath.format(
            self.test_contacts[0]['name'])
        thread = self.UTILS.element.getElementByXpath(name_xpath)
        self.UTILS.test.test(
            thread,
            "Thread for {} found".format(self.test_contacts[0]['name']))
        name_xpath = DOM.Messages.thread_selector_xpath.format(
            self.test_contacts[1]['name'])
        thread = self.UTILS.element.getElementByXpath(name_xpath)
        self.UTILS.test.test(
            thread,
            "Thread for {} found".format(self.test_contacts[1]['name']))