def confirm_bookmark_exists()

in modules/browser_object_navigation.py [0:0]


    def confirm_bookmark_exists(self, match_string: str) -> BasePage:
        """
        For a given string, return self if it exists in the label of a bookmark, else assert False.
        """

        bookmarks = self.get_elements("bookmark-in-bar")
        logging.info(f"Found {len(bookmarks)} bookmarks.")
        for el in bookmarks:
            logging.info(el.get_attribute("label"))

        matches_short_string = any(
            [match_string in el.get_attribute("label") for el in bookmarks]
        )
        matches_long_string = any(
            [el.get_attribute("label") in match_string for el in bookmarks]
        )
        assert matches_short_string or matches_long_string
        return self