本文整理匯總了Python中OWDTestToolkit.apps.dialer.Dialer.createContactFromThisNum方法的典型用法代碼示例。如果您正苦於以下問題:Python Dialer.createContactFromThisNum方法的具體用法?Python Dialer.createContactFromThisNum怎麽用?Python Dialer.createContactFromThisNum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OWDTestToolkit.apps.dialer.Dialer
的用法示例。
在下文中一共展示了Dialer.createContactFromThisNum方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_main
# 需要導入模塊: from OWDTestToolkit.apps.dialer import Dialer [as 別名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import createContactFromThisNum [as 別名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
self.contacts = Contacts(self)
self.given_name = "John"
self.family_name = "Doe"
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.dialer.launch()
self.dialer.enterNumber("123456789")
self.dialer.createContactFromThisNum()
contFields = self.contacts.get_contact_fields()
self.contacts.replace_str(contFields['givenName'], self.given_name)
self.contacts.replace_str(contFields['familyName'], self.family_name)
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
done_button.tap()
time.sleep(2)
self.UTILS.reporting.logResult('info', "displayed_app: {}".format(self.apps.displayed_app.name))
self.UTILS.test.test(self.apps.displayed_app.name == "Phone", "The dialer app is now displayed.")
示例2: test_main
# 需要導入模塊: from OWDTestToolkit.apps.dialer import Dialer [as 別名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import createContactFromThisNum [as 別名]
class test_main(GaiaTestCase):
test_num = "089123456"
test_msg = "Testing " + test_num + " number."
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.messages = Messages(self)
self.Dialer = Dialer(self)
self.contacts = Contacts(self)
# Establish which phone number to use.
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.cp_incoming_number = 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.connect_to_network()
self.UTILS.statusbar.clearAllStatusBarNotifs()
# Launch messages app.
self.messages.launch()
self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)
self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.cp_incoming_number, timeout=5)
self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)
last_msg = self.messages.last_message_in_this_thread()
num = last_msg.find_element("tag name", "a")
num.tap()
call_btn = self.UTILS.element.getElement(DOM.Messages.header_call_btn, "Call button")
call_btn.tap()
time.sleep(5)
# Create a contact from this number.
self.Dialer.createContactFromThisNum()
# Make sure the number is automatically in the contact details.
number_field = self.UTILS.element.getElement(("id", "number_0"), "Mobile number field")
self.UTILS.test.test(number_field.get_attribute("value") == self.test_num,
"The correct number is automatically entered in the new contact's number field.")
示例3: test_main
# 需要導入模塊: from OWDTestToolkit.apps.dialer import Dialer [as 別名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import createContactFromThisNum [as 別名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.dialer.launch()
self.dialer.enterNumber("123456789")
self.dialer.createContactFromThisNum()