def click_long_on_screen(self, x, y):
     """
     Long clicks the specified coordinates.
     :param x: the x coordinate
     :param y: the y coordinate
     """
     return call(self, "clickLongOnScreen", RemoteObject.from_float(x), RemoteObject.from_float(y))
Beispiel #2
0
 def click_long_on_screen(self, x, y):
     """
     Long clicks the specified coordinates.
     :param x: the x coordinate
     :param y: the y coordinate
     """
     return call(self, "clickLongOnScreen", RemoteObject.from_float(x), RemoteObject.from_float(y))
 def get_view(self, res_id=None, class_name=None, index=None):
     if res_id:
         if index:
             return call(self, "getView", res_id, index)
         return call(self, "getView", res_id)
     if class_name:
         if index:
             return call(self, "getView", RemoteObject.from_class_name(class_name), index)
         return call(self, "getView", RemoteObject.from_class_name(class_name))
Beispiel #4
0
 def get_view(self, res_id=None, class_name=None, index=None):
     if res_id:
         if index:
             return call(self, "getView", res_id, index)
         return call(self, "getView", res_id)
     if class_name:
         if index:
             return call(self, "getView", RemoteObject.from_class_name(class_name), index)
         return call(self, "getView", RemoteObject.from_class_name(class_name))
Beispiel #5
0
    def drag(self, from_x, to_x, from_y, to_y, step_count):
        """
        Simulate touching the specified location and dragging it to a new location.


        :param from_x : x coordinate of the initial touch, in screen coordinates
        :param to_x : x coordinate of the drag destination, in screen coordinates
        :param from_y : y coordinate of the initial touch, in screen coordinates
        :param to_y : y coordinate of the drag destination, in screen coordinates
        :param step_count : how many move steps to include in the drag. Less steps results in a faster drag
        """
        return call(self, "drag", RemoteObject.from_float(from_x), RemoteObject.from_float(to_x),
                    RemoteObject.from_float(from_y), RemoteObject.from_float(to_y), step_count)
    def drag(self, from_x, to_x, from_y, to_y, step_count):
        """
        Simulate touching the specified location and dragging it to a new location.


        :param from_x : x coordinate of the initial touch, in screen coordinates
        :param to_x : x coordinate of the drag destination, in screen coordinates
        :param from_y : y coordinate of the initial touch, in screen coordinates
        :param to_y : y coordinate of the drag destination, in screen coordinates
        :param step_count : how many move steps to include in the drag. Less steps results in a faster drag
        """
        return call(self, "drag", RemoteObject.from_float(from_x), RemoteObject.from_float(to_x),
                    RemoteObject.from_float(from_y), RemoteObject.from_float(to_y), step_count)
def set_proxy():
    """
    Set Ifeng video request host to local proxy server.
    """
    host = get_local_ip()
    data_interface = RemoteObject.from_class_name(data_interface_class_name)
    call_static(data_interface, "setHost", host+':8080/proxy')
Beispiel #8
0
def set_proxy():
    """
    Set Ifeng video request host to local proxy server.
    """
    host = get_local_ip()
    data_interface = RemoteObject.from_class_name(data_interface_class_name)
    call_static(data_interface, "setHost", host + ':8080/proxy')
Beispiel #9
0
    def wait_for_view(self, class_name):
        """
        Waits for a View matching the specified class. Default timeout is 20 seconds.
        :param class_name:viewClass the {@link View} class to wait for
        :return:{@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout
        """

        return call(self, "waitForView", RemoteObject.from_class_name(class_name))
    def wait_for_view(self, class_name):
        """
        Waits for a View matching the specified class. Default timeout is 20 seconds.
        :param class_name:viewClass the {@link View} class to wait for
        :return:{@code true} if the {@link View} is displayed and {@code false} if it is not displayed before the timeout
        """

        return call(self, "waitForView", RemoteObject.from_class_name(class_name))
 def __init__(self, instrumentation, activity=None):
     super().__init__()
     solo_class = RemoteObject.from_class_name(solo_class_name)
     instrumentation.class_name = instrumentation_class_name
     if activity:
         activity.class_name = activity_class_name
         remote_solo = new(solo_class, instrumentation, activity)
     else:
         remote_solo = new(solo_class, instrumentation)
     self.__dict__.update(remote_solo.__dict__)
Beispiel #12
0
 def __init__(self, instrumentation, activity=None):
     super().__init__()
     solo_class = RemoteObject.from_class_name(solo_class_name)
     instrumentation.class_name = instrumentation_class_name
     if activity:
         activity.class_name = activity_class_name
         remote_solo = new(solo_class, instrumentation, activity)
     else:
         remote_solo = new(solo_class, instrumentation)
     self.__dict__.update(remote_solo.__dict__)
 def get_instance(cls, instrumentation):
     instrumentation.class_name = instrumentation_class_name
     ui_device_class = RemoteObject.from_class_name(ui_device_class_name)
     return UIDevice.from_object(call_static(ui_device_class, "getInstance", instrumentation))
Beispiel #14
0
 def get_instrumentation():
     instrument_registry_class = RemoteObject.from_class_name(
         instrument_registry)
     remote_obj = call_static(instrument_registry_class,
                              "getInstrumentation")
     return Instrumentation.from_object(remote_obj)
 def get_instrumentation():
     instrument_registry_class = RemoteObject.from_class_name(instrument_registry)
     remote_obj = call_static(instrument_registry_class, "getInstrumentation")
     return Instrumentation.from_object(remote_obj)
Beispiel #16
0
def get_host():
    data_interface = RemoteObject.from_class_name(
        "com.ifeng.video.dao.db.constants.DataInterface")
    v = data_interface.get_field("LIVE_CHANNEL_INFO")
    print(v)
Beispiel #17
0
def set_proxy():
    host = get_local_ip()
    data_interface = RemoteObject.from_class_name(data_interface_class_name)
    call_static(data_interface, "setHost", host + ':8080/proxy')
Beispiel #18
0
 def get_instance(cls, instrumentation):
     instrumentation.class_name = instrumentation_class_name
     ui_device_class = RemoteObject.from_class_name(ui_device_class_name)
     return UIDevice.from_object(
         call_static(ui_device_class, "getInstance", instrumentation))
Beispiel #19
0
def get_host():
    data_interface = RemoteObject.from_class_name("com.ifeng.video.dao.db.constants.DataInterface")
    v = data_interface.get_field("LIVE_CHANNEL_INFO")
    print(v)