本文整理汇总了Python中OWDTestToolkit.apps.messages.Messages.header_createContact方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.header_createContact方法的具体用法?Python Messages.header_createContact怎么用?Python Messages.header_createContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.messages.Messages
的用法示例。
在下文中一共展示了Messages.header_createContact方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import header_createContact [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")
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.messages import Messages [as 别名]
# 或者: from OWDTestToolkit.apps.messages.Messages import header_createContact [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.num1 = self.UTILS.general.get_config_variable("phone_number", "custom")
self.num2 = "621234567"
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.num1], "Test {} number.".format(self.num2))
self.messages.wait_for_message()
# Tap the header to create a contact.
self.messages.header_createContact()
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
# Cancel the action.
form_header = self.UTILS.element.getElement(DOM.Contacts.contact_form_header, "Contact form header")
form_header.tap(25, 25)
# Wait for the contacts app to go away.
self.marionette.switch_to_frame()
self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@src, '{}')]".\
format(DOM.Contacts.frame_locator[1])), "Contacts iframe")
# Kill the SMS app (and all others).
self.apps.kill_all()
# Open the contacts app.
self.contacts.launch()
# Verify that there are no contacts.
self.UTILS.element.waitForElements(("xpath", "//p[contains(text(), 'No contacts')]"),
"No contacts message")