SeleniumBase/seleniumbase/__init__.py

51 lines
2.2 KiB
Python
Raw Normal View History

2022-05-14 06:16:25 +08:00
import collections
2024-06-24 01:43:13 +08:00
import os
import pdb
try:
import pdbp # (Pdb+) --- Python Debugger Plus
except Exception:
pass
2022-05-14 06:16:25 +08:00
import sys
2022-02-26 07:08:31 +08:00
from selenium import webdriver
from seleniumbase.__version__ import __version__
2022-05-14 06:16:25 +08:00
from seleniumbase.common import decorators # noqa
from seleniumbase.common import encryption # noqa
from seleniumbase.core import colored_traceback
from seleniumbase.core.browser_launcher import get_driver # noqa
2022-01-27 14:35:25 +08:00
from seleniumbase.fixtures import js_utils # noqa
from seleniumbase.fixtures import page_actions # noqa
from seleniumbase.fixtures import page_utils # noqa
2023-07-18 23:22:23 +08:00
from seleniumbase.fixtures import shared_utils # noqa
2015-12-05 05:11:53 +08:00
from seleniumbase.fixtures.base_case import BaseCase # noqa
2016-07-15 11:26:03 +08:00
from seleniumbase.masterqa.master_qa import MasterQA # noqa
from seleniumbase.plugins.sb_manager import SB # noqa
from seleniumbase.plugins.driver_manager import Driver # noqa
from seleniumbase.plugins.driver_manager import DriverContext # noqa
2022-12-31 17:22:59 +08:00
from seleniumbase import translate # noqa
2021-05-09 02:17:24 +08:00
if sys.version_info[0] < 3 and "pdbp" in locals():
# With Python3, "import pdbp" is all you need
for key in pdbp.__dict__.keys():
# Replace pdb with pdbp
pdb.__dict__[key] = pdbp.__dict__[key]
if hasattr(pdb, "DefaultConfig"):
# Here's how to customize Pdb+ options
2023-04-27 04:15:06 +08:00
pdb.DefaultConfig.filename_color = pdb.Color.fuchsia
pdb.DefaultConfig.line_number_color = pdb.Color.turquoise
2023-04-27 04:15:06 +08:00
pdb.DefaultConfig.truncate_long_lines = False
pdb.DefaultConfig.sticky_by_default = True
colored_traceback.add_hook()
2024-06-24 01:43:13 +08:00
os.environ["SE_AVOID_STATS"] = "true" # Disable Selenium Manager stats
2022-02-26 07:08:31 +08:00
if sys.version_info >= (3, 7):
webdriver.TouchActions = None # Lifeline for past selenium-wire versions
if sys.version_info >= (3, 10):
2022-02-26 07:08:31 +08:00
collections.Callable = collections.abc.Callable # Lifeline for nosetests
del collections # Undo "import collections" / Simplify "dir(seleniumbase)"
2024-06-24 01:43:13 +08:00
del os # Undo "import os" / Simplify "dir(seleniumbase)"
2020-04-27 13:03:21 +08:00
del sys # Undo "import sys" / Simplify "dir(seleniumbase)"
2022-02-26 07:08:31 +08:00
del webdriver # Undo "import webdriver" / Simplify "dir(seleniumbase)"
version_list = [int(i) for i in __version__.split(".") if i.isdigit()]
version_tuple = tuple(version_list)
version_info = version_tuple # noqa