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


Python Browser.tap_add_bookmark_to_home_screen_choice_button方法代码示例

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


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

示例1: test_browser_bookmark

# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_add_bookmark_to_home_screen_choice_button [as 别名]
    def test_browser_bookmark(self):
        # https://github.com/mozilla/gaia-ui-tests/issues/452
        browser = Browser(self.marionette)
        browser.launch()

        browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')

        browser.tap_bookmark_button()
        browser.tap_add_bookmark_to_home_screen_choice_button()
        browser.type_bookmark_title(self.bookmark_title)
        browser.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.marionette.switch_to_frame()
        self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));")
        self.marionette.switch_to_frame(self.marionette.find_element(*self._homescreen_frame_locator))

        # Wait for Gaia to insert the element into the page
        self.wait_for_element_present(*self._homescreen_icon_locator)

        # check whether bookmark was added
        while self._homescreen_has_more_pages:
            if self.is_element_displayed(*self._homescreen_icon_locator):
                self._bookmark_added = True
                break
            self._go_to_next_page()

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)
开发者ID:rwood-moz,项目名称:gaia-ui-tests,代码行数:30,代码来源:test_browser_bookmark.py

示例2: test_browser_bookmark

# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_add_bookmark_to_home_screen_choice_button [as 别名]
    def test_browser_bookmark(self):
        # https://github.com/mozilla/gaia-ui-tests/issues/452
        browser = Browser(self.marionette)
        browser.launch()

        browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')

        browser.tap_bookmark_button()
        browser.tap_add_bookmark_to_home_screen_choice_button()
        browser.type_bookmark_title(self.bookmark_title)
        browser.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        homescreen = Homescreen(self.marionette)
        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)
开发者ID:brijeshks,项目名称:gaia,代码行数:21,代码来源:test_browser_bookmark.py

示例3: test_browser_bookmark

# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_add_bookmark_to_home_screen_choice_button [as 别名]
    def test_browser_bookmark(self):
        # https://github.com/mozilla/gaia-ui-tests/issues/452
        browser = Browser(self.marionette)
        browser.launch()

        browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')

        browser.tap_bookmark_button()
        browser.tap_add_bookmark_to_home_screen_choice_button()
        browser.type_bookmark_title(self.bookmark_title)
        browser.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        homescreen = Homescreen(self.marionette)
        self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));")
        homescreen.switch_to_homescreen_frame()

        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)
开发者ID:AaronMT,项目名称:gaia-ui-tests,代码行数:22,代码来源:test_browser_bookmark.py

示例4: TestBrowserBookmark

# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_add_bookmark_to_home_screen_choice_button [as 别名]
class TestBrowserBookmark(GaiaMtbfTestCase):

    _bookmark_added = False

    def setUp(self):
        GaiaMtbfTestCase.setUp(self)
        self.connect_to_network()

        self.test_url = 'http://mozqa.com/data/firefox/layout/mozilla.html'

        curr_time = repr(time.time()).replace('.', '')
        self.bookmark_title = 'gaia%s' % curr_time[10:]

        self.homescreen = Homescreen(self.marionette)
        self.browser = Browser(self.marionette)
        self.browser.launch()

    def test_browser_bookmark(self):
        self.wait_for_element_displayed(*self.browser._awesome_bar_locator)
        self.marionette.find_element(*self.browser._awesome_bar_locator).clear()

        self.browser.go_to_url(self.test_url)
        self.browser.tap_bookmark_button()

        bookmark = self.browser.tap_add_bookmark_to_home_screen_choice_button()
        self.wait_for_element_displayed(*bookmark._bookmark_title_input_locator)
        bookmark.type_bookmark_title(self.bookmark_title)
        bookmark.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        self.wait_for_element_displayed('id', 'bookmark-title')
        self.homescreen.wait_for_app_icon_present(self.bookmark_title)
        self._bookmark_added = self.homescreen.is_app_installed(self.bookmark_title)
        if self.find_element('id', 'edit-button').is_displayed():
            self.find_element('id', 'edit-button').tap()

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)

    def tearDown(self):
        # make sure it goes back to the top for activating editing mode
        self.device.touch_home_button()
        self.device.touch_home_button()

        # delete the bookmark
        self.apps.switch_to_displayed_app()
        self.homescreen.activate_edit_mode()
        self.confirm_dialog = self.homescreen.installed_app(self.bookmark_title).tap_delete_app()
        self.confirm_dialog.tap_confirm()

        self.data_layer.disable_wifi()
        GaiaMtbfTestCase.tearDown(self)
开发者ID:nhirata,项目名称:MTBF-Driver,代码行数:55,代码来源:test_mtbf_browser_bookmark.py

示例5: test_browser_bookmark

# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_add_bookmark_to_home_screen_choice_button [as 别名]
    def test_browser_bookmark(self):
        browser = Browser(self.marionette)
        browser.launch()

        browser.go_to_url(self.test_url)
        browser.tap_bookmark_button()

        bookmark = browser.tap_add_bookmark_to_home_screen_choice_button()
        bookmark.type_bookmark_title(self.bookmark_title)
        bookmark.tap_add_bookmark_to_home_screen_dialog_button()

        # Switch to Home Screen to look for bookmark
        self.device.touch_home_button()

        homescreen = Homescreen(self.marionette)
        self._bookmark_added = homescreen.is_app_installed(self.bookmark_title)

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)
开发者ID:GotoCode,项目名称:gaia,代码行数:20,代码来源:test_browser_bookmark.py


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