mangoautomation 1.0.51__tar.gz → 1.0.52__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.

Potentially problematic release.


This version of mangoautomation might be problematic. Click here for more details.

Files changed (63) hide show
  1. {mangoautomation-1.0.51/mangoautomation.egg-info → mangoautomation-1.0.52}/PKG-INFO +1 -1
  2. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_element.py +23 -6
  3. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_element.py +18 -4
  4. {mangoautomation-1.0.51 → mangoautomation-1.0.52/mangoautomation.egg-info}/PKG-INFO +1 -1
  5. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/setup.py +1 -1
  6. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/LICENSE +0 -0
  7. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/MANIFEST.in +0 -0
  8. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/README.md +0 -0
  9. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/__init__.py +0 -0
  10. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/enums/__init__.py +0 -0
  11. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/enums/_base_enum.py +0 -0
  12. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/enums/_ui_enum.py +0 -0
  13. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/exceptions/__init__.py +0 -0
  14. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/exceptions/_error_msg.py +0 -0
  15. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/exceptions/_exceptions.py +0 -0
  16. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/models/__init__.py +0 -0
  17. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/models/_ui_model.py +0 -0
  18. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/tools/__init__.py +0 -0
  19. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/tools/_mate.py +0 -0
  20. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/tools/_uiautodev.py +0 -0
  21. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/__init__.py +0 -0
  22. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/_async_element.py +0 -0
  23. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/_base_data.py +0 -0
  24. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/_driver_object.py +0 -0
  25. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/_sync_element.py +0 -0
  26. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/__init__.py +0 -0
  27. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_application.py +0 -0
  28. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_assertion.py +0 -0
  29. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_customization.py +0 -0
  30. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_element.py +0 -0
  31. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_equipment.py +0 -0
  32. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_new_android.py +0 -0
  33. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_page.py +0 -0
  34. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/ios/__init__.py +0 -0
  35. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/__init__.py +0 -0
  36. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/assertion.py +0 -0
  37. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/customization.py +0 -0
  38. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/element.py +0 -0
  39. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/input_device.py +0 -0
  40. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/new_windows.py +0 -0
  41. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/__init__.py +0 -0
  42. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/__init__.py +0 -0
  43. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_assertion.py +0 -0
  44. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_browser.py +0 -0
  45. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_customization.py +0 -0
  46. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_input_device.py +0 -0
  47. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_new_browser.py +0 -0
  48. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_page.py +0 -0
  49. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/__init__.py +0 -0
  50. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_assertion.py +0 -0
  51. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_browser.py +0 -0
  52. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_customization.py +0 -0
  53. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_input_device.py +0 -0
  54. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_new_browser.py +0 -0
  55. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_page.py +0 -0
  56. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation.egg-info/SOURCES.txt +0 -0
  57. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation.egg-info/dependency_links.txt +0 -0
  58. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation.egg-info/requires.txt +0 -0
  59. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/mangoautomation.egg-info/top_level.txt +0 -0
  60. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/setup.cfg +0 -0
  61. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/tests/__init__.py +0 -0
  62. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/tests/test_ui_and.py +0 -0
  63. {mangoautomation-1.0.51 → mangoautomation-1.0.52}/tests/test_ui_web.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mangoautomation
3
- Version: 1.0.51
3
+ Version: 1.0.52
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -6,10 +6,10 @@ import asyncio
6
6
  import os
7
7
 
8
8
  import time
9
- from mangotools.decorator import async_method_callback
10
- from mangotools.models import MethodModel
11
9
  from playwright.async_api import Locator, Error
12
10
 
11
+ from mangotools.decorator import async_method_callback
12
+ from mangotools.models import MethodModel
13
13
  from ..._base_data import BaseData
14
14
  from ....exceptions import MangoAutomationError
15
15
  from ....exceptions._error_msg import ERROR_MSG_0024, ERROR_MSG_0056
@@ -55,10 +55,27 @@ class AsyncWebElement(metaclass=Meta):
55
55
  MethodModel(f='set_cache_key', p='请输入获取元素文本后存储的key', d=True)])
56
56
  async def w_get_text(self, locating: Locator, set_cache_key=None):
57
57
  """获取元素文本"""
58
- value = await locating.inner_text()
59
- if set_cache_key:
60
- self.base_data.test_data.set_cache(key=set_cache_key, value=value)
61
- return value
58
+ methods = [
59
+ ("inner_text", locating.inner_text),
60
+ ("text_content", locating.text_content),
61
+ ("input_value", locating.input_value),
62
+ ("get_attribute", lambda: locating.get_attribute("value")),
63
+ ("evaluate", lambda: locating.evaluate("el => el.value")),
64
+ ]
65
+
66
+ for method_name, method in methods:
67
+ try:
68
+ value = await method()
69
+ if value is not None and str(value).strip() and set_cache_key:
70
+ self.base_data.test_data.set_cache(key=set_cache_key, value=value)
71
+ return value
72
+ elif value is not None and str(value).strip():
73
+ return value
74
+ except Exception as e:
75
+ print(f"方法 [{method_name}] 失败: {str(e)}")
76
+ continue
77
+
78
+ return None
62
79
 
63
80
  @async_method_callback('web', '元素操作', 5, [
64
81
  MethodModel(f='locating'),
@@ -54,10 +54,24 @@ class SyncWebElement(metaclass=Meta):
54
54
  MethodModel(f='set_cache_key', p='请输入获取元素文本后存储的key', d=True)])
55
55
  def w_get_text(self, locating: Locator, set_cache_key=None):
56
56
  """获取元素文本"""
57
- value = locating.inner_text()
58
- if set_cache_key:
59
- self.base_data.test_data.set_cache(key=set_cache_key, value=value)
60
- return value
57
+ methods = [
58
+ ("inner_text", lambda: locating.inner_text()),
59
+ ("text_content", lambda: locating.text_content()),
60
+ ("input_value", lambda: locating.input_value() if locating.is_visible() else None),
61
+ ("get_attribute", lambda: locating.get_attribute("value")),
62
+ ("evaluate", lambda: locating.evaluate("el => el.value")),
63
+ ]
64
+ for method_name, method in methods:
65
+ try:
66
+ value = method()
67
+ if value is not None and str(value).strip() and set_cache_key:
68
+ self.base_data.test_data.set_cache(key=set_cache_key, value=value)
69
+ return value
70
+ elif value is not None and str(value).strip():
71
+ return value
72
+ except Exception:
73
+ continue
74
+ return None
61
75
 
62
76
  @sync_method_callback('web', '元素操作', 5, [
63
77
  MethodModel(f='locating'),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mangoautomation
3
- Version: 1.0.51
3
+ Version: 1.0.52
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- __version__ = '1.0.51'
3
+ __version__ = '1.0.52'
4
4
 
5
5
  with open("README.md", "r", encoding='utf-8') as fh:
6
6
  long_description = fh.read()