chore(deps): bump selenium 4.14.0+ (#25933)
Co-authored-by: Evan Rusackas <evan@rusackas.com>
This commit is contained in:
parent
9661afff16
commit
44ff462718
|
|
@ -86,7 +86,7 @@ dependencies = [
|
||||||
"pyyaml>=6.0.0, <7.0.0",
|
"pyyaml>=6.0.0, <7.0.0",
|
||||||
"PyJWT>=2.4.0, <3.0",
|
"PyJWT>=2.4.0, <3.0",
|
||||||
"redis>=4.6.0, <5.0",
|
"redis>=4.6.0, <5.0",
|
||||||
"selenium>=3.141.0, <4.10.0",
|
"selenium>=4.14.0, <5.0",
|
||||||
"shillelagh[gsheetsapi]>=1.2.18, <2.0",
|
"shillelagh[gsheetsapi]>=1.2.18, <2.0",
|
||||||
"shortid",
|
"shortid",
|
||||||
"sshtunnel>=0.4.0, <0.5",
|
"sshtunnel>=0.4.0, <0.5",
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ attrs==24.2.0
|
||||||
# via
|
# via
|
||||||
# cattrs
|
# cattrs
|
||||||
# jsonschema
|
# jsonschema
|
||||||
|
# outcome
|
||||||
# requests-cache
|
# requests-cache
|
||||||
|
# trio
|
||||||
babel==2.16.0
|
babel==2.16.0
|
||||||
# via flask-babel
|
# via flask-babel
|
||||||
backoff==2.2.1
|
backoff==2.2.1
|
||||||
|
|
@ -42,7 +44,9 @@ cattrs==24.1.2
|
||||||
celery==5.4.0
|
celery==5.4.0
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
certifi==2024.8.30
|
certifi==2024.8.30
|
||||||
# via requests
|
# via
|
||||||
|
# requests
|
||||||
|
# selenium
|
||||||
cffi==1.17.1
|
cffi==1.17.1
|
||||||
# via
|
# via
|
||||||
# cryptography
|
# cryptography
|
||||||
|
|
@ -93,7 +97,10 @@ email-validator==2.2.0
|
||||||
et-xmlfile==2.0.0
|
et-xmlfile==2.0.0
|
||||||
# via openpyxl
|
# via openpyxl
|
||||||
exceptiongroup==1.2.2
|
exceptiongroup==1.2.2
|
||||||
# via cattrs
|
# via
|
||||||
|
# cattrs
|
||||||
|
# trio
|
||||||
|
# trio-websocket
|
||||||
flask==2.3.3
|
flask==2.3.3
|
||||||
# via
|
# via
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
|
|
@ -149,8 +156,11 @@ greenlet==3.0.3
|
||||||
# -r requirements/base.in
|
# -r requirements/base.in
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
# shillelagh
|
# shillelagh
|
||||||
|
# sqlalchemy
|
||||||
gunicorn==23.0.0
|
gunicorn==23.0.0
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
|
h11==0.14.0
|
||||||
|
# via wsproto
|
||||||
hashids==1.3.1
|
hashids==1.3.1
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
holidays==0.25
|
holidays==0.25
|
||||||
|
|
@ -161,8 +171,13 @@ idna==3.10
|
||||||
# via
|
# via
|
||||||
# email-validator
|
# email-validator
|
||||||
# requests
|
# requests
|
||||||
|
# trio
|
||||||
importlib-metadata==8.5.0
|
importlib-metadata==8.5.0
|
||||||
# via apache-superset (pyproject.toml)
|
# via
|
||||||
|
# apache-superset (pyproject.toml)
|
||||||
|
# flask
|
||||||
|
# markdown
|
||||||
|
# shillelagh
|
||||||
importlib-resources==6.4.5
|
importlib-resources==6.4.5
|
||||||
# via limits
|
# via limits
|
||||||
isodate==0.7.2
|
isodate==0.7.2
|
||||||
|
|
@ -228,6 +243,8 @@ openpyxl==3.1.5
|
||||||
# via pandas
|
# via pandas
|
||||||
ordered-set==4.1.0
|
ordered-set==4.1.0
|
||||||
# via flask-limiter
|
# via flask-limiter
|
||||||
|
outcome==1.3.0.post0
|
||||||
|
# via trio
|
||||||
packaging==24.2
|
packaging==24.2
|
||||||
# via
|
# via
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
|
|
@ -283,6 +300,8 @@ pyparsing==3.2.0
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
pyrsistent==0.20.0
|
pyrsistent==0.20.0
|
||||||
# via jsonschema
|
# via jsonschema
|
||||||
|
pysocks==1.7.1
|
||||||
|
# via urllib3
|
||||||
python-dateutil==2.9.0.post0
|
python-dateutil==2.9.0.post0
|
||||||
# via
|
# via
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
|
|
@ -319,7 +338,7 @@ rich==13.9.4
|
||||||
# via flask-limiter
|
# via flask-limiter
|
||||||
rsa==4.9
|
rsa==4.9
|
||||||
# via google-auth
|
# via google-auth
|
||||||
selenium==3.141.0
|
selenium==4.27.1
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
shillelagh==1.2.18
|
shillelagh==1.2.18
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
|
|
@ -335,6 +354,10 @@ six==1.16.0
|
||||||
# wtforms-json
|
# wtforms-json
|
||||||
slack-sdk==3.33.4
|
slack-sdk==3.33.4
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
|
sniffio==1.3.1
|
||||||
|
# via trio
|
||||||
|
sortedcontainers==2.4.0
|
||||||
|
# via trio
|
||||||
sqlalchemy==1.4.54
|
sqlalchemy==1.4.54
|
||||||
# via
|
# via
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
|
|
@ -356,14 +379,22 @@ sshtunnel==0.4.0
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
tabulate==0.8.10
|
tabulate==0.8.10
|
||||||
# via apache-superset (pyproject.toml)
|
# via apache-superset (pyproject.toml)
|
||||||
|
trio==0.28.0
|
||||||
|
# via
|
||||||
|
# selenium
|
||||||
|
# trio-websocket
|
||||||
|
trio-websocket==0.11.1
|
||||||
|
# via selenium
|
||||||
typing-extensions==4.12.2
|
typing-extensions==4.12.2
|
||||||
# via
|
# via
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
# alembic
|
# alembic
|
||||||
# cattrs
|
# cattrs
|
||||||
# flask-limiter
|
# flask-limiter
|
||||||
|
# kombu
|
||||||
# limits
|
# limits
|
||||||
# rich
|
# rich
|
||||||
|
# selenium
|
||||||
# shillelagh
|
# shillelagh
|
||||||
tzdata==2024.2
|
tzdata==2024.2
|
||||||
# via
|
# via
|
||||||
|
|
@ -385,6 +416,8 @@ vine==5.1.0
|
||||||
# kombu
|
# kombu
|
||||||
wcwidth==0.2.13
|
wcwidth==0.2.13
|
||||||
# via prompt-toolkit
|
# via prompt-toolkit
|
||||||
|
websocket-client==1.8.0
|
||||||
|
# via selenium
|
||||||
werkzeug==3.1.3
|
werkzeug==3.1.3
|
||||||
# via
|
# via
|
||||||
# -r requirements/base.in
|
# -r requirements/base.in
|
||||||
|
|
@ -394,6 +427,8 @@ werkzeug==3.1.3
|
||||||
# flask-login
|
# flask-login
|
||||||
wrapt==1.17.0
|
wrapt==1.17.0
|
||||||
# via deprecated
|
# via deprecated
|
||||||
|
wsproto==1.2.0
|
||||||
|
# via trio-websocket
|
||||||
wtforms==3.2.1
|
wtforms==3.2.1
|
||||||
# via
|
# via
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
|
|
@ -409,6 +444,8 @@ xlsxwriter==3.0.9
|
||||||
# apache-superset (pyproject.toml)
|
# apache-superset (pyproject.toml)
|
||||||
# pandas
|
# pandas
|
||||||
zipp==3.21.0
|
zipp==3.21.0
|
||||||
# via importlib-metadata
|
# via
|
||||||
|
# importlib-metadata
|
||||||
|
# importlib-resources
|
||||||
zstandard==0.23.0
|
zstandard==0.23.0
|
||||||
# via flask-compress
|
# via flask-compress
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ attrs==24.2.0
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# cattrs
|
# cattrs
|
||||||
# jsonschema
|
# jsonschema
|
||||||
|
# outcome
|
||||||
# requests-cache
|
# requests-cache
|
||||||
|
# trio
|
||||||
babel==2.16.0
|
babel==2.16.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -77,6 +79,7 @@ certifi==2024.8.30
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# requests
|
# requests
|
||||||
|
# selenium
|
||||||
cffi==1.17.1
|
cffi==1.17.1
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -177,6 +180,8 @@ exceptiongroup==1.2.2
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# cattrs
|
# cattrs
|
||||||
# pytest
|
# pytest
|
||||||
|
# trio
|
||||||
|
# trio-websocket
|
||||||
filelock==3.12.2
|
filelock==3.12.2
|
||||||
# via virtualenv
|
# via virtualenv
|
||||||
flask==2.3.3
|
flask==2.3.3
|
||||||
|
|
@ -312,6 +317,7 @@ greenlet==3.0.3
|
||||||
# apache-superset
|
# apache-superset
|
||||||
# gevent
|
# gevent
|
||||||
# shillelagh
|
# shillelagh
|
||||||
|
# sqlalchemy
|
||||||
grpcio==1.68.0
|
grpcio==1.68.0
|
||||||
# via
|
# via
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
|
@ -323,6 +329,10 @@ gunicorn==23.0.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
h11==0.14.0
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# wsproto
|
||||||
hashids==1.3.1
|
hashids==1.3.1
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -343,14 +353,19 @@ idna==3.10
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# email-validator
|
# email-validator
|
||||||
# requests
|
# requests
|
||||||
|
# trio
|
||||||
importlib-metadata==8.5.0
|
importlib-metadata==8.5.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
# flask
|
||||||
|
# markdown
|
||||||
|
# shillelagh
|
||||||
importlib-resources==6.4.5
|
importlib-resources==6.4.5
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# limits
|
# limits
|
||||||
|
# matplotlib
|
||||||
# prophet
|
# prophet
|
||||||
iniconfig==2.0.0
|
iniconfig==2.0.0
|
||||||
# via pytest
|
# via pytest
|
||||||
|
|
@ -479,6 +494,10 @@ ordered-set==4.1.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# flask-limiter
|
# flask-limiter
|
||||||
|
outcome==1.3.0.post0
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# trio
|
||||||
packaging==24.2
|
packaging==24.2
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -629,6 +648,10 @@ pyrsistent==0.20.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# jsonschema
|
# jsonschema
|
||||||
|
pysocks==1.7.1
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# urllib3
|
||||||
pytest==7.4.4
|
pytest==7.4.4
|
||||||
# via
|
# via
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
|
@ -716,7 +739,7 @@ rsa==4.9
|
||||||
# google-auth
|
# google-auth
|
||||||
ruff==0.8.0
|
ruff==0.8.0
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
selenium==3.141.0
|
selenium==4.27.1
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
|
@ -751,6 +774,14 @@ slack-sdk==3.33.4
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# apache-superset
|
# apache-superset
|
||||||
|
sniffio==1.3.1
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# trio
|
||||||
|
sortedcontainers==2.4.0
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# trio
|
||||||
sqlalchemy==1.4.54
|
sqlalchemy==1.4.54
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -799,6 +830,15 @@ tqdm==4.67.1
|
||||||
# prophet
|
# prophet
|
||||||
trino==0.330.0
|
trino==0.330.0
|
||||||
# via apache-superset
|
# via apache-superset
|
||||||
|
trio==0.28.0
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# selenium
|
||||||
|
# trio-websocket
|
||||||
|
trio-websocket==0.11.1
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# selenium
|
||||||
typing-extensions==4.12.2
|
typing-extensions==4.12.2
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -806,8 +846,10 @@ typing-extensions==4.12.2
|
||||||
# apache-superset
|
# apache-superset
|
||||||
# cattrs
|
# cattrs
|
||||||
# flask-limiter
|
# flask-limiter
|
||||||
|
# kombu
|
||||||
# limits
|
# limits
|
||||||
# rich
|
# rich
|
||||||
|
# selenium
|
||||||
# shillelagh
|
# shillelagh
|
||||||
tzdata==2024.2
|
tzdata==2024.2
|
||||||
# via
|
# via
|
||||||
|
|
@ -840,6 +882,10 @@ wcwidth==0.2.13
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# prompt-toolkit
|
# prompt-toolkit
|
||||||
|
websocket-client==1.8.0
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# selenium
|
||||||
werkzeug==3.1.3
|
werkzeug==3.1.3
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -851,6 +897,10 @@ wrapt==1.17.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# deprecated
|
# deprecated
|
||||||
|
wsproto==1.2.0
|
||||||
|
# via
|
||||||
|
# -c requirements/base.txt
|
||||||
|
# trio-websocket
|
||||||
wtforms==3.2.1
|
wtforms==3.2.1
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
|
|
@ -875,6 +925,7 @@ zipp==3.21.0
|
||||||
# via
|
# via
|
||||||
# -c requirements/base.txt
|
# -c requirements/base.txt
|
||||||
# importlib-metadata
|
# importlib-metadata
|
||||||
|
# importlib-resources
|
||||||
zope-event==5.0
|
zope-event==5.0
|
||||||
# via gevent
|
# via gevent
|
||||||
zope-interface==5.4.0
|
zope-interface==5.4.0
|
||||||
|
|
|
||||||
|
|
@ -1488,7 +1488,10 @@ WEBDRIVER_WINDOW = {
|
||||||
WEBDRIVER_AUTH_FUNC = None
|
WEBDRIVER_AUTH_FUNC = None
|
||||||
|
|
||||||
# Any config options to be passed as-is to the webdriver
|
# Any config options to be passed as-is to the webdriver
|
||||||
WEBDRIVER_CONFIGURATION: dict[Any, Any] = {"service_log_path": "/dev/null"}
|
WEBDRIVER_CONFIGURATION = {
|
||||||
|
"options": {"capabilities": {}, "preferences": {}},
|
||||||
|
"service": {"log_output": "/dev/null", "service_args": [], "port": 0, "env": {}},
|
||||||
|
}
|
||||||
|
|
||||||
# Additional args to be passed as arguments to the config object
|
# Additional args to be passed as arguments to the config object
|
||||||
# Note: If using Chrome, you'll want to add the "--marionette" arg.
|
# Note: If using Chrome, you'll want to add the "--marionette" arg.
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,11 @@ import logging
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from typing import Any, TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
|
from packaging import version
|
||||||
|
from selenium import __version__ as selenium_version
|
||||||
from selenium.common.exceptions import (
|
from selenium.common.exceptions import (
|
||||||
StaleElementReferenceException,
|
StaleElementReferenceException,
|
||||||
TimeoutException,
|
TimeoutException,
|
||||||
|
|
@ -31,6 +33,7 @@ from selenium.common.exceptions import (
|
||||||
)
|
)
|
||||||
from selenium.webdriver import chrome, firefox, FirefoxProfile
|
from selenium.webdriver import chrome, firefox, FirefoxProfile
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
|
from selenium.webdriver.common.service import Service
|
||||||
from selenium.webdriver.remote.webdriver import WebDriver
|
from selenium.webdriver.remote.webdriver import WebDriver
|
||||||
from selenium.webdriver.support import expected_conditions as EC # noqa: N812
|
from selenium.webdriver.support import expected_conditions as EC # noqa: N812
|
||||||
from selenium.webdriver.support.ui import WebDriverWait
|
from selenium.webdriver.support.ui import WebDriverWait
|
||||||
|
|
@ -246,13 +249,16 @@ class WebDriverSelenium(WebDriverProxy):
|
||||||
def create(self) -> WebDriver:
|
def create(self) -> WebDriver:
|
||||||
pixel_density = current_app.config["WEBDRIVER_WINDOW"].get("pixel_density", 1)
|
pixel_density = current_app.config["WEBDRIVER_WINDOW"].get("pixel_density", 1)
|
||||||
if self._driver_type == "firefox":
|
if self._driver_type == "firefox":
|
||||||
driver_class = firefox.webdriver.WebDriver
|
driver_class: type[WebDriver] = firefox.webdriver.WebDriver
|
||||||
|
service_class: type[Service] = firefox.service.Service
|
||||||
options = firefox.options.Options()
|
options = firefox.options.Options()
|
||||||
profile = FirefoxProfile()
|
profile = FirefoxProfile()
|
||||||
profile.set_preference("layout.css.devPixelsPerPx", str(pixel_density))
|
profile.set_preference("layout.css.devPixelsPerPx", str(pixel_density))
|
||||||
kwargs: dict[Any, Any] = {"options": options, "firefox_profile": profile}
|
options.profile = profile
|
||||||
|
kwargs = {"options": options}
|
||||||
elif self._driver_type == "chrome":
|
elif self._driver_type == "chrome":
|
||||||
driver_class = chrome.webdriver.WebDriver
|
driver_class = chrome.webdriver.WebDriver
|
||||||
|
service_class = chrome.service.Service
|
||||||
options = chrome.options.Options()
|
options = chrome.options.Options()
|
||||||
options.add_argument(f"--force-device-scale-factor={pixel_density}")
|
options.add_argument(f"--force-device-scale-factor={pixel_density}")
|
||||||
options.add_argument(f"--window-size={self._window[0]},{self._window[1]}")
|
options.add_argument(f"--window-size={self._window[0]},{self._window[1]}")
|
||||||
|
|
@ -261,15 +267,41 @@ class WebDriverSelenium(WebDriverProxy):
|
||||||
raise Exception( # pylint: disable=broad-exception-raised
|
raise Exception( # pylint: disable=broad-exception-raised
|
||||||
f"Webdriver name ({self._driver_type}) not supported"
|
f"Webdriver name ({self._driver_type}) not supported"
|
||||||
)
|
)
|
||||||
# Prepare args for the webdriver init
|
|
||||||
|
|
||||||
# Add additional configured options
|
# Prepare args for the webdriver init
|
||||||
for arg in current_app.config["WEBDRIVER_OPTION_ARGS"]:
|
for arg in list(current_app.config["WEBDRIVER_OPTION_ARGS"]):
|
||||||
options.add_argument(arg)
|
options.add_argument(arg)
|
||||||
|
|
||||||
kwargs.update(current_app.config["WEBDRIVER_CONFIGURATION"])
|
# Add additional configured webdriver options
|
||||||
logger.debug("Init selenium driver")
|
webdriver_conf = dict(current_app.config["WEBDRIVER_CONFIGURATION"])
|
||||||
|
|
||||||
|
if version.parse(selenium_version) < version.parse("4.10.0"):
|
||||||
|
kwargs |= webdriver_conf
|
||||||
|
else:
|
||||||
|
driver_opts = dict(
|
||||||
|
webdriver_conf.get("options", {"capabilities": {}, "preferences": {}})
|
||||||
|
)
|
||||||
|
driver_srv = dict(
|
||||||
|
webdriver_conf.get(
|
||||||
|
"service",
|
||||||
|
{
|
||||||
|
"log_output": "/dev/null",
|
||||||
|
"service_args": [],
|
||||||
|
"port": 0,
|
||||||
|
"env": {},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
)
|
||||||
|
for name, value in driver_opts.get("capabilities", {}).items():
|
||||||
|
options.set_capability(name, value)
|
||||||
|
if hasattr(options, "profile"):
|
||||||
|
for name, value in driver_opts.get("preferences", {}).items():
|
||||||
|
options.profile.set_preference(str(name), value)
|
||||||
|
kwargs |= {
|
||||||
|
"service": service_class(**driver_srv),
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.debug("Init selenium driver")
|
||||||
return driver_class(**kwargs)
|
return driver_class(**kwargs)
|
||||||
|
|
||||||
def auth(self, user: User) -> WebDriver:
|
def auth(self, user: User) -> WebDriver:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue