uiautodev 0.3.5__tar.gz → 0.3.6__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.
Files changed (29) hide show
  1. {uiautodev-0.3.5 → uiautodev-0.3.6}/PKG-INFO +1 -1
  2. {uiautodev-0.3.5 → uiautodev-0.3.6}/pyproject.toml +1 -1
  3. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/app.py +1 -1
  4. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/android.py +15 -17
  5. {uiautodev-0.3.5 → uiautodev-0.3.6}/LICENSE +0 -0
  6. {uiautodev-0.3.5 → uiautodev-0.3.6}/README.md +0 -0
  7. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/__init__.py +0 -0
  8. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/__main__.py +0 -0
  9. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/appium_proxy.py +0 -0
  10. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/case.py +0 -0
  11. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/cli.py +0 -0
  12. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/command_proxy.py +0 -0
  13. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/command_types.py +0 -0
  14. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/common.py +0 -0
  15. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/appium.py +0 -0
  16. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/base_driver.py +0 -0
  17. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/ios.py +0 -0
  18. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/mock.py +0 -0
  19. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/udt/appium-uiautomator2-v5.12.4-light.apk +0 -0
  20. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/driver/udt/udt.py +0 -0
  21. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/exceptions.py +0 -0
  22. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/model.py +0 -0
  23. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/provider.py +0 -0
  24. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/router/device.py +0 -0
  25. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/router/xml.py +0 -0
  26. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/static/demo.html +0 -0
  27. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/utils/common.py +0 -0
  28. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/utils/exceptions.py +0 -0
  29. {uiautodev-0.3.5 → uiautodev-0.3.6}/uiautodev/utils/usbmux.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiautodev
3
- Version: 0.3.5
3
+ Version: 0.3.6
4
4
  Summary: Mobile UI Automation, include UI hierarchy inspector, script recorder
5
5
  Home-page: https://uiauto.dev
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uiautodev"
3
- version = "0.3.5"
3
+ version = "0.3.6"
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>"]
@@ -68,7 +68,7 @@ def info() -> InfoResponse:
68
68
  platform=platform.system(), # Linux | Darwin | Windows
69
69
  code_language="Python",
70
70
  cwd=os.getcwd(),
71
- drivers=["android"],
71
+ drivers=["android", "ios"],
72
72
  )
73
73
 
74
74
 
@@ -13,7 +13,6 @@ from typing import List, Tuple
13
13
  from xml.etree import ElementTree
14
14
 
15
15
  import adbutils
16
- import requests
17
16
  import uiautomator2 as u2
18
17
  from PIL import Image
19
18
 
@@ -29,7 +28,7 @@ logger = logging.getLogger(__name__)
29
28
  class AndroidDriver(BaseDriver):
30
29
  def __init__(self, serial: str):
31
30
  super().__init__(serial)
32
- self.device = adbutils.device(serial)
31
+ self.adb_device = adbutils.device(serial)
33
32
  self._try_dump_list = [
34
33
  self._get_u2_hierarchy,
35
34
  self._get_appium_hierarchy,
@@ -38,7 +37,7 @@ class AndroidDriver(BaseDriver):
38
37
 
39
38
  @cached_property
40
39
  def udt(self) -> UDT:
41
- return UDT(self.device)
40
+ return UDT(self.adb_device)
42
41
 
43
42
  @cached_property
44
43
  def ud(self) -> u2.Device:
@@ -46,8 +45,7 @@ class AndroidDriver(BaseDriver):
46
45
 
47
46
  def screenshot(self, id: int) -> Image.Image:
48
47
  try:
49
- img = self.device.screenshot(display_id=id)
50
- return img.convert("RGB")
48
+ return self.adb_device.screenshot() # display_id is not OK now
51
49
  except adbutils.AdbError as e:
52
50
  logger.warning("screenshot error: %s", str(e))
53
51
  if id > 0:
@@ -56,7 +54,7 @@ class AndroidDriver(BaseDriver):
56
54
 
57
55
  def shell(self, command: str) -> ShellResponse:
58
56
  try:
59
- ret = self.device.shell2(command, rstrip=True, timeout=20)
57
+ ret = self.adb_device.shell2(command, rstrip=True, timeout=20)
60
58
  if ret.returncode == 0:
61
59
  return ShellResponse(output=ret.output, error=None)
62
60
  else:
@@ -68,7 +66,7 @@ class AndroidDriver(BaseDriver):
68
66
 
69
67
  def dump_hierarchy(self) -> Tuple[str, Node]:
70
68
  """returns xml string and hierarchy object"""
71
- wsize = self.device.window_size()
69
+ wsize = self.adb_device.window_size()
72
70
  logger.debug("window size: %s", wsize)
73
71
  start = time.time()
74
72
  xml_data = self._dump_hierarchy_raw()
@@ -125,7 +123,7 @@ class AndroidDriver(BaseDriver):
125
123
  # c.close()
126
124
 
127
125
  def _get_appium_hierarchy(self) -> str:
128
- c = self.device.create_connection(adbutils.Network.TCP, 6790)
126
+ c = self.adb_device.create_connection(adbutils.Network.TCP, 6790)
129
127
  try:
130
128
  content = fetch_through_socket(c, "/wd/hub/session/0/source", timeout=10)
131
129
  return json.loads(content)["value"]
@@ -140,34 +138,34 @@ class AndroidDriver(BaseDriver):
140
138
  return self.udt.dump_hierarchy()
141
139
 
142
140
  def tap(self, x: int, y: int):
143
- self.device.click(x, y)
141
+ self.adb_device.click(x, y)
144
142
 
145
143
  def window_size(self) -> Tuple[int, int]:
146
- w, h = self.device.window_size()
144
+ w, h = self.adb_device.window_size()
147
145
  return (w, h)
148
146
 
149
147
  def app_install(self, app_path: str):
150
- self.device.install(app_path)
148
+ self.adb_device.install(app_path)
151
149
 
152
150
  def app_current(self) -> CurrentAppResponse:
153
- info = self.device.app_current()
151
+ info = self.adb_device.app_current()
154
152
  return CurrentAppResponse(
155
153
  package=info.package, activity=info.activity, pid=info.pid
156
154
  )
157
155
 
158
156
  def app_launch(self, package: str):
159
- if self.device.package_info(package) is None:
157
+ if self.adb_device.package_info(package) is None:
160
158
  raise AndroidDriverException(f"App not installed: {package}")
161
- self.device.app_start(package)
159
+ self.adb_device.app_start(package)
162
160
 
163
161
  def app_terminate(self, package: str):
164
- self.device.app_stop(package)
162
+ self.adb_device.app_stop(package)
165
163
 
166
164
  def home(self):
167
- self.device.keyevent("HOME")
165
+ self.adb_device.keyevent("HOME")
168
166
 
169
167
  def wake_up(self):
170
- self.device.keyevent("WAKEUP")
168
+ self.adb_device.keyevent("WAKEUP")
171
169
 
172
170
 
173
171
  def parse_xml(xml_data: str, wsize: WindowSize) -> Node:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes