本文整理汇总了Python中OWDTestToolkit.apps.contacts.Contacts.edit_contact方法的典型用法代码示例。如果您正苦于以下问题:Python Contacts.edit_contact方法的具体用法?Python Contacts.edit_contact怎么用?Python Contacts.edit_contact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.contacts.Contacts
的用法示例。
在下文中一共展示了Contacts.edit_contact方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import edit_contact [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"])
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import edit_contact [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
# Get details of our test contacts.
self.contact = MockContact()
self.contact2 = MockContact()
"""
We're not testing adding a contact, so just stick one
into the database.
"""
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
# Edit the contact with the new details.
self.contacts.edit_contact(self.contact["name"], self.contact2)
# test: The 'view contact' page shows the correct details for this new contact.
self.contacts.check_view_contact_details(self.contact2)
# test: The 'edit contact' page shows the correct details for this new contact.
self.contacts.check_edit_contact_details(self.contact2)