Skip to content

Commit

Permalink
Update culebratester client dependency
Browse files Browse the repository at this point in the history
- Update culebratester client to 2.0.70
- Add ui_object get bounds
- Fix ui_object get content description
  • Loading branch information
dtmilano committed Feb 24, 2024
1 parent 7beb29f commit 83c36d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
classifiers=['Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License'],
install_requires=['setuptools', 'requests', 'numpy', 'matplotlib', 'culebratester-client >= 2.0.64'],
install_requires=['setuptools', 'requests', 'numpy', 'matplotlib', 'culebratester-client >= 2.0.70'],
)
17 changes: 15 additions & 2 deletions src/com/dtmilano/android/uiautomator/uiautomatorhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

import culebratester_client
from culebratester_client import Text, ObjectRef, DefaultApi, Point, PerformTwoPointerGestureBody, \
BooleanResponse, NumberResponse, StatusResponse, StringResponse
BooleanResponse, NumberResponse, StatusResponse, StringResponse, Rect

from com.dtmilano.android.adb.adbclient import AdbClient
from com.dtmilano.android.common import obtainAdbPath
Expand Down Expand Up @@ -711,10 +711,23 @@ def get_content_description(self, oid: int) -> str:
:param oid: the oid
:return: the content description
"""
response: StringResponse = self.uiAutomatorHelper.api_instance.ui_object2_oid_get_content_description_get(
response: StringResponse = self.uiAutomatorHelper.api_instance.ui_object_oid_get_content_description_get(
oid=oid)
return response.value

def get_bounds(self, oid: int) -> Tuple[int, int, int, int]:
"""
Gets the view's bounds property. # noqa: E501
:see https://github.com/dtmilano/CulebraTester2-public/blob/master/openapi.yaml
:param oid:
:type oid:
:return:
:rtype:
"""
rect: Rect = self.uiAutomatorHelper.api_instance.ui_object_oid_get_bounds_get(oid=oid)
return rect.left, rect.top, rect.right, rect.bottom

def perform_two_pointer_gesture(self, oid: int, startPoint1: Tuple[int, int], startPoint2: Tuple[int, int],
endPoint1: Tuple[int, int], endPoint2: Tuple[int, int], steps: int) -> None:
"""
Expand Down

0 comments on commit 83c36d9

Please sign in to comment.