utils-seleniumxp 1.1.0__tar.gz → 1.3.0__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.
Files changed (21) hide show
  1. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/PKG-INFO +17 -10
  2. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/README.md +9 -4
  3. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/pyproject.toml +60 -27
  4. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/__init__.py +12 -3
  5. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/eventfiring_addon.py +1 -1
  6. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/eventlistener.py +1 -1
  7. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/locatorutils.py +1 -1
  8. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/sessionhandling.py +92 -48
  9. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/version.py +16 -6
  10. utils_seleniumxp-1.3.0/utils_seleniumxp/webdriver_addon.py +771 -0
  11. utils_seleniumxp-1.3.0/utils_seleniumxp/webdriver_addons/__init__.py +4 -0
  12. utils_seleniumxp-1.3.0/utils_seleniumxp/webdriver_addons/close_popups.py +350 -0
  13. utils_seleniumxp-1.3.0/utils_seleniumxp/webdriver_addons/shadow_dom.py +388 -0
  14. utils_seleniumxp-1.3.0/utils_seleniumxp/webdriver_addons/smartwait.py +0 -0
  15. utils_seleniumxp-1.3.0/utils_seleniumxp/webdriver_addons/windowopen_logger.py +195 -0
  16. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/webelement_addon.py +4 -4
  17. utils_seleniumxp-1.1.0/utils_seleniumxp/webdriver_addon.py +0 -1406
  18. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/.gitignore +0 -0
  19. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/AUTHORS.md +0 -0
  20. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/LICENSE.txt +0 -0
  21. {utils_seleniumxp-1.1.0 → utils_seleniumxp-1.3.0}/utils_seleniumxp/SeleniumPythonUtils.ini +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: utils-seleniumxp
3
- Version: 1.1.0
3
+ Version: 1.3.0
4
4
  Summary: Package with utilities and functional extensions for Selenium webdriver Python language bindings
5
5
  Project-URL: Documentation, https://dornech.github.io/utils-seleniumxp
6
6
  Project-URL: Source, https://github.com/dornech/utils-seleniumxp
@@ -10,23 +10,25 @@ Author-email: dornech <dornech@gmx.de>
10
10
  License: GPL-3.0-only
11
11
  License-File: AUTHORS.md
12
12
  License-File: LICENSE.txt
13
- Keywords: Chrome,FireFox,Selenium,close popup,event-firing webdriver,factory function,parsel,webdriver
13
+ Keywords: Chrome,FireFox,Selenium,close popup,event-firing webdriver,factory function,parsel,requests,shadow DOM,stealth-selenium,waitless,webdriver
14
14
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Classifier: Programming Language :: Python :: 3.13
19
18
  Classifier: Programming Language :: Python :: 3.14
20
19
  Classifier: Programming Language :: Python :: Implementation :: CPython
21
- Requires-Python: >=3.10
20
+ Requires-Python: >=3.11
22
21
  Requires-Dist: cssify
22
+ Requires-Dist: hatchling
23
23
  Requires-Dist: parsel
24
24
  Requires-Dist: psutil
25
25
  Requires-Dist: requests
26
+ Requires-Dist: selenium-autowait
26
27
  Requires-Dist: selenium-requests
27
- Requires-Dist: selenium~=4.33.0
28
+ Requires-Dist: selenium>=4.33.0
28
29
  Requires-Dist: stealthenium>=1.1.1
29
30
  Requires-Dist: utils-mystuff
31
+ Requires-Dist: waitless
30
32
  Description-Content-Type: text/markdown
31
33
 
32
34
  # SeleniumXP utilities for Python
@@ -46,12 +48,17 @@ The package consist of various helpers and extensions to the Selenium webdriver:
46
48
 
47
49
  Different from other packages extending the Selenium webdriver class this package does not work with
48
50
  wrapping the original webdriver but providing a mixin class or alternatively directly setting
