本文整理汇总了Python中OWDTestToolkit.apps.contacts.Contacts.import_hotmail_login方法的典型用法代码示例。如果您正苦于以下问题:Python Contacts.import_hotmail_login方法的具体用法?Python Contacts.import_hotmail_login怎么用?Python Contacts.import_hotmail_login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWDTestToolkit.apps.contacts.Contacts
的用法示例。
在下文中一共展示了Contacts.import_hotmail_login方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def __init__(self, *args, **kwargs):
kwargs['restart'] = True
super(test_main, self).__init__(*args, **kwargs)
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.settings = Settings(self)
# Create test contacts.
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Set up to use data connection.
self.connect_to_network()
# Launch contacts app.
self.contacts.launch()
login_result = self.contacts.import_hotmail_login("[email protected]", "wrongpass")
self.UTILS.test.test(login_result == False, "Login failed.")
示例2: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def __init__(self, *args, **kwargs):
kwargs['restart'] = True
super(test_main, self).__init__(*args, **kwargs)
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_2_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_2_pass", "common")
self.number_of_hotmail_contacts = 2
self.data_layer.connect_to_wifi()
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.contacts.launch()
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
if not login_result:
self.UTILS.reporting.logResult(False, "Cannot continue past this point without importing the contacts.")
return
self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
self.contacts.import_all()
import_header = self.UTILS.element.getElement(
DOM.Contacts.import_contacts_header, "Import Contacts Header", True, 10, True)
time.sleep(1)
import_header.tap(25, 25)
self.wait_for_element_displayed(DOM.Contacts.settings_done_button[0], DOM.Contacts.settings_done_button[1],
timeout=5)
done = self.marionette.find_element(*DOM.Contacts.settings_done_button)
self.UTILS.element.simulateClick(done)
# Check our three contacts are in the list.
prepopulated_contact = (DOM.Contacts.view_all_contact_specific_contact[0],
DOM.Contacts.view_all_contact_specific_contact[1].format("OWD"))
self.UTILS.element.waitForElements(prepopulated_contact, "Prepopulated Contact")
# ... and the hotmail contacts ...
hotmail_imported = (DOM.Contacts.view_all_contact_specific_contact[0],
DOM.Contacts.view_all_contact_specific_contact[1].format("roy"))
contacts = self.UTILS.element.getElements(hotmail_imported, "Gmail imported contacts")
self.UTILS.test.test(len(contacts) == self.number_of_hotmail_contacts, "All gmail contacts has been imported")
result = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot and details", result)
示例3: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def __init__(self, *args, **kwargs):
kwargs['restart'] = True
super(test_main, self).__init__(*args, **kwargs)
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.settings = Settings(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_2_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_2_pass", "common")
# Get details of our test contacts.
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Set up to use data connection.
self.data_layer.connect_to_cell_data()
self.contacts.launch()
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
# Login unsuccessful or no available contacts to import
if not login_result:
self.UTILS.test.test(False, "Login unsuccessful")
self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
contact_list = self.UTILS.element.getElements(DOM.Contacts.import_conts_list, "Contact list")
cont_count = len(contact_list)
num_contacts = self.UTILS.element.getElement(DOM.Contacts.import_num_of_conts, "Number of contacts")
self.UTILS.reporting.logResult("info", "Detected message '{}'.".format(num_contacts.text))
self.UTILS.test.test(str(cont_count) in num_contacts.text, "'{}' contains the real count, which is {}.".\
format(num_contacts.text, cont_count))
示例4: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.settings = Settings(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_1_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_1_pass", "common")
# Get details of our test contacts.
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Set up to use data connection.
self.connect_to_network()
self.contacts.launch()
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
if not login_result:
self.UTILS.reporting.logResult(False, "Cannot continue past this point without importing the contacts.")
return
# Check the Import button is disabled to begin with.
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") == "true", "Import button is disabled.")
"""
Select / de-select contacts and make sure Import button is enabled / disabled
as expected.
"""
self.UTILS.reporting.logResult("info", "Enable contact 1...")
self.contacts.import_toggle_select_contact(1)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") != "true", "Import button is enabled.")
self.UTILS.reporting.logResult("info", "Enable contact 2...")
self.contacts.import_toggle_select_contact(2)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") != "true", "Import button is enabled.")
self.UTILS.reporting.logResult("info", "Disable contact 2...")
self.contacts.import_toggle_select_contact(2)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") != "true", "Import button is enabled.")
self.UTILS.reporting.logResult("info", "Disable contact 1...")
self.contacts.import_toggle_select_contact(1)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") == "true", "Import button is disabled.")
result = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot and details", result)
示例5: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def __init__(self, *args, **kwargs):
kwargs['restart'] = True
super(test_main, self).__init__(*args, **kwargs)
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_2_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_2_pass", "common")
self.data_layer.remove_all_contacts()
self.data_layer.connect_to_wifi()
# Create test contacts.
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.contacts.launch()
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
if not login_result:
self.UTILS.reporting.logResult(False, "Cannot continue past this point without importing the contacts.")
return
self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
contact_list = self.UTILS.element.getElements(DOM.Contacts.import_conts_list, "Contact list")
cont_number = 1
i_counter = 0
for i in contact_list:
i_counter = i_counter + 1
if "hotmail" in i.get_attribute("data-search").lower():
cont_number = i_counter
break
self.contacts.import_toggle_select_contact(cont_number)
self.marionette.execute_script("document.getElementById('{}').click()".\
format(DOM.Contacts.import_import_btn[1]))
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
import_header = self.UTILS.element.getElement(DOM.Contacts.import_contacts_header, "Import contacts header")
time.sleep(1)
# TODO: Change this when ShadowDOM marionette bug fixed (Bug 1061698)
import_header.tap(25, 25)
self.wait_for_element_displayed(DOM.Contacts.settings_done_button[0], DOM.Contacts.settings_done_button[1],
timeout=5)
done = self.marionette.find_element(*DOM.Contacts.settings_done_button)
self.UTILS.element.simulateClick(done)
# Check our two contacts are in the list.
prepopulated_contact = (DOM.Contacts.view_all_contact_specific_contact[0],
DOM.Contacts.view_all_contact_specific_contact[1].format("OWD"))
self.UTILS.element.waitForElements(prepopulated_contact, "Prepopulated Contact")
hotmail_imported = (DOM.Contacts.view_all_contact_specific_contact[0],
DOM.Contacts.view_all_contact_specific_contact[1].format("roy"))
self.UTILS.element.waitForElements(hotmail_imported, "Hotmail imported contact")
result = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot and details", result)
示例6: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def __init__(self, *args, **kwargs):
kwargs['restart'] = True
super(test_main, self).__init__(*args, **kwargs)
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_2_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_2_pass", "common")
self.data_layer.remove_all_contacts()
self.data_layer.connect_to_wifi()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.contacts.launch()
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
if not login_result:
self.UTILS.reporting.logResult(False, "Cannot continue past this point without importing the contacts.")
return
# Try to get the hotmail contact (use the first one if not).
self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
contact_list = self.UTILS.element.getElements(DOM.Contacts.import_conts_list, "Contact list")
cont_number = 1
i_counter = 0
for i in contact_list:
i_counter = i_counter + 1
if "hotmail" in i.get_attribute("data-search").lower():
cont_number = i_counter
break
self.contacts.import_toggle_select_contact(cont_number)
self.marionette.execute_script("document.getElementById('{}').click()".
format(DOM.Contacts.import_import_btn[1]))
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
import_header = self.UTILS.element.getElement(
DOM.Contacts.import_contacts_header, "Import Contacts Header", True, 10, True)
import_header.tap(25, 25)
done = self.UTILS.element.getElement(DOM.Contacts.settings_done_button, "Done button", True, 10, True)
self.UTILS.element.simulateClick(done)
# Check our contact is in the list.
hotmail_imported = (DOM.Contacts.view_all_contact_specific_contact[0],
DOM.Contacts.view_all_contact_specific_contact[1].format("roy"))
self.UTILS.element.waitForElements(hotmail_imported, "Hotmail imported contact")
result = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot and details", result)
示例7: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def setUp(self):
# Set up child objects...
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.settings = Settings(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_1_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_1_pass", "common")
# Get details of our test contacts.
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
# Set up to use data connection.
self.connect_to_network()
self.contacts.launch()
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
if not login_result:
self.UTILS.reporting.logResult(False, "Cannot continue past this point without importing the contacts.")
return
# Check the Import button is disabled to begin with.
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") == "true", "Import button is disabled.")
# Tap the Select All button (can't be done with marionette yet).
self.UTILS.reporting.logResult("info", "Tapping the 'Select All' button ...")
self.marionette.execute_script("document.getElementById('{}').click()".\
format(DOM.Contacts.import_select_all[1]))
time.sleep(1)
result = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot and details", result)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") != "true", "Import button is enabled.")
"""
The only way I can see to test that all contacts are selected is to toggle
all of them and make sure the Import button is then disabled (because that
means all of them were selected before the toggle).
"""
contact_list = self.UTILS.element.getElements(("class name", "block-item"), "Contacts list")
for i in range(len(contact_list)):
i_num = i + 1
self.UTILS.reporting.logResult("info", "Disable contact {} ...".format(i_num))
self.contacts.import_toggle_select_contact(i_num)
import_btn = self.UTILS.element.getElement(DOM.Contacts.import_import_btn, "Import button")
self.UTILS.test.test(import_btn.get_attribute("disabled") == "true", "Import button is disabled.")
result = self.UTILS.debug.screenShotOnErr()
self.UTILS.reporting.logResult("info", "Screenshot and details", result)
示例8: test_main
# 需要导入模块: from OWDTestToolkit.apps.contacts import Contacts [as 别名]
# 或者: from OWDTestToolkit.apps.contacts.Contacts import import_hotmail_login [as 别名]
class test_main(GaiaTestCase):
def __init__(self, *args, **kwargs):
kwargs['restart'] = True
super(test_main, self).__init__(*args, **kwargs)
def setUp(self):
GaiaTestCase.setUp(self)
self.UTILS = UTILS(self)
self.contacts = Contacts(self)
self.settings = Settings(self)
self.hotmail_user = self.UTILS.general.get_config_variable("hotmail_2_email", "common")
self.hotmail_passwd = self.UTILS.general.get_config_variable("hotmail_2_pass", "common")
self.contact = MockContact()
self.UTILS.general.insertContact(self.contact)
self.connect_to_network()
def tearDown(self):
self.UTILS.reporting.reportResults()
GaiaTestCase.tearDown(self)
def test_run(self):
self.contacts.launch()
contact_list = self.UTILS.element.getElements(DOM.Contacts.view_all_contact_list, "Contacts list")
contacts_before = len(contact_list)
login_result = self.contacts.import_hotmail_login(self.hotmail_user, self.hotmail_passwd)
if not login_result:
self.UTILS.reporting.logResult(False, "Cannot continue past this point without importing the contacts.")
return
# self.UTILS.iframe.switchToFrame(*DOM.Contacts.hotmail_import_frame, via_root_frame=False)
frame = self.marionette.find_element(*('id', 'fb-extensions'))
self.marionette.switch_to_frame(frame)
self.contacts.import_toggle_select_contact(1)
time.sleep(1)
header_close = self.UTILS.element.getElement(DOM.Contacts.hotmail_header, "Outlook header")
time.sleep(1)
self.UTILS.element.simulateClickAtPos(header_close, 25, 25)
self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
self.wait_for_element_displayed(*DOM.Contacts.import_contacts_header)
import_header = self.marionette.find_element(*DOM.Contacts.import_contacts_header)
time.sleep(1)
import_header.tap(25, 25)
done = self.UTILS.element.getElement(DOM.Contacts.settings_done_button, "Settings Done button")
time.sleep(1)
done.tap()
contact_list = self.UTILS.element.getElements(DOM.Contacts.view_all_contact_list, "Contacts list")
contacts_after = len(contact_list)
self.UTILS.test.test(contacts_after == contacts_before,
"No more contacts were imported ({} before and {} after)."
.format(contacts_after, contacts_before))