QWeb 3.3.0__tar.gz → 3.3.1__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 (83) hide show
  1. {QWeb-3.3.0 → QWeb-3.3.1}/PKG-INFO +1 -1
  2. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/_version.py +3 -3
  3. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/text.py +41 -11
  4. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/PKG-INFO +1 -1
  5. {QWeb-3.3.0 → QWeb-3.3.1}/LICENSE +0 -0
  6. {QWeb-3.3.0 → QWeb-3.3.1}/MANIFEST.in +0 -0
  7. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/__init__.py +0 -0
  8. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/__main__.py +0 -0
  9. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/custom_config.py +0 -0
  10. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/__init__.py +0 -0
  11. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/actions.py +0 -0
  12. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/ajax.py +0 -0
  13. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/alert.py +0 -0
  14. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/blocks.py +0 -0
  15. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/__init__.py +0 -0
  16. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/android.py +0 -0
  17. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/bs_desktop.py +0 -0
  18. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/bs_mobile.py +0 -0
  19. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/chrome.py +0 -0
  20. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/edge.py +0 -0
  21. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/firefox.py +0 -0
  22. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/browser/safari.py +0 -0
  23. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/checkbox.py +0 -0
  24. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/config.py +0 -0
  25. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/config_defaults.py +0 -0
  26. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/cookies.py +0 -0
  27. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/decorators.py +0 -0
  28. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/download.py +0 -0
  29. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/dragdrop.py +0 -0
  30. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/dropdown.py +0 -0
  31. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/element.py +0 -0
  32. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/exceptions.py +0 -0
  33. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/file.py +0 -0
  34. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/frame.py +0 -0
  35. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/frame_checker.py +0 -0
  36. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/icon.py +0 -0
  37. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/input_.py +0 -0
  38. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/input_handler.py +0 -0
  39. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/javascript.py +0 -0
  40. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/lists.py +0 -0
  41. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/meas.py +0 -0
  42. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/platform.py +0 -0
  43. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/screenshot.py +0 -0
  44. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/search_strategy.py +0 -0
  45. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/secrets.py +0 -0
  46. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/table.py +0 -0
  47. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/user.py +0 -0
  48. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/util.py +0 -0
  49. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/window.py +0 -0
  50. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/internal/xhr.py +0 -0
  51. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/__init__.py +0 -0
  52. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/ajax.py +0 -0
  53. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/alert.py +0 -0
  54. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/blocks.py +0 -0
  55. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/browser.py +0 -0
  56. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/checkbox.py +0 -0
  57. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/config.py +0 -0
  58. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/cookies.py +0 -0
  59. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/debug.py +0 -0
  60. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/download.py +0 -0
  61. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/dragdrop.py +0 -0
  62. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/dropdown.py +0 -0
  63. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/element.py +0 -0
  64. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/file.py +0 -0
  65. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/frame.py +0 -0
  66. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/icon.py +0 -0
  67. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/input_.py +0 -0
  68. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/javascript.py +0 -0
  69. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/lists.py +0 -0
  70. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/screenshot.py +0 -0
  71. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/search_strategy.py +0 -0
  72. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/table.py +0 -0
  73. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/text.py +0 -0
  74. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb/keywords/window.py +0 -0
  75. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/SOURCES.txt +0 -0
  76. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/dependency_links.txt +0 -0
  77. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/not-zip-safe +0 -0
  78. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/requires.txt +0 -0
  79. {QWeb-3.3.0 → QWeb-3.3.1}/QWeb.egg-info/top_level.txt +0 -0
  80. {QWeb-3.3.0 → QWeb-3.3.1}/README.md +0 -0
  81. {QWeb-3.3.0 → QWeb-3.3.1}/setup.cfg +0 -0
  82. {QWeb-3.3.0 → QWeb-3.3.1}/setup.py +0 -0
  83. {QWeb-3.3.0 → QWeb-3.3.1}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: QWeb
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: Keyword driven automation for the web
5
5
  Home-page: https://github.com/qentinelqi/qweb/
6
6
  Author: Qentinel Group
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-05-15T09:38:03+0300",
11
+ "date": "2024-05-22T15:39:23+0300",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "0fd1c7dfe8396e97924772cc016ddaf47cc36bdb",
15
- "version": "v3.3.0"
14
+ "full-revisionid": "17e1c21838fcba8fb0a839efefe66df28dd0d45e",
15
+ "version": "v3.3.1"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -176,7 +176,7 @@ def get_all_text_elements(text: str, **kwargs) -> list[WebElement]:
176
176
 
177
177
  if "css" not in kwargs:
178
178
  try:
179
- web_elements = get_clickable_element_by_js(text, shadow_dom=shadow_dom, **kwargs)
179
+ web_elements = get_clickable_elements(text, shadow_dom=shadow_dom, **kwargs)
180
180
  except (
181
181
  JavascriptException,
182
182
  WebDriverException,
@@ -428,21 +428,51 @@ def _get_anchor_with_inner_text(
428
428
 
429
429
 
430
430
  @frame.all_frames
431
- def get_clickable_element_by_js(
431
+ def get_clickable_elements(
432
432
  locator: str, shadow_dom: bool = False, **kwargs
433
433
  ) -> Optional[list[WebElement]]:
434
+ """
435
+ Retrieve clickable elements based on a locator string.
436
+
437
+ Args:
438
+ locator (str): The string to locate elements by.
439
+ shadow_dom (bool): Whether to search within shadow DOM.
440
+ partial_match (bool): Whether to use partial matching.
441
+ **kwargs: Additional keyword arguments.
442
+
443
+ Returns:
444
+ Optional[List[WebElement]]: List of clickable WebElement objects, or None if none found.
445
+ """
434
446
  partial = kwargs["partial_match"]
447
+
448
+ # find parent <a> from slots with direct text
449
+ if partial:
450
+ xpath = f"//a[descendant::slot[contains(., '{locator}')]]"
451
+ else:
452
+ xpath = f"//a[descendant::slot[text()='{locator}']]"
453
+
454
+ # Find slots with text and get their parent link
455
+ driver = browser.get_current_browser()
456
+ xpath_elements = driver.find_elements(By.XPATH, xpath)
457
+ # Find normal elements via javascript
435
458
  if shadow_dom:
436
- web_elements = element.get_visible_elements_from_elements(
437
- javascript.get_clickable_from_shadow_dom(locator, partial)
438
- )
459
+ js_elements = javascript.get_clickable_from_shadow_dom(locator, partial)
439
460
  else:
440
- web_elements = element.get_visible_elements_from_elements(
441
- javascript.get_clickable(locator), **kwargs
442
- )
443
- if web_elements:
444
- logger.debug("Found elements by js: {}".format(web_elements))
445
- return web_elements
461
+ js_elements = javascript.get_clickable(locator)
462
+
463
+ if js_elements:
464
+ logger.debug(f"Found elements by js: {js_elements}")
465
+
466
+ # merge found elements and check visibility
467
+ if not xpath_elements:
468
+ xpath_elements = []
469
+ else:
470
+ logger.debug(f"Found elements by xpath: {xpath_elements}")
471
+ if js_elements:
472
+ util.remove_duplicates_from_list(js_elements, xpath_elements)
473
+ # util.remove_stale_elements(xpath_elements)
474
+ if xpath_elements:
475
+ return element.get_visible_elements_from_elements(xpath_elements, **kwargs)
446
476
  return None
447
477
 
448
478
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: QWeb
3
- Version: 3.3.0
3
+ Version: 3.3.1
4
4
  Summary: Keyword driven automation for the web
5
5
  Home-page: https://github.com/qentinelqi/qweb/
6
6
  Author: Qentinel Group
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes