mangoautomation 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl
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/exceptions/_error_msg.py +2 -7
- mangoautomation/uidrive/web/async_web/__init__.py +6 -2
- mangoautomation/uidrive/web/async_web/_element.py +6 -1
- mangoautomation/uidrive/web/async_web/_input_device.py +0 -5
- mangoautomation/uidrive/web/sync_web/_element.py +8 -3
- {mangoautomation-1.0.0.dist-info → mangoautomation-1.0.2.dist-info}/METADATA +1 -1
- {mangoautomation-1.0.0.dist-info → mangoautomation-1.0.2.dist-info}/RECORD +10 -10
- {mangoautomation-1.0.0.dist-info → mangoautomation-1.0.2.dist-info}/LICENSE +0 -0
- {mangoautomation-1.0.0.dist-info → mangoautomation-1.0.2.dist-info}/WHEEL +0 -0
- {mangoautomation-1.0.0.dist-info → mangoautomation-1.0.2.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ ERROR_MSG_0007 = (307, '请先启动容器')
|
|
|
14
14
|
ERROR_MSG_0008 = (308, '浏览器类型不正确,请联系管理员检查')
|
|
15
15
|
ERROR_MSG_0009 = (309, '浏览器路径不正确,请手动设置一个正确的浏览器路径,现在的路径:{}')
|
|
16
16
|
ERROR_MSG_0010 = (310, '浏览器被关闭,请重试')
|
|
17
|
-
ERROR_MSG_0011 = (311, '
|
|
17
|
+
ERROR_MSG_0011 = (311, '操作元素【{}】超时,请检查元素可见但是是否可操作或调整定位方式')
|
|
18
18
|
ERROR_MSG_0012 = (312, '操作失败,请检查输入的值是否有空字符串,null或不满足传参的值')
|
|
19
19
|
ERROR_MSG_0013 = (
|
|
20
20
|
313, '打开url时超时,分为2个问题:1.启用的浏览器过多,应当减少浏览器并发个数;2.自行查看为啥60秒还未打开:{}')
|
|
@@ -37,14 +37,9 @@ ERROR_MSG_0028 = (328, '一个元素内只能包含一个需要被替换的内
|
|
|
37
37
|
ERROR_MSG_0029 = (329, '页面无元素:{} 表达式:{}')
|
|
38
38
|
ERROR_MSG_0030 = (330, '断言时没有找到元素')
|
|
39
39
|
ERROR_MSG_0031 = (331, '元素未找到准备进行断言获取元素文本类容异常')
|
|
40
|
-
ERROR_MSG_0032 = (332, '元素:{}
|
|
41
|
-
ERROR_MSG_0033 = (333, 'mysql中无:{}库')
|
|
42
|
-
ERROR_MSG_0034 = (334, 'sql存在语法错误,sql:{}')
|
|
43
|
-
ERROR_MSG_0035 = (335, 'sql语句是空,或查询字段或条件字段不存在')
|
|
40
|
+
ERROR_MSG_0032 = (332, '元素:{} 的元素表达式定位有多个,或其他元素异常,请检查元素是否可用')
|
|
44
41
|
ERROR_MSG_0036 = (336, '公共参数sql在数据库中查询不到结果,sql:{}')
|
|
45
|
-
ERROR_MSG_0037 = (337, '用例前置sql在数据库中查询不到结果,sql:{}')
|
|
46
42
|
ERROR_MSG_0038 = (338, '公共参数的sql_key不是列表')
|
|
47
|
-
ERROR_MSG_0039 = (339, '用例前置的sql_key不是列表')
|
|
48
43
|
ERROR_MSG_0040 = (
|
|
49
44
|
340, '设备启动超时!请检查设备是否开启了:文件传输模式、开发者模式、usb调试,开启后请重新连接电脑,设备号:{}')
|
|
50
45
|
ERROR_MSG_0041 = (341, '查找页面元素时直接失败,元素:{},报错信息:{}')
|
|
@@ -10,9 +10,9 @@ from playwright._impl._errors import TimeoutError, Error, TargetClosedError
|
|
|
10
10
|
from playwright.async_api._generated import Locator
|
|
11
11
|
|
|
12
12
|
from mangotools.assertion import PublicAssertion, SqlAssertion
|
|
13
|
-
from mangotools.mangos import Mango
|
|
14
13
|
from mangotools.enums import StatusEnum
|
|
15
|
-
from
|
|
14
|
+
from mangotools.mangos import Mango
|
|
15
|
+
from ....enums import ElementExpEnum, ElementOperationEnum
|
|
16
16
|
from ....exceptions import MangoAutomationError
|
|
17
17
|
from ....exceptions._error_msg import *
|
|
18
18
|
from ....uidrive._base_data import BaseData
|
|
@@ -137,6 +137,10 @@ class AsyncWebDevice(AsyncWebBrowser,
|
|
|
137
137
|
ele_list.append(locator.nth(nth))
|
|
138
138
|
else:
|
|
139
139
|
raise MangoAutomationError(*ERROR_MSG_0023)
|
|
140
|
+
if not ele_list:
|
|
141
|
+
raise MangoAutomationError(*ERROR_MSG_0023)
|
|
142
|
+
if not ele_list and _type == ElementOperationEnum.OPE.value:
|
|
143
|
+
raise MangoAutomationError(*ERROR_MSG_0029, value=(name, loc))
|
|
140
144
|
try:
|
|
141
145
|
count = len(ele_list)
|
|
142
146
|
loc = ele_list[sub - 1] if sub else ele_list
|
|
@@ -58,7 +58,6 @@ class AsyncWebElement(metaclass=Meta):
|
|
|
58
58
|
value = await locating.inner_text()
|
|
59
59
|
if set_cache_key:
|
|
60
60
|
self.base_data.test_data.set_cache(key=set_cache_key, value=value)
|
|
61
|
-
|
|
62
61
|
return value
|
|
63
62
|
|
|
64
63
|
@async_method_callback('web', '元素操作', 6, [
|
|
@@ -98,6 +97,12 @@ class AsyncWebElement(metaclass=Meta):
|
|
|
98
97
|
await download.save_as(save_path)
|
|
99
98
|
self.base_data.test_data.set_cache(file_key, file_name)
|
|
100
99
|
|
|
100
|
+
@async_method_callback('web', '元素操作', 9, [
|
|
101
|
+
MethodModel(f='locating')])
|
|
102
|
+
async def w_element_wheel(self, locating: Locator):
|
|
103
|
+
"""滚动到元素位置"""
|
|
104
|
+
await locating.scroll_into_view_if_needed()
|
|
105
|
+
|
|
101
106
|
@async_method_callback('web', '元素操作', 9, [
|
|
102
107
|
MethodModel(f='locating1'),
|
|
103
108
|
MethodModel(f='locating2')])
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
# @Project: 芒果测试平台
|
|
3
3
|
# @Description: # @Time : 2023-04-29 12:11
|
|
4
4
|
# @Author : 毛鹏
|
|
5
|
-
from playwright.async_api import Locator
|
|
6
5
|
|
|
7
6
|
from mangotools.decorator import async_method_callback
|
|
8
7
|
from mangotools.models import MethodModel
|
|
@@ -22,10 +21,6 @@ class AsyncWebDeviceInput(metaclass=Meta):
|
|
|
22
21
|
"""模拟按下指定的键"""
|
|
23
22
|
await self.base_data.page.keyboard.press(str(keyboard))
|
|
24
23
|
|
|
25
|
-
async def w_element_wheel(self, locating: Locator):
|
|
26
|
-
"""滚动到元素位置"""
|
|
27
|
-
await locating.scroll_into_view_if_needed()
|
|
28
|
-
|
|
29
24
|
@async_method_callback('web', '输入设备', 1, [
|
|
30
25
|
MethodModel(f='y', p='请输入向上滚动像素', d=True)])
|
|
31
26
|
async def w_wheel(self, y):
|
|
@@ -7,12 +7,12 @@ import os
|
|
|
7
7
|
import time
|
|
8
8
|
from playwright.sync_api import Locator, Error
|
|
9
9
|
|
|
10
|
+
from mangotools.decorator import sync_method_callback
|
|
11
|
+
from mangotools.models import MethodModel
|
|
10
12
|
from ....exceptions import MangoAutomationError
|
|
11
13
|
from ....exceptions._error_msg import ERROR_MSG_0024, ERROR_MSG_0056
|
|
12
14
|
from ....tools import Meta
|
|
13
15
|
from ....uidrive._base_data import BaseData
|
|
14
|
-
from mangotools.decorator import sync_method_callback
|
|
15
|
-
from mangotools.models import MethodModel
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class SyncWebElement(metaclass=Meta):
|
|
@@ -57,7 +57,6 @@ class SyncWebElement(metaclass=Meta):
|
|
|
57
57
|
value = locating.inner_text()
|
|
58
58
|
if set_cache_key:
|
|
59
59
|
self.base_data.test_data.set_cache(key=set_cache_key, value=value)
|
|
60
|
-
|
|
61
60
|
return value
|
|
62
61
|
|
|
63
62
|
@sync_method_callback('web', '元素操作', 6, [
|
|
@@ -97,6 +96,12 @@ class SyncWebElement(metaclass=Meta):
|
|
|
97
96
|
download.save_as(save_path)
|
|
98
97
|
self.base_data.test_data.set_cache(file_key, file_name)
|
|
99
98
|
|
|
99
|
+
@sync_method_callback('web', '元素操作', 9, [
|
|
100
|
+
MethodModel(f='locating')])
|
|
101
|
+
def w_element_wheel(self, locating: Locator):
|
|
102
|
+
"""滚动到元素位置"""
|
|
103
|
+
locating.scroll_into_view_if_needed()
|
|
104
|
+
|
|
100
105
|
@sync_method_callback('web', '元素操作', 9, [
|
|
101
106
|
MethodModel(f='locating1'),
|
|
102
107
|
MethodModel(f='locating2')])
|
|
@@ -3,7 +3,7 @@ mangoautomation/enums/__init__.py,sha256=xPv6158_Tup3U9rbYtUGgWR8W479-7czLvcRk4D
|
|
|
3
3
|
mangoautomation/enums/_base_enum.py,sha256=dpaXsdhWY08BhIzi1B1ksh_p18ZTmhWvTYhbd3n_ONQ,1176
|
|
4
4
|
mangoautomation/enums/_ui_enum.py,sha256=rdkejsyc4ogZbyNfZcp1q0V0bDPo14vg0A6or6ShaXA,4494
|
|
5
5
|
mangoautomation/exceptions/__init__.py,sha256=dXtRZSuYg3e_lwYUKYvYjtxTKHITdbi2l9XkHk9DpfY,374
|
|
6
|
-
mangoautomation/exceptions/_error_msg.py,sha256=
|
|
6
|
+
mangoautomation/exceptions/_error_msg.py,sha256=IhD60gAFfqtOWraDhuKuh_5y6GtpCAtWD2E3BkoRPoQ,5983
|
|
7
7
|
mangoautomation/exceptions/_exceptions.py,sha256=s3vF0g4nGA1tPiGdI7Mxv9W7uR3uZ9qUSl-KzYppVEU,371
|
|
8
8
|
mangoautomation/models/__init__.py,sha256=XdqEQNfIw7mcnmv3ZgWPJyFwQvap5Cu2ZMKcIK4wn9M,416
|
|
9
9
|
mangoautomation/models/_ui_model.py,sha256=IGophozQMO-NQjM_DPdlwud484yfWQw1CRwbDWjI3Vs,1446
|
|
@@ -29,27 +29,27 @@ mangoautomation/uidrive/pc/element.py,sha256=LdlWHhvXsaHH6jTp6nNrF81OWPtx81dct4y
|
|
|
29
29
|
mangoautomation/uidrive/pc/input_device.py,sha256=F6ZqKja3XkJww66x3l9Idha3R19D832J-5TfiKWmUso,353
|
|
30
30
|
mangoautomation/uidrive/pc/new_windows.py,sha256=lETHZa7cW8Z0iUShzgVTRxqivkYaOo8WIE58q_8KYfQ,2338
|
|
31
31
|
mangoautomation/uidrive/web/__init__.py,sha256=MgTklzty_SvX4UemCnqJuViq3cIjUgAjFoEtP-mcDWw,123
|
|
32
|
-
mangoautomation/uidrive/web/async_web/__init__.py,sha256=
|
|
32
|
+
mangoautomation/uidrive/web/async_web/__init__.py,sha256=gJxCPWUALVzbQJAM5RH_1-7Jto0hcm1kAXy72pZw24g,9106
|
|
33
33
|
mangoautomation/uidrive/web/async_web/_assertion.py,sha256=8cLYPe3pP6FrcjDZoFOphP7psgoJJMozq0Z_BDGNXCo,11859
|
|
34
34
|
mangoautomation/uidrive/web/async_web/_browser.py,sha256=s7piT1w8UHocwF9OnZkff8rFfuNHRMSjCxOSM4BC5DQ,4327
|
|
35
35
|
mangoautomation/uidrive/web/async_web/_customization.py,sha256=uw6p9uLHLXglgSkH4qjDl1v0iGlaNjvf8LljRH5cAHU,347
|
|
36
|
-
mangoautomation/uidrive/web/async_web/_element.py,sha256=
|
|
37
|
-
mangoautomation/uidrive/web/async_web/_input_device.py,sha256=
|
|
36
|
+
mangoautomation/uidrive/web/async_web/_element.py,sha256=kJH2FapesgjpAL9wlnaHrL2lP6OoePg4fBMcNt_TKm0,8609
|
|
37
|
+
mangoautomation/uidrive/web/async_web/_input_device.py,sha256=sMAMHb_8QyPx3pKci0gRDQc2O7h1OYMGyA7fCWl81iM,3288
|
|
38
38
|
mangoautomation/uidrive/web/async_web/_new_browser.py,sha256=cmamXXguIq-Zfhb_je8t3klX5vAaK4IqgENXi9TmmrA,5604
|
|
39
39
|
mangoautomation/uidrive/web/async_web/_page.py,sha256=TCYf79qQdVBBTTNq2COZFJVcLCgg5Ksu9lMgmQPVInU,2147
|
|
40
40
|
mangoautomation/uidrive/web/sync_web/__init__.py,sha256=vHDYYESVi-6ApllUXOrDopcQod3dBXcPlTSAng8eIGE,8662
|
|
41
41
|
mangoautomation/uidrive/web/sync_web/_assertion.py,sha256=zZ4_4WiBQFSRwAh0P0JANa5z-ozbNTh3bnUqcZBti9s,11424
|
|
42
42
|
mangoautomation/uidrive/web/sync_web/_browser.py,sha256=vQJq-TWEUq0rHWLWglE5wptqy8WQKWy4P3NUr2pzsSA,4187
|
|
43
43
|
mangoautomation/uidrive/web/sync_web/_customization.py,sha256=E_pfI8gKd0O6r4huJIvA6hoW-X9fSDVL4zEUqhHgxwE,355
|
|
44
|
-
mangoautomation/uidrive/web/sync_web/_element.py,sha256=
|
|
44
|
+
mangoautomation/uidrive/web/sync_web/_element.py,sha256=fObJa-_pMgSxluerGVMX7BhQ64J7H8YRqitopxZjqSQ,8231
|
|
45
45
|
mangoautomation/uidrive/web/sync_web/_input_device.py,sha256=8t6tJgMb4zgb4Sv02XP3gUU0ZVbApCs3WaILv8Fe1iY,3169
|
|
46
46
|
mangoautomation/uidrive/web/sync_web/_new_browser.py,sha256=RO1e4fQoeBol3w8NIx_oxIfRkGvx3ZbPSARTwMwetVQ,5378
|
|
47
47
|
mangoautomation/uidrive/web/sync_web/_page.py,sha256=MNekcL7o5YXEloeuvi3YrpOZxGhEWfrq-5i4PbtTLFg,2027
|
|
48
48
|
tests/__init__.py,sha256=UhCNFqiVjxdh4CXESNo4oE7qfjpYYVkeHbSE5-7LGDY,125
|
|
49
49
|
tests/test_ui_and.py,sha256=4k0_3bx_k2KbZifeRWGK65sxtdiPUOjkNzZ5oxjrc18,672
|
|
50
50
|
tests/test_ui_web.py,sha256=MFaUN8O5qKOMMgyk2eelhKZsYcSJm0Do6pCgsdBZEH4,2765
|
|
51
|
-
mangoautomation-1.0.
|
|
52
|
-
mangoautomation-1.0.
|
|
53
|
-
mangoautomation-1.0.
|
|
54
|
-
mangoautomation-1.0.
|
|
55
|
-
mangoautomation-1.0.
|
|
51
|
+
mangoautomation-1.0.2.dist-info/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
|
|
52
|
+
mangoautomation-1.0.2.dist-info/METADATA,sha256=0qiU0G3_yuWD7dVZLViveNrIHv9LnKQsgfECxhVRpBs,624
|
|
53
|
+
mangoautomation-1.0.2.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
54
|
+
mangoautomation-1.0.2.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
|
|
55
|
+
mangoautomation-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|