uiautodev 0.3.7__tar.gz → 0.4.0__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 uiautodev might be problematic. Click here for more details.
- {uiautodev-0.3.7 → uiautodev-0.4.0}/PKG-INFO +3 -2
- {uiautodev-0.3.7 → uiautodev-0.4.0}/pyproject.toml +3 -2
- uiautodev-0.4.0/uiautodev/__init__.py +8 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/command_proxy.py +25 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/command_types.py +7 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/android.py +15 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/base_driver.py +20 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/ios.py +20 -11
- uiautodev-0.3.7/uiautodev/__init__.py +0 -12
- {uiautodev-0.3.7 → uiautodev-0.4.0}/LICENSE +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/README.md +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/__main__.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/app.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/appium_proxy.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/case.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/cli.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/common.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/appium.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/mock.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/udt/appium-uiautomator2-v5.12.4-light.apk +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/udt/udt.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/exceptions.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/model.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/provider.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/router/device.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/router/xml.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/static/demo.html +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/utils/common.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/utils/exceptions.py +0 -0
- {uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/utils/usbmux.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uiautodev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Mobile UI Automation, include UI hierarchy inspector, script recorder
|
|
5
5
|
Home-page: https://uiauto.dev
|
|
6
6
|
License: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Provides-Extra: appium
|
|
18
|
-
Requires-Dist: adbutils (>=2.
|
|
18
|
+
Requires-Dist: adbutils (>=2.7.0,<3.0.0)
|
|
19
19
|
Requires-Dist: appium-python-client (>=4.0.0,<5.0.0) ; extra == "appium"
|
|
20
20
|
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
21
21
|
Requires-Dist: construct
|
|
@@ -29,6 +29,7 @@ Requires-Dist: pydantic (>=2.6,<3.0)
|
|
|
29
29
|
Requires-Dist: pygments (>=2)
|
|
30
30
|
Requires-Dist: uiautomator2 (>=2)
|
|
31
31
|
Requires-Dist: uvicorn[standard]
|
|
32
|
+
Requires-Dist: wdapy (>=0.2.2,<0.3.0)
|
|
32
33
|
Description-Content-Type: text/markdown
|
|
33
34
|
|
|
34
35
|
# uiautodev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "uiautodev"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "Mobile UI Automation, include UI hierarchy inspector, script recorder"
|
|
5
5
|
homepage = "https://uiauto.dev"
|
|
6
6
|
authors = ["codeskyblue <codeskyblue@gmail.com>"]
|
|
@@ -10,7 +10,7 @@ readme = "README.md"
|
|
|
10
10
|
[tool.poetry.dependencies]
|
|
11
11
|
python = "^3.8"
|
|
12
12
|
pillow = "*"
|
|
13
|
-
adbutils = "^2.
|
|
13
|
+
adbutils = "^2.7.0"
|
|
14
14
|
construct = "*"
|
|
15
15
|
lxml = "*"
|
|
16
16
|
click = "^8.1.7"
|
|
@@ -23,6 +23,7 @@ fastapi = "^0.111.0"
|
|
|
23
23
|
uvicorn = {version = "*", extras = ["standard"]}
|
|
24
24
|
poetry = "^1.8.2"
|
|
25
25
|
pydantic = "^2.6"
|
|
26
|
+
wdapy = "^0.2.2"
|
|
26
27
|
|
|
27
28
|
[tool.poetry.extras]
|
|
28
29
|
appium = ["appium-python-client", "httppretty"]
|
|
@@ -105,6 +105,31 @@ def home(driver: BaseDriver):
|
|
|
105
105
|
driver.home()
|
|
106
106
|
|
|
107
107
|
|
|
108
|
+
@register(Command.BACK)
|
|
109
|
+
def back(driver: BaseDriver):
|
|
110
|
+
driver.back()
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@register(Command.APP_SWITCH)
|
|
114
|
+
def app_switch(driver: BaseDriver):
|
|
115
|
+
driver.app_switch()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
@register(Command.VOLUME_UP)
|
|
119
|
+
def volume_up(driver: BaseDriver):
|
|
120
|
+
driver.volume_up()
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@register(Command.VOLUME_DOWN)
|
|
124
|
+
def volume_down(driver: BaseDriver):
|
|
125
|
+
driver.volume_down()
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@register(Command.VOLUME_MUTE)
|
|
129
|
+
def volume_mute(driver: BaseDriver):
|
|
130
|
+
driver.volume_mute()
|
|
131
|
+
|
|
132
|
+
|
|
108
133
|
@register(Command.DUMP)
|
|
109
134
|
def dump(driver: BaseDriver) -> DumpResponse:
|
|
110
135
|
source, _ = driver.dump_hierarchy()
|
|
@@ -32,6 +32,13 @@ class Command(str, enum.Enum):
|
|
|
32
32
|
|
|
33
33
|
LIST = "list"
|
|
34
34
|
|
|
35
|
+
# 0.4.0
|
|
36
|
+
BACK = "back"
|
|
37
|
+
APP_SWITCH = "appSwitch"
|
|
38
|
+
VOLUME_UP = "volumeUp"
|
|
39
|
+
VOLUME_DOWN = "volumeDown"
|
|
40
|
+
VOLUME_MUTE = "volumeMute"
|
|
41
|
+
|
|
35
42
|
|
|
36
43
|
class TapRequest(BaseModel):
|
|
37
44
|
x: Union[int, float]
|
|
@@ -144,6 +144,21 @@ class AndroidDriver(BaseDriver):
|
|
|
144
144
|
|
|
145
145
|
def wake_up(self):
|
|
146
146
|
self.adb_device.keyevent("WAKEUP")
|
|
147
|
+
|
|
148
|
+
def back(self):
|
|
149
|
+
self.adb_device.keyevent("BACK")
|
|
150
|
+
|
|
151
|
+
def app_switch(self):
|
|
152
|
+
self.adb_device.keyevent("APP_SWITCH")
|
|
153
|
+
|
|
154
|
+
def volume_up(self):
|
|
155
|
+
self.adb_device.keyevent("VOLUME_UP")
|
|
156
|
+
|
|
157
|
+
def volume_down(self):
|
|
158
|
+
self.adb_device.keyevent("VOLUME_DOWN")
|
|
159
|
+
|
|
160
|
+
def volume_mute(self):
|
|
161
|
+
self.adb_device.keyevent("VOLUME_MUTE")
|
|
147
162
|
|
|
148
163
|
|
|
149
164
|
def parse_xml(xml_data: str, wsize: WindowSize, display_id: Optional[int] = None) -> Node:
|
|
@@ -70,6 +70,26 @@ class BaseDriver(abc.ABC):
|
|
|
70
70
|
def home(self):
|
|
71
71
|
""" press home button """
|
|
72
72
|
raise NotImplementedError()
|
|
73
|
+
|
|
74
|
+
def back(self):
|
|
75
|
+
""" press back button """
|
|
76
|
+
raise NotImplementedError()
|
|
77
|
+
|
|
78
|
+
def app_switch(self):
|
|
79
|
+
""" switch app """
|
|
80
|
+
raise NotImplementedError()
|
|
81
|
+
|
|
82
|
+
def volume_up(self):
|
|
83
|
+
""" volume up """
|
|
84
|
+
raise NotImplementedError()
|
|
85
|
+
|
|
86
|
+
def volume_down(self):
|
|
87
|
+
""" volume down """
|
|
88
|
+
raise NotImplementedError()
|
|
89
|
+
|
|
90
|
+
def volume_mute(self):
|
|
91
|
+
""" volume mute """
|
|
92
|
+
raise NotImplementedError()
|
|
73
93
|
|
|
74
94
|
def wake_up(self):
|
|
75
95
|
""" wake up the device """
|
|
@@ -13,13 +13,14 @@ from functools import partial
|
|
|
13
13
|
from typing import List, Optional, Tuple
|
|
14
14
|
from xml.etree import ElementTree
|
|
15
15
|
|
|
16
|
+
import wdapy
|
|
16
17
|
from PIL import Image
|
|
17
18
|
|
|
18
19
|
from uiautodev.command_types import CurrentAppResponse
|
|
19
20
|
from uiautodev.driver.base_driver import BaseDriver
|
|
20
21
|
from uiautodev.exceptions import IOSDriverException
|
|
21
22
|
from uiautodev.model import Node, WindowSize
|
|
22
|
-
from uiautodev.utils.usbmux import
|
|
23
|
+
from uiautodev.utils.usbmux import select_device
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
class IOSDriver(BaseDriver):
|
|
@@ -27,6 +28,7 @@ class IOSDriver(BaseDriver):
|
|
|
27
28
|
""" serial is the udid of the ios device """
|
|
28
29
|
super().__init__(serial)
|
|
29
30
|
self.device = select_device(serial)
|
|
31
|
+
self.wda = wdapy.AppiumUSBClient(self.device.serial)
|
|
30
32
|
|
|
31
33
|
def _request(self, method: str, path: str, payload: Optional[dict] = None) -> bytes:
|
|
32
34
|
conn = self.device.make_http_connection(port=8100)
|
|
@@ -56,29 +58,36 @@ class IOSDriver(BaseDriver):
|
|
|
56
58
|
return self._request_json("GET", "/status")
|
|
57
59
|
|
|
58
60
|
def screenshot(self, id: int = 0) -> Image.Image:
|
|
59
|
-
|
|
60
|
-
png_data = base64.b64decode(png_base64)
|
|
61
|
-
return Image.open(io.BytesIO(png_data))
|
|
61
|
+
return self.wda.screenshot()
|
|
62
62
|
|
|
63
63
|
def window_size(self):
|
|
64
|
-
return self.
|
|
64
|
+
return self.wda.window_size()
|
|
65
65
|
|
|
66
66
|
def dump_hierarchy(self) -> Tuple[str, Node]:
|
|
67
67
|
"""returns xml string and hierarchy object"""
|
|
68
|
-
|
|
68
|
+
t = self.wda.sourcetree()
|
|
69
|
+
xml_data = t.value
|
|
69
70
|
root = ElementTree.fromstring(xml_data)
|
|
70
71
|
return xml_data, parse_xml_element(root, WindowSize(width=1, height=1))
|
|
71
72
|
|
|
72
73
|
def tap(self, x: int, y: int):
|
|
73
|
-
self.
|
|
74
|
+
self.wda.tap(x, y)
|
|
74
75
|
|
|
75
76
|
def app_current(self) -> CurrentAppResponse:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return CurrentAppResponse(package=value["bundleId"], pid=value["pid"])
|
|
77
|
+
info = self.wda.app_current()
|
|
78
|
+
return CurrentAppResponse(package=info.bundle_id, pid=info.pid)
|
|
79
79
|
|
|
80
80
|
def home(self):
|
|
81
|
-
self.
|
|
81
|
+
self.wda.homescreen()
|
|
82
|
+
|
|
83
|
+
def app_switch(self):
|
|
84
|
+
raise NotImplementedError()
|
|
85
|
+
|
|
86
|
+
def volume_up(self):
|
|
87
|
+
self.wda.volume_up()
|
|
88
|
+
|
|
89
|
+
def volume_down(self):
|
|
90
|
+
self.wda.volume_down()
|
|
82
91
|
|
|
83
92
|
|
|
84
93
|
def parse_xml_element(element, wsize: WindowSize, indexes: List[int]=[0]) -> Node:
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
|
|
4
|
-
"""Created on Mon Mar 04 2024 14:28:53 by codeskyblue
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from importlib.metadata import PackageNotFoundError, version
|
|
8
|
-
|
|
9
|
-
try:
|
|
10
|
-
__version__ = version("uiautodev")
|
|
11
|
-
except PackageNotFoundError:
|
|
12
|
-
__version__ = "0.0.0"
|
|
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
|
{uiautodev-0.3.7 → uiautodev-0.4.0}/uiautodev/driver/udt/appium-uiautomator2-v5.12.4-light.apk
RENAMED
|
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
|