setup-selenium-testing 0.1.4__tar.gz → 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/PKG-INFO +1 -1
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/pyproject.toml +1 -1
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/setup_selenium/setup_selenium.py +17 -3
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/LICENSE +0 -0
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/README.md +0 -0
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/setup_selenium/__init__.py +0 -0
- {setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/setup_selenium/py.typed +0 -0
{setup_selenium_testing-0.1.4 → setup_selenium_testing-0.1.6}/setup_selenium/setup_selenium.py
RENAMED
@@ -8,7 +8,7 @@ import os as os
|
|
8
8
|
from enum import Enum
|
9
9
|
from typing import TYPE_CHECKING, Optional, Union
|
10
10
|
|
11
|
-
from selenium import webdriver
|
11
|
+
from selenium import __version__, webdriver
|
12
12
|
from selenium.common.exceptions import NoSuchWindowException, WebDriverException
|
13
13
|
from selenium.webdriver.chrome.service import Service as ChromeService
|
14
14
|
from selenium.webdriver.common.selenium_manager import SeleniumManager
|
@@ -28,6 +28,11 @@ if TYPE_CHECKING:
|
|
28
28
|
webdriver.FirefoxOptions, webdriver.ChromeOptions, webdriver.EdgeOptions
|
29
29
|
]
|
30
30
|
|
31
|
+
NEW_SELENIUM = False
|
32
|
+
if Version(__version__) >= Version("4.20.0"):
|
33
|
+
NEW_SELENIUM = True
|
34
|
+
|
35
|
+
|
31
36
|
__all__ = ["SetupSelenium"]
|
32
37
|
|
33
38
|
|
@@ -171,7 +176,11 @@ class SetupSelenium:
|
|
171
176
|
driver_version = driver_version or None
|
172
177
|
|
173
178
|
sm = SeleniumManager()
|
174
|
-
|
179
|
+
|
180
|
+
if NEW_SELENIUM:
|
181
|
+
args = [f"{sm._get_binary()}", "--browser", browser]
|
182
|
+
else:
|
183
|
+
args = [f"{sm.get_binary()}", "--browser", browser] # type: ignore[attr-defined]
|
175
184
|
|
176
185
|
if browser_version:
|
177
186
|
args.append("--browser-version")
|
@@ -187,7 +196,12 @@ class SetupSelenium:
|
|
187
196
|
args.append("--browser-path")
|
188
197
|
args.append(browser_path)
|
189
198
|
|
190
|
-
|
199
|
+
if NEW_SELENIUM:
|
200
|
+
args.append("--output")
|
201
|
+
args.append("json")
|
202
|
+
output = sm._run(args)
|
203
|
+
else:
|
204
|
+
output = sm.run(args) # type: ignore[attr-defined]
|
191
205
|
driver_path = output["driver_path"]
|
192
206
|
browser_path = output["browser_path"]
|
193
207
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|