mangoautomation 1.0.58__py3-none-any.whl → 1.0.60__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 +68 -0
- mangoautomation/models/__init__.py +2 -1
- mangoautomation/models/_ui_model.py +14 -7
- mangoautomation/uidrive/_async_element.py +30 -29
- mangoautomation/uidrive/_base_data.py +5 -3
- mangoautomation/uidrive/_sync_element.py +29 -28
- mangoautomation/uidrive/android/__init__.py +2 -2
- mangoautomation/uidrive/android/_application.py +9 -9
- mangoautomation/uidrive/android/_assertion.py +4 -4
- mangoautomation/uidrive/android/_element.py +16 -16
- mangoautomation/uidrive/android/_equipment.py +7 -7
- mangoautomation/uidrive/android/_new_android.py +1 -1
- mangoautomation/uidrive/android/_page.py +12 -12
- mangoautomation/uidrive/web/async_web/__init__.py +3 -4
- mangoautomation/uidrive/web/async_web/_assertion.py +5 -5
- mangoautomation/uidrive/web/async_web/_browser.py +6 -6
- mangoautomation/uidrive/web/async_web/_element.py +29 -21
- mangoautomation/uidrive/web/async_web/_input_device.py +10 -6
- mangoautomation/uidrive/web/async_web/_new_browser.py +4 -2
- mangoautomation/uidrive/web/async_web/_page.py +2 -1
- mangoautomation/uidrive/web/sync_web/__init__.py +3 -4
- mangoautomation/uidrive/web/sync_web/_assertion.py +4 -4
- mangoautomation/uidrive/web/sync_web/_browser.py +7 -6
- mangoautomation/uidrive/web/sync_web/_element.py +29 -18
- mangoautomation/uidrive/web/sync_web/_input_device.py +7 -6
- mangoautomation/uidrive/web/sync_web/_new_browser.py +4 -2
- mangoautomation/uidrive/web/sync_web/_page.py +1 -1
- mangoautomation-1.0.60.dist-info/METADATA +42 -0
- mangoautomation-1.0.60.dist-info/RECORD +59 -0
- {mangoautomation-1.0.58.dist-info → mangoautomation-1.0.60.dist-info}/WHEEL +1 -1
- tests/__init__.py +5 -0
- tests/get_ope.py +12 -0
- tests/test_ui_and.py +0 -24
- mangoautomation-1.0.58.dist-info/METADATA +0 -34
- mangoautomation-1.0.58.dist-info/RECORD +0 -57
- {mangoautomation-1.0.58.dist-info → mangoautomation-1.0.60.dist-info/licenses}/LICENSE +0 -0
- {mangoautomation-1.0.58.dist-info → mangoautomation-1.0.60.dist-info}/top_level.txt +0 -0
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import os
|
|
6
6
|
|
|
7
7
|
import time
|
|
8
|
-
from playwright.sync_api import Locator, Error
|
|
8
|
+
from playwright.sync_api import Locator, Error, TimeoutError
|
|
9
9
|
|
|
10
10
|
from mangotools.decorator import sync_method_callback
|
|
11
11
|
from mangotools.models import MethodModel
|
|
12
12
|
from ....exceptions import MangoAutomationError
|
|
13
|
-
from ....exceptions.
|
|
13
|
+
from ....exceptions.error_msg import ERROR_MSG_0024, ERROR_MSG_0056
|
|
14
14
|
from ....tools import Meta
|
|
15
15
|
from ....uidrive._base_data import BaseData
|
|
16
16
|
|
|
@@ -24,11 +24,15 @@ class SyncWebElement(metaclass=Meta):
|
|
|
24
24
|
@sync_method_callback('web', '元素操作', 0, [MethodModel(f='locating')])
|
|
25
25
|
def w_click(self, locating: Locator):
|
|
26
26
|
"""元素单击"""
|
|
27
|
+
if locating.count() < 1:
|
|
28
|
+
raise TimeoutError('元素个数小于1,直接操作超时!')
|
|
27
29
|
locating.click()
|
|
28
30
|
|
|
29
31
|
@sync_method_callback('web', '元素操作', 1, [MethodModel(f='locating')])
|
|
30
32
|
def w_dblclick(self, locating: Locator):
|
|
31
33
|
"""元素双击"""
|
|
34
|
+
if locating.count() < 1:
|
|
35
|
+
raise TimeoutError('元素个数小于1,直接操作超时!')
|
|
32
36
|
locating.dblclick()
|
|
33
37
|
|
|
34
38
|
@sync_method_callback('web', '元素操作', 2, [MethodModel(f='locating')])
|
|
@@ -38,9 +42,11 @@ class SyncWebElement(metaclass=Meta):
|
|
|
38
42
|
|
|
39
43
|
@sync_method_callback('web', '元素操作', 3, [
|
|
40
44
|
MethodModel(f='locating'),
|
|
41
|
-
MethodModel(f='input_value', p='请输入输入内容', d=True)])
|
|
45
|
+
MethodModel(n='输入文本', f='input_value', p='请输入输入内容', d=True)])
|
|
42
46
|
def w_input(self, locating: Locator, input_value: str):
|
|
43
47
|
"""元素输入"""
|
|
48
|
+
if locating.count() < 1:
|
|
49
|
+
raise TimeoutError('元素个数小于1,直接操作超时!')
|
|
44
50
|
locating.fill(str(input_value))
|
|
45
51
|
|
|
46
52
|
@sync_method_callback('web', '元素操作', 4, [MethodModel(f='locating')])
|
|
@@ -51,9 +57,11 @@ class SyncWebElement(metaclass=Meta):
|
|
|
51
57
|
|
|
52
58
|
@sync_method_callback('web', '元素操作', 5, [
|
|
53
59
|
MethodModel(f='locating'),
|
|
54
|
-
MethodModel(f='set_cache_key', p='请输入获取元素文本后存储的key', d=True)])
|
|
60
|
+
MethodModel(n='缓存的key', f='set_cache_key', p='请输入获取元素文本后存储的key', d=True)])
|
|
55
61
|
def w_get_text(self, locating: Locator, set_cache_key=None):
|
|
56
62
|
"""获取元素文本"""
|
|
63
|
+
if locating.count() < 1:
|
|
64
|
+
raise TimeoutError('元素个数小于1,直接操作超时!')
|
|
57
65
|
methods = [
|
|
58
66
|
("inner_text", lambda: locating.inner_text()),
|
|
59
67
|
("text_content", lambda: locating.text_content()),
|
|
@@ -75,9 +83,11 @@ class SyncWebElement(metaclass=Meta):
|
|
|
75
83
|
|
|
76
84
|
@sync_method_callback('web', '元素操作', 5, [
|
|
77
85
|
MethodModel(f='locating'),
|
|
78
|
-
MethodModel(f='input_value', p='请输入输入内容', d=True)])
|
|
86
|
+
MethodModel(n='输入文本', f='input_value', p='请输入输入内容', d=True)])
|
|
79
87
|
def w_clear_input(self, locating: Locator, input_value: str):
|
|
80
88
|
"""元素清空再输入"""
|
|
89
|
+
if locating.count() < 1:
|
|
90
|
+
raise TimeoutError('元素个数小于1,直接操作超时!')
|
|
81
91
|
locating.clear()
|
|
82
92
|
locating.fill(str(input_value))
|
|
83
93
|
|
|
@@ -92,34 +102,35 @@ class SyncWebElement(metaclass=Meta):
|
|
|
92
102
|
|
|
93
103
|
@sync_method_callback('web', '元素操作', 6, [
|
|
94
104
|
MethodModel(f='locating'),
|
|
95
|
-
MethodModel(f='file_path', p='请输入文件路径,参照帮助文档', d=True)])
|
|
105
|
+
MethodModel(n='文件名称', f='file_path', p='请输入文件路径,参照帮助文档', d=True)])
|
|
96
106
|
def w_upload_files(self, locating: Locator, file_path: str | list):
|
|
97
107
|
"""拖拽文件上传"""
|
|
98
108
|
try:
|
|
99
109
|
if isinstance(file_path, str):
|
|
100
|
-
locating.set_input_files(file_path)
|
|
110
|
+
locating.set_input_files(file_path, timeout=30000)
|
|
101
111
|
else:
|
|
102
112
|
for file in file_path:
|
|
103
|
-
locating.set_input_files(file)
|
|
113
|
+
locating.set_input_files(file, timeout=30000)
|
|
104
114
|
except Error:
|
|
105
115
|
raise MangoAutomationError(*ERROR_MSG_0024)
|
|
106
116
|
|
|
107
117
|
@sync_method_callback('web', '元素操作', 7, [
|
|
108
118
|
MethodModel(f='locating'),
|
|
109
|
-
MethodModel(f='file_path', p='请输入文件路径,参照帮助文档', d=True)])
|
|
119
|
+
MethodModel(n='文件名称', f='file_path', p='请输入文件路径,参照帮助文档', d=True)])
|
|
110
120
|
def w_click_upload_files(self, locating: Locator, file_path: str | list):
|
|
111
121
|
"""点击并选择文件上传"""
|
|
112
|
-
with self.base_data.page.expect_file_chooser() as fc_info:
|
|
122
|
+
with self.base_data.page.expect_file_chooser(timeout=30000) as fc_info:
|
|
113
123
|
locating.click()
|
|
114
124
|
file_chooser = fc_info.value
|
|
115
125
|
file_chooser.set_files(file_path)
|
|
116
126
|
|
|
117
127
|
@sync_method_callback('web', '元素操作', 8, [
|
|
118
128
|
MethodModel(f='locating'),
|
|
119
|
-
MethodModel(f='file_key', p='请输入文件存储路径的key,后续通过key获取文件保存的绝对路径',
|
|
129
|
+
MethodModel(n='缓存的key', f='file_key', p='请输入文件存储路径的key,后续通过key获取文件保存的绝对路径',
|
|
130
|
+
d=True)])
|
|
120
131
|
def w_download(self, locating: Locator, file_key: str):
|
|
121
132
|
"""下载文件"""
|
|
122
|
-
with self.base_data.page.expect_download() as download_info:
|
|
133
|
+
with self.base_data.page.expect_download(timeout=30000) as download_info:
|
|
123
134
|
locating.click()
|
|
124
135
|
download = download_info.value
|
|
125
136
|
file_name = download.suggested_filename
|
|
@@ -140,7 +151,7 @@ class SyncWebElement(metaclass=Meta):
|
|
|
140
151
|
|
|
141
152
|
@sync_method_callback('web', '元素操作', 10, [
|
|
142
153
|
MethodModel(f='locating'),
|
|
143
|
-
MethodModel(f='n', p='请输入循环点击的时间', d=True)])
|
|
154
|
+
MethodModel(n='点击时间', f='n', p='请输入循环点击的时间', d=True)])
|
|
144
155
|
def w_time_click(self, locating: Locator, n: int):
|
|
145
156
|
"""循环点击N秒"""
|
|
146
157
|
try:
|
|
@@ -155,7 +166,7 @@ class SyncWebElement(metaclass=Meta):
|
|
|
155
166
|
|
|
156
167
|
@sync_method_callback('web', '元素操作', 11, [
|
|
157
168
|
MethodModel(f='locating'),
|
|
158
|
-
MethodModel(f='n', p='请输入向上像素', d=True)])
|
|
169
|
+
MethodModel(n='像素大小', f='n', p='请输入向上像素', d=True)])
|
|
159
170
|
def w_drag_up_pixel(self, locating: Locator, n: int):
|
|
160
171
|
"""往上拖动N个像素"""
|
|
161
172
|
try:
|
|
@@ -173,7 +184,7 @@ class SyncWebElement(metaclass=Meta):
|
|
|
173
184
|
|
|
174
185
|
@sync_method_callback('web', '元素操作', 12, [
|
|
175
186
|
MethodModel(f='locating'),
|
|
176
|
-
MethodModel(f='n', p='请输入向下像素', d=True)])
|
|
187
|
+
MethodModel(n='像素大小', f='n', p='请输入向下像素', d=True)])
|
|
177
188
|
def w_drag_down_pixel(self, locating: Locator, n: int):
|
|
178
189
|
"""往下拖动N个像素"""
|
|
179
190
|
try:
|
|
@@ -191,7 +202,7 @@ class SyncWebElement(metaclass=Meta):
|
|
|
191
202
|
|
|
192
203
|
@sync_method_callback('web', '元素操作', 13, [
|
|
193
204
|
MethodModel(f='locating'),
|
|
194
|
-
MethodModel(f='n', p='请输入向左像素', d=True)])
|
|
205
|
+
MethodModel(n='像素大小', f='n', p='请输入向左像素', d=True)])
|
|
195
206
|
def w_drag_left_pixel(self, locating: Locator, n: int):
|
|
196
207
|
"""往左拖动N个像素"""
|
|
197
208
|
try:
|
|
@@ -209,7 +220,7 @@ class SyncWebElement(metaclass=Meta):
|
|
|
209
220
|
|
|
210
221
|
@sync_method_callback('web', '元素操作', 14, [
|
|
211
222
|
MethodModel(f='locating'),
|
|
212
|
-
MethodModel(f='n', p='请输入向右像素', d=True)])
|
|
223
|
+
MethodModel(n='像素大小', f='n', p='请输入向右像素', d=True)])
|
|
213
224
|
def w_drag_right_pixel(self, locating: Locator, n: int):
|
|
214
225
|
"""往右拖动N个像素"""
|
|
215
226
|
try:
|
|
@@ -226,7 +237,7 @@ class SyncWebElement(metaclass=Meta):
|
|
|
226
237
|
|
|
227
238
|
@sync_method_callback('web', '元素操作', 15, [
|
|
228
239
|
MethodModel(f='locating'),
|
|
229
|
-
MethodModel(f='path', p='请输入截图保存路径', d=True)])
|
|
240
|
+
MethodModel(n='截图路径', f='path', p='请输入截图保存路径', d=True)])
|
|
230
241
|
def w_ele_screenshot(self, locating: Locator, path: str):
|
|
231
242
|
"""元素截图"""
|
|
232
243
|
locating.screenshot(path=path)
|
|
@@ -15,19 +15,19 @@ class SyncWebDeviceInput(metaclass=Meta):
|
|
|
15
15
|
self.base_data = base_data
|
|
16
16
|
|
|
17
17
|
@sync_method_callback('web', '输入设备', 0, [
|
|
18
|
-
MethodModel(f='keyboard', p='请输入键盘名称,首字母大写', d=True)])
|
|
18
|
+
MethodModel(n='按键值', f='keyboard', p='请输入键盘名称,首字母大写', d=True)])
|
|
19
19
|
def w_keys(self, keyboard: str):
|
|
20
20
|
"""模拟按下指定的键"""
|
|
21
21
|
self.base_data.page.keyboard.press(str(keyboard))
|
|
22
22
|
|
|
23
23
|
@sync_method_callback('web', '输入设备', 1, [
|
|
24
|
-
MethodModel(f='y', p='请输入向上滚动像素', d=True)])
|
|
24
|
+
MethodModel(n='y坐标', f='y', p='请输入向上滚动像素', d=True)])
|
|
25
25
|
def w_wheel(self, y):
|
|
26
26
|
"""鼠标上下滚动像素,负数代表向上"""
|
|
27
27
|
self.base_data.page.mouse.wheel(0, y)
|
|
28
28
|
|
|
29
29
|
@sync_method_callback('web', '输入设备', 2, [
|
|
30
|
-
MethodModel(f='x', p='请输入点击的x轴', d=True), MethodModel(f='y', p='请输入点击的y轴', d=True)])
|
|
30
|
+
MethodModel(n='x坐标', f='x', p='请输入点击的x轴', d=True), MethodModel(n='y坐标', f='y', p='请输入点击的y轴', d=True)])
|
|
31
31
|
def w_mouse_click(self, x: float, y: float):
|
|
32
32
|
"""鼠标点击坐标"""
|
|
33
33
|
self.base_data.page.mouse.click(x, y)
|
|
@@ -60,19 +60,20 @@ class SyncWebDeviceInput(metaclass=Meta):
|
|
|
60
60
|
center_y = viewport_size['height'] / 2
|
|
61
61
|
self.base_data.page.mouse.click(center_x, center_y)
|
|
62
62
|
|
|
63
|
-
@sync_method_callback('web', '输入设备', 5, [
|
|
63
|
+
@sync_method_callback('web', '输入设备', 5, [
|
|
64
|
+
MethodModel(n='输入文本', f='text', p='请输入键盘输入的内容', d=True)])
|
|
64
65
|
def w_keyboard_type_text(self, text: str):
|
|
65
66
|
"""模拟人工输入文字"""
|
|
66
67
|
self.base_data.page.keyboard.type(str(text))
|
|
67
68
|
|
|
68
69
|
@sync_method_callback('web', '输入设备', 6, [
|
|
69
|
-
MethodModel(f='text', p='请输入键盘输入的内容', d=True)])
|
|
70
|
+
MethodModel(n='输入文本', f='text', p='请输入键盘输入的内容', d=True)])
|
|
70
71
|
def w_keyboard_insert_text(self, text: str):
|
|
71
72
|
"""直接输入文字"""
|
|
72
73
|
self.base_data.page.keyboard.insert_text(str(text))
|
|
73
74
|
|
|
74
75
|
@sync_method_callback('web', '输入设备', 7, [
|
|
75
|
-
MethodModel(f='count', p='请输入要删除字符串的个数', d=True)])
|
|
76
|
+
MethodModel(n='删除个数', f='count', p='请输入要删除字符串的个数', d=True)])
|
|
76
77
|
def w_keyboard_delete_text(self, count: int):
|
|
77
78
|
"""删除光标左侧的字符"""
|
|
78
79
|
for _ in range(0, int(count) + 1):
|
|
@@ -21,7 +21,7 @@ from playwright.sync_api import sync_playwright, Page, BrowserContext, Browser,
|
|
|
21
21
|
|
|
22
22
|
from ....enums import BrowserTypeEnum
|
|
23
23
|
from ....exceptions import MangoAutomationError
|
|
24
|
-
from ....exceptions.
|
|
24
|
+
from ....exceptions.error_msg import ERROR_MSG_0057, ERROR_MSG_0008, ERROR_MSG_0062, ERROR_MSG_0009, ERROR_MSG_0055
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class SyncWebNewBrowser:
|
|
@@ -114,7 +114,9 @@ class SyncWebNewBrowser:
|
|
|
114
114
|
args_dict["no_viewport"] = True
|
|
115
115
|
if self.web_recording and self.videos_path:
|
|
116
116
|
args_dict["record_video_dir"] = self.videos_path
|
|
117
|
-
|
|
117
|
+
context = self.browser.new_context(**args_dict)
|
|
118
|
+
context.set_default_timeout(3000)
|
|
119
|
+
return context
|
|
118
120
|
|
|
119
121
|
def new_page(self, context: BrowserContext) -> Page:
|
|
120
122
|
try:
|
|
@@ -18,7 +18,7 @@ class SyncWebPage(metaclass=Meta):
|
|
|
18
18
|
self.base_data = base_data
|
|
19
19
|
|
|
20
20
|
@sync_method_callback('web', '页面操作', 0, [
|
|
21
|
-
MethodModel(f='individual', p='请输入页签下标,从1开始数', d=True)])
|
|
21
|
+
MethodModel(n='页签下标', f='individual', p='请输入页签下标,从1开始数', d=True)])
|
|
22
22
|
def w_switch_tabs(self, individual: int):
|
|
23
23
|
"""切换页签"""
|
|
24
24
|
pages = self.base_data.context.pages
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mangoautomation
|
|
3
|
+
Version: 1.0.60
|
|
4
|
+
Summary: 测试工具
|
|
5
|
+
Home-page: https://gitee.com/mao-peng/testkit
|
|
6
|
+
Author: 毛鹏
|
|
7
|
+
Author-email: 729164035@qq.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: setuptools>=68.2.0
|
|
14
|
+
Requires-Dist: pydantic>=2.9.2
|
|
15
|
+
Requires-Dist: playwright==1.43.0
|
|
16
|
+
Requires-Dist: uiautomation>=2.0.20
|
|
17
|
+
Requires-Dist: uiautomator2>=3.2.5
|
|
18
|
+
Requires-Dist: mangotools>=1.1.42
|
|
19
|
+
Requires-Dist: adbutils~=2.8.9
|
|
20
|
+
Requires-Dist: uiautodev>=0.9.0
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: description
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
29
|
+
|
|
30
|
+
# testkit
|
|
31
|
+
|
|
32
|
+
#### 介绍
|
|
33
|
+
|
|
34
|
+
测试工具
|
|
35
|
+
|
|
36
|
+
#### 安装教程
|
|
37
|
+
|
|
38
|
+
1. pip install mangokit
|
|
39
|
+
|
|
40
|
+
#### 使用说明
|
|
41
|
+
|
|
42
|
+
1.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
mangoautomation/__init__.py,sha256=6nV7fyiPU5G-kWbrpCQUlkJdhJyPQh27qQaSvNvQkzQ,125
|
|
2
|
+
mangoautomation/enums/__init__.py,sha256=TZnjNeYQRysRolki82U0_s8BQamQ2EjlWFJ-RDDPel8,387
|
|
3
|
+
mangoautomation/enums/_base_enum.py,sha256=dpaXsdhWY08BhIzi1B1ksh_p18ZTmhWvTYhbd3n_ONQ,1176
|
|
4
|
+
mangoautomation/enums/_ui_enum.py,sha256=rdkejsyc4ogZbyNfZcp1q0V0bDPo14vg0A6or6ShaXA,4494
|
|
5
|
+
mangoautomation/exceptions/__init__.py,sha256=4CmTPcSFypENe3zXzsBUjA5MxXLugnP14dlakmItVjs,227
|
|
6
|
+
mangoautomation/exceptions/_error_msg.py,sha256=wnyHrBPE4ZGcWhvz8bD2K-8rMRRwcUIVVYIHWdhYM2U,5335
|
|
7
|
+
mangoautomation/exceptions/_exceptions.py,sha256=BiyST1QPivpfIOuKn1gKhpXOyBv6gfip_KvlQuu8ctw,385
|
|
8
|
+
mangoautomation/exceptions/error_msg.py,sha256=S51nDyUr0Jr4hE3i6D24JoGij_d_eeVNsUe2MTuRdJo,5341
|
|
9
|
+
mangoautomation/models/__init__.py,sha256=25zmLzbB4gObJ6nqN7jPYP9LcdlixDKBGVoc7JrwggI,323
|
|
10
|
+
mangoautomation/models/_ui_model.py,sha256=5Fus-YwIn-Pz4KxtAJMwSkYFLTCAhXpNGts6j7d5XUw,1592
|
|
11
|
+
mangoautomation/tools/__init__.py,sha256=J-uPfaTZMMo7CL2PY6_5qCO24iIBTtUJTuFXDJz_AZg,296
|
|
12
|
+
mangoautomation/tools/_mate.py,sha256=9lk_EJnAX_OyXbe5WacyHkkcEr2ScBgasl6eUnlklWA,405
|
|
13
|
+
mangoautomation/tools/_uiautodev.py,sha256=RMOQMXse744xwUDb1_l7qDv9mUiqZt1Gm5sbB-nlgDk,1388
|
|
14
|
+
mangoautomation/uidrive/__init__.py,sha256=3xD94fw5QQvBPMPDq2o-SiJI_zt0AdJuB_X0eAFth8g,430
|
|
15
|
+
mangoautomation/uidrive/_async_element.py,sha256=ZaEu-nesNW8gaJs0pp6cGttUqfz1DHV3FoBJFhVbhtA,13859
|
|
16
|
+
mangoautomation/uidrive/_base_data.py,sha256=xDjgBJ6CDFajUy18ft-NKe-7vKe7WtgMC9zV6gRrmPY,3946
|
|
17
|
+
mangoautomation/uidrive/_driver_object.py,sha256=7RGiAIPHU_bQtwVPEprnXt-HOzoKuKn_Bu2RZxjSAVs,2055
|
|
18
|
+
mangoautomation/uidrive/_sync_element.py,sha256=B2f8d0ZLlEmzWodxzeFzcZAIYXjlQ-P85Rk_M8fWqRY,13712
|
|
19
|
+
mangoautomation/uidrive/android/__init__.py,sha256=HBYY1L-g7OASchquaUXH7NcpxXpuJVx6Zuw0JbNgq-Y,5524
|
|
20
|
+
mangoautomation/uidrive/android/_application.py,sha256=ic9RbiOAft3wWi6QH6PgcRVN8kiahe3wMyErxsHp3FU,2854
|
|
21
|
+
mangoautomation/uidrive/android/_assertion.py,sha256=ps6uBP4KxcBGJkrlG7m-Caq1rz4UfJhKUNU2YBetu-c,4349
|
|
22
|
+
mangoautomation/uidrive/android/_customization.py,sha256=pCLMmruozOyCJQZWAYupxxKqpWmZyCYsfSBw3XW7vf0,381
|
|
23
|
+
mangoautomation/uidrive/android/_element.py,sha256=3IEUCh9nzgB0hFG0nMcoPC28wMAoDxMS2Tf3gcmm80g,7212
|
|
24
|
+
mangoautomation/uidrive/android/_equipment.py,sha256=TeVFB5QzKTNIAfcV7DMYkQZVzgIGx4_hWQ3Z1RsIKXc,5215
|
|
25
|
+
mangoautomation/uidrive/android/_new_android.py,sha256=WldFsGm5QnJ9QVPtWxRgwCiWSX3jYObFxAPCQ5xSKyg,1636
|
|
26
|
+
mangoautomation/uidrive/android/_page.py,sha256=Ep9btx-2dgaEmjHAVExjB35HQx29PGZ0DHNndIYNpJc,4620
|
|
27
|
+
mangoautomation/uidrive/ios/__init__.py,sha256=SdxI8e5AOoAb8JTaDoMkObezIluJ50nm2b6zeDHv1PI,125
|
|
28
|
+
mangoautomation/uidrive/pc/__init__.py,sha256=gp3T9C5bSA78dv1AgWXeB9yQQi6q5Tkd0NedCencGWo,2275
|
|
29
|
+
mangoautomation/uidrive/pc/assertion.py,sha256=mH25hZ2i4T8kA1F2loW_nuPJ-Hb0z1pwILTJqkwwpLA,125
|
|
30
|
+
mangoautomation/uidrive/pc/customization.py,sha256=hHf66ImrVxFlGtONrWSHUDrYjmWFc4ANJ883TIrJFG8,239
|
|
31
|
+
mangoautomation/uidrive/pc/element.py,sha256=LdlWHhvXsaHH6jTp6nNrF81OWPtx81dct4yDBHikQBg,519
|
|
32
|
+
mangoautomation/uidrive/pc/input_device.py,sha256=F6ZqKja3XkJww66x3l9Idha3R19D832J-5TfiKWmUso,353
|
|
33
|
+
mangoautomation/uidrive/pc/new_windows.py,sha256=lETHZa7cW8Z0iUShzgVTRxqivkYaOo8WIE58q_8KYfQ,2338
|
|
34
|
+
mangoautomation/uidrive/web/__init__.py,sha256=MgTklzty_SvX4UemCnqJuViq3cIjUgAjFoEtP-mcDWw,123
|
|
35
|
+
mangoautomation/uidrive/web/async_web/__init__.py,sha256=Xa5WwPyH_xKHJ6E3j87wYIDIA52fO9DZqkNe981vmJc,8378
|
|
36
|
+
mangoautomation/uidrive/web/async_web/_assertion.py,sha256=2tPSGiJSKmrkiM0bvOd6nfTKTAjDAlosgXcn-oiN0zM,12820
|
|
37
|
+
mangoautomation/uidrive/web/async_web/_browser.py,sha256=mx1m4bPZSdvNOD_8V3gcFUjGMfU3oXj6IJJdlT4ukD0,5381
|
|
38
|
+
mangoautomation/uidrive/web/async_web/_customization.py,sha256=uw6p9uLHLXglgSkH4qjDl1v0iGlaNjvf8LljRH5cAHU,347
|
|
39
|
+
mangoautomation/uidrive/web/async_web/_element.py,sha256=qEwvGZGzDBNhvYiKB3rlgtTS9D07ln-5iPOUIwKzIdI,11064
|
|
40
|
+
mangoautomation/uidrive/web/async_web/_input_device.py,sha256=0EjGkCQWjKY69bTIILNoX7p_6VVfYAVgjNaj4t2r6nk,3440
|
|
41
|
+
mangoautomation/uidrive/web/async_web/_new_browser.py,sha256=v-OXD-uYD7XagupxSlG4g_ZBsRq_Jpo88iwE_A_Ilfs,6202
|
|
42
|
+
mangoautomation/uidrive/web/async_web/_page.py,sha256=DIdyu-TmAUmgkwXDeNzB0p9bqc0Csomj_7ahWcO8ZH0,2175
|
|
43
|
+
mangoautomation/uidrive/web/sync_web/__init__.py,sha256=wV1_y-lsX5qW30ERIvP-X0eRdnwVV3L7uTRCMiowqfo,7938
|
|
44
|
+
mangoautomation/uidrive/web/sync_web/_assertion.py,sha256=2GOhwD7CKtUbsdWmo0aT9pxfBFUQ_bYrjdvRoIBwDNs,12594
|
|
45
|
+
mangoautomation/uidrive/web/sync_web/_browser.py,sha256=b-nBdskqKTFX4Y7xRs8NqEXYulJj9CP2hgLJ9qWnWlQ,5245
|
|
46
|
+
mangoautomation/uidrive/web/sync_web/_customization.py,sha256=E_pfI8gKd0O6r4huJIvA6hoW-X9fSDVL4zEUqhHgxwE,355
|
|
47
|
+
mangoautomation/uidrive/web/sync_web/_element.py,sha256=QIwgQ0cdMc9-oa5TwRTKxxwndUgvVCTogTohSNKhzRs,10683
|
|
48
|
+
mangoautomation/uidrive/web/sync_web/_input_device.py,sha256=zPFd8xFuLeem9Io0ZBkiaJlFoPSHea-A87_vnYHEg80,3287
|
|
49
|
+
mangoautomation/uidrive/web/sync_web/_new_browser.py,sha256=APGUFhOVAW68x-6y9tQLZJkn2utfR-PrpjgP8WE38SE,6149
|
|
50
|
+
mangoautomation/uidrive/web/sync_web/_page.py,sha256=LC7FWr6Exv-KSiSU0y2Zxjd39_QLohe_UD5nvA8htUM,2045
|
|
51
|
+
mangoautomation-1.0.60.dist-info/licenses/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
|
|
52
|
+
tests/__init__.py,sha256=fdlqghHH7eXneovXweQjn6gVb8jwm6wprtPw5ksV_IA,350
|
|
53
|
+
tests/get_ope.py,sha256=LhATAdHROfUKTmndNitFth4b845P7jDN9DugEwq8vAU,383
|
|
54
|
+
tests/test_ui_and.py,sha256=A_0pqG6s5Ts02He7P3NwuDSK3g9Q3VP1Sb_P8wq6g0Q,125
|
|
55
|
+
tests/test_ui_web.py,sha256=MFaUN8O5qKOMMgyk2eelhKZsYcSJm0Do6pCgsdBZEH4,2765
|
|
56
|
+
mangoautomation-1.0.60.dist-info/METADATA,sha256=Db8_o0u0j81MpOqi-khhcV9BYyYSI321Seqwa6UXzxM,976
|
|
57
|
+
mangoautomation-1.0.60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
58
|
+
mangoautomation-1.0.60.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
|
|
59
|
+
mangoautomation-1.0.60.dist-info/RECORD,,
|
tests/__init__.py
CHANGED
|
@@ -3,3 +3,8 @@
|
|
|
3
3
|
# @Description:
|
|
4
4
|
# @Time : 2024-09-07 23:25
|
|
5
5
|
# @Author : 毛鹏
|
|
6
|
+
import random
|
|
7
|
+
|
|
8
|
+
data_list = [{'exp': 2, 'loc': 'get_by_role("textbox", name="请输入1密码")'},
|
|
9
|
+
{'exp': 0, 'loc': '//input[@type="password"]'}]
|
|
10
|
+
print(random.randint(0, len(data_list) - 1), len(data_list))
|
tests/get_ope.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Project: 芒果测试平台
|
|
3
|
+
# @Description:
|
|
4
|
+
# @Time : 2025-08-31 17:41
|
|
5
|
+
# @Author : 毛鹏
|
|
6
|
+
import json
|
|
7
|
+
from mangoautomation.uidrive import *
|
|
8
|
+
from mangotools.decorator import func_info
|
|
9
|
+
|
|
10
|
+
print(json.dumps(func_info, ensure_ascii=False, indent=4))
|
|
11
|
+
with open('ope.json', 'w') as f:
|
|
12
|
+
f.write(json.dumps(func_info, ensure_ascii=False, indent=4))
|
tests/test_ui_and.py
CHANGED
|
@@ -3,27 +3,3 @@
|
|
|
3
3
|
# @Description:
|
|
4
4
|
# @Time : 2025-05-03 10:02
|
|
5
5
|
# @Author : 毛鹏
|
|
6
|
-
import traceback
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
# driver_object = DriverObject()
|
|
11
|
-
# driver_object.set_android('ed789e3b')
|
|
12
|
-
# test_data = DataProcessor()
|
|
13
|
-
# base_data = BaseData(test_data)
|
|
14
|
-
# base_data.android = driver_object.android.new_android()
|
|
15
|
-
# android_driver = AndroidDriver(base_data)
|
|
16
|
-
# android_driver.a_close_app('aaasdsadawdwadwa')
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def a_ass(a, b):
|
|
21
|
-
assert a == b, f'断言A=B失败, a的值:{a}, b的值:{b}'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
try:
|
|
25
|
-
a_ass(1, 2)
|
|
26
|
-
except AssertionError as error:
|
|
27
|
-
print(error.args[1])
|
|
28
|
-
print(type(error))
|
|
29
|
-
traceback.print_exc()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: mangoautomation
|
|
3
|
-
Version: 1.0.58
|
|
4
|
-
Summary: 测试工具
|
|
5
|
-
Home-page: https://gitee.com/mao-peng/testkit
|
|
6
|
-
Author: 毛鹏
|
|
7
|
-
Author-email: 729164035@qq.com
|
|
8
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: setuptools >=68.2.0
|
|
14
|
-
Requires-Dist: pydantic >=2.9.2
|
|
15
|
-
Requires-Dist: playwright ==1.43.0
|
|
16
|
-
Requires-Dist: uiautomation >=2.0.20
|
|
17
|
-
Requires-Dist: uiautomator2 >=3.2.5
|
|
18
|
-
Requires-Dist: mangotools >=1.1.39
|
|
19
|
-
Requires-Dist: adbutils ~=2.8.9
|
|
20
|
-
Requires-Dist: uiautodev >=0.9.0
|
|
21
|
-
|
|
22
|
-
# testkit
|
|
23
|
-
|
|
24
|
-
#### 介绍
|
|
25
|
-
|
|
26
|
-
测试工具
|
|
27
|
-
|
|
28
|
-
#### 安装教程
|
|
29
|
-
|
|
30
|
-
1. pip install mangokit
|
|
31
|
-
|
|
32
|
-
#### 使用说明
|
|
33
|
-
|
|
34
|
-
1.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
mangoautomation/__init__.py,sha256=6nV7fyiPU5G-kWbrpCQUlkJdhJyPQh27qQaSvNvQkzQ,125
|
|
2
|
-
mangoautomation/enums/__init__.py,sha256=TZnjNeYQRysRolki82U0_s8BQamQ2EjlWFJ-RDDPel8,387
|
|
3
|
-
mangoautomation/enums/_base_enum.py,sha256=dpaXsdhWY08BhIzi1B1ksh_p18ZTmhWvTYhbd3n_ONQ,1176
|
|
4
|
-
mangoautomation/enums/_ui_enum.py,sha256=rdkejsyc4ogZbyNfZcp1q0V0bDPo14vg0A6or6ShaXA,4494
|
|
5
|
-
mangoautomation/exceptions/__init__.py,sha256=4CmTPcSFypENe3zXzsBUjA5MxXLugnP14dlakmItVjs,227
|
|
6
|
-
mangoautomation/exceptions/_error_msg.py,sha256=wnyHrBPE4ZGcWhvz8bD2K-8rMRRwcUIVVYIHWdhYM2U,5335
|
|
7
|
-
mangoautomation/exceptions/_exceptions.py,sha256=BiyST1QPivpfIOuKn1gKhpXOyBv6gfip_KvlQuu8ctw,385
|
|
8
|
-
mangoautomation/models/__init__.py,sha256=VaL1_5Dvm2g70NGgWCKzbje4VQzJhcnAAdg4JP1WJ_U,269
|
|
9
|
-
mangoautomation/models/_ui_model.py,sha256=wKiBNpGDhSVCAYf798I0bMzdhCGXfSOptMCQrBLTUCM,1416
|
|
10
|
-
mangoautomation/tools/__init__.py,sha256=J-uPfaTZMMo7CL2PY6_5qCO24iIBTtUJTuFXDJz_AZg,296
|
|
11
|
-
mangoautomation/tools/_mate.py,sha256=9lk_EJnAX_OyXbe5WacyHkkcEr2ScBgasl6eUnlklWA,405
|
|
12
|
-
mangoautomation/tools/_uiautodev.py,sha256=RMOQMXse744xwUDb1_l7qDv9mUiqZt1Gm5sbB-nlgDk,1388
|
|
13
|
-
mangoautomation/uidrive/__init__.py,sha256=3xD94fw5QQvBPMPDq2o-SiJI_zt0AdJuB_X0eAFth8g,430
|
|
14
|
-
mangoautomation/uidrive/_async_element.py,sha256=-nkYBazbYlitsTIfN8XhKIM8GitQifoZ0aTqaOH05Nk,13757
|
|
15
|
-
mangoautomation/uidrive/_base_data.py,sha256=ur2Ts40MAhOYXb0vGVXZdSwEVCI3Csri9I9f1pw1r4Y,3766
|
|
16
|
-
mangoautomation/uidrive/_driver_object.py,sha256=7RGiAIPHU_bQtwVPEprnXt-HOzoKuKn_Bu2RZxjSAVs,2055
|
|
17
|
-
mangoautomation/uidrive/_sync_element.py,sha256=Zdg5LwNeZBjctpojPmjQfMgrsAAne_w_KWFwhucSlxA,13576
|
|
18
|
-
mangoautomation/uidrive/android/__init__.py,sha256=SWn7PwRZOf34LCE9KigClDaV8R0n70rqLsG6hCeAok0,5499
|
|
19
|
-
mangoautomation/uidrive/android/_application.py,sha256=EeEM0MPtOPeYeKx92mtMFWqGpCRmri-D_CzXvPt13RA,2800
|
|
20
|
-
mangoautomation/uidrive/android/_assertion.py,sha256=Gzic7cH3_Vr6NLiMBPRJr7q1F8YFF2dEopINMR4XQFc,4289
|
|
21
|
-
mangoautomation/uidrive/android/_customization.py,sha256=pCLMmruozOyCJQZWAYupxxKqpWmZyCYsfSBw3XW7vf0,381
|
|
22
|
-
mangoautomation/uidrive/android/_element.py,sha256=lOrQyQhOoJ2LrbiQ9t0wxH7LcpwZgyDxU0iUuKaSjRo,6989
|
|
23
|
-
mangoautomation/uidrive/android/_equipment.py,sha256=WRaXLf4DuVzxG8TL5c4lHam6hZo_jsWwitYQUun3Srk,5125
|
|
24
|
-
mangoautomation/uidrive/android/_new_android.py,sha256=UHj2DaNBfgvnJxYIzmUNc3gqTIRXxL_5kxEDQVbzWNw,1637
|
|
25
|
-
mangoautomation/uidrive/android/_page.py,sha256=cOPKlIucf-rqtpm9AkpZtAnDd9QGvJRGLXS15kPVhIM,4454
|
|
26
|
-
mangoautomation/uidrive/ios/__init__.py,sha256=SdxI8e5AOoAb8JTaDoMkObezIluJ50nm2b6zeDHv1PI,125
|
|
27
|
-
mangoautomation/uidrive/pc/__init__.py,sha256=gp3T9C5bSA78dv1AgWXeB9yQQi6q5Tkd0NedCencGWo,2275
|
|
28
|
-
mangoautomation/uidrive/pc/assertion.py,sha256=mH25hZ2i4T8kA1F2loW_nuPJ-Hb0z1pwILTJqkwwpLA,125
|
|
29
|
-
mangoautomation/uidrive/pc/customization.py,sha256=hHf66ImrVxFlGtONrWSHUDrYjmWFc4ANJ883TIrJFG8,239
|
|
30
|
-
mangoautomation/uidrive/pc/element.py,sha256=LdlWHhvXsaHH6jTp6nNrF81OWPtx81dct4yDBHikQBg,519
|
|
31
|
-
mangoautomation/uidrive/pc/input_device.py,sha256=F6ZqKja3XkJww66x3l9Idha3R19D832J-5TfiKWmUso,353
|
|
32
|
-
mangoautomation/uidrive/pc/new_windows.py,sha256=lETHZa7cW8Z0iUShzgVTRxqivkYaOo8WIE58q_8KYfQ,2338
|
|
33
|
-
mangoautomation/uidrive/web/__init__.py,sha256=MgTklzty_SvX4UemCnqJuViq3cIjUgAjFoEtP-mcDWw,123
|
|
34
|
-
mangoautomation/uidrive/web/async_web/__init__.py,sha256=awtvLCGjUKIx46d2rZpO2CcuBK2WAKZ7PN6yt6ztlBA,8401
|
|
35
|
-
mangoautomation/uidrive/web/async_web/_assertion.py,sha256=iC_j2pZN1pr2kFmxjEb8fBSX91M0BmrcRKARe3JH-kQ,12761
|
|
36
|
-
mangoautomation/uidrive/web/async_web/_browser.py,sha256=39YroURzagpq0HoEn1RZnNf1KDKXIgWpKSvp5L_Yut0,5286
|
|
37
|
-
mangoautomation/uidrive/web/async_web/_customization.py,sha256=uw6p9uLHLXglgSkH4qjDl1v0iGlaNjvf8LljRH5cAHU,347
|
|
38
|
-
mangoautomation/uidrive/web/async_web/_element.py,sha256=Y8VMZM4YavX8hjCX33USFfCsDnZUtkpSZm2Iow0cm_k,10188
|
|
39
|
-
mangoautomation/uidrive/web/async_web/_input_device.py,sha256=sMAMHb_8QyPx3pKci0gRDQc2O7h1OYMGyA7fCWl81iM,3288
|
|
40
|
-
mangoautomation/uidrive/web/async_web/_new_browser.py,sha256=eCXa_WqCZfaom-PSBR9nM5x1XBQCPswUFT4134d3WDE,6133
|
|
41
|
-
mangoautomation/uidrive/web/async_web/_page.py,sha256=TCYf79qQdVBBTTNq2COZFJVcLCgg5Ksu9lMgmQPVInU,2147
|
|
42
|
-
mangoautomation/uidrive/web/sync_web/__init__.py,sha256=31U15FJftsv6yyDlKT-2zN0CNPyolZPRuPh7mdeKKas,7961
|
|
43
|
-
mangoautomation/uidrive/web/sync_web/_assertion.py,sha256=hVA7-Z3CfPgkmtnK_3M5UGo6sct88W6AJfQTnrqu9jU,12534
|
|
44
|
-
mangoautomation/uidrive/web/sync_web/_browser.py,sha256=c7xHkIIFPawlzcVkGjwqeKfWAM--87wEJb3V3Ysi29w,5146
|
|
45
|
-
mangoautomation/uidrive/web/sync_web/_customization.py,sha256=E_pfI8gKd0O6r4huJIvA6hoW-X9fSDVL4zEUqhHgxwE,355
|
|
46
|
-
mangoautomation/uidrive/web/sync_web/_element.py,sha256=i9sDm_KbbTF8H442zbQzEHZeM0Iszr1mVJUhEcxXUDM,9812
|
|
47
|
-
mangoautomation/uidrive/web/sync_web/_input_device.py,sha256=8t6tJgMb4zgb4Sv02XP3gUU0ZVbApCs3WaILv8Fe1iY,3169
|
|
48
|
-
mangoautomation/uidrive/web/sync_web/_new_browser.py,sha256=5gd0Z2wyou0WCTPcMTjzos_3duB59djKJyTCXyULIZ8,6080
|
|
49
|
-
mangoautomation/uidrive/web/sync_web/_page.py,sha256=MNekcL7o5YXEloeuvi3YrpOZxGhEWfrq-5i4PbtTLFg,2027
|
|
50
|
-
tests/__init__.py,sha256=UhCNFqiVjxdh4CXESNo4oE7qfjpYYVkeHbSE5-7LGDY,125
|
|
51
|
-
tests/test_ui_and.py,sha256=4k0_3bx_k2KbZifeRWGK65sxtdiPUOjkNzZ5oxjrc18,672
|
|
52
|
-
tests/test_ui_web.py,sha256=MFaUN8O5qKOMMgyk2eelhKZsYcSJm0Do6pCgsdBZEH4,2765
|
|
53
|
-
mangoautomation-1.0.58.dist-info/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
|
|
54
|
-
mangoautomation-1.0.58.dist-info/METADATA,sha256=JL3gL8kW5TM5DdnsWr4jOx7DE3X4odT32Nf4P8fAoRM,816
|
|
55
|
-
mangoautomation-1.0.58.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
56
|
-
mangoautomation-1.0.58.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
|
|
57
|
-
mangoautomation-1.0.58.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|