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.

Files changed (61) hide show
  1. {mangoautomation-1.0.33/mangoautomation.egg-info → mangoautomation-1.0.34}/PKG-INFO +1 -1
  2. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_async_element.py +16 -27
  3. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_sync_element.py +16 -27
  4. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_browser.py +13 -2
  5. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_browser.py +12 -1
  6. {mangoautomation-1.0.33 → mangoautomation-1.0.34/mangoautomation.egg-info}/PKG-INFO +1 -1
  7. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/setup.py +1 -1
  8. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/LICENSE +0 -0
  9. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/MANIFEST.in +0 -0
  10. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/README.md +0 -0
  11. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/__init__.py +0 -0
  12. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/enums/__init__.py +0 -0
  13. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/enums/_base_enum.py +0 -0
  14. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/enums/_ui_enum.py +0 -0
  15. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/exceptions/__init__.py +0 -0
  16. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/exceptions/_error_msg.py +0 -0
  17. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/exceptions/_exceptions.py +0 -0
  18. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/models/__init__.py +0 -0
  19. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/models/_ui_model.py +0 -0
  20. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/tools/__init__.py +0 -0
  21. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/tools/_mate.py +0 -0
  22. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/__init__.py +0 -0
  23. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_base_data.py +0 -0
  24. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/_driver_object.py +0 -0
  25. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/__init__.py +0 -0
  26. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_application.py +0 -0
  27. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_assertion.py +0 -0
  28. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_customization.py +0 -0
  29. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_element.py +0 -0
  30. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_equipment.py +0 -0
  31. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_new_android.py +0 -0
  32. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/android/_page.py +0 -0
  33. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/__init__.py +0 -0
  34. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/assertion.py +0 -0
  35. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/customization.py +0 -0
  36. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/element.py +0 -0
  37. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/input_device.py +0 -0
  38. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/pc/new_windows.py +0 -0
  39. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/__init__.py +0 -0
  40. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/__init__.py +0 -0
  41. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_assertion.py +0 -0
  42. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_customization.py +0 -0
  43. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_element.py +0 -0
  44. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_input_device.py +0 -0
  45. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_new_browser.py +0 -0
  46. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/async_web/_page.py +0 -0
  47. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/__init__.py +0 -0
  48. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_assertion.py +0 -0
  49. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_customization.py +0 -0
  50. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_element.py +0 -0
  51. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_input_device.py +0 -0
  52. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_new_browser.py +0 -0
  53. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation/uidrive/web/sync_web/_page.py +0 -0
  54. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/SOURCES.txt +0 -0
  55. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/dependency_links.txt +0 -0
  56. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/requires.txt +0 -0
  57. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/mangoautomation.egg-info/top_level.txt +0 -0
  58. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/setup.cfg +0 -0
  59. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/tests/__init__.py +0 -0
  60. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/tests/test_ui_and.py +0 -0
  61. {mangoautomation-1.0.33 → mangoautomation-1.0.34}/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.33
3
+ Version: 1.0.34
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -7,7 +7,7 @@ import asyncio
7
7
  import os
8
8
  import traceback
9
9
 
10
- from playwright._impl._errors import TargetClosedError, Error, TimeoutError
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
- try:
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, TimeoutError
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
- try:
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:
@@ -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
- await self.base_data.page.screenshot(path=path, full_page=True)
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):
@@ -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
- self.base_data.page.screenshot(path=path, full_page=True)
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mangoautomation
3
- Version: 1.0.33
3
+ Version: 1.0.34
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- __version__ = '1.0.33'
3
+ __version__ = '1.0.34'
4
4
 
5
5
  with open("README.md", "r", encoding='utf-8') as fh:
6
6
  long_description = fh.read()