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.dismiss_keyboard()
        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)
    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.dismiss_keyboard()
        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)
    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.dismiss_keyboard()
        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:
            self._go_to_next_page()
            if self.is_element_displayed(*self._homescreen_icon_locator):
                self._bookmark_added = True
                break

        self.assertTrue(self._bookmark_added, 'The bookmark %s was not found to be installed on the home screen.' % self.bookmark_title)
    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.dismiss_keyboard()
        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)