本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.header_addToContact方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.header_addToContact方法的具体用法?Python Messages.header_addToContact怎么用?Python Messages.header_addToContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.messages.Messages
的用法示例。
在下文中一共展示了Messages.header_addToContact方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import header_addToContact [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"])