setup-selenium-testing 0.1.3__py3-none-any.whl → 0.1.6__py3-none-any.whl

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.
@@ -1 +1 @@
1
- from .selenium_module import Browser, SetupSelenium, set_logger
1
+ from .setup_selenium import Browser, SetupSelenium, set_logger
@@ -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
- args = [f"{sm.get_binary()}", "--browser", browser]
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
- output = sm.run(args)
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
 
@@ -288,10 +302,14 @@ class SetupSelenium:
288
302
  # log file. if we enable root logging, we can capture the logging from
289
303
  # geckodriver, ourselves.
290
304
  logpath = os.path.devnull
291
- options.log.level = "fatal" # type: ignore[assignment]
292
305
  if enable_log_driver:
293
306
  lp = os.path.abspath(os.path.expanduser(log_dir))
294
307
  logpath = os.path.join(lp, "geckodriver.log")
308
+ if not options.log.level:
309
+ options.log.level = "trace" # type: ignore[assignment]
310
+
311
+ if not options.log.level:
312
+ options.log.level = "fatal" # type: ignore[assignment]
295
313
 
296
314
  if driver_path:
297
315
  service = FirefoxService(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: setup-selenium-testing
3
- Version: 0.1.3
3
+ Version: 0.1.6
4
4
  Summary: Setup Selenium for automation testing
5
5
  Home-page: https://github.com/bandophahita/setup_selenium
6
6
  License: MIT
@@ -21,10 +21,9 @@ Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Provides-Extra: dev
22
22
  Provides-Extra: test
23
23
  Requires-Dist: black ; extra == "dev"
24
- Requires-Dist: isort ; extra == "dev"
25
24
  Requires-Dist: mypy ; extra == "dev"
26
25
  Requires-Dist: pytest ; extra == "dev" or extra == "test"
27
- Requires-Dist: ruff ; extra == "dev"
26
+ Requires-Dist: ruff (>=0.2.0) ; extra == "dev"
28
27
  Requires-Dist: selenium (>=4.7.0)
29
28
  Requires-Dist: semantic-version
30
29
  Requires-Dist: tox ; extra == "dev" or extra == "test"
@@ -0,0 +1,7 @@
1
+ setup_selenium/__init__.py,sha256=-w9Vvo72ZLaEyIEfc_Nh0bDDJz9W0pOy4rkRXurIJHI,63
2
+ setup_selenium/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ setup_selenium/setup_selenium.py,sha256=Gt4KKP1s-ADqvJY-FRvLGK3bX3nMXKQ8booLnKaTc3U,21576
4
+ setup_selenium_testing-0.1.6.dist-info/LICENSE,sha256=KGdE-1D1chm3UNFtfE8x-EpVxhmv2zFx8oltbO8M1qE,1070
5
+ setup_selenium_testing-0.1.6.dist-info/METADATA,sha256=mxSK2mKqxISsVvH24MK86OHLqxRYceV2YyYV0GrAxj8,5357
6
+ setup_selenium_testing-0.1.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
7
+ setup_selenium_testing-0.1.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.8.1
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- setup_selenium/__init__.py,sha256=Wem42Sg7sr4nq1d_qVeSrxee5YXllJvfex3sBdoiCRM,64
2
- setup_selenium/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- setup_selenium/selenium_module.py,sha256=4nLGWMXQsUwQPxJWMuq8XnR_qNHQGhyF7ta71SomzrQ,21006
4
- setup_selenium_testing-0.1.3.dist-info/LICENSE,sha256=KGdE-1D1chm3UNFtfE8x-EpVxhmv2zFx8oltbO8M1qE,1070
5
- setup_selenium_testing-0.1.3.dist-info/METADATA,sha256=CsHV_im2TaGQtkc2Oe85GAdpusQ6PIiTcEfA53IM_ZI,5385
6
- setup_selenium_testing-0.1.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
7
- setup_selenium_testing-0.1.3.dist-info/RECORD,,