capybara/node/document_matchers.py
def has_title(self, title, **kwargs):
        """
        Checks if the page has the given title.

        Args:
            title (str | RegexObject): The string or regex that the title should match.
            **kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.

        Returns:
            bool: Whether it matches.
        """

        try:
            self.assert_title(title, **kwargs)
            return True
        except ExpectationNotMet:
            return False
def has_title(self, title, **kwargs):
        """
        Checks if the page has the given title.

        Args:
            title (str | RegexObject): The string or regex that the title should match.
            **kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.

        Returns:
            bool: Whether it matches.
        """

        try:
            self.assert_title(title, **kwargs)
            return True
        except ExpectationNotMet:
            return False
Checks if the page has the given title.

        Args:
            title (str | RegexObject): The string or regex that the title should match.
            **kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.

        Returns:
            bool: Whether it matches.