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

@@ -6,8 +6,9 @@
6
6
  import sys
7
7
 
8
8
  from ..tools._mate import Meta
9
+ from ..tools._uiautodev import start_uiautodev, stop_uiautodev
9
10
 
10
11
  python_version = sys.version_info
11
12
  if f"{python_version.major}.{python_version.minor}" != "3.10":
12
13
  raise Exception("必须使用>Python3.10.4")
13
- __all__ = ['Meta']
14
+ __all__ = ['Meta', 'start_uiautodev', 'stop_uiautodev']
@@ -0,0 +1,49 @@
1
+ # -*- coding: utf-8 -*-
2
+ # @Project: 芒果测试平台
3
+ # @Description:
4
+ # @Time : 2025-07-01 10:43
5
+ # @Author : 毛鹏
6
+
7
+ import subprocess
8
+
9
+ import time
10
+
11
+ uiautodev_process = None
12
+
13
+
14
+ def start_uiautodev():
15
+ """启动 uiautodev 服务"""
16
+ global uiautodev_process
17
+ if uiautodev_process is not None:
18
+ return "uiautodev 服务已在运行!"
19
+ try:
20
+ # 启动 uiautodev 服务(后台运行)
21
+ uiautodev_process = subprocess.Popen(
22
+ ['uiauto.dev'],
23
+ stdout=subprocess.PIPE,
24
+ stderr=subprocess.PIPE,
25
+ text=True
26
+ )
27
+ print("uiautodev 服务启动成功!PID:", uiautodev_process.pid)
28
+ return 'https://uiauto.devsleep.com/'
29
+ except Exception as e:
30
+ return f"启动 uiautodev 服务失败:{e}"
31
+
32
+
33
+ def stop_uiautodev():
34
+ """关闭 uiautodev 服务"""
35
+ global uiautodev_process
36
+
37
+ if uiautodev_process is None:
38
+ return "uiautodev 服务未运行!"
39
+ try:
40
+ uiautodev_process.terminate()
41
+ uiautodev_process.wait(timeout=5)
42
+ return "uiautodev 服务已关闭"
43
+ except subprocess.TimeoutExpired:
44
+ uiautodev_process.kill()
45
+ return "uiautodev 服务被强制终止"
46
+ except Exception as e:
47
+ return f"关闭 uiautodev 服务失败:{e}"
48
+ finally:
49
+ uiautodev_process = None
@@ -124,4 +124,8 @@ class AndroidDriver(AndroidPage,
124
124
  text = self.a_get_text(loc)
125
125
  except Exception:
126
126
  pass
127
- return loc, loc.count, text
127
+ if exp == ElementExpEnum.XPATH.value:
128
+ count = len(loc.all())
129
+ else:
130
+ count = loc.count
131
+ return loc, count, text
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mangoautomation
3
- Version: 1.0.42
3
+ Version: 1.0.44
4
4
  Summary: 测试工具
5
5
  Home-page: https://gitee.com/mao-peng/testkit
6
6
  Author: 毛鹏
@@ -12,8 +12,9 @@ Requires-Dist: pydantic ==2.9.2
12
12
  Requires-Dist: playwright ==1.43.0
13
13
  Requires-Dist: uiautomation ==2.0.20
14
14
  Requires-Dist: uiautomator2 ==3.2.5
15
- Requires-Dist: mangotools >=1.0.23
15
+ Requires-Dist: mangotools >=1.0.28
16
16
  Requires-Dist: adbutils ~=2.8.9
17
+ Requires-Dist: uiautodev ==0.9.0
17
18
 
18
19
  # testkit
19
20
 
@@ -7,14 +7,15 @@ mangoautomation/exceptions/_error_msg.py,sha256=GrB9crXQMNlq1Ng8a7RsuKfDHDhXglu_
7
7
  mangoautomation/exceptions/_exceptions.py,sha256=BiyST1QPivpfIOuKn1gKhpXOyBv6gfip_KvlQuu8ctw,385
8
8
  mangoautomation/models/__init__.py,sha256=XdqEQNfIw7mcnmv3ZgWPJyFwQvap5Cu2ZMKcIK4wn9M,416
9
9
  mangoautomation/models/_ui_model.py,sha256=IGophozQMO-NQjM_DPdlwud484yfWQw1CRwbDWjI3Vs,1446
10
- mangoautomation/tools/__init__.py,sha256=i0rZF_gS0h1Rd0bMhgDSJp4JbEb3rm33zg-MDEX7KdE,342
10
+ mangoautomation/tools/__init__.py,sha256=cc6zpsEdp3JiIx7HfOz-Vob7oTIIFzsuxDLgl20har4,443
11
11
  mangoautomation/tools/_mate.py,sha256=9lk_EJnAX_OyXbe5WacyHkkcEr2ScBgasl6eUnlklWA,405
12
+ mangoautomation/tools/_uiautodev.py,sha256=RMOQMXse744xwUDb1_l7qDv9mUiqZt1Gm5sbB-nlgDk,1388
12
13
  mangoautomation/uidrive/__init__.py,sha256=Tk_gh4Qg2qnewEGxa-7Id4fkQLY3fvQE4X7JB0BEscY,577
13
14
  mangoautomation/uidrive/_async_element.py,sha256=gXHsUxZxmiYvUNq8RqPP3UGupOscTvz_mD7xI2qapRA,13424
14
15
  mangoautomation/uidrive/_base_data.py,sha256=ur2Ts40MAhOYXb0vGVXZdSwEVCI3Csri9I9f1pw1r4Y,3766
15
16
  mangoautomation/uidrive/_driver_object.py,sha256=Re8j6VLHKfwW2VFdi-1XFRuix8tRBLcHYRBLVF6CApE,1962
16
17
  mangoautomation/uidrive/_sync_element.py,sha256=s9wb_RUCDcyONhRghe5T0I7zpTfvzRK3DhlxmT_DyVk,13242
17
- mangoautomation/uidrive/android/__init__.py,sha256=FSIzfPane33QEj6bXslpd8bF1xGCDwMAHBOrpNzdyE4,5874
18
+ mangoautomation/uidrive/android/__init__.py,sha256=P8Qa1tuTLBlRhRrTmH7fGwTIo8TDgorRHSfZC2EQA4w,5999
18
19
  mangoautomation/uidrive/android/_application.py,sha256=Cj7-oDPmqF-PMirRZgjt5xy_nqmUmRIZWt_VJ8EoKTE,2798
19
20
  mangoautomation/uidrive/android/_assertion.py,sha256=Rnf0ZSbegczxj1oKoCKe-__oLs9ugzIG_KlJbO_w0vI,3629
20
21
  mangoautomation/uidrive/android/_customization.py,sha256=pCLMmruozOyCJQZWAYupxxKqpWmZyCYsfSBw3XW7vf0,381
@@ -48,8 +49,8 @@ mangoautomation/uidrive/web/sync_web/_page.py,sha256=MNekcL7o5YXEloeuvi3YrpOZxGh
48
49
  tests/__init__.py,sha256=UhCNFqiVjxdh4CXESNo4oE7qfjpYYVkeHbSE5-7LGDY,125
49
50
  tests/test_ui_and.py,sha256=4k0_3bx_k2KbZifeRWGK65sxtdiPUOjkNzZ5oxjrc18,672
50
51
  tests/test_ui_web.py,sha256=MFaUN8O5qKOMMgyk2eelhKZsYcSJm0Do6pCgsdBZEH4,2765
51
- mangoautomation-1.0.42.dist-info/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
52
- mangoautomation-1.0.42.dist-info/METADATA,sha256=ulqvhUKHMFFANmHKUnzz_VfWE8WcXbVEzu43Q5-dnr0,626
53
- mangoautomation-1.0.42.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
54
- mangoautomation-1.0.42.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
55
- mangoautomation-1.0.42.dist-info/RECORD,,
52
+ mangoautomation-1.0.44.dist-info/LICENSE,sha256=03WP-mgFmo8ofRYDe1HVDQUEUKQZ2q6P6Q-2A4c-46A,1085
53
+ mangoautomation-1.0.44.dist-info/METADATA,sha256=yQzTLzpQM2qvT1WXJFH3sI-fdcMBPzyFcKj1E9shD7Y,660
54
+ mangoautomation-1.0.44.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
55
+ mangoautomation-1.0.44.dist-info/top_level.txt,sha256=g-uCmjvEODG8WFbmwbGM0-G0zHntHv8ZsS0PQRaMGtE,22
56
+ mangoautomation-1.0.44.dist-info/RECORD,,