49
- additional methods via 'setattr' in the original webdriver class. This is done and controlled
50
- via a pretty versatile custom factory function initializing the webdriver.
51
+ additional methods via 'setattr' in the original webdriver class (monkey patching). This is done
52
+ and controlled via a pretty versatile custom factory function initializing the webdriver.
53
+ The factory function includes stealthenizing mechanism. Beside typical script injection techniques
54
+ and for this reason to use pre-patched webdriver classes like "undetected chromedriver"
55
+ or other pre-patched webdriver classes. However, using pre-patched webdriver classes is not limited
56
+ to "undetected chromedriver"or patched classes for stealthenizing even the use of such functional enriched
57
+ wrappers contradict to the choosen monkey patching approach of SeleniumXP.
51
58
 
52
59
  The webelement extensions are done via setattr only. Implementing a mixin class would require
53
- to modify webdriver methods to return the new class with the mixin. So benefit of the
54
- settattr approach is that extending the webelement class is independent from changes to the
60
+ to modify webdriver methods to return the new class with the mixin. So benefit of the monkey patching
61
+ approach with setattr is that extending the webelement class is independent from changes to the
55
62
  webdriver class.
56
63
 
57
64
  Note: as I am coming from camel case notation I was struggling a little bit with the Python naming conventions.
@@ -15,12 +15,17 @@ The package consist of various helpers and extensions to the Selenium webdriver:
15
15
 
16
16
  Different from other packages extending the Selenium webdriver class this package does not work with
17
17
  wrapping the original webdriver but providing a mixin class or alternatively directly setting
18
- additional methods via 'setattr' in the original webdriver class. This is done and controlled
19
- via a pretty versatile custom factory function initializing the webdriver.
18
+ additional methods via 'setattr' in the original webdriver class (monkey patching). This is done
19
+ and controlled via a pretty versatile custom factory function initializing the webdriver.
20
+ The factory function includes stealthenizing mechanism. Beside typical script injection techniques
21
+ and for this reason to use pre-patched webdriver classes like "undetected chromedriver"
22
+ or other pre-patched webdriver classes. However, using pre-patched webdriver classes is not limited
23
+ to "undetected chromedriver"or patched classes for stealthenizing even the use of such functional enriched
24
+ wrappers contradict to the choosen monkey patching approach of SeleniumXP.
20
25
 
21
26
  The webelement extensions are done via setattr only. Implementing a mixin class would require
22
- to modify webdriver methods to return the new class with the mixin. So benefit of the
23
- settattr approach is that extending the webelement class is independent from changes to the
27
+ to modify webdriver methods to return the new class with the mixin. So benefit of the monkey patching
28
+ approach with setattr is that extending the webelement class is independent from changes to the
24
29
  webdriver class.
25
30
 
26
31
  Note: as I am coming from camel case notation I was struggling a little bit with the Python naming conventions.
@@ -15,13 +15,14 @@ build-backend = "hatchling.build"
15
15
  name = "utils-seleniumxp"
16
16
  description = "Package with utilities and functional extensions for Selenium webdriver Python language bindings"
17
17
  readme = "README.md"
18
- requires-python = ">=3.10"
18
+ requires-python = ">=3.11"
19
19
  # only license identifier from https://spdx.org/licenses/ are allowed
20
20
  license = { text = "GPL-3.0-only" }
21
21
  # keywords for easier look-up on PyPI
22
22
  keywords = [
23
23
  "Selenium", "webdriver", "Chrome", "FireFox",
24
- "factory function", "event-firing webdriver", "parsel", "close popup"
24
+ "factory function", "event-firing webdriver", "close popup",
25
+ "parsel", "requests", "shadow DOM", "stealth-selenium", "waitless"
25
26
  ]
