# Path: selene/support/shared/config.py
# T = TypeVar('T')
# class Source(Generic[T]):
# class _LazyDriver:
# class SharedConfig(Config):
#     def __init__(self, value: T = None):
#     def put(self, value: T):
#     def clear(self):
#     def value(self) -> T:
#     def __init__(self, config: SharedConfig):
#     def _set_driver(self) -> Callable[[], WebDriver]:
#     def _hold_browser_open(self):
#     def has_webdriver_started(self):
#     def has_browser_alive(self):
#     def instance(self) -> WebDriver:
#     def create(self) -> WebDriver:
#         def quit_if_not_asked_to_hold():
#     def get_or_create(self) -> WebDriver:
#     def quit(self):
#     def __init__(
#         self,
#         # Config
#         driver: Optional[WebDriver] = None,
#         timeout: int = 4,  # todo: consider removing defaults
#         base_url: str = '',
#         set_value_by_js: bool = False,
#         type_by_js: bool = False,
#         wait_for_no_overlap_found_by_js: bool = False,
#         window_width: Optional[int] = None,
#         window_height: Optional[int] = None,
#         hook_wait_failure: Optional[
#             Callable[[TimeoutException], Exception]
#         ] = None,
#         log_outer_html_on_failure: bool = False,
#         # SharedConfig
#         set_driver: Callable[[], WebDriver] = None,
#         source: _LazyDriver = None,  # todo: type should not be _LazyDriver but something like Source ...
#         browser_name: str = 'chrome',  # todo: rename to config.type? config.name? config.browser?
#         hold_browser_open: bool = False,
#         save_screenshot_on_failure: bool = True,
#         save_page_source_on_failure: bool = True,
#         poll_during_waits: int = 100,
#         counter=None,  # default is set below
#         reports_folder: Optional[str] = None,  # default is set below
#         last_screenshot: Union[Optional[str], Source[str]] = None,
#         last_page_source: Union[Optional[str], Source[str]] = None,
#     ):
#     def _set_chrome_or_firefox_from_webdriver_manager(self):
#         def get_chrome():
#         def get_firefox():
#     def driver(self) -> WebDriver:
#     def get_or_create_driver(self) -> WebDriver:
#     def quit_driver(self):
#     def reset_driver(self):
#     def driver(self, value: WebDriver):
#     def set_driver(self):
#     def set_driver(self, value: Callable[[], WebDriver]):
#     def generate_filename(self, prefix='', suffix=''):
#     def _inject_screenshot_and_page_source_pre_hooks(self, hook):
#         def save_and_log_screenshot(error: TimeoutException) -> Exception:
#         def save_and_log_page_source(error: TimeoutException) -> Exception:
#     def wait(self, entity):
#     def timeout(self, value: int):
#     def base_url(self, value: str):
#     def set_value_by_js(self, value: bool):
#     def type_by_js(self, value: bool):
#     def wait_for_no_overlap_found_by_js(self, value: bool):
#     def window_width(self, value: Optional[int]):
#     def window_height(self, value: Optional[int]):
#     def log_outer_html_on_failure(self, value: bool):
#     def hook_wait_failure(
#         self, value: Callable[[TimeoutException], Exception]
#     ):
#     def last_screenshot(self) -> str:
#     def last_screenshot(self, value: str):
#     def last_page_source(self) -> str:
#     def last_page_source(self, value: str):
#     def hold_browser_open(self) -> bool:
#     def hold_browser_open(self, value: bool):
#     def save_screenshot_on_failure(self) -> bool:
#     def save_screenshot_on_failure(self, value: bool):
#     def save_page_source_on_failure(self) -> bool:
#     def save_page_source_on_failure(self, value: bool):
#     def browser_name(self) -> str:
#     def browser_name(self, value: str):
#     def cash_elements(self) -> bool:
#     def cash_elements(self, value: bool):
#     def start_maximized(self):
#     def start_maximized(self, value):
#     def desired_capabilities(self):
#     def desired_capabilities(self, value):
#     def poll_during_waits(self) -> int:
#     def poll_during_waits(self, value: int):
#     def counter(self):
#     def counter(self, value):
#     def reports_folder(self) -> str:
#     def reports_folder(self, value):


from selene.support.shared import config
# MIT License
#
# Copyright (c) 2015-2021 Iakiv Kramarenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


class TestSeleneSharedConfig:
    old_timeout = config.timeout
    # old_polling_interval = config.poll_during_waits  # deprecated
    old_base_url = config.base_url
    old_browser_name = config.browser_name
    old_hold_browser_open = config.hold_browser_open


# Path: selene/support/shared/config.py
# T = TypeVar('T')
# class Source(Generic[T]):
# class _LazyDriver:
# class SharedConfig(Config):
#     def __init__(self, value: T = None):
#     def put(self, value: T):
#     def clear(self):
#     def value(self) -> T:
#     def __init__(self, config: SharedConfig):
#     def _set_driver(self) -> Callable[[], WebDriver]:
#     def _hold_browser_open(self):
#     def has_webdriver_started(self):
#     def has_browser_alive(self):
#     def instance(self) -> WebDriver:
#     def create(self) -> WebDriver:
#         def quit_if_not_asked_to_hold():
#     def get_or_create(self) -> WebDriver:
#     def quit(self):
#     def __init__(
#         self,
#         # Config
#         driver: Optional[WebDriver] = None,
#         timeout: int = 4,  # todo: consider removing defaults
#         base_url: str = '',
#         set_value_by_js: bool = False,
#         type_by_js: bool = False,
#         wait_for_no_overlap_found_by_js: bool = False,
#         window_width: Optional[int] = None,
#         window_height: Optional[int] = None,
#         hook_wait_failure: Optional[
#             Callable[[TimeoutException], Exception]
#         ] = None,
#         log_outer_html_on_failure: bool = False,
#         # SharedConfig
#         set_driver: Callable[[], WebDriver] = None,
#         source: _LazyDriver = None,  # todo: type should not be _LazyDriver but something like Source ...
#         browser_name: str = 'chrome',  # todo: rename to config.type? config.name? config.browser?
#         hold_browser_open: bool = False,
#         save_screenshot_on_failure: bool = True,
#         save_page_source_on_failure: bool = True,
#         poll_during_waits: int = 100,
#         counter=None,  # default is set below
#         reports_folder: Optional[str] = None,  # default is set below
#         last_screenshot: Union[Optional[str], Source[str]] = None,
#         last_page_source: Union[Optional[str], Source[str]] = None,
#     ):
#     def _set_chrome_or_firefox_from_webdriver_manager(self):
#         def get_chrome():
#         def get_firefox():
#     def driver(self) -> WebDriver:
#     def get_or_create_driver(self) -> WebDriver:
#     def quit_driver(self):
#     def reset_driver(self):
#     def driver(self, value: WebDriver):
#     def set_driver(self):
#     def set_driver(self, value: Callable[[], WebDriver]):
#     def generate_filename(self, prefix='', suffix=''):
#     def _inject_screenshot_and_page_source_pre_hooks(self, hook):
#         def save_and_log_screenshot(error: TimeoutException) -> Exception:
#         def save_and_log_page_source(error: TimeoutException) -> Exception:
#     def wait(self, entity):
#     def timeout(self, value: int):
#     def base_url(self, value: str):
#     def set_value_by_js(self, value: bool):
#     def type_by_js(self, value: bool):
#     def wait_for_no_overlap_found_by_js(self, value: bool):
#     def window_width(self, value: Optional[int]):
#     def window_height(self, value: Optional[int]):
#     def log_outer_html_on_failure(self, value: bool):
#     def hook_wait_failure(
#         self, value: Callable[[TimeoutException], Exception]
#     ):
#     def last_screenshot(self) -> str:
#     def last_screenshot(self, value: str):
#     def last_page_source(self) -> str:
#     def last_page_source(self, value: str):
#     def hold_browser_open(self) -> bool:
#     def hold_browser_open(self, value: bool):
#     def save_screenshot_on_failure(self) -> bool:
#     def save_screenshot_on_failure(self, value: bool):
#     def save_page_source_on_failure(self) -> bool:
#     def save_page_source_on_failure(self, value: bool):
#     def browser_name(self) -> str:
#     def browser_name(self, value: str):
#     def cash_elements(self) -> bool:
#     def cash_elements(self, value: bool):
#     def start_maximized(self):
#     def start_maximized(self, value):
#     def desired_capabilities(self):
#     def desired_capabilities(self, value):
#     def poll_during_waits(self) -> int:
#     def poll_during_waits(self, value: int):
#     def counter(self):
#     def counter(self, value):
#     def reports_folder(self) -> str:
#     def reports_folder(self, value):


# Path: tests/integration/config_test.py
from selene.support.shared import config

# MIT License
#
# Copyright (c) 2015-2021 Iakiv Kramarenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


class TestSeleneSharedConfig:
    old_timeout = config.timeout
    # old_polling_interval = config.poll_during_waits  # deprecated
    old_base_url = config.base_url
    old_browser_name = config.browser_name
    old_hold_browser_open = config.hold_browser_open


    def setup_class(self):