当前位置: 首页>>代码示例>>Python>>正文


Python contacts.Contacts类代码示例

本文整理汇总了Python中OWDTestToolkit.apps.contacts.Contacts的典型用法代码示例。如果您正苦于以下问题:Python Contacts类的具体用法?Python Contacts怎么用?Python Contacts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Contacts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_main

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()
        self.UTILS.general.insertContact(self.test_contact)

        self.contact_name = self.test_contact["givenName"]

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.dialer.launch()
        contacts_option_btn = self.UTILS.element.getElement(DOM.Dialer.option_bar_contacts, "Contacts option")
        contacts_option_btn.tap()
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.contacts_sub_iframe, via_root_frame=False)

        self.contacts.view_contact(self.contact_name, header_check=False)
        phone_field = self.UTILS.element.getElement(DOM.Contacts.view_contact_tel_field, "Telephone number")
        phone_field.tap()

        # The call is tested.
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.UTILS.element.waitForElements(("xpath", DOM.Dialer.outgoing_call_numberXP.format(self.test_contact["name"])),
                                           "Outgoing call found with number matching {}".format(self.test_contact["name"]))
        self.dialer.hangUp()
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:33,代码来源:test_26797.py

示例2: test_main

class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)

        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()
        x = self.UTILS.element.getElement(DOM.Contacts.settings_button, "Settings button")
        x.tap()

        x = self.UTILS.element.getElement(DOM.Contacts.import_contacts, "Import button")
        time.sleep(1)
        x.tap()

        self.UTILS.element.waitForElements(DOM.Contacts.gmail_button, "Gmail button")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:26,代码来源:test_27034.py

示例3: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)


    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        self.contacts.launch()
        self.messages.launch()
        self.UTILS.home.touchHomeButton()
        time.sleep(1)

        self.UTILS.home.holdHomeButton()

        self.UTILS.element.waitForElements(DOM.Home.cards_view, "App 'cards' list (task switcher)")

        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot:", x)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_26416.py

示例4: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        # 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):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        audio_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("audio"))
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        self.UTILS.test.test(audio_btn, "Audio button present in contact")
        self.UTILS.test.test(video_btn, "Video button present in contact")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:28,代码来源:test_35116.py

示例5: test_main

class test_main(GaiaTestCase):

    def setUp(self):
        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")
        self.contact = MockContact(tel={'type': '', 'value': self.phone_number})

        self.UTILS.general.insertContact(self.contact)
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search("Knot A Match")
        self.contacts.check_search_results("Knot A Match", False)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:30,代码来源:test_27737.py

示例6: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        # Import contact (adjust the correct number).
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Start a new SMS and add the message and contact name.
        self.messages.startNewSMS()
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.view_contact(self.contact["givenName"], False)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.checkIsInToField(self.contact["name"], True)

        # Remove it.
        self.messages.removeContactFromToField(self.contact["name"])

        # Verify the contact name is no longer present before removing it.
        self.messages.checkIsInToField(self.contact["name"], False)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_26406.py

示例7: test_main

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)

        # 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):

        # Launch contacts app.
        self.contacts.launch()
        x = self.UTILS.element.getElement(DOM.Contacts.settings_button, "Settings button")
        x.tap()

        x = self.UTILS.element.getElement(DOM.Contacts.import_contacts, "Import button")
        x.tap()

        # Wait for the Hotmail button.
        x = self.UTILS.element.getElement(DOM.Contacts.hotmail_button, "Hotmail button")
        x_dis = x.get_attribute("disabled")
        self.UTILS.test.test(x_dis == "true", "The Hotmail button is disabled ('disabled' was set to '{}').".format(x_dis))

        x = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Screenshot and details", x)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:35,代码来源:test_27047.py

示例8: test_main

class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)
        self.contact = MockContact(tel=[{'type': 'Mobile', 'value': '111111111'},
                                        {'type': 'Mobile', 'value': '222222222'}])

        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.messages.launch()

        # Type a message containing the required string
        self.messages.startNewSMS()
        self.messages.enterSMSMsg("Test message")

        # Search for our contact.
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.search(self.contact['name'])
        self.contacts.select_search_result_several_phones(self.contact['name'],
                                                          self.contact['tel'][0]['value'], cancel=True)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:29,代码来源:test_26405.py

示例9: test_main

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.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:31,代码来源:test_26823.py

示例10: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        # Create our test contacts.
        self.contact_list = [MockContact() for i in range(3)]
        map(self.UTILS.general.insertContact, self.contact_list)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()

        # Search for our new contact.
        self.contacts.search(self.contact_list[0]["tel"]["value"])

        # Verify that we're now in the 'search results' screen.
        self.UTILS.element.waitForElements(DOM.Contacts.search_results_list, "Search results list")

        # Cancel the search.
        x = self.UTILS.element.getElement(DOM.Contacts.search_cancel_btn, "Cancel search button")
        x.tap()

        # Verify that we're no longer in the 'search results' screen.
        self.UTILS.element.waitForNotElements(DOM.Contacts.search_results_list, "Search results list")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_27061.py

示例11: test_main

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)

        # Create 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()

        # Launch contacts app.
        self.contacts.launch()

        x = self.contacts.import_gmail_login("wrongname", "wrongpass")

        self.UTILS.test.test(x == False, "Login failed.")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:32,代码来源:test_27037.py

示例12: test_main

class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Insert test contact
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        _ = setup_translations(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.marionette.switch_to_frame()
        msg_dom = (DOM.Loop.connection_error_msg[0], DOM.Loop.connection_error_msg[1].format(_("connection failure")))
        self.wait_for_element_displayed(*msg_dom,
                                        timeout=15)
        error_msg = self.marionette.find_element(*msg_dom)
        self.UTILS.test.test(error_msg, "Error message due to connection failure was found")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:34,代码来源:test_35118.py

示例13: test_main

class test_main(GaiaTestCase):

    test_msg = "Test."

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)
        self.gallery = Gallery(self)

        # Import contact (adjust to the correct number).
        self.test_num = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.cont = MockContact(tel={"type": "Mobile", "value": self.test_num})
        self.UTILS.reporting.logComment("Using target telephone number " + self.cont["tel"]["value"])

    def tearDown(self):
        self.UTILS.general.remove_files()
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.general.add_file_to_device('./tests/_resources/imgd.jpg')

        # Launch messages app.
        self.messages.launch()

        # Create a new SMS
        self.messages.startNewSMS()

        # Insert the phone number in the To field
        self.messages.addNumbersInToField([self.test_num])

        # Create MMS.
        self.messages.enterSMSMsg(self.test_msg)

        self.messages.create_mms_image()
        self.gallery.click_on_thumbnail_at_position_mms(0)

        # Click send and wait for the message to be received
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()
        """
        Open contacts app and create a contact with the same phone number used to send the MMS in the
        previous step
        """

        self.contacts.launch()
        self.contacts.create_contact(self.cont)

        # Switch back to the messages app.
        self.UTILS.home.goHome()
        self.messages.launch()

        # Verify the thread now contains the name of the contact instead of the phone number
        self.UTILS.reporting.logComment("Trying to open the thread with name: " + self.cont["name"])
        self.messages.openThread(self.cont["name"])
        self.messages.wait_for_message(send_time)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:60,代码来源:test_31716.py

示例14: test_main

class test_main(GaiaTestCase):

    def setUp(self):
        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")
        self.phone_number2 = self.UTILS.general.get_config_variable("short_phone_number", "custom")

        self.test_contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number2})
        self.UTILS.general.insertContact(self.test_contact)

        # Generate an entry in the call log
        self.dialer.launch()
        self.dialer.callLog_clearAll()
        self.dialer.createMultipleCallLogEntries(self.phone_number, 1)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        # Open the call log and add to our contact.
        self.dialer.callLog_addToContact(self.phone_number, self.test_contact["name"])

        # Verify that this contact has been modified in contacts.
        self.contacts.launch()
        self.contacts.view_contact(self.test_contact["name"])

        self.UTILS.element.waitForElements(("xpath", DOM.Contacts.view_contact_tels_xpath.format(self.phone_number)),
                                           "Telephone number {} in contact".format(self.phone_number))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:33,代码来源:test_27021.py

示例15: main

class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.contacts = Contacts(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

        self.apps.kill_all()
        time.sleep(2)
        _ = setup_translations(self)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        header = self.marionette.find_element(*DOM.Loop.app_header)
        self.UTILS.test.test(header, "Firefox Hello launched successfully")
        self.UTILS.iframe.switch_to_frame(*DOM.Loop.frame_locator)
        phone_btn = self.marionette.find_element(*DOM.Loop.wizard_login_phone_number)
        self.UTILS.test.test(phone_btn, "Login using phone number button present")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:35,代码来源:test_35119.py


注:本文中的OWDTestToolkit.apps.contacts.Contacts类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。