26
27
  authors = [
27
28
  { name = "dornech", email = "dornech@gmx.de" },
@@ -29,7 +30,6 @@ authors = [
29
30
  # options under https://pypi.org/classifiers/
30
31
  classifiers = [
31
32
  "Programming Language :: Python",
32
- "Programming Language :: Python :: 3.10",
33
33
  "Programming Language :: Python :: 3.11",
34
34
  "Programming Language :: Python :: 3.12",
35
35
  "Programming Language :: Python :: 3.13",
@@ -39,13 +39,16 @@ classifiers = [
39
39
  # direct dependencies of this package, installed when users `pip install utils-seleniumxp` later.
40
40
  dependencies = [
41
41
  "cssify",
42
+ "hatchling",
42
43
  "parsel",
43
44
  "psutil",
44
45
  "requests",
45
- "selenium~=4.33.0",
46
+ "selenium>=4.33.0",
47
+ "selenium-autowait",
46
48
  "selenium-requests",
47
49
  "stealthenium>=1.1.1",
48
- "utils_mystuff"
50
+ "utils-mystuff",
51
+ "waitless",
49
52
  ]
50
53
  dynamic = ["version"]
51
54
 
@@ -93,7 +96,7 @@ exclude = [
93
96
  [tool.commitizen]
94
97
  name = "cz_customize"
95
98
  version_scheme = "pep440"
96
- version = "1.1.0"
99
+ version = "1.3.0"
97
100
  version_files = ["pyproject.toml:version"]
98
101
  tag_format = "v$version"
99
102
  # retry_after_failure = false
@@ -120,8 +123,8 @@ bump_map = {"feat" = "MINOR", "fix" = "PATCH", "BREAKING CHANGE" = "MAJOR"}
120
123
  # with Initial Commit in changelog
121
124
  commit_parser ="^(?P<change_type>[Ii]nitial [Cc]ommit|feat|fix|refactor|perf|docs|style|test|chore|build|ci|revert|BREAKING CHANGE)(\\((?P<scope>[^)]+)\\))?(:\\s(?P<message>.*))?"
122
125
  changelog_pattern = "^([Ii]nitial [Cc]ommit|feat|fix|docs|style|refactor|perf|test|chore|build|ci|revert|BREAKING CHANGE).*"
123
- change_type_map = { feat = "Features", fix = "Bug fixes", refactor = "Refactoring", perf = "performance improvements", docs = "Documentation", style = "Code style", test = "Testing", chore = "Chores", build = "Build system", ci = "Continuous Integration" }
124
- change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf", "docs", "style", "test", "chore", "build", "ci"]
126
+ change_type_map = { feat = "Features", fix = "Bug fixes", refactor = "Code refactoring", perf = "Performance improvements", docs = "Documentation", style = "Code style", test = "Testing", chore = "Chores", build = "Build system", ci = "Continuous Integration" }
127
+ change_type_order = ["BREAKING CHANGE", "Features", "Bug fixes", "Code refactoring", "Performance improvements", "Documentation", "Code style", "Testing", "Chore", "Build System", "Continuous Integration", "Initial Commit"]
125
128
 
126
129
 
127
130
  ##################
@@ -140,7 +143,7 @@ ignore-args = false
140
143
  ignore-kwargs = false
141
144
  ignore-no-params = true
142
145
  ignore_typechecker= false
143
- # disable = []
146
+ disable = ["SIG305", "SIG306"]
144
147
  # target = []
145
148
 
146
149
  [tool.ruff]
@@ -151,8 +154,9 @@ include = [
151
154
  "src/**/*.py",
152
155
  "src/**/*.pyi",
153
156
  "tests/**/*.py",
154
- "tests/**/*.pyi"
157
+ "tests/**/*.pyi",
155
158
  ]
159
+ output-prefer-rule-codes = true
156
160
 
157
161
  [tool.ruff.lint]
158
162
  preview = true # preview features & checks, use with caution
@@ -243,10 +247,32 @@ ignore_missing_imports = true
243
247
  pretty = true
244
248
  show_column_numbers = true
245
249
  warn_no_return = false
246
- warn_unused_ignores = true
250
+ # warn_unused_ignores = true
251
+ warn_unused_ignores = false
247
252
  warn_return_any = true
248
253
  warn_unused_configs = true
249
254
 
255
+ [tool.deptry]
256
+ known_first_party = ["utils_seleniumxp"]
257
+ exclude = ["docs", "tests"]
258
+ ignore_notebooks = true
259
+ github_output = true
260
+ github_warning_errors = ["DEP003"]
261
+
262
+ [tool.deptry.package_module_name_map]
263
+ mkdocs-gen-files = "mkdocs_gen_files"
264
+ cssify = "cssify"
265
+ hatchling = "hatchling"
266
+ parsel = "parsel"
267
+ psutil = "psutil"
268
+ requests = "requests"
269
+ selenium = "selenium"
270
+ selenium-autowait = "selenium_autowait"
271
+ selenium-requests = "seleniumrequests"
272
+ stealthenium = "stealthenium"
273
+ utils-mystuff = "utils_mystuff"
274
+ waitless = "waitless"
275
+
250
276
  [tool.cruft]
251
277
  skip = ["README.md", "CHANGELOG.MD", "src/", "tests/", "docs/", "notebooks/"]
252
278
 
@@ -256,6 +282,10 @@ addopts = "-ra -q --doctest-glob='*.md'"
256
282
  testpaths = [
257
283
  "tests",
258
284
  ]
285
+ markers = [
286
+ "integration: integration test cases",
287
+ "local: test cases not suitable for CI",
288
+ ]
259
289
 
260
290
  [tool.coverage.run]
261
291
  branch = true
@@ -302,20 +332,21 @@ dependencies = [
302
332
  ]
303
333
  # installer = "pip"
304
334
 
305
- # Hatch default test environment for "hatch test" (also used in GitAction)
335
+ # Hatch default test environment for "hatch test" (also used in GitHub Action)
336
+ # do not define scripts [tool.hatch.envs.hatch-test.scripts] without taking over hatch standard scripts!!!
306
337
  [tool.hatch.envs.hatch-test]
307
338
  dependencies = [
308
339
  "pip",
309
340
  "coverage-enable-subprocess==1.0",
310
- "coverage[toml]~=7.4",
311
- "pytest~=8.1",
312
- "pytest-mock~=3.12",
313
- "pytest-randomly~=3.15",
314
- "pytest-rerunfailures~=14.0",
315
- "pytest-xdist[psutil]~=3.5",
341
+ "coverage[toml]>=7.4",
342
+ "pytest>=8.1",
343
+ "pytest-mock>=3.12",
344
+ "pytest-randomly>=3.15",
345
+ "pytest-rerunfailures>=14.0",
346
+ "pytest-xdist[psutil]>=3.5",
316
347
  ]
317
348
 
318
- # Test environment with test-only dependencies (do not mix up with default hatch-test environment "hatch-test" !)
349
+ # Hatch local testing environment with test-only dependencies (do not mix up with default hatch-test environment "hatch-test" !)
319
350
  [tool.hatch.envs.test]
320
351
  dependencies = [
321
352
  # required test dependencies
@@ -332,28 +363,30 @@ dependencies = [
332
363
  cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/utils_seleniumxp --cov=tests {args}"
333
364
  no-cov = "cov --no-cov {args}"
334
365
  debug = "cov --no-cov -s --pdb --pdbcls=IPython.core.debugger:Pdb {args}"
366
+ test_not_local_only = "run pytest -m 'not local'"
367
+ test_local_only = "run pytest -m 'local'"
335
368
 
336
- # Hatch testing environment matrix for various Python versions replacing the functionality of tox
369
+ # Hatch local testing environment matrix for various Python versions replacing the functionality of tox
337
370
  [[tool.hatch.envs.test.matrix]]
338
371
  template = ["test"]
339
- python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
372
+ python = ["3.11", "3.12", "3.13", "3.14"]
340
373
 
341
374
  # Hatch default linting environment for "hatch fmt"
342
375
  [tool.hatch.envs.hatch-static-analysis]
343
376
  dependencies = [
344
377
  "pip",
345
- "mypy==1.16.0",
346
- "ruff==0.11.12",
378
+ "mypy==2.3.0",
379
+ "ruff==0.16.2",
347
380
  ]
348
381
 
349
- # Hatch Linting environment for GitAction
382
+ # Hatch Linting environment for GitHub Action
350
383
  [tool.hatch.envs.lint]
351
384
  template = "lint" # don't inherit from default!
352
385
  dependencies = [
353
386
  "pip",
354
- "mypy==1.16.0",
355
- "ruff==0.11.12",
356
- "docsig==0.71.0",
387
+ "mypy==2.3.0",
388
+ "ruff==0.16.2",
389
+ "docsig==0.94.0",
357
390
  ]
358
391
  [tool.hatch.envs.lint.scripts]
359
392
  typing = [
@@ -34,7 +34,7 @@ provided for enabling a direct download, disabling browser notifications or opti
34
34
 
35
35
  The webelement extension are done via setattr only. Implementing a mixin class would require
36
36
  to modify webdriver methods to return the new class with the mixin. So benefit of the
37
- settattr approach is that extending the webelement class is independend from changes to the
37
+ settattr approach is that extending the webelement class is independent from changes to the
38
38
  webdriver class.
39
39
 
40
40
  The package also provides an extended event-firing webdriver class.
@@ -70,13 +70,20 @@ from utils_seleniumxp.version import __version__
70
70
  # package: import <selenium.xxx> as <SeleniumBinding short name>
71
71
  # use: from UtilsSeleniumXP import <SeleniumBinding short name>
72
72
 
73
- from selenium import webdriver as WebDriver
73
+ # from selenium import webdriver as WebDriver
74
+ from selenium.webdriver.chrome.webdriver import WebDriver as Chrome
75
+ from selenium.webdriver.chrome.options import Options as ChromeOptions
76
+ from selenium.webdriver.firefox.webdriver import WebDriver as Firefox
77
+ from selenium.webdriver.firefox.options import Options as FirefoxOptions
78
+ # from selenium.webdriver.common.webdriver import LocalWebDriver as _LocalWebDriver
79
+ from selenium.webdriver.remote.webdriver import WebDriver as WebDriver
74
80
  from selenium.webdriver.remote.webdriver import WebDriver as _RemoteWebDriver
75
81
  from selenium.webdriver.remote.webelement import WebElement as _WebElement
76
82
  from selenium.webdriver.remote.shadowroot import ShadowRoot as _ShadowRoot
77
83
  from selenium.webdriver.remote.switch_to import SwitchTo as _SwitchTo
78
84
  from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
79
85
  from selenium.webdriver.common.alert import Alert
86
+ from selenium.webdriver.common.action_chains import ActionChains
80
87
  from selenium.webdriver.common.by import By
81
88
  from selenium.webdriver.common.keys import Keys
82
89
  from selenium.webdriver.support.select import Select
@@ -112,7 +119,9 @@ from utils_seleniumxp.locatorutils import SeleniumLocatorXPATH as SeleniumLocato
112
119
  from utils_seleniumxp.locatorutils import SeleniumLocatorCSS as SeleniumLocatorCSS
113
120
  from utils_seleniumxp.locatorutils import parameterizedSeleniumLocator as parameterizedSeleniumLocator
114
121
  from utils_seleniumxp.locatorutils import parselSelectorExtension as parselSelectorExtension
122
+ from utils_seleniumxp.eventlistener import SimpleEventListener
123
+
124
+ # import modules to execute code
115
125
  import utils_seleniumxp.webdriver_addon as WebdriverAddOn
116
126
  import utils_seleniumxp.webelement_addon as WebelementAddOn
117
127
  import utils_seleniumxp.eventfiring_addon as EventFiringAddon
118
- from utils_seleniumxp.eventlistener import SimpleEventListener
@@ -15,7 +15,7 @@ module providing event firing and listening - additional functionalities compare
15
15
  # boolean-type arguments
16
16
  # ruff: noqa: FBT001, FBT002
17
17
  # others
18
- # ruff: noqa: B006, E301, PLR0904, PLR0917, SIM102
18
+ # ruff: noqa: B006, E301, PLR0904, PLR0917, RUF105, SIM102
19
19
  #
20
20
  # disable mypy errors
21
21
  # - mypy error "Returning Any from function ..."
@@ -17,7 +17,7 @@ the Selenium project including not covered standard functions
17
17
  # boolean-type arguments
18
18
  # ruff: noqa: FBT001, FBT002
19
19
  # others
20
- # ruff: noqa: B006, PLR0904, PLR5501, PLR6301
20
+ # ruff: noqa: B006, PLR0904, PLR5501, PLR6301, RUF105
21
21
 
22
22
  # fmt: off
23
23
 
@@ -15,7 +15,7 @@ module providing Selenium locator tools
15
15
  # boolean-type arguments
16
16
  # ruff: noqa: FBT001, FBT002
17
17
  # others
18
- # ruff: noqa: B006, TID252
18
+ # ruff: noqa: B006, RUF105, TID252
19
19
  #
20
20
  # disable mypy errors
21
21
  # mypy: disable-error-code = "attr-defined, no-any-return"