本文整理汇总了Python中OWDTestToolkit.apps.dialer.Dialer.enterNumber方法的典型用法代码示例。如果您正苦于以下问题:Python Dialer.enterNumber方法的具体用法?Python Dialer.enterNumber怎么用?Python Dialer.enterNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.dialer.Dialer
的用法示例。
在下文中一共展示了Dialer.enterNumber方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
self.cont1 = MockContact(tel=[{"type": "Mobile", "value": "111111111"}])
self.UTILS.general.insertContact(self.cont1)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.dialer.launch()
self.dialer.enterNumber("1111")
x = self.UTILS.element.getElement(DOM.Dialer.suggestion_item_single, "Suggestion item")
self.UTILS.test.test(self.cont1["tel"][0]["value"] in x.text,
"'{}' is shown as a suggestion (it was '{}').".format(self.cont1["tel"][0]["value"], x.text))
self.dialer.enterNumber("2")
self.UTILS.element.waitForNotElements(DOM.Dialer.suggestion_item_single, "Suggestion item")
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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.Contact_1 = MockContact(tel={'type': 'Mobile', 'value': '665666666'})
self.num = self.Contact_1["tel"]["value"]
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Enter a number in the dialer.
self.dialer.launch()
self.dialer.enterNumber(self.num)
self.dialer.call_this_number()
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
x = self.UTILS.element.getElement(DOM.Dialer.hangup_bar_locator, "Hangup button")
x.tap()
self.marionette.switch_to_frame()
x = DOM.Dialer.frame_locator_calling
self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@%s,'%s')]" % (x[0],x[1])), "Calling iframe", True, 5)
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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.Contact_1 = MockContact(tel={'type': 'Mobile', 'value': '665666666'})
self.num = self.Contact_1["tel"]["value"]
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Enter a number in the dialer.
self.dialer.launch()
self.dialer.enterNumber(self.num)
self.dialer.call_this_number()
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot of call being made:", x)
self.dialer.hangUp()
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.dialer = Dialer(self)
# Get details of our test contacts.
self.test_contact = MockContact(tel={'type': 'Mobile', 'value': '665666666'})
self.UTILS.general.insertContact(self.test_contact)
self._name = self.test_contact["name"]
self.phone_number = self.test_contact["tel"]["value"]
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.dialer.launch()
self.dialer.enterNumber(self.phone_number)
self.dialer.call_this_number()
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
outgoing_number = self.UTILS.element.getElement(DOM.Dialer.outgoing_call_number, "Outgoing number").text.encode("utf-8")
self.UTILS.reporting.logResult('info', 'Outgoing number: {}'.format(outgoing_number))
# We use 'in' since it's possible that the displayed outgoing contact name is ellipsed
self.UTILS.test.test(outgoing_number in self._name, "Outgoing call found with name matches '{}'".format(self._name))
time.sleep(2)
self.dialer.hangUp()
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
# Remove the phone number from the contact and insert it.
self.test_contact = MockContact(tel={'type': '', 'value': ''})
self.UTILS.general.insertContact(self.test_contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Add a number and add it to an existing contact.
self.dialer.launch()
self.dialer.enterNumber(self.phone_number)
self.dialer.addThisNumberToContact(self.test_contact["name"])
self.UTILS.test.test(self.apps.displayed_app.name == self.dialer.app_name, "After adding number to contact we are taken back to Dialer")
# Verify that this contact has been modified in contacts.
self.apps.kill_all()
self.contacts.launch()
self.contacts.view_contact(self.test_contact["name"])
contact_phone_number = self.UTILS.element.getElement(DOM.Contacts.view_contact_tel_field, "Contact telephone number")
self.UTILS.test.test(self.phone_number in contact_phone_number.text, "Contact correctly updated with new phone number")
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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.")
示例7: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
self.cont1 = MockContact(tel=[{"type": "Mobile", "value": "111111111"}])
self.UTILS.general.insertContact(self.cont1)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.dialer.launch()
self.dialer.enterNumber("123")
time.sleep(1)
self.UTILS.element.waitForNotElements(DOM.Dialer.suggestion_count, "Suggestion count")
self.UTILS.element.waitForNotElements(DOM.Dialer.suggestion_item, "Suggestion item")
self.dialer.enterNumber("4")
time.sleep(1)
self.UTILS.element.waitForNotElements(DOM.Dialer.suggestion_count, "Suggestion count")
self.UTILS.element.waitForNotElements(DOM.Dialer.suggestion_item, "Suggestion item")
示例8: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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.num = self.UTILS.general.get_config_variable("phone_number", "custom")
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Enter a number in the dialer.
self.dialer.launch()
self.dialer.enterNumber(self.num)
# Press the add to contacts button, then select 'add to existing contact'.
x = self.UTILS.element.getElement(DOM.Dialer.add_to_contacts_button, "Add to contacts button")
x.tap()
x = self.UTILS.element.getElement(DOM.Dialer.add_to_existing_contact_btn, "Add to existing contact button")
x.tap()
# You should now see the error message.
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.UTILS.element.waitForElements( ("xpath", "//*[contains(text(), 'Cannot add to contact')]"),
"Warning that there are no contacts.", True, 5, False)
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screen shot of current position:", x)
示例9: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
self.test_number = "123456789"
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.dialer.launch()
self.dialer.enterNumber(self.test_number)
add_to_contacts_button = self.UTILS.element.getElement(DOM.Dialer.add_to_contacts_button, "Add to contacts button")
add_to_contacts_button.tap()
cancel_button = self.UTILS.element.getElement(DOM.Dialer.cancel_action, "Cancel button")
cancel_button.tap()
phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field", False)
dialer_num = phone_field.get_attribute("value")
self.UTILS.test.test(str(self.test_number) in dialer_num, "After cancelling, phone number field still contains '%s' (it was %s)." % \
(self.test_number,dialer_num))
示例10: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
self.phone_number = self.UTILS.general.get_config_variable("target_call_number", "common")
self.prefixes = ["0034", "+34"]
self.test_numbers = [prefix + self.phone_number for prefix in self.prefixes]
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def _do_the_call(self, number):
self.dialer.enterNumber(number)
self.dialer.call_this_number_and_hangup(5)
def test_run(self):
# Launch dialer app.
self.dialer.launch()
map(self._do_the_call, self.test_numbers)
示例11: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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.Contact_1 = MockContact()
self.num = self.UTILS.general.get_config_variable("phone_number", "custom")
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Enter a number in the dialer.
self.dialer.launch()
self.dialer.enterNumber(self.num)
# Press the add to contacts button, then select 'add to existing contact'.
x = self.UTILS.element.getElement(DOM.Dialer.add_to_contacts_button, "Add to contacts button")
x.tap()
x = self.UTILS.element.getElement(DOM.Dialer.create_new_contact_btn, "Create new contact button")
x.tap()
# Enter the details of the new contact.
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
contFields = self.contacts.get_contact_fields()
self.contacts.replace_str(contFields['givenName'], self.Contact_1["givenName"])
self.contacts.replace_str(contFields['familyName'], self.Contact_1["familyName"])
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
done_button.tap()
# Verify that the contacts app is closed and we are returned to the call log.
self.marionette.switch_to_frame()
self.UTILS.element.waitForNotElements(("xpath", "//iframe[contains(@{}, '{}')]".\
format(DOM.Contacts.frame_locator[0], DOM.Contacts.frame_locator[1])),
"Contacts frame")
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)
# Verify that this contact has been created in contacts.
self.apps.kill_all()
self.contacts.launch()
self.contacts.view_contact(self.Contact_1["name"])
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Final screenshot and html dump:", x)
示例12: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.dialer = Dialer(self)
#
# Get own number and incoming
#
self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
self.call_number = self.UTILS.general.get_config_variable("target_call_number", "common")
self.incoming_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")
self.UTILS.statusbar.clearAllStatusBarNotifs()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch dialer app.
self.dialer.launch()
self.dialer.enterNumber(self.call_number)
self.dialer.call_this_number_and_hangup(2)
time.sleep(2)
self.UTILS.messages.create_incoming_sms(self.incoming_number, "Call:" + self.phone_number)
self.UTILS.iframe.switch_to_frame(*DOM.Dialer.frame_locator)
self.dialer.answer_and_hangup(3)
time.sleep(2)
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)
time.sleep(2)
self.dialer.enterNumber(self.call_number)
self.dialer.call_this_number()
self.UTILS.messages.create_incoming_sms(self.incoming_number, "Call:" + self.phone_number)
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
self.wait_for_element_displayed('id', 'incoming-answer', timeout=50)
answer = self.marionette.find_element('id', 'incoming-answer')
if answer:
answer.tap()
time.sleep(2)
self.dialer.hangUp()
time.sleep(5)
self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
self.dialer.hangUp()
示例13: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.dialer = Dialer(self)
self.test_contacts = [MockContact() for i in range(3)]
self.test_numbers = [self.test_contacts[i]["tel"]["value"] for i in range(len(self.test_contacts))]
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def _do_the_call(self, number):
self.dialer.enterNumber(number, validate=False)
self.dialer.call_this_number_and_hangup(5)
def test_run(self):
self.dialer.launch()
# Delete all call log
self.dialer.callLog_clearAll()
# Call each number
map(self._do_the_call, self.test_numbers)
self.dialer.callLog_clearAll()
# Go back to dialer keypad
keypad_options = self.UTILS.element.getElement(DOM.Dialer.option_bar_keypad, "Keypad Option")
keypad_options.tap()
# Tap call button
call_button = self.UTILS.element.getElement(DOM.Dialer.call_number_button, "Call button")
call_button.tap()
# Assert that nothing is presented in the input area
phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field")
dialer_num = phone_field.get_attribute("value")
self.assertEqual(dialer_num, "", "Nothing in the input area")
screenshot = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screen shot of the result of tapping call button", screenshot)
示例14: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.dialer = Dialer(self)
# Get details of our test contacts.
self.num = self.UTILS.general.get_config_variable("phone_number", "custom")
self.Contact_1 = MockContact(tel={'type': 'Mobile', 'value': self.num})
self.UTILS.general.insertContact(self.Contact_1)
self.contact_name = self.Contact_1["name"]
self.contact_given_name = self.Contact_1["givenName"]
self.contact_number = self.Contact_1["tel"]["value"]
def tearDown(self):
# Delete the contact. (REVISAR)
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch dialer app.
self.dialer.launch()
# Call
self.dialer.enterNumber(self.contact_number)
self.dialer.call_this_number()
time.sleep(2)
# Hang Up
self.dialer.hangUp()
x = self.UTILS.element.getElement(DOM.Dialer.option_bar_keypad, "Keypad Option")
x.tap()
x = self.UTILS.element.getElement(DOM.Dialer.call_number_button, "Call button")
x.tap()
# Make sure that after tapping, we get the last outgoing call in the call log
x = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field", False)
dialer_num = x.get_attribute("value")
self.UTILS.test.test(True, "Dialer_num: {}".format(dialer_num))
示例15: test_main
# 需要导入模块: from OWDTestToolkit.apps.dialer import Dialer [as 别名]
# 或者: from OWDTestToolkit.apps.dialer.Dialer import enterNumber [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()