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


Python Messages.threadType方法代码示例

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


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

示例1: test_main

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

    def setUp(self):

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

        # Prepare the contact we're going to insert.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(tel={'type': '', 'value': self.phone_number})

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

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

    def test_run(self):

        # Launch messages app.
        self.messages.launch()
        """
        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["tel"]["value"]],
                                        "Test message.")
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.wait_for_message(send_time=send_time)

        # Examine the carrier.
        expect = self.contact["tel"]["type"]
        actual = self.messages.threadType()
        self.UTILS.test.test(expect == actual, "The type is listed as: '{}' (subheader was '{}').".\
                             format(expect, actual))

        expect = self.contact["tel"]["value"]
        actual = self.messages.threadCarrier()
        self.UTILS.test.test(expect == actual, "The carrier is listed as: '{}' (subheader was '{}').".\
                             format(expect, actual))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:46,代码来源:test_27746.py

示例2: test_main

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

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

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

    def test_run(self):

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

        # View the details of our contact.
        self.contacts.view_contact(self.contact['name'])

        # Tap the sms button in the view details screen to go to the sms page.
        smsBTN = self.UTILS.element.getElement(DOM.Contacts.sms_button, "Send SMS button")
        smsBTN.tap()

        time.sleep(2)
        self.marionette.switch_to_frame()
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)

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

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

        # Wait for the last message in this thread to be a 'received' one.
        returnedSMS = self.messages.wait_for_message(send_time=send_time)
        self.UTILS.test.test(returnedSMS, "A received message appeared in the thread.", True)
        self.messages.check_last_message_contents(self.test_msg)

        # Examine the carrier.
        expect = self.contact["tel"]["type"]
        actual = self.messages.threadType()
        self.UTILS.test.test(expect == actual, "The type is listed as: '{}' (subheader was '{}').".\
                             format(expect, actual))

        # Phone Number is shown instead of carrier as the secondary header
        expect = self.contact["tel"]["value"]
        actual = self.messages.threadCarrier()
        self.UTILS.test.test(expect == actual, "The telephone number is: '{}' (subheader was '{}').".\
                             format(expect, actual))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:65,代码来源:test_27735.py


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