本文整理汇总了Python中OWDTestToolkit.apps.contacts.Contacts.start_create_new_contact方法的典型用法代码示例。如果您正苦于以下问题:Python Contacts.start_create_new_contact方法的具体用法?Python Contacts.start_create_new_contact怎么用?Python Contacts.start_create_new_contact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.contacts.Contacts
的用法示例。
在下文中一共展示了Contacts.start_create_new_contact方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import start_create_new_contact [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.contact = MockContact()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.contacts.launch()
self.contacts.start_create_new_contact()
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
self.UTILS.test.test(not done_button.is_enabled(), "Done button is not enabled")
contFields = self.contacts.get_contact_fields()
"""
Put the contact details into each of the fields (this method
clears each field first).
"""
self.contacts.replace_str(contFields['tel'], self.contact["tel"]["value"])
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
self.UTILS.test.test(done_button.is_enabled(), "Done button is not enabled")
done_button.tap()
self.contacts.view_contact(self.contact["tel"]["value"])
示例2: main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import start_create_new_contact [as 别名]
class main(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.loop = Loop(self)
self.contacts = Contacts(self)
self.settings = Settings(self)
self.test_contact = MockContact(givenName="QA", familyName="Automation")
self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
_ = setup_translations(self)
self.expected_msg = _("This contact does not have either a phone number or an email address.")
self.contacts.launch()
self.contacts.start_create_new_contact()
cont_fields = self.contacts.get_contact_fields()
self.contacts.replace_str(cont_fields['givenName'], self.test_contact['givenName'])
self.contacts.replace_str(cont_fields['familyName'], self.test_contact['familyName'])
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
done_button.tap()
self.connect_to_network()
self.loop.initial_test_checks()
self.settings.launch()
self.settings.fxa()
self.settings.fxa_log_out()
self.apps.kill_all()
time.sleep(2)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# First, login
self.loop.launch()
result = self.loop.wizard_or_login()
if result:
self.loop.firefox_login(self.fxa_user, self.fxa_pass)
self.loop.allow_permission_ffox_login()
self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
self.loop.open_address_book()
elem = (DOM.Contacts.view_all_contact_specific_contact[
0], DOM.Contacts.view_all_contact_specific_contact[1].format(self.test_contact["givenName"]))
entry = self.UTILS.element.getElement(elem, "Contact in address book")
entry.tap()
time.sleep(5)
self.marionette.switch_to_frame()
title = self.UTILS.element.getElement(DOM.GLOBAL.modal_dialog_alert_title, "Error title")
msg = self.UTILS.element.getElement(DOM.GLOBAL.modal_dialog_alert_msg, "Error message")
self.UTILS.test.test(title.text == "Firefox Hello", "Error title matches")
self.UTILS.test.test(msg.text == self.expected_msg, "Error message matches")
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import start_create_new_contact [as 别名]
class test_main(GaiaTestCase):
name = "Obi"
surname = "Wan"
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
# Click create new contact.
self.contacts.start_create_new_contact()
# Add some info. to the field.
given_name = self.UTILS.element.getElement(DOM.Contacts.given_name_field, "Given name field")
given_name.send_keys(self.name)
# Press the 'x'.
reset = self.UTILS.element.getElement(DOM.Contacts.given_name_reset_icon, "Given name reset icon")
reset.tap()
# Click the header, then verify that the field contains nothing.
self.marionette.find_element("xpath", '//h1[@id="contact-form-title"]').tap()
given_name = self.UTILS.element.getElement(DOM.Contacts.given_name_field, "Given name field")
self.UTILS.test.test(given_name.text == "", "Given name field is empty after being cleared.")
# Add some info. to the field.
surname = self.UTILS.element.getElement(DOM.Contacts.family_name_field, "Surname field")
surname.send_keys(self.surname)
# Press the 'x'.
reset = self.UTILS.element.getElement(DOM.Contacts.family_name_reset_icon, "Surname reset icon")
reset.tap()
# Click the header, then verify that the field contains nothing.
self.marionette.find_element("xpath", '//h1[@id="contact-form-title"]').tap()
surname = self.UTILS.element.getElement(DOM.Contacts.family_name_field, "Surname field")
self.UTILS.test.test(surname.text == "", "Surname field is empty after being cleared.")
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import start_create_new_contact [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
# Prepare the contact.
self.contact = MockContact()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
self.contacts.start_create_new_contact()
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot at this point", x)
x = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
self.UTILS.test.test(not x.is_enabled(), "Done button is not enabled")
contFields = self.contacts.get_contact_fields()
"""
Put the contact details into each of the fields (this method
clears each field first).
"""
self.contacts.replace_str(contFields['givenName'], self.contact["givenName"])
self.contacts.replace_str(contFields['familyName'], self.contact["familyName"])
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot at this point", x)
x = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
self.UTILS.test.test(x.is_enabled(), "Done button is not enabled")
x.tap()
self.contacts.view_contact(self.contact["name"])
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import start_create_new_contact [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
# Prepare the contact.
self.contact = MockContact()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Launch contacts app.
self.contacts.launch()
# Create the contact.
self.contacts.start_create_new_contact()
contFields = self.contacts.get_contact_fields()
self.contacts.replace_str(contFields['givenName'], self.contact["givenName"])
self.contacts.replace_str(contFields['familyName'], self.contact["familyName"])
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot at this point", x)
x = self.UTILS.element.getElement(DOM.Contacts.done_button, "Done button")
x.tap()
self.contacts.view_contact(self.contact["name"])
time.sleep(1)
self.UTILS.element.waitForNotElements(("xpath", "//h2[text()='Home']"), "'Home' section.")
x = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot at this point", x)
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import start_create_new_contact [as 别名]
class test_main(GaiaTestCase):
email_address = "[email protected]"
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Click create new contact.
self.contacts.launch()
self.contacts.start_create_new_contact()
# Verify that the 'DONE' button is disabled just now.
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
self.UTILS.test.test(not done_button.is_enabled(), "Done button is disabled by default.")
# Add some info. to the email field.
self.UTILS.general.typeThis(DOM.Contacts.email_field, "Email field", self.email_address)
# Verify that the 'DONE' button is enabled just now.
done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
self.UTILS.test.test(done_button.is_enabled() == True, "Done button is enabled if email is filled in.")
# Press the DONE button and return to the view all contacts screen.
done_button.tap()
self.UTILS.element.waitForElements(DOM.Contacts.view_all_header, "View all contacts header")
# Verify that our contact is now present with the email address as his contact name.
elem = (DOM.Contacts.view_all_contact_specific_contact[0],
DOM.Contacts.view_all_contact_specific_contact[1].format(self.email_address))
self.UTILS.element.getElement(elem, "Contact '" + self.email_address + "'")