# Path: webdriverwrapper/exceptions.py
# class InfoMessagesException(WebdriverWrapperException):
#     """
#     Exception raised when there is missing some expected info message. Like
#     "sucessfully saved" and so on.
#     """
# 
#     def __init__(self, url, info_messages, expected_info_messages, allowed_info_messages):
#         msg = 'Expected info messages "{}", but found "{}" instead.'.format(expected_info_messages, info_messages)
#         if allowed_info_messages:
#             msg += ' Allowed info messages: "{}"'.format(allowed_info_messages)
#         super(InfoMessagesException, self).__init__(url, msg)


from selenium.common.exceptions import NoSuchElementException
from .exceptions import InfoMessagesException
        You can set expected infos by decorators :py:func:`.expected_info_messages`
        and :py:func:`.allowed_info_messages`.
        """
        f = lambda key, default=[]: getattr(test_method, key, default)
        expected_info_messages = f(EXPECTED_INFO_MESSAGES)
        allowed_info_messages = f(ALLOWED_INFO_MESSAGES)
        self.check_infos(expected_info_messages, allowed_info_messages)

    def check_infos(self, expected_info_messages=[], allowed_info_messages=[]):
        """
        This method should be called whenever you need to check if there is some
        info. Normally you need only ``check_expected_infos`` called after each
        test (which you specify only once), but it will check infos only at the
        end of test. When you have big use case and you need to check messages
        on every step, use this.

        To parameters you should pass same values like to decorators
        :py:func:`.expected_info_messages` and :py:func:`.allowed_info_messages`.
        """
        # Close unexpected alerts (it's blocking).
        self.close_alert(ignore_exception=True)

        expected_info_messages = set(expected_info_messages)
        allowed_info_messages = set(allowed_info_messages)
        info_messages = set(self.get_info_messages())
        if (
                info_messages & expected_info_messages != expected_info_messages
                or
                (expected_info_messages and info_messages - (expected_info_messages | allowed_info_messages))
        ):

# Path: webdriverwrapper/exceptions.py
# class InfoMessagesException(WebdriverWrapperException):
#     """
#     Exception raised when there is missing some expected info message. Like
#     "sucessfully saved" and so on.
#     """
# 
#     def __init__(self, url, info_messages, expected_info_messages, allowed_info_messages):
#         msg = 'Expected info messages "{}", but found "{}" instead.'.format(expected_info_messages, info_messages)
#         if allowed_info_messages:
#             msg += ' Allowed info messages: "{}"'.format(allowed_info_messages)
#         super(InfoMessagesException, self).__init__(url, msg)


# Path: webdriverwrapper/info.py
from selenium.common.exceptions import NoSuchElementException
from .exceptions import InfoMessagesException

        You can set expected infos by decorators :py:func:`.expected_info_messages`
        and :py:func:`.allowed_info_messages`.
        """
        f = lambda key, default=[]: getattr(test_method, key, default)
        expected_info_messages = f(EXPECTED_INFO_MESSAGES)
        allowed_info_messages = f(ALLOWED_INFO_MESSAGES)
        self.check_infos(expected_info_messages, allowed_info_messages)

    def check_infos(self, expected_info_messages=[], allowed_info_messages=[]):
        """
        This method should be called whenever you need to check if there is some
        info. Normally you need only ``check_expected_infos`` called after each
        test (which you specify only once), but it will check infos only at the
        end of test. When you have big use case and you need to check messages
        on every step, use this.

        To parameters you should pass same values like to decorators
        :py:func:`.expected_info_messages` and :py:func:`.allowed_info_messages`.
        """
        # Close unexpected alerts (it's blocking).
        self.close_alert(ignore_exception=True)

        expected_info_messages = set(expected_info_messages)
        allowed_info_messages = set(allowed_info_messages)
        info_messages = set(self.get_info_messages())
        if (
                info_messages & expected_info_messages != expected_info_messages
                or
                (expected_info_messages and info_messages - (expected_info_messages | allowed_info_messages))
        ):

            raise InfoMessagesException(self.current_url, info_messages, expected_info_messages, allowed_info_messages)