mangoautomation 1.0.31__py3-none-any.whl → 1.0.33__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.

@@ -255,7 +255,13 @@ class AsyncElement(AsyncWebDevice, AndroidDriver):
255
255
  file_path = os.path.join(self.base_data.screenshot_path, file_name)
256
256
  self.element_result_model.picture_path = file_path
257
257
  self.element_result_model.picture_name = file_name
258
- await self.__error_screenshot(file_path)
258
+ try:
259
+ await self.__error_screenshot(file_path)
260
+ except MangoAutomationError as error:
261
+ self.element_result_model.error_message += f'执行过程中发生失败,准备截图时截图失败,失败原因:{error.msg}'
262
+ except Exception as error:
263
+ self.base_data.log.error(
264
+ f'截图失败未知异常-1,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
259
265
 
260
266
  async def __error_screenshot(self, file_path):
261
267
  if self.drive_type == DriveTypeEnum.WEB.value:
@@ -255,7 +255,13 @@ class SyncElement(SyncWebDevice, AndroidDriver):
255
255
  file_path = os.path.join(self.base_data.screenshot_path, file_name)
256
256
  self.element_result_model.picture_path = file_path
257
257
  self.element_result_model.picture_name = file_name
258
- self.__error_screenshot(file_path)
258
+ try:
259
+ self.__error_screenshot(file_path)
260
+ except MangoAutomationError as error:
261
+ self.element_result_model.error_message += f'执行过程中发生失败,准备截图时截图失败,失败原因:{error.msg}'
262
+ except Exception as error:
263
+ self.base_data.log.error(
264
+ f'截图失败未知异常-1,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
259
265
 
260
266
  def __error_screenshot(self, file_path):
261
267
  if self.drive_type == DriveTypeEnum.WEB.value:
@@ -8,12 +8,12 @@ import os.path
8
8
  import traceback
9
9
  from urllib.parse import urlparse
10
10
 
11
- from playwright._impl._errors import TimeoutError, Error
11
+ 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
15
  from ....exceptions import MangoAutomationError
16
- from ....exceptions._error_msg import ERROR_MSG_0049, ERROR_MSG_0013, ERROR_MSG_0058, ERROR_MSG_0059
16
+ from ....exceptions._error_msg import ERROR_MSG_0049, ERROR_MSG_0013, ERROR_MSG_0058, ERROR_MSG_0059, ERROR_MSG_0010
17
17
  from ....tools import Meta
18
18
  from ..._base_data import BaseData
19
19
 
@@ -41,11 +41,14 @@ class AsyncWebBrowser(metaclass=Meta):
41
41
  await self.base_data.page.goto(url, timeout=60000)
42
42
  await asyncio.sleep(2)
43
43
  except TimeoutError as error:
44
- self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
44
+ self.base_data.log.debug(f'打开URL失败-1,类型:{type(error)},失败详情:{error}')
45
45
  raise MangoAutomationError(*ERROR_MSG_0013, value=(url,))
46
+ except TargetClosedError as error:
47
+ self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
48
+ raise MangoAutomationError(*ERROR_MSG_0010, value=(url,))
46
49
  except Error as error:
47
50
  self.base_data.log.debug(
48
- f'打开URL失败-2,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
51
+ f'打开URL失败-3,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
49
52
  raise MangoAutomationError(*ERROR_MSG_0058, value=(url,))
50
53
 
51
54
  @async_method_callback('web', '浏览器操作', 2, [
@@ -8,12 +8,12 @@ import traceback
8
8
  from urllib.parse import urlparse
9
9
 
10
10
  import time
11
- from playwright._impl._errors import TimeoutError, Error
11
+ from playwright._impl._errors import TimeoutError, Error, TargetClosedError
12
12
 
13
13
  from mangotools.decorator import sync_method_callback
14
14
  from mangotools.models import MethodModel
15
15
  from ....exceptions import MangoAutomationError
16
- from ....exceptions._error_msg import ERROR_MSG_0049, ERROR_MSG_0013, ERROR_MSG_0058, ERROR_MSG_0059
16
+ from ....exceptions._error_msg import ERROR_MSG_0049, ERROR_MSG_0013, ERROR_MSG_0058, ERROR_MSG_0059, ERROR_MSG_0010
17
17
  from ....tools import Meta
18
18
  from ....uidrive._base_data import BaseData
19
19
 
@@ -43,9 +43,12 @@ class SyncWebBrowser(metaclass=Meta):
43
43
  except TimeoutError as error:
44
44
  self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
45
45
  raise MangoAutomationError(*ERROR_MSG_0013, value=(url,))
46
+ except TargetClosedError as error:
47
+ self.base_data.log.debug(f'打开URL失败-2,类型:{type(error)},失败详情:{error}')
48
+ raise MangoAutomationError(*ERROR_MSG_0010, value=(url,))
46
49
  except Error as error:
47
50
  self.base_data.log.debug(
48
- f'打开URL失败-2,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
51
+ f'打开URL失败-3,类型:{type(error)},失败详情:{error},失败明细:{traceback.format_exc()}')
49
52
  raise MangoAutomationError(*ERROR_MSG_0058, value=(url,))
50
53
 
51
54
  @sync_method_callback('web', '浏览器操作', 2, [MethodModel(f='path', p='请输入截图保存路径', d=True)])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mangoautomation
3
- Version: 1.0.31
3
+ Version: 1.0.33
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -10,10 +10,10 @@ mangoautomation/models/_ui_model.py,sha256=IGophozQMO-NQjM_DPdlwud484yfWQw1CRwbD
10
10
  mangoautomation/tools/__init__.py,sha256=i0rZF_gS0h1Rd0bMhgDSJp4JbEb3rm33zg-MDEX7KdE,342
11
11
  mangoautomation/tools/_mate.py,sha256=9lk_EJnAX_OyXbe5WacyHkkcEr2ScBgasl6eUnlklWA,405
12
12
  mangoautomation/uidrive/__init__.py,sha256=Tk_gh4Qg2qnewEGxa-7Id4fkQLY3fvQE4X7JB0BEscY,577
13
- mangoautomation/uidrive/_async_element.py,sha256=C3tjoN7PzChuINMa1XgR9G-rCxfn0OSbDG9F6v5IPmg,13567
13
+ mangoautomation/uidrive/_async_element.py,sha256=Va8uMzLPLk7eS4Gxa2qmMYmoIEx2HE4AURc23BYimZI,13993
14
14
  mangoautomation/uidrive/_base_data.py,sha256=OCg5HXk_2sMgf5A6JTJErKLC8nZfhbzwKBRJHCDMueA,3174
15
15
  mangoautomation/uidrive/_driver_object.py,sha256=Re8j6VLHKfwW2VFdi-1XFRuix8tRBLcHYRBLVF6CApE,1962
16
- mangoautomation/uidrive/_sync_element.py,sha256=FbP8bLYnlPMZtfJDdhHxavP9snYgP0vMBoRniFe41_s,13379
16
+ mangoautomation/uidrive/_sync_element.py,sha256=v6WI_5KVpvdG_3z5vt_gpmp3pFChAfL6c8WtUUmLzUY,13805
17
17
  mangoautomation/uidrive/android/__init__.py,sha256=FSIzfPane33QEj6bXslpd8bF1xGCDwMAHBOrpNzdyE4,5874
18
18
  mangoautomation/uidrive/android/_application.py,sha256=frvRyqUlx6__3j4xQdaJ4SOnEnipR3uPCOnWKDrkT7Y,2771
19
19
  mangoautomation/uidrive/android/_assertion.py,sha256=xkSBdjSfAbYtidHWWWY7Ko2OYaHi9OcZZOlnqIUT-FM,3611
@@ -31,7 +31,7 @@ mangoautomation/uidrive/pc/new_windows.py,sha256=lETHZa7cW8Z0iUShzgVTRxqivkYaOo8
31
31
  mangoautomation/uidrive/web/__init__.py,sha256=MgTklzty_SvX4UemCnqJuViq3cIjUgAjFoEtP-mcDWw,123
32
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
- mangoautomation/uidrive/web/async_web/_browser.py,sha256=s7piT1w8UHocwF9OnZkff8rFfuNHRMSjCxOSM4BC5DQ,4327
34
+ mangoautomation/uidrive/web/async_web/_browser.py,sha256=wrljG5G7CX_B8rtfH_QRuy8WRxphKFZIVvpfH-SEF8U,4587
35
35
  mangoautomation/uidrive/web/async_web/_customization.py,sha256=uw6p9uLHLXglgSkH4qjDl1v0iGlaNjvf8LljRH5cAHU,347
36
36
  mangoautomation/uidrive/web/async_web/_element.py,sha256=kIIc7DRlsMYj7oCfprf4EdP3Ez8FNN6mnfJ0RZdRXlo,9116
37
37
  mangoautomation/uidrive/web/async_web/_input_device.py,sha256=sMAMHb_8QyPx3pKci0gRDQc2O7h1OYMGyA7fCWl81iM,3288
@@ -39,7 +39,7 @@ mangoautomation/uidrive/web/async_web/_new_browser.py,sha256=bru_zVQ5Z_FEvuX1h8y
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
- mangoautomation/uidrive/web/sync_web/_browser.py,sha256=vQJq-TWEUq0rHWLWglE5wptqy8WQKWy4P3NUr2pzsSA,4187
42
+ mangoautomation/uidrive/web/sync_web/_browser.py,sha256=Fp5UeQix4Qizi2Rq1C6gyIJ4pDYB_BtS-Sh3UeIrxLE,4447
43
43
  mangoautomation/uidrive/web/sync_web/_customization.py,sha256=E_pfI8gKd0O6r4huJIvA6hoW-X9fSDVL4zEUqhHgxwE,355
44
44
  mangoautomation/uidrive/web/sync_web/_element.py,sha256=6qkn88PVl0XNtXF0jfbePXMqsRht4glidN-MuqghWZE,8716
45
45
  mangoautomation/uidrive/web/sync_web/_input_device.py,sha256=8t6tJgMb4zgb4Sv02XP3gUU0ZVbApCs3WaILv8Fe1iY,3169
@@ -48,8 +48,8 @@ mangoautomation/uidrive/web/sync_web/_page.py,sha256=MNekcL7o5YXEloeuvi3YrpOZxGh
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.31.dist-info/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
52
- mangoautomation-1.0.31.dist-info/METADATA,sha256=lkXHSS543EeOVw-z3_QFOTJpqV_F_YYirHxOblOlluc,625
53
- mangoautomation-1.0.31.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
54
- mangoautomation-1.0.31.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
55
- mangoautomation-1.0.31.dist-info/RECORD,,
51
+ mangoautomation-1.0.33.dist-info/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
52
+ mangoautomation-1.0.33.dist-info/METADATA,sha256=_kKhgFndcusEnJpa65YLXyA7APOn4NqNf7PXaoivSCU,625
53
+ mangoautomation-1.0.33.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
54
+ mangoautomation-1.0.33.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
55
+ mangoautomation-1.0.33.dist-info/RECORD,,