Skip to content

Commit 83c36d9

Browse files
committed
Update culebratester client dependency
- Update culebratester client to 2.0.70 - Add ui_object get bounds - Fix ui_object get content description
1 parent 7beb29f commit 83c36d9

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
classifiers=['Development Status :: 5 - Production/Stable',
2323
'Intended Audience :: Developers',
2424
'License :: OSI Approved :: Apache Software License'],
25-
install_requires=['setuptools', 'requests', 'numpy', 'matplotlib', 'culebratester-client >= 2.0.64'],
25+
install_requires=['setuptools', 'requests', 'numpy', 'matplotlib', 'culebratester-client >= 2.0.70'],
2626
)

src/com/dtmilano/android/uiautomator/uiautomatorhelper.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
import culebratester_client
3838
from culebratester_client import Text, ObjectRef, DefaultApi, Point, PerformTwoPointerGestureBody, \
39-
BooleanResponse, NumberResponse, StatusResponse, StringResponse
39+
BooleanResponse, NumberResponse, StatusResponse, StringResponse, Rect
4040

4141
from com.dtmilano.android.adb.adbclient import AdbClient
4242
from com.dtmilano.android.common import obtainAdbPath
@@ -711,10 +711,23 @@ def get_content_description(self, oid: int) -> str:
711711
:param oid: the oid
712712
:return: the content description
713713
"""
714-
response: StringResponse = self.uiAutomatorHelper.api_instance.ui_object2_oid_get_content_description_get(
714+
response: StringResponse = self.uiAutomatorHelper.api_instance.ui_object_oid_get_content_description_get(
715715
oid=oid)
716716
return response.value
717717

718+
def get_bounds(self, oid: int) -> Tuple[int, int, int, int]:
719+
"""
720+
Gets the view's bounds property. # noqa: E501
721+
:see https://github.com/dtmilano/CulebraTester2-public/blob/master/openapi.yaml
722+
723+
:param oid:
724+
:type oid:
725+
:return:
726+
:rtype:
727+
"""
728+
rect: Rect = self.uiAutomatorHelper.api_instance.ui_object_oid_get_bounds_get(oid=oid)
729+
return rect.left, rect.top, rect.right, rect.bottom
730+
718731
def perform_two_pointer_gesture(self, oid: int, startPoint1: Tuple[int, int], startPoint2: Tuple[int, int],
719732
endPoint1: Tuple[int, int], endPoint2: Tuple[int, int], steps: int) -> None:
720733
"""

0 commit comments

Comments
 (0)