# Path: webdriverwrapper/exceptions.py
# def _create_exception_msg(
#         id_=None, class_name=None, name=None, tag_name=None,
#         parent_id=None, parent_class_name=None, parent_name=None, parent_tag_name=None,
#         text=None, xpath=None, css_selector=None, url=None,
#         driver=None,
# ):
# def _create_exception_msg_tag(
#         id_=None, class_name=None, name=None, tag_name=None,
#         parent_id=None, parent_class_name=None, parent_name=None, parent_tag_name=None,
#         text=None, xpath=None, css_selector=None,
# ):
# def _create_exception_msg_tag_element(id_=None, class_name=None, name=None, tag_name=None, text=None, xpath=None, css_selector=None):
# def _get_suggestion(driver, id_=None, class_name=None, name=None):
# def _find_best_suggestion(value, items):
#     def __init__(self, url, msg):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, url, error_page, expected_error_page, allowed_error_pages, traceback=None):
#     def __init__(self, url, error_messages, expected_error_messages, allowed_error_messages):
#     def __init__(self, url, js_errors):
#     def __init__(self, url, info_messages, expected_info_messages, allowed_info_messages):
# class WebdriverWrapperException(Exception):
# class ErrorPageException(WebdriverWrapperException):
# class ErrorMessagesException(WebdriverWrapperException):
# class JSErrorsException(WebdriverWrapperException):
# class InfoMessagesException(WebdriverWrapperException):


import pytest
from webdriverwrapper.exceptions import (
    _create_exception_msg,
    _create_exception_msg_tag_element,
    _find_best_suggestion,
    NoSuchElementException,
)

def test_make_msg_id():
    assert '<* id=id>' == _create_exception_msg_tag_element(id_='id')


def test_make_msg_class_name():
    assert '<* class=class>' == _create_exception_msg_tag_element(class_name='class')


def test_make_msg_tag_name():
    assert '<div>' == _create_exception_msg_tag_element(tag_name='div')


def test_make_msg_name():
    assert '<* name=xx>' == _create_exception_msg_tag_element(name='xx')


def test_make_msg_combined():
    assert '<div id=id name=xx>' == _create_exception_msg_tag_element(tag_name='div', id_='id', name='xx')


def test_make_msg_xpath():
    assert '//*' == _create_exception_msg_tag_element(xpath='//*')


def test_make_msg_css_selector():
    assert 'div.class' == _create_exception_msg_tag_element(css_selector='div.class')


def test_make_msg_with_url():

# Path: webdriverwrapper/exceptions.py
# def _create_exception_msg(
#         id_=None, class_name=None, name=None, tag_name=None,
#         parent_id=None, parent_class_name=None, parent_name=None, parent_tag_name=None,
#         text=None, xpath=None, css_selector=None, url=None,
#         driver=None,
# ):
# def _create_exception_msg_tag(
#         id_=None, class_name=None, name=None, tag_name=None,
#         parent_id=None, parent_class_name=None, parent_name=None, parent_tag_name=None,
#         text=None, xpath=None, css_selector=None,
# ):
# def _create_exception_msg_tag_element(id_=None, class_name=None, name=None, tag_name=None, text=None, xpath=None, css_selector=None):
# def _get_suggestion(driver, id_=None, class_name=None, name=None):
# def _find_best_suggestion(value, items):
#     def __init__(self, url, msg):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, url, error_page, expected_error_page, allowed_error_pages, traceback=None):
#     def __init__(self, url, error_messages, expected_error_messages, allowed_error_messages):
#     def __init__(self, url, js_errors):
#     def __init__(self, url, info_messages, expected_info_messages, allowed_info_messages):
# class WebdriverWrapperException(Exception):
# class ErrorPageException(WebdriverWrapperException):
# class ErrorMessagesException(WebdriverWrapperException):
# class JSErrorsException(WebdriverWrapperException):
# class InfoMessagesException(WebdriverWrapperException):


# Path: tests/test_exceptions.py
import pytest
from webdriverwrapper.exceptions import (
    _create_exception_msg,
    _create_exception_msg_tag_element,
    _find_best_suggestion,
    NoSuchElementException,
)


def test_make_msg_id():
    assert '<* id=id>' == _create_exception_msg_tag_element(id_='id')


def test_make_msg_class_name():
    assert '<* class=class>' == _create_exception_msg_tag_element(class_name='class')


def test_make_msg_tag_name():
    assert '<div>' == _create_exception_msg_tag_element(tag_name='div')


def test_make_msg_name():
    assert '<* name=xx>' == _create_exception_msg_tag_element(name='xx')


def test_make_msg_combined():
    assert '<div id=id name=xx>' == _create_exception_msg_tag_element(tag_name='div', id_='id', name='xx')


def test_make_msg_xpath():
    assert '//*' == _create_exception_msg_tag_element(xpath='//*')


def test_make_msg_css_selector():
    assert 'div.class' == _create_exception_msg_tag_element(css_selector='div.class')


def test_make_msg_with_url():

    assert 'No element <* id=id> found at http://example.com' == _create_exception_msg(id_='id', url='http://example.com')