コード例 #1
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"]))
コード例 #2
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)
コード例 #3
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)
コード例 #4
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"])
コード例 #5
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"])
コード例 #6
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)
コード例 #7
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)
コード例 #8
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"])
コード例 #9
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"])
コード例 #10
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()
コード例 #11
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)
コード例 #12
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()
コード例 #13
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)
コード例 #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.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.")
コード例 #15
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)
コード例 #16
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")
コード例 #17
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"])
コード例 #18
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)
コード例 #19
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)
コード例 #20
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")
コード例 #21
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)
コード例 #22
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")
コード例 #23
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")
コード例 #24
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")
コード例 #25
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()
コード例 #26
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"]))
コード例 #27
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")
コード例 #28
0
ファイル: test_27739.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)

        # 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()
コード例 #29
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)
コード例 #30
0
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 number in the target field.
        self.messages.addNumbersInToField([self.phone_number])

        # Tap the message area.
        x = self.UTILS.element.getElement(DOM.Messages.input_message_area, "Message body input field")
        x.tap()

        # 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 target number is supplied, but message still empty.")
コード例 #31
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)
コード例 #32
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())
コード例 #33
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"]))
コード例 #34
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())
コード例 #35
0
ファイル: test_29914.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"

        # Establish which phone number to use.
        num1 = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact1 = MockContact(givenName="Name 1", familyName="Surname 1",
                                    name="Name 1 Surname 1", tel={"type": "Mobile", "value": num1})
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact1["tel"]["value"])
        self.UTILS.general.insertContact(self.contact1)

        num2 = self.UTILS.general.get_config_variable("incoming_call_number", "common")
        self.contact2 = MockContact(givenName="Name 3", familyName="Surname 3",
                                    name="Name 3 Surname 3", tel={"type": "Mobile", "value": num2})
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact2["tel"]["value"])
        self.UTILS.general.insertContact(self.contact2)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()
        self.test_nums = [self.contact1["tel"]["value"], self.contact2["tel"]["value"]]

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

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

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

        # Insert the phone numbers in the To field
        for num in self.test_nums:
            self.messages.addNumbersInToField([num])

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

        # Add an image file
        self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg')
        self.messages.create_mms_image()
        self.gallery.click_on_thumbnail_at_position_mms(0)

        # Click send and wait for the message to be received
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.closeThread()
        self.messages.openThread(self.contact1["name"])
        self.messages.wait_for_message(send_time=send_time)

        # Obtaining file attached type
        img_type = self.UTILS.element.getElement(DOM.Messages.attach_preview_img_type, "preview type")
        typ = img_type.get_attribute("data-attachment-type")

        if typ != "img":
            self.UTILS.test.test(False, "Incorrect file type. The file must be img ")

        self.messages.closeThread()

        # Check how many elements are there
        self.UTILS.reporting.logResult("info", "Check how many threads are there")
        original_count = self.messages.countNumberOfThreads()
        self.UTILS.reporting.logResult("info", "Number of threads {} in list.".format(original_count))
        self.UTILS.test.test(original_count == 2, "Check how many threads are there")
コード例 #36
0
ファイル: test_29914.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"

        # Establish which phone number to use.
        num1 = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact1 = MockContact(givenName="Name 1",
                                    familyName="Surname 1",
                                    name="Name 1 Surname 1",
                                    tel={
                                        "type": "Mobile",
                                        "value": num1
                                    })
        self.UTILS.reporting.logComment("Using target telephone number " +
                                        self.contact1["tel"]["value"])
        self.UTILS.general.insertContact(self.contact1)

        num2 = self.UTILS.general.get_config_variable("incoming_call_number",
                                                      "common")
        self.contact2 = MockContact(givenName="Name 3",
                                    familyName="Surname 3",
                                    name="Name 3 Surname 3",
                                    tel={
                                        "type": "Mobile",
                                        "value": num2
                                    })
        self.UTILS.reporting.logComment("Using target telephone number " +
                                        self.contact2["tel"]["value"])
        self.UTILS.general.insertContact(self.contact2)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()
        self.test_nums = [
            self.contact1["tel"]["value"], self.contact2["tel"]["value"]
        ]

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

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

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

        # Insert the phone numbers in the To field
        for num in self.test_nums:
            self.messages.addNumbersInToField([num])

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

        # Add an image file
        self.UTILS.general.add_file_to_device('./tests/_resources/80x60.jpg')
        self.messages.create_mms_image()
        self.gallery.click_on_thumbnail_at_position_mms(0)

        # Click send and wait for the message to be received
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.closeThread()
        self.messages.openThread(self.contact1["name"])
        self.messages.wait_for_message(send_time=send_time)

        # Obtaining file attached type
        img_type = self.UTILS.element.getElement(
            DOM.Messages.attach_preview_img_type, "preview type")
        typ = img_type.get_attribute("data-attachment-type")

        if typ != "img":
            self.UTILS.test.test(False,
                                 "Incorrect file type. The file must be img ")

        self.messages.closeThread()

        # Check how many elements are there
        self.UTILS.reporting.logResult("info",
                                       "Check how many threads are there")
        original_count = self.messages.countNumberOfThreads()
        self.UTILS.reporting.logResult(
            "info", "Number of threads {} in list.".format(original_count))
        self.UTILS.test.test(original_count == 2,
                             "Check how many threads are there")
コード例 #37
0
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"])