mangoautomation 1.0.50__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.
- {mangoautomation-1.0.50/mangoautomation.egg-info → mangoautomation-1.0.52}/PKG-INFO +1 -1
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/exceptions/_error_msg.py +1 -1
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/_async_element.py +2 -2
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/_sync_element.py +2 -2
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_element.py +23 -6
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_element.py +18 -4
- {mangoautomation-1.0.50 → mangoautomation-1.0.52/mangoautomation.egg-info}/PKG-INFO +1 -1
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/setup.py +1 -1
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/LICENSE +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/MANIFEST.in +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/README.md +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/enums/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/enums/_base_enum.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/enums/_ui_enum.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/exceptions/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/exceptions/_exceptions.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/models/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/models/_ui_model.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/tools/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/tools/_mate.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/tools/_uiautodev.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/_base_data.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/_driver_object.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_application.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_assertion.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_customization.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_element.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_equipment.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_new_android.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_page.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/ios/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/assertion.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/customization.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/element.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/input_device.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/new_windows.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_assertion.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_browser.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_customization.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_input_device.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_new_browser.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_page.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_assertion.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_browser.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_customization.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_input_device.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_new_browser.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_page.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation.egg-info/SOURCES.txt +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation.egg-info/dependency_links.txt +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation.egg-info/requires.txt +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation.egg-info/top_level.txt +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/setup.cfg +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/tests/__init__.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/tests/test_ui_and.py +0 -0
- {mangoautomation-1.0.50 → mangoautomation-1.0.52}/tests/test_ui_web.py +0 -0
|
@@ -54,7 +54,7 @@ ERROR_MSG_0049 = (4049, 'url格式错误,请检查url或者是选择的测试
|
|
|
54
54
|
ERROR_MSG_0050 = (4050, 'xpath定位未找到元素')
|
|
55
55
|
ERROR_MSG_0051 = (4051, '')
|
|
56
56
|
ERROR_MSG_0052 = (4052, '元素【{}】 进行断言时发生异常,请检查元素是否可以正常使用')
|
|
57
|
-
ERROR_MSG_0053 = (4053, '
|
|
57
|
+
ERROR_MSG_0053 = (4053, '')
|
|
58
58
|
ERROR_MSG_0054 = (4054, '步骤是操作类型,但是你没有输入操作内容,请查看文档中对元素操作的介绍')
|
|
59
59
|
ERROR_MSG_0055 = (4055, '您的电脑未安装指定浏览器!')
|
|
60
60
|
ERROR_MSG_0056 = (4056, '输入的参数类型不正确,请检查操作输入框的类型是否正确')
|
|
@@ -144,7 +144,7 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
144
144
|
|
|
145
145
|
async def __ass(self):
|
|
146
146
|
if self.element_model.ope_value is None:
|
|
147
|
-
raise MangoAutomationError(*
|
|
147
|
+
raise MangoAutomationError(*ERROR_MSG_0054)
|
|
148
148
|
await self.__ope_value(True)
|
|
149
149
|
try:
|
|
150
150
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
@@ -163,7 +163,7 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
163
163
|
pass
|
|
164
164
|
except MangoAutomationError as error:
|
|
165
165
|
self.element_result_model.ass_msg = error.msg
|
|
166
|
-
raise
|
|
166
|
+
raise error
|
|
167
167
|
self.element_result_model.ope_value = {i.f: i.v for i in self.element_model.ope_value if i.d}
|
|
168
168
|
|
|
169
169
|
async def __sql(self):
|
|
@@ -144,7 +144,7 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
144
144
|
|
|
145
145
|
def __ass(self):
|
|
146
146
|
if self.element_model.ope_value is None:
|
|
147
|
-
raise MangoAutomationError(*
|
|
147
|
+
raise MangoAutomationError(*ERROR_MSG_0054)
|
|
148
148
|
self.__ope_value(True)
|
|
149
149
|
try:
|
|
150
150
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
@@ -163,7 +163,7 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
163
163
|
pass
|
|
164
164
|
except MangoAutomationError as error:
|
|
165
165
|
self.element_result_model.ass_msg = error.msg
|
|
166
|
-
raise
|
|
166
|
+
raise error
|
|
167
167
|
self.element_result_model.ope_value = {i.f: i.v for i in self.element_model.ope_value if i.d}
|
|
168
168
|
|
|
169
169
|
def __sql(self):
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_element.py
RENAMED
|
@@ -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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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'),
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_element.py
RENAMED
|
@@ -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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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'),
|
|
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
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/__init__.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_application.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_assertion.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_customization.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_element.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_equipment.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/android/_new_android.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/customization.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/pc/input_device.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_browser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/async_web/_page.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/__init__.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_assertion.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_browser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation/uidrive/web/sync_web/_page.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.50 → mangoautomation-1.0.52}/mangoautomation.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|