capybara/node/matchers.py
def assert_text(self, *args, **kwargs):
        """
        Asserts that the page or current node has the given text content, ignoring any HTML tags.

        Args:
            *args: Variable length argument list for :class:`TextQuery`.
            **kwargs: Arbitrary keyword arguments for :class:`TextQuery`.

        Returns:
            True

        Raises:
            ExpectationNotMet: If the assertion hasn't succeeded during the wait time.
        """

        query = TextQuery(*args, **kwargs)

        @self.synchronize(wait=query.wait)
        def assert_text():
            count = query.resolve_for(self)

            if not (matches_count(count, query.options) and
                    (count > 0 or expects_none(query.options))):
                raise ExpectationNotMet(query.failure_message)

            return True

        return assert_text()
def assert_text(self, *args, **kwargs):
        """
        Asserts that the page or current node has the given text content, ignoring any HTML tags.

        Args:
            *args: Variable length argument list for :class:`TextQuery`.
            **kwargs: Arbitrary keyword arguments for :class:`TextQuery`.

        Returns:
            True

        Raises:
            ExpectationNotMet: If the assertion hasn't succeeded during the wait time.
        """

        query = TextQuery(*args, **kwargs)

        @self.synchronize(wait=query.wait)
        def assert_text():
            count = query.resolve_for(self)

            if not (matches_count(count, query.options) and
                    (count > 0 or expects_none(query.options))):
                raise ExpectationNotMet(query.failure_message)

            return True

        return assert_text()
Asserts that the page or current node has the given text content, ignoring any HTML tags.

        Args:
            *args: Variable length argument list for :class:`TextQuery`.
            **kwargs: Arbitrary keyword arguments for :class:`TextQuery`.

        Returns:
            True

        Raises:
            ExpectationNotMet: If the assertion hasn't succeeded during the wait time.