|
36 | 36 |
|
37 | 37 | import culebratester_client |
38 | 38 | from culebratester_client import Text, ObjectRef, DefaultApi, Point, PerformTwoPointerGestureBody, \ |
39 | | - BooleanResponse, NumberResponse, StatusResponse, StringResponse |
| 39 | + BooleanResponse, NumberResponse, StatusResponse, StringResponse, Rect |
40 | 40 |
|
41 | 41 | from com.dtmilano.android.adb.adbclient import AdbClient |
42 | 42 | from com.dtmilano.android.common import obtainAdbPath |
@@ -711,10 +711,23 @@ def get_content_description(self, oid: int) -> str: |
711 | 711 | :param oid: the oid |
712 | 712 | :return: the content description |
713 | 713 | """ |
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( |
715 | 715 | oid=oid) |
716 | 716 | return response.value |
717 | 717 |
|
| 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 | + |
718 | 731 | def perform_two_pointer_gesture(self, oid: int, startPoint1: Tuple[int, int], startPoint2: Tuple[int, int], |
719 | 732 | endPoint1: Tuple[int, int], endPoint2: Tuple[int, int], steps: int) -> None: |
720 | 733 | """ |
|
0 commit comments