mangoautomation 1.0.33__tar.gz → 1.0.34__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.33/mangoautomation.egg-info → mangoautomation-1.0.34}/PKG-INFO +1 -1
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_async_element.py +16 -27
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_sync_element.py +16 -27
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_browser.py +13 -2
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_browser.py +12 -1
- {mangoautomation-1.0.33 → mangoautomation-1.0.34/mangoautomation.egg-info}/PKG-INFO +1 -1
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/setup.py +1 -1
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/LICENSE +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/MANIFEST.in +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/README.md +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/enums/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/enums/_base_enum.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/enums/_ui_enum.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/exceptions/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/exceptions/_error_msg.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/exceptions/_exceptions.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/models/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/models/_ui_model.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/tools/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/tools/_mate.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_base_data.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_driver_object.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_application.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_assertion.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_customization.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_element.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_equipment.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_new_android.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_page.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/assertion.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/customization.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/element.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/input_device.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/new_windows.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_assertion.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_customization.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_element.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_input_device.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_new_browser.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_page.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_assertion.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_customization.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_element.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_input_device.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_new_browser.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_page.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/SOURCES.txt +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/dependency_links.txt +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/requires.txt +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/top_level.txt +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/setup.cfg +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/tests/__init__.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/tests/test_ui_and.py +0 -0
- {mangoautomation-1.0.33 → mangoautomation-1.0.34}/tests/test_ui_web.py +0 -0
|
@@ -7,7 +7,7 @@ import asyncio
|
|
|
7
7
|
import os
|
|
8
8
|
import traceback
|
|
9
9
|
|
|
10
|
-
from playwright._impl._errors import TargetClosedError, Error
|
|
10
|
+
from playwright._impl._errors import TargetClosedError, Error
|
|
11
11
|
|
|
12
12
|
from mangotools.assertion import PublicAssertion
|
|
13
13
|
from mangotools.decorator import async_retry
|
|
@@ -241,22 +241,22 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
241
241
|
raise MangoAutomationError(*ERROR_MSG_0027)
|
|
242
242
|
|
|
243
243
|
async def __error(self, msg: str):
|
|
244
|
-
self.element_result_model.status = StatusEnum.FAIL.value
|
|
245
|
-
self.element_result_model.error_message = msg
|
|
246
|
-
self.base_data.log.debug(
|
|
247
|
-
f"""
|
|
248
|
-
元素操作失败----->
|
|
249
|
-
元 素 对 象:{self.element_model.model_dump() if self.element_model else self.element_model}
|
|
250
|
-
元素测试结果:{
|
|
251
|
-
self.element_result_model.model_dump() if self.element_result_model else self.element_result_model}
|
|
252
|
-
"""
|
|
253
|
-
)
|
|
254
|
-
file_name = f'失败截图-{self.element_model.name}{self.base_data.test_data.get_time_for_min()}.jpg'
|
|
255
|
-
file_path = os.path.join(self.base_data.screenshot_path, file_name)
|
|
256
|
-
self.element_result_model.picture_path = file_path
|
|
257
|
-
self.element_result_model.picture_name = file_name
|
|
258
244
|
try:
|
|
245
|
+
self.element_result_model.status = StatusEnum.FAIL.value
|
|
246
|
+
self.element_result_model.error_message = msg
|
|
247
|
+
self.base_data.log.debug(
|
|
248
|
+
f"""
|
|
249
|
+
元素操作失败----->
|
|
250
|
+
元 素 对 象:{self.element_model.model_dump() if self.element_model else self.element_model}
|
|
251
|
+
元素测试结果:{
|
|
252
|
+
self.element_result_model.model_dump() if self.element_result_model else self.element_result_model}
|
|
253
|
+
"""
|
|
254
|
+
)
|
|
255
|
+
file_name = f'失败截图-{self.element_model.name}{self.base_data.test_data.get_time_for_min()}.jpg'
|
|
256
|
+
file_path = os.path.join(self.base_data.screenshot_path, file_name)
|
|
259
257
|
await self.__error_screenshot(file_path)
|
|
258
|
+
self.element_result_model.picture_path = file_path
|
|
259
|
+
self.element_result_model.picture_name = file_name
|
|
260
260
|
except MangoAutomationError as error:
|
|
261
261
|
self.element_result_model.error_message += f'执行过程中发生失败,准备截图时截图失败,失败原因:{error.msg}'
|
|
262
262
|
except Exception as error:
|
|
@@ -265,18 +265,7 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
|
|
|
265
265
|
|
|
266
266
|
async def __error_screenshot(self, file_path):
|
|
267
267
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
268
|
-
|
|
269
|
-
await self.w_screenshot(file_path)
|
|
270
|
-
except (TargetClosedError, TimeoutError) as error:
|
|
271
|
-
self.base_data.log.debug(
|
|
272
|
-
f'截图出现异常失败-1,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
273
|
-
self.base_data.setup()
|
|
274
|
-
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
275
|
-
except AttributeError as error:
|
|
276
|
-
self.base_data.log.debug(
|
|
277
|
-
f'截图出现异常失败-2,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
278
|
-
self.base_data.setup()
|
|
279
|
-
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
268
|
+
await self.w_screenshot(file_path)
|
|
280
269
|
elif self.drive_type == DriveTypeEnum.ANDROID.value:
|
|
281
270
|
self.a_screenshot(file_path)
|
|
282
271
|
else:
|
|
@@ -7,7 +7,7 @@ import os
|
|
|
7
7
|
import traceback
|
|
8
8
|
|
|
9
9
|
import time
|
|
10
|
-
from playwright._impl._errors import TargetClosedError, Error
|
|
10
|
+
from playwright._impl._errors import TargetClosedError, Error
|
|
11
11
|
|
|
12
12
|
from mangotools.assertion import PublicAssertion
|
|
13
13
|
from mangotools.decorator import sync_retry
|
|
@@ -241,22 +241,22 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
241
241
|
raise MangoAutomationError(*ERROR_MSG_0027)
|
|
242
242
|
|
|
243
243
|
def __error(self, msg: str):
|
|
244
|
-
self.element_result_model.status = StatusEnum.FAIL.value
|
|
245
|
-
self.element_result_model.error_message = msg
|
|
246
|
-
self.base_data.log.debug(
|
|
247
|
-
f"""
|
|
248
|
-
元素操作失败----->
|
|
249
|
-
元 素 对 象:{self.element_model.model_dump() if self.element_model else self.element_model}
|
|
250
|
-
元素测试结果:{
|
|
251
|
-
self.element_result_model.model_dump() if self.element_result_model else self.element_result_model}
|
|
252
|
-
"""
|
|
253
|
-
)
|
|
254
|
-
file_name = f'失败截图-{self.element_model.name}{self.base_data.test_data.get_time_for_min()}.jpg'
|
|
255
|
-
file_path = os.path.join(self.base_data.screenshot_path, file_name)
|
|
256
|
-
self.element_result_model.picture_path = file_path
|
|
257
|
-
self.element_result_model.picture_name = file_name
|
|
258
244
|
try:
|
|
245
|
+
self.element_result_model.status = StatusEnum.FAIL.value
|
|
246
|
+
self.element_result_model.error_message = msg
|
|
247
|
+
self.base_data.log.debug(
|
|
248
|
+
f"""
|
|
249
|
+
元素操作失败----->
|
|
250
|
+
元 素 对 象:{self.element_model.model_dump() if self.element_model else self.element_model}
|
|
251
|
+
元素测试结果:{
|
|
252
|
+
self.element_result_model.model_dump() if self.element_result_model else self.element_result_model}
|
|
253
|
+
"""
|
|
254
|
+
)
|
|
255
|
+
file_name = f'失败截图-{self.element_model.name}{self.base_data.test_data.get_time_for_min()}.jpg'
|
|
256
|
+
file_path = os.path.join(self.base_data.screenshot_path, file_name)
|
|
259
257
|
self.__error_screenshot(file_path)
|
|
258
|
+
self.element_result_model.picture_path = file_path
|
|
259
|
+
self.element_result_model.picture_name = file_name
|
|
260
260
|
except MangoAutomationError as error:
|
|
261
261
|
self.element_result_model.error_message += f'执行过程中发生失败,准备截图时截图失败,失败原因:{error.msg}'
|
|
262
262
|
except Exception as error:
|
|
@@ -265,18 +265,7 @@ class SyncElement(SyncWebDevice, AndroidDriver):
|
|
|
265
265
|
|
|
266
266
|
def __error_screenshot(self, file_path):
|
|
267
267
|
if self.drive_type == DriveTypeEnum.WEB.value:
|
|
268
|
-
|
|
269
|
-
self.w_screenshot(file_path)
|
|
270
|
-
except (TargetClosedError, TimeoutError) as error:
|
|
271
|
-
self.base_data.log.debug(
|
|
272
|
-
f'截图出现异常失败-1,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
273
|
-
self.base_data.setup()
|
|
274
|
-
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
275
|
-
except AttributeError as error:
|
|
276
|
-
self.base_data.log.debug(
|
|
277
|
-
f'截图出现异常失败-2,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
278
|
-
self.base_data.setup()
|
|
279
|
-
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
268
|
+
self.w_screenshot(file_path)
|
|
280
269
|
elif self.drive_type == DriveTypeEnum.ANDROID.value:
|
|
281
270
|
self.a_screenshot(file_path)
|
|
282
271
|
else:
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_browser.py
RENAMED
|
@@ -12,10 +12,10 @@ from playwright._impl._errors import TimeoutError, Error, TargetClosedError
|
|
|
12
12
|
|
|
13
13
|
from mangotools.decorator import async_method_callback
|
|
14
14
|
from mangotools.models import MethodModel
|
|
15
|
+
from ..._base_data import BaseData
|
|
15
16
|
from ....exceptions import MangoAutomationError
|
|
16
17
|
from ....exceptions._error_msg import ERROR_MSG_0049, ERROR_MSG_0013, ERROR_MSG_0058, ERROR_MSG_0059, ERROR_MSG_0010
|
|
17
18
|
from ....tools import Meta
|
|
18
|
-
from ..._base_data import BaseData
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class AsyncWebBrowser(metaclass=Meta):
|
|
@@ -55,7 +55,18 @@ class AsyncWebBrowser(metaclass=Meta):
|
|
|
55
55
|
MethodModel(f='path', p='请输入截图保存路径', d=True)])
|
|
56
56
|
async def w_screenshot(self, path: str):
|
|
57
57
|
"""整个页面截图"""
|
|
58
|
-
|
|
58
|
+
try:
|
|
59
|
+
await self.base_data.page.screenshot(path=path, full_page=True)
|
|
60
|
+
except (TargetClosedError, TimeoutError) as error:
|
|
61
|
+
self.base_data.log.debug(
|
|
62
|
+
f'截图出现异常失败-1,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
63
|
+
self.base_data.setup()
|
|
64
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
65
|
+
except AttributeError as error:
|
|
66
|
+
self.base_data.log.debug(
|
|
67
|
+
f'截图出现异常失败-2,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
68
|
+
self.base_data.setup()
|
|
69
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
59
70
|
|
|
60
71
|
@async_method_callback('web', '浏览器操作', 3)
|
|
61
72
|
async def w_alert(self):
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_browser.py
RENAMED
|
@@ -54,7 +54,18 @@ class SyncWebBrowser(metaclass=Meta):
|
|
|
54
54
|
@sync_method_callback('web', '浏览器操作', 2, [MethodModel(f='path', p='请输入截图保存路径', d=True)])
|
|
55
55
|
def w_screenshot(self, path: str):
|
|
56
56
|
"""整个页面截图"""
|
|
57
|
-
|
|
57
|
+
try:
|
|
58
|
+
self.base_data.page.screenshot(path=path, full_page=True)
|
|
59
|
+
except (TargetClosedError, TimeoutError) as error:
|
|
60
|
+
self.base_data.log.debug(
|
|
61
|
+
f'截图出现异常失败-1,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
62
|
+
self.base_data.setup()
|
|
63
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
64
|
+
except AttributeError as error:
|
|
65
|
+
self.base_data.log.debug(
|
|
66
|
+
f'截图出现异常失败-2,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
|
|
67
|
+
self.base_data.setup()
|
|
68
|
+
raise MangoAutomationError(*ERROR_MSG_0010)
|
|
58
69
|
|
|
59
70
|
@sync_method_callback('web', '浏览器操作', 3)
|
|
60
71
|
def w_alert(self):
|
|
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.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/__init__.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_application.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_assertion.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_customization.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_element.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_equipment.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_new_android.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/customization.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/input_device.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_element.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_page.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/__init__.py
RENAMED
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_assertion.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_element.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_page.py
RENAMED
|
File without changes
|
|
File without changes
|
{mangoautomation-1.0.33 → mangoautomation-1.0.34}/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
|