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


Python Loop.open_address_book方法代码示例

本文整理汇总了Python中OWDTestToolkit.apps.loop.Loop.open_address_book方法的典型用法代码示例。如果您正苦于以下问题:Python Loop.open_address_book方法的具体用法?Python Loop.open_address_book怎么用?Python Loop.open_address_book使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OWDTestToolkit.apps.loop.Loop的用法示例。


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

示例1: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [as 别名]
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

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

        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_message = _("No problem! Just share the following link and they can call you back from"
                          " any browser.")


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

            self.UTILS.iframe.switch_to_active_frame()
            elem = (DOM.Loop.call_screen_contact_details[
                    0], DOM.Loop.call_screen_contact_details[1].format(self.test_contact["name"]))
            self.UTILS.element.waitForElements(elem, "Call to contact: {}".format(self.test_contact["name"]))

            time.sleep(5)
            self.apps.switch_to_displayed_app()
            self.UTILS.element.waitForElements(DOM.Loop.share_panel, "Share panel")

            not_a_user_explanation = self.marionette.find_element(*DOM.Loop.not_a_user_explanation)
            self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                                 format(not_a_user_explanation.text, self.expected_message))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:60,代码来源:test_35094.py

示例2: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [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")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:59,代码来源:test_35093.py

示例3: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [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.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.connect_to_network()

        self.target_name = "QA"
        self.test_contacts = [MockContact() for i in range(5)]
        self.test_contacts[0]["givenName"] = self.target_name
        self.test_contacts[0]["familyName"] = "Automation"
        map(self.UTILS.general.insertContact, self.test_contacts)

        # Clean start
        if not self.loop.is_installed():
            self.loop.install()
        else:
            self.loop.launch()
            # If already logged in, logout
            if not self.loop.wizard_or_login():
                self.loop.open_settings()
                self.loop.logout()

        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()   
            self.contacts.search(self.target_name)
            self.contacts.check_search_results(self.target_name)
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:54,代码来源:test_35078.py

示例4: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [as 别名]
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.test_contact = MockContact()
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.connect_to_network()
        self.UTILS.general.insertContact(self.test_contact)
        # Clean start
        if not self.loop.is_installed():
            self.loop.install()
        else:
            self.loop.launch()
            # If already logged in, logout
            if not self.loop.wizard_or_login():
                self.loop.open_settings()
                self.loop.logout()

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

            self.UTILS.iframe.switch_to_active_frame()
            elem = (DOM.Loop.call_screen_contact_details[0], DOM.Loop.call_screen_contact_details[1].format(self.test_contact["name"]))
            self.UTILS.element.waitForElements(elem, "Call to contact: {}".format(self.test_contact["name"]))
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:54,代码来源:test_35076.py

示例5: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [as 别名]
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

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

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        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_settings()
            self.loop.change_call_mode("Audio")
            self.loop.settings_go_back()

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

            self.UTILS.iframe.switch_to_active_frame()
            video_mode = self.UTILS.element.getElement(DOM.Loop.call_screen_video_mode, "Video")
            self.UTILS.test.test("setting-disabled" in video_mode.get_attribute("class"), "Video is disabled when call mode is set to 'Audio'")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:51,代码来源:test_35095.py

示例6: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [as 别名]
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.test_contact = MockContact()
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")


        self.test_contact["givenName"] = "This is a very looooooooooooong name"
        self.test_contact["familyName"] = "Test"
        self.test_contact["name"] = "{} {}".format(
            self.test_contact["givenName"], self.test_contact["familyName"])

        self.UTILS.general.insertContact(self.test_contact)

        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"]))
            self.UTILS.element.waitForElements(elem, "Contact in address book")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:47,代码来源:test_35088.py

示例7: main

# 需要导入模块: from OWDTestToolkit.apps.loop import Loop [as 别名]
# 或者: from OWDTestToolkit.apps.loop.Loop import open_address_book [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.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.target_name = "QA"
        self.test_contacts = [MockContact() for i in range(3)]
        self.test_contacts[0]["givenName"] = self.target_name
        self.test_contacts[0]["familyName"] = "Automation"
        self.test_contacts[0]["name"] = "{} {}".format(
            self.test_contacts[0]["givenName"], self.test_contacts[0]["familyName"])
        map(self.UTILS.general.insertContact, self.test_contacts)
    
        self.contacts.launch()
        self._add_contact_as_favorite(self.test_contacts[0])

        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_contacts[0]["givenName"]))
            self.UTILS.element.waitForElements(elem, "Contact in address book")

    def _add_contact_as_favorite(self, contact):
        self.contacts.view_contact(contact['name'])

        favorite_btn = self.UTILS.element.getElement(DOM.Contacts.favourite_button, "Favourite toggle button")
        favorite_btn.tap()

        back_btn = self.UTILS.element.getElement(DOM.Contacts.details_back_button, "Back button")
        back_btn.tap()

        string = "{}{}".format(contact['givenName'], contact['familyName']).upper()
        favs = ("xpath", DOM.Contacts.favourites_list_xpath.format(string))
        self.UTILS.element.waitForElements(favs, "'" + contact['name'] + "' in the favourites list")
开发者ID:owdqa,项目名称:owd_test_cases,代码行数:63,代码来源:test_35086.py


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