mangoautomation 1.0.51__tar.gz → 1.0.53__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.53}/PKG-INFO +1 -1
  2. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/_async_element.py +3 -1
  3. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/_sync_element.py +2 -0
  4. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_element.py +22 -6
  5. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_element.py +18 -4
  6. {mangoautomation-1.0.51 → mangoautomation-1.0.53/mangoautomation.egg-info}/PKG-INFO +1 -1
  7. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/setup.py +1 -1
  8. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/LICENSE +0 -0
  9. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/MANIFEST.in +0 -0
  10. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/README.md +0 -0
  11. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/__init__.py +0 -0
  12. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/enums/__init__.py +0 -0
  13. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/enums/_base_enum.py +0 -0
  14. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/enums/_ui_enum.py +0 -0
  15. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/exceptions/__init__.py +0 -0
  16. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/exceptions/_error_msg.py +0 -0
  17. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/exceptions/_exceptions.py +0 -0
  18. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/models/__init__.py +0 -0
  19. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/models/_ui_model.py +0 -0
  20. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/tools/__init__.py +0 -0
  21. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/tools/_mate.py +0 -0
  22. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/tools/_uiautodev.py +0 -0
  23. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/__init__.py +0 -0
  24. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/_base_data.py +0 -0
  25. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/_driver_object.py +0 -0
  26. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/__init__.py +0 -0
  27. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_application.py +0 -0
  28. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_assertion.py +0 -0
  29. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_customization.py +0 -0
  30. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_element.py +0 -0
  31. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_equipment.py +0 -0
  32. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_new_android.py +0 -0
  33. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/android/_page.py +0 -0
  34. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/ios/__init__.py +0 -0
  35. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/pc/__init__.py +0 -0
  36. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/pc/assertion.py +0 -0
  37. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/pc/customization.py +0 -0
  38. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/pc/element.py +0 -0
  39. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/pc/input_device.py +0 -0
  40. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/pc/new_windows.py +0 -0
  41. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/__init__.py +0 -0
  42. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/__init__.py +0 -0
  43. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_assertion.py +0 -0
  44. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_browser.py +0 -0
  45. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_customization.py +0 -0
  46. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_input_device.py +0 -0
  47. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_new_browser.py +0 -0
  48. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/async_web/_page.py +0 -0
  49. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/__init__.py +0 -0
  50. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_assertion.py +0 -0
  51. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_browser.py +0 -0
  52. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_customization.py +0 -0
  53. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_input_device.py +0 -0
  54. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_new_browser.py +0 -0
  55. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation/uidrive/web/sync_web/_page.py +0 -0
  56. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation.egg-info/SOURCES.txt +0 -0
  57. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation.egg-info/dependency_links.txt +0 -0
  58. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation.egg-info/requires.txt +0 -0
  59. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/mangoautomation.egg-info/top_level.txt +0 -0
  60. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/setup.cfg +0 -0
  61. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/tests/__init__.py +0 -0
  62. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/tests/test_ui_and.py +0 -0
  63. {mangoautomation-1.0.51 → mangoautomation-1.0.53}/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.53
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -126,6 +126,7 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
126
126
  if self.element_model.ope_value is None:
127
127
  raise MangoAutomationError(*ERROR_MSG_0054)
128
128
  await self.__ope_value()
129
+ self.element_model.ope_value = self.base_data.test_data.replace(self.element_model.ope_value)
129
130
  if self.drive_type == DriveTypeEnum.WEB.value:
130
131
  await self.web_action_element(
131
132
  self.element_model.name,
@@ -146,6 +147,7 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
146
147
  if self.element_model.ope_value is None:
147
148
  raise MangoAutomationError(*ERROR_MSG_0054)
148
149
  await self.__ope_value(True)
150
+ self.element_model.ope_value = self.base_data.test_data.replace(self.element_model.ope_value)
149
151
  try:
150
152
  if self.drive_type == DriveTypeEnum.WEB.value:
151
153
  self.element_result_model.ass_msg = await self.web_assertion_element(
@@ -197,7 +199,7 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
197
199
  value = self.element_data.get('value')
198
200
  self.base_data.test_data.set_cache(key, self.base_data.test_data.replace(value))
199
201
 
200
- async def __ope_value(self, is_ass: bool = False):
202
+ async def __ope_value(self,is_ass: bool = False):
201
203
  try:
202
204
  ope_key = 'actual' if is_ass else 'locating'
203
205
  for i in self.element_model.ope_value:
@@ -126,6 +126,7 @@ class SyncElement(SyncWebDevice, AndroidDriver):
126
126
  if self.element_model.ope_value is None:
127
127
  raise MangoAutomationError(*ERROR_MSG_0054)
128
128
  self.__ope_value()
129
+ self.element_model.ope_value = self.base_data.test_data.replace(self.element_model.ope_value)
129
130
  if self.drive_type == DriveTypeEnum.WEB.value:
130
131
  self.web_action_element(
131
132
  self.element_model.name,
@@ -146,6 +147,7 @@ class SyncElement(SyncWebDevice, AndroidDriver):
146
147
  if self.element_model.ope_value is None:
147
148
  raise MangoAutomationError(*ERROR_MSG_0054)
148
149
  self.__ope_value(True)
150
+ self.element_model.ope_value = self.base_data.test_data.replace(self.element_model.ope_value)
149
151
  try:
150
152
  if self.drive_type == DriveTypeEnum.WEB.value:
151
153
  self.element_result_model.ass_msg = self.web_assertion_element(
@@ -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,26 @@ 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:
75
+ continue
76
+
77
+ return None
62
78
 
63
79
  @async_method_callback('web', '元素操作', 5, [
64
80
  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.53
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.53'
4
4
 
5
5
  with open("README.md", "r", encoding='utf-8') as fh:
6
6
  long_description = fh.read()