mangoautomation 1.0.34__tar.gz → 1.0.36__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.34/mangoautomation.egg-info → mangoautomation-1.0.36}/PKG-INFO +2 -2
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/exceptions/_error_msg.py +2 -2
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/_async_element.py +33 -32
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/_sync_element.py +33 -32
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_browser.py +1 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_element.py +8 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_browser.py +1 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_element.py +10 -2
- {mangoautomation-1.0.34 → mangoautomation-1.0.36/mangoautomation.egg-info}/PKG-INFO +2 -2
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation.egg-info/requires.txt +1 -1
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/setup.py +2 -2
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/LICENSE +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/MANIFEST.in +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/README.md +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/enums/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/enums/_base_enum.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/enums/_ui_enum.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/exceptions/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/exceptions/_exceptions.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/models/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/models/_ui_model.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/tools/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/tools/_mate.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/_base_data.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/_driver_object.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_application.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_assertion.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_customization.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_element.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_equipment.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_new_android.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_page.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/assertion.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/customization.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/element.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/input_device.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/new_windows.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_assertion.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_customization.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_input_device.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_new_browser.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_page.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_assertion.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_customization.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_input_device.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_new_browser.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_page.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation.egg-info/SOURCES.txt +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation.egg-info/dependency_links.txt +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation.egg-info/top_level.txt +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/setup.cfg +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/tests/__init__.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/tests/test_ui_and.py +0 -0
- {mangoautomation-1.0.34 → mangoautomation-1.0.36}/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.
|
|
3
|
+
Version: 1.0.36
|
|
4
4
|
Summary: 测试工具
|
|
5
5
|
Home-page: https://gitee.com/mao-peng/testkit
|
|
6
6
|
Author: 毛鹏
|
|
@@ -12,7 +12,7 @@ Requires-Dist: pydantic==2.9.2
|
|
|
12
12
|
Requires-Dist: playwright==1.43.0
|
|
13
13
|
Requires-Dist: uiautomation==2.0.20
|
|
14
14
|
Requires-Dist: uiautomator2==3.2.5
|
|
15
|
-
Requires-Dist: mangotools==1.0.
|
|
15
|
+
Requires-Dist: mangotools==1.0.22
|
|
16
16
|
Requires-Dist: adbutils~=2.8.9
|
|
17
17
|
|
|
18
18
|
# testkit
|
|
@@ -10,10 +10,10 @@ ERROR_MSG_0003 = (4003, '')
|
|
|
10
10
|
ERROR_MSG_0004 = (4004, '')
|
|
11
11
|
ERROR_MSG_0005 = (4018, '断言失败,断言输入值是:空字符串、null或不满足函数接受类型')
|
|
12
12
|
ERROR_MSG_0006 = (4006, '')
|
|
13
|
-
ERROR_MSG_0007 = (4007, '')
|
|
13
|
+
ERROR_MSG_0007 = (4007, '安卓设备被关闭,请检查设备')
|
|
14
14
|
ERROR_MSG_0008 = (4008, '浏览器类型不正确,请联系管理员检查')
|
|
15
15
|
ERROR_MSG_0009 = (4009, '浏览器路径不正确,请手动设置一个正确的浏览器路径,现在的路径:{}')
|
|
16
|
-
ERROR_MSG_0010 = (4010, '
|
|
16
|
+
ERROR_MSG_0010 = (4010, '浏览器被关闭,请不要手动关闭浏览器')
|
|
17
17
|
ERROR_MSG_0011 = (4011, '操作元素【{}】超时,请检查元素可见但是是否可操作或调整定位方式')
|
|
18
18
|
ERROR_MSG_0012 = (4012, '操作失败,请检查输入的值是否有空字符串,null或不满足传参的值')
|
|
19
19
|
ERROR_MSG_0013 = (
|
|
@@ -57,15 +57,6 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
57
57
|
self.base_data.log.debug(f'不存在这个类型,如果是非管理员看到这种提示,请联系管理员')
|
|
58
58
|
raise Exception('不存在的设备类型')
|
|
59
59
|
|
|
60
|
-
async def clean_data(self):
|
|
61
|
-
try:
|
|
62
|
-
self.element_model.loc = self.base_data.test_data.replace(self.element_model.loc)
|
|
63
|
-
self.element_model.sleep = self.base_data.test_data.replace(self.element_model.sleep)
|
|
64
|
-
self.element_model.sub = self.base_data.test_data.replace(self.element_model.sub)
|
|
65
|
-
except MangoAutomationError as error:
|
|
66
|
-
self.base_data.log.debug(f'操作元素解析数据失败,类型:{type(error)}, 详情:{error}')
|
|
67
|
-
raise MangoAutomationError(error.code, error.msg)
|
|
68
|
-
|
|
69
60
|
async def element_main(self) -> ElementResultModel:
|
|
70
61
|
try:
|
|
71
62
|
await self.__main()
|
|
@@ -73,12 +64,6 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
73
64
|
await asyncio.sleep(self.element_model.sleep)
|
|
74
65
|
self.element_result_model.status = StatusEnum.SUCCESS.value
|
|
75
66
|
self.element_result_model.error_message = None
|
|
76
|
-
except TargetClosedError as error:
|
|
77
|
-
self.base_data.setup()
|
|
78
|
-
self.base_data.log.debug(
|
|
79
|
-
f'浏览器关闭异常,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
80
|
-
self.element_result_model.status = StatusEnum.FAIL.value
|
|
81
|
-
self.element_result_model.error_message = '浏览器被关闭,请不要认关闭浏览器,非认为管理请联系管理员解决!'
|
|
82
67
|
except MangoAutomationError as error:
|
|
83
68
|
await self.__error(error.msg)
|
|
84
69
|
self.base_data.log.debug(f'已知异常,类型:{type(error)},失败详情:{error}')
|
|
@@ -97,17 +82,37 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
97
82
|
|
|
98
83
|
@async_retry()
|
|
99
84
|
async def __main(self):
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
85
|
+
try:
|
|
86
|
+
self.element_model.loc = self.base_data.test_data.replace(self.element_model.loc)
|
|
87
|
+
self.element_model.sleep = self.base_data.test_data.replace(self.element_model.sleep)
|
|
88
|
+
self.element_model.sub = self.base_data.test_data.replace(self.element_model.sub)
|
|
89
|
+
except MangoAutomationError as error:
|
|
90
|
+
self.base_data.log.debug(f'操作元素解析数据失败,类型:{type(error)}, 详情:{error}')
|
|
91
|
+
raise MangoAutomationError(error.code, error.msg)
|
|
92
|
+
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
93
|
+
if not self.base_data.page and self.base_data.context:
|
|
94
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
95
|
+
elif self.drive_type == DriveTypeEnum.ANDROID.value:
|
|
96
|
+
if not self.base_data.android:
|
|
97
|
+
raise MangoAutomationError(*ERROR_MSG_0007)
|
|
109
98
|
else:
|
|
110
|
-
|
|
99
|
+
pass
|
|
100
|
+
try:
|
|
101
|
+
if self.element_model.type == ElementOperationEnum.OPE.value:
|
|
102
|
+
await self.__ope()
|
|
103
|
+
elif self.element_model.type == ElementOperationEnum.ASS.value:
|
|
104
|
+
await self.__ass()
|
|
105
|
+
elif self.element_model.type == ElementOperationEnum.SQL.value:
|
|
106
|
+
await self.__sql()
|
|
107
|
+
elif self.element_model.type == ElementOperationEnum.CUSTOM.value:
|
|
108
|
+
await self.__custom()
|
|
109
|
+
else:
|
|
110
|
+
raise MangoAutomationError(*ERROR_MSG_0015)
|
|
111
|
+
except TargetClosedError as error:
|
|
112
|
+
self.base_data.setup()
|
|
113
|
+
self.base_data.log.debug(
|
|
114
|
+
f'浏览器关闭异常,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
115
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
111
116
|
|
|
112
117
|
async def __ope(self):
|
|
113
118
|
method_name = getattr(self.element_model, 'ope_key', None)
|
|
@@ -122,7 +127,6 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
122
127
|
raise MangoAutomationError(*ERROR_MSG_0048)
|
|
123
128
|
if self.element_model.ope_value is None:
|
|
124
129
|
raise MangoAutomationError(*ERROR_MSG_0054)
|
|
125
|
-
|
|
126
130
|
await self.__ope_value()
|
|
127
131
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
128
132
|
await self.web_action_element(
|
|
@@ -208,18 +212,15 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
208
212
|
'sub': self.element_model.sub
|
|
209
213
|
}
|
|
210
214
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
211
|
-
loc, \
|
|
212
|
-
self.element_result_model.ele_quantity, \
|
|
215
|
+
loc, self.element_result_model.ele_quantity, \
|
|
213
216
|
self.element_result_model.element_text \
|
|
214
217
|
= await self.web_find_ele(**find_params, is_iframe=self.element_model.is_iframe)
|
|
215
218
|
elif self.drive_type == DriveTypeEnum.ANDROID.value:
|
|
216
|
-
loc, \
|
|
217
|
-
self.element_result_model.ele_quantity, \
|
|
219
|
+
loc, self.element_result_model.ele_quantity, \
|
|
218
220
|
self.element_result_model.element_text \
|
|
219
221
|
= self.a_find_ele(**find_params)
|
|
220
222
|
else:
|
|
221
|
-
loc, \
|
|
222
|
-
self.element_result_model.ele_quantity, \
|
|
223
|
+
loc, self.element_result_model.ele_quantity, \
|
|
223
224
|
self.element_result_model.element_text \
|
|
224
225
|
= None, 0, None
|
|
225
226
|
|
|
@@ -57,15 +57,6 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
57
57
|
self.base_data.log.error(f'不存在这个类型,如果是非管理员看到这种提示,请联系管理员')
|
|
58
58
|
raise Exception('不存在的设备类型')
|
|
59
59
|
|
|
60
|
-
def clean_data(self):
|
|
61
|
-
try:
|
|
62
|
-
self.element_model.loc = self.base_data.test_data.replace(self.element_model.loc)
|
|
63
|
-
self.element_model.sleep = self.base_data.test_data.replace(self.element_model.sleep)
|
|
64
|
-
self.element_model.sub = self.base_data.test_data.replace(self.element_model.sub)
|
|
65
|
-
except MangoAutomationError as error:
|
|
66
|
-
self.base_data.log.debug(f'操作元素解析数据失败,类型:{type(error)}, 详情:{error}')
|
|
67
|
-
raise MangoAutomationError(error.code, error.msg)
|
|
68
|
-
|
|
69
60
|
def element_main(self) -> ElementResultModel:
|
|
70
61
|
try:
|
|
71
62
|
self.__main()
|
|
@@ -73,12 +64,6 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
73
64
|
time.sleep(self.element_model.sleep)
|
|
74
65
|
self.element_result_model.status = StatusEnum.SUCCESS.value
|
|
75
66
|
self.element_result_model.error_message = None
|
|
76
|
-
except TargetClosedError as error:
|
|
77
|
-
self.base_data.setup()
|
|
78
|
-
self.base_data.log.debug(
|
|
79
|
-
f'浏览器关闭异常,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
80
|
-
self.element_result_model.status = StatusEnum.FAIL.value
|
|
81
|
-
self.element_result_model.error_message = '浏览器被关闭,请不要认关闭浏览器,非认为管理请联系管理员解决!'
|
|
82
67
|
except MangoAutomationError as error:
|
|
83
68
|
self.__error(error.msg)
|
|
84
69
|
self.base_data.log.debug(f'已知异常,类型:{type(error)},失败详情:{error}')
|
|
@@ -97,17 +82,37 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
97
82
|
|
|
98
83
|
@sync_retry()
|
|
99
84
|
def __main(self):
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
self.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
self.
|
|
85
|
+
try:
|
|
86
|
+
self.element_model.loc = self.base_data.test_data.replace(self.element_model.loc)
|
|
87
|
+
self.element_model.sleep = self.base_data.test_data.replace(self.element_model.sleep)
|
|
88
|
+
self.element_model.sub = self.base_data.test_data.replace(self.element_model.sub)
|
|
89
|
+
except MangoAutomationError as error:
|
|
90
|
+
self.base_data.log.debug(f'操作元素解析数据失败,类型:{type(error)}, 详情:{error}')
|
|
91
|
+
raise MangoAutomationError(error.code, error.msg)
|
|
92
|
+
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
93
|
+
if not self.base_data.page and self.base_data.context:
|
|
94
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
95
|
+
elif self.drive_type == DriveTypeEnum.ANDROID.value:
|
|
96
|
+
if not self.base_data.android:
|
|
97
|
+
raise MangoAutomationError(*ERROR_MSG_0007)
|
|
109
98
|
else:
|
|
110
|
-
|
|
99
|
+
pass
|
|
100
|
+
try:
|
|
101
|
+
if self.element_model.type == ElementOperationEnum.OPE.value:
|
|
102
|
+
self.__ope()
|
|
103
|
+
elif self.element_model.type == ElementOperationEnum.ASS.value:
|
|
104
|
+
self.__ass()
|
|
105
|
+
elif self.element_model.type == ElementOperationEnum.SQL.value:
|
|
106
|
+
self.__sql()
|
|
107
|
+
elif self.element_model.type == ElementOperationEnum.CUSTOM.value:
|
|
108
|
+
self.__custom()
|
|
109
|
+
else:
|
|
110
|
+
raise MangoAutomationError(*ERROR_MSG_0015)
|
|
111
|
+
except TargetClosedError as error:
|
|
112
|
+
self.base_data.setup()
|
|
113
|
+
self.base_data.log.debug(
|
|
114
|
+
f'浏览器关闭异常,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
115
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
111
116
|
|
|
112
117
|
def __ope(self):
|
|
113
118
|
method_name = getattr(self.element_model, 'ope_key', None)
|
|
@@ -122,7 +127,6 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
122
127
|
raise MangoAutomationError(*ERROR_MSG_0048)
|
|
123
128
|
if self.element_model.ope_value is None:
|
|
124
129
|
raise MangoAutomationError(*ERROR_MSG_0054)
|
|
125
|
-
|
|
126
130
|
self.__ope_value()
|
|
127
131
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
128
132
|
self.web_action_element(
|
|
@@ -208,18 +212,15 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
208
212
|
'sub': self.element_model.sub
|
|
209
213
|
}
|
|
210
214
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
211
|
-
loc, \
|
|
212
|
-
self.element_result_model.ele_quantity, \
|
|
215
|
+
loc, self.element_result_model.ele_quantity, \
|
|
213
216
|
self.element_result_model.element_text \
|
|
214
217
|
= self.web_find_ele(**find_params, is_iframe=self.element_model.is_iframe)
|
|
215
218
|
elif self.drive_type == DriveTypeEnum.ANDROID.value:
|
|
216
|
-
loc, \
|
|
217
|
-
self.element_result_model.ele_quantity, \
|
|
219
|
+
loc, self.element_result_model.ele_quantity, \
|
|
218
220
|
self.element_result_model.element_text \
|
|
219
221
|
= self.a_find_ele(**find_params)
|
|
220
222
|
else:
|
|
221
|
-
loc, \
|
|
222
|
-
self.element_result_model.ele_quantity, \
|
|
223
|
+
loc, self.element_result_model.ele_quantity, \
|
|
223
224
|
self.element_result_model.element_text \
|
|
224
225
|
= None, 0, None
|
|
225
226
|
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_browser.py
RENAMED
|
@@ -44,6 +44,7 @@ class AsyncWebBrowser(metaclass=Meta):
|
|
|
44
44
|
self.base_data.log.debug(f'打开URL失败-1,类型:{type(error)},失败详情:{error}')
|
|
45
45
|
raise MangoAutomationError(*ERROR_MSG_0013, value=(url,))
|
|
46
46
|
except TargetClosedError as error:
|
|
47
|
+
self.base_data.setup()
|
|
47
48
|
self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
|
|
48
49
|
raise MangoAutomationError(*ERROR_MSG_0010, value=(url,))
|
|
49
50
|
except Error as error:
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_element.py
RENAMED
|
@@ -60,6 +60,14 @@ class AsyncWebElement(metaclass=Meta):
|
|
|
60
60
|
self.base_data.test_data.set_cache(key=set_cache_key, value=value)
|
|
61
61
|
return value
|
|
62
62
|
|
|
63
|
+
@async_method_callback('web', '元素操作', 5, [
|
|
64
|
+
MethodModel(f='locating'),
|
|
65
|
+
MethodModel(f='input_value', p='请输入输入内容', d=True)])
|
|
66
|
+
async def w_clear_input(self, locating: Locator, input_value: str):
|
|
67
|
+
"""元素清空再输入"""
|
|
68
|
+
await locating.clear()
|
|
69
|
+
await locating.fill(str(input_value))
|
|
70
|
+
|
|
63
71
|
@async_method_callback('web', '元素操作', 6, [MethodModel(f='locating')])
|
|
64
72
|
async def w_many_click(self, locating: Locator):
|
|
65
73
|
"""多元素循环单击"""
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_browser.py
RENAMED
|
@@ -44,6 +44,7 @@ class SyncWebBrowser(metaclass=Meta):
|
|
|
44
44
|
self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
|
|
45
45
|
raise MangoAutomationError(*ERROR_MSG_0013, value=(url,))
|
|
46
46
|
except TargetClosedError as error:
|
|
47
|
+
self.base_data.setup()
|
|
47
48
|
self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
|
|
48
49
|
raise MangoAutomationError(*ERROR_MSG_0010, value=(url,))
|
|
49
50
|
except Error as error:
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_element.py
RENAMED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import os
|
|
6
6
|
|
|
7
7
|
import time
|
|
8
|
-
from mangotools.decorator import sync_method_callback
|
|
9
|
-
from mangotools.models import MethodModel
|
|
10
8
|
from playwright.sync_api import Locator, Error
|
|
11
9
|
|
|
10
|
+
from mangotools.decorator import sync_method_callback
|
|
11
|
+
from mangotools.models import MethodModel
|
|
12
12
|
from ....exceptions import MangoAutomationError
|
|
13
13
|
from ....exceptions._error_msg import ERROR_MSG_0024, ERROR_MSG_0056
|
|
14
14
|
from ....tools import Meta
|
|
@@ -59,6 +59,14 @@ class SyncWebElement(metaclass=Meta):
|
|
|
59
59
|
self.base_data.test_data.set_cache(key=set_cache_key, value=value)
|
|
60
60
|
return value
|
|
61
61
|
|
|
62
|
+
@sync_method_callback('web', '元素操作', 5, [
|
|
63
|
+
MethodModel(f='locating'),
|
|
64
|
+
MethodModel(f='input_value', p='请输入输入内容', d=True)])
|
|
65
|
+
def w_clear_input(self, locating: Locator, input_value: str):
|
|
66
|
+
"""元素清空再输入"""
|
|
67
|
+
locating.clear()
|
|
68
|
+
locating.fill(str(input_value))
|
|
69
|
+
|
|
62
70
|
@sync_method_callback('web', '元素操作', 6, [MethodModel(f='locating')])
|
|
63
71
|
def w_many_click(self, locating: Locator):
|
|
64
72
|
"""多元素循环单击"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mangoautomation
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.36
|
|
4
4
|
Summary: 测试工具
|
|
5
5
|
Home-page: https://gitee.com/mao-peng/testkit
|
|
6
6
|
Author: 毛鹏
|
|
@@ -12,7 +12,7 @@ Requires-Dist: pydantic==2.9.2
|
|
|
12
12
|
Requires-Dist: playwright==1.43.0
|
|
13
13
|
Requires-Dist: uiautomation==2.0.20
|
|
14
14
|
Requires-Dist: uiautomator2==3.2.5
|
|
15
|
-
Requires-Dist: mangotools==1.0.
|
|
15
|
+
Requires-Dist: mangotools==1.0.22
|
|
16
16
|
Requires-Dist: adbutils~=2.8.9
|
|
17
17
|
|
|
18
18
|
# testkit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
2
|
|
|
3
|
-
__version__ = '1.0.
|
|
3
|
+
__version__ = '1.0.36'
|
|
4
4
|
|
|
5
5
|
with open("README.md", "r", encoding='utf-8') as fh:
|
|
6
6
|
long_description = fh.read()
|
|
@@ -21,7 +21,7 @@ setup(
|
|
|
21
21
|
'playwright==1.43.0',
|
|
22
22
|
'uiautomation==2.0.20',
|
|
23
23
|
'uiautomator2==3.2.5',
|
|
24
|
-
'mangotools==1.0.
|
|
24
|
+
'mangotools==1.0.22',
|
|
25
25
|
'adbutils~=2.8.9',
|
|
26
26
|
|
|
27
27
|
],
|
|
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.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/__init__.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_application.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_assertion.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_customization.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_element.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_equipment.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/android/_new_android.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/customization.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/pc/input_device.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/async_web/_page.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/__init__.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_assertion.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/mangoautomation/uidrive/web/sync_web/_page.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.34 → mangoautomation-1.0.36}/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
|