当前位置: 首页>>代码示例>>Python>>正文


Python Messages.openThread方法代码示例

本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.openThread方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.openThread方法的具体用法?Python Messages.openThread怎么用?Python Messages.openThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OWDTestToolkit.apps.messages.Messages的用法示例。


在下文中一共展示了Messages.openThread方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:62,代码来源:test_29911.py

示例2: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

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

        timestamp = time.time()
        self.test_msgs = ["Hello world {} at {}".format(i, timestamp) for i in range(3)]

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

    def test_run(self):
        for msg in self.test_msgs:
            self.messages.create_and_send_mms("image", [self.phone_number], msg)
            self.messages.wait_for_message()
            self.messages.closeThread()

        self.messages.openThread(self.phone_number)
        self.messages.deleteMessagesInThisThread()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:33,代码来源:test_29916.py

示例3: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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 the correct number).
        self.telNum = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Using target telephone number " + self.telNum)

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

    def test_run(self):

        # Launch messages app.
        self.messages.launch()
        """
        Send a message to create a thread (use number, not name as this
        avoids some blocking bugs just now). 
        """

        self.messages.create_and_send_sms([self.telNum], "Test message.")
        returnedSMS = self.messages.wait_for_message()

        # Examine the header.
        self.UTILS.element.headerCheck(self.telNum)

        # Close the thread and check we can find it again with this number.
        self.messages.closeThread()
        self.messages.openThread(self.telNum)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:37,代码来源:test_27757.py

示例4: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:62,代码来源:test_31716.py

示例5: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

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

        self.actions = Actions(self.marionette)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.incoming_sms_num = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        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):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        # Send several messages to have something in the threads
        for i in range(4):
            sms_message = "Message {} " + "0123456789" * 5
            sms_message = sms_message.format(i)
            self.UTILS.messages.create_incoming_sms(self.phone_number, sms_message)
            self.UTILS.statusbar.wait_for_notification_toaster_detail(sms_message, timeout=120)

        self.messages.launch()
        self.messages.openThread(self.incoming_sms_num[0])
        self.messages.forwardMessage("sms", self.phone_number)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:36,代码来源:test_31576.py

示例6: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

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

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

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], "Test message.")
        self.messages.wait_for_message()

        # Tap the header to create a contact.
        self.messages.header_addToContact()

        # Select our contact.
        self.contacts.view_contact(self.contact["givenName"], False)

        # Check the phone number.
        second_phone = self.UTILS.element.getElement(("id", "number_1"), "2nd phone number.")
        self.UTILS.test.test(second_phone.get_attribute("value") == self.phone_number,
                             "Contact now has a 2nd number which is '{}' (it was '{}').".format(self.phone_number, second_phone.get_attribute("value")))

        # Press the Done button.
        done_btn = self.UTILS.element.getElement(DOM.Contacts.edit_update_button, "Update button")
        done_btn.tap()

        # Wait for contacts app to close and return to sms app.
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@src, '{}')]".format(DOM.Contacts.frame_locator[1])),
                                              "Contacts iframe")

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

        # Verify the header is now the name,
        header = self.UTILS.element.getElement(DOM.Messages.message_header, "Message header")
        self.UTILS.test.test(header.text == self.contact["name"],
                             "Message header has been changed to match the contact (it was '{}').".format(header.text))

        # Go back to the threads view and check the message name there too.
        self.messages.go_back()
        self.messages.openThread(self.contact["name"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:58,代码来源:test_26988.py

示例7: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):
    test_msgs = ["First message", "Second message", "Third message"]

    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 & delete all Threads
        Make sure we have no threads
        """

        self.messages.launch()

        for i in range(3):
            self.UTILS.reporting.debug("** Sending [{}]".format(self.test_msgs[i]))
            self.data_layer.send_sms(self.phone_number, self.test_msgs[i])
            self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msgs[i], timeout=120)

        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.openThread(self.phone_number)

        # Go into edit mode..
        edit_btn = self.UTILS.element.getElement(DOM.Messages.edit_messages_icon, "Edit button")
        edit_btn.tap()

        select_btn = self.UTILS.element.getElement(DOM.Messages.edit_msgs_select_btn, "Select messages button")
        select_btn.tap()

        # Select all
        select_all_btn = self.UTILS.element.getElement(DOM.Messages.check_all_messages_btn, "Select all button")
        select_all_btn.tap()

        # Tap delete
        self.messages.deleteSelectedMessages()

        # Check conversation isn't there anymore.
        self.UTILS.element.waitForNotElements(("xpath",
            DOM.Messages.thread_selector_xpath.format(self.phone_number)), "Thread")

        time.sleep(1)
        fnam = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot of final position:", fnam)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:58,代码来源:test_26853.py

示例8: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:58,代码来源:test_26845.py

示例9: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):

    test_msg = "Test message."

    def setUp(self):

        # Set up child objects...
        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")

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

    def test_run(self):

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

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], "Test message.")
        x = self.messages.wait_for_message()

        # Tap the header to create a contact.
        self.messages.header_createContact()

        # Fill in some details.
        contFields = self.contacts.get_contact_fields()
        self.contacts.replace_str(contFields['givenName'], "Test")
        self.contacts.replace_str(contFields['familyName'], "Testerton")

        # Press the Done button.
        x = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
        x.tap()

        # Wait for contacts app to close and return to sms app.
        self.marionette.switch_to_frame()
        self.UTILS.element.waitForNotElements(("xpath",
            "//iframe[contains(@src, '{}')]".format(DOM.Contacts.frame_locator[1])),
                                       "Contacts iframe")

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

        # Verify the header is now the name,
        x = self.UTILS.element.getElement(DOM.Messages.message_header, "Message header")
        self.UTILS.test.test(x.text == "Test Testerton",
                        "Message header has been changed to match the contact (it was '{}').".format(x.text))

        # Go back to the threads view and check the message name there too.
        self.messages.go_back()
        self.messages.openThread("Test Testerton")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:57,代码来源:test_26987.py

示例10: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:56,代码来源:test_26863.py

示例11: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):

    test_msgs = ["First message", "Second message", "Third message"]

    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):
        self.UTILS.statusbar.clearAllStatusBarNotifs()
        """
        Launch messages app & delete all Threads
        Make sure we have no threads
        """

        self.messages.launch()
        time.sleep(2)

        for i in range(3):
            self.UTILS.reporting.debug("** Sending [{}]".format(self.test_msgs[i]))
            self.data_layer.send_sms(self.phone_number, self.test_msgs[i])
            self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msgs[i], timeout=120)

        self.UTILS.reporting.debug("** Opening thread to check messages")
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.openThread(self.phone_number)

        # Check how many elements are there
        original_count = self.messages.countMessagesInThisThread()
        self.UTILS.reporting.logResult("info", "Before deletion there were {} messages in this thread.".\
                                       format(original_count))

        # Select the messages to be deleted.
        self.messages.deleteMessagesInThisThread([1])

        # Check message isn't there anymore.
        msg_list = self.UTILS.element.getElements(DOM.Messages.message_list, "Messages")
        final_count = len(msg_list)
        real_count = original_count - 1
        self.UTILS.test.test(final_count == (original_count - 1),
                        "After deleting the message, there were {} messages in this thread ({}) found).".\
                        format(real_count, final_count))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:56,代码来源:test_26852.py

示例12: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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 the correct number).
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.data_layer.delete_all_sms()

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

    def test_run(self):

        # Send some messages to create a thread
        self.texts = ["Test 1", "Test 2", "Test 3"]
        self.directions = ["outgoing", "incoming"]
        self.create_test_sms(self.phone_number, self.texts)

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

        # Enter the thread.
        self.messages.openThread(self.phone_number)

        # Find the first message.
        time.sleep(2)
        msg_list = self.UTILS.element.getElements(DOM.Messages.message_list, "Message list", False)
        msgs = [(text, direction) for text in self.texts for direction in self.directions]
        for (msg, expected) in zip(msg_list, msgs):
            direction = "outgoing" if "outgoing" in msg.get_attribute("class") else "incoming"
            text = self.marionette.find_element(*DOM.Messages.last_message_text_nested, id=msg.id).text
            self.UTILS.test.test(text == expected[0], "**** Text: {}  Expected: {}".format(text, expected[0]))
            self.UTILS.test.test(direction == expected[1], "Direction: {}  Expected: {}".\
                                 format(direction, expected[1]))

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

        # Check the keyboard is now present.
        self.UTILS.iframe.switchToFrame(*DOM.Keyboard.frame_locator)

    def create_test_sms(self, number, msg_list):
        """Send messages in the list to populate a thread.
        """
        for msg in msg_list:
            self.data_layer.send_sms(number, msg)
            self.UTILS.statusbar.wait_for_notification_toaster_detail(msg, timeout=120)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:56,代码来源:test_27748.py

示例13: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):

    links = ["www.google.com", "www.hotmail.com", "www.wikipedia.org"]
    test_msg = "Test " + " ".join(links) + " this."

    def setUp(self):

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

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

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

    def test_run(self):

        self.connect_to_network()

        # Create and send a new test message.
        self.data_layer.send_sms(self.phone_number, self.test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)

        map(self.try_link, range(len(self.links)), self.links)

    def try_link(self, link_number, link):
        self.UTILS.reporting.logResult("info", "Tapping <b>{}</b> ...".format(link))

        # Switch to messaging app.
        self.messages.launch()
        self.messages.openThread(self.phone_number)
        time.sleep(1)

        # Get last message.
        msg = self.messages.last_message_in_this_thread()

        # Find all URLs
        l = msg.find_element("xpath", "//a[text()='{}']".format(link))

        # Tap on required link.
        self.UTILS.element.simulateClick(l)

        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            link in self.browser.loaded_url(), "Web page loaded #{} correctly.".format(link_number + 1))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:54,代码来源:test_26969.py

示例14: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
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_1 = MockContact(tel={'type': '', 'value': self.phone_number})
        self.contact_2 = MockContact(tel={'type': '', 'value': self.phone_number})

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

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

    def test_run(self):

        # Launch messages app.
        self.messages.launch()
        """
        Send a message to create a thread (use number, not name as this
        avoids some blocking bugs just now).
        """

        self.messages.create_and_send_sms([self.contact_1["tel"]["value"]], "Test message.")
        self.messages.wait_for_message()

        # Open contacts app and modify the contact used to send the SMS in the previous step
        self.contacts.launch()
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact_2["tel"]["value"])
        self.contacts.edit_contact(self.contact_1["name"], self.contact_2)

        # Re-launch messages app.
        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.contact_2["name"])
        self.messages.openThread(self.contact_2["name"])
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:47,代码来源:test_27743.py

示例15: test_main

# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import openThread [as 别名]
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.gallery = Gallery(self)
        self.settings = Settings(self)

        self.test_msg = "Hello World"

        self.phone_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")
        self.UTILS.reporting.logComment("Sending mms to telephone number " + self.phone_number)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

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

        # Create and Send all MMS
        for msg in ["Test {}".format(i) for i in range(3)]:
            self.messages.create_and_send_mms("image", [self.phone_number], msg)
            self.messages.closeThread()

        self.messages.openThread(self.phone_number)

        # Check the messages
        msg_list = self.UTILS.element.getElements(DOM.Messages.message_list, "Message list", False)
        pos = 0
        for (pos, msg) in enumerate(msg_list):
            # Do the check for each message.
            self.UTILS.test.test(msg.find_element("css selector", "p span").text == "Test {}".format(pos),
                        "The message at position {} contains the string 'Test {}'.".format(pos, pos))
            self.UTILS.test.test("outgoing" in msg.get_attribute("class"),
                        "The message at position {} is  outgoing.".format(pos))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:43,代码来源:test_29903.py


注:本文中的OWDTestToolkit.apps.messages.Messages.openThread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。