Пример #1
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))
Пример #2
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))
Пример #3
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')
Пример #4
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')
Пример #5
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))
Пример #6
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))
Пример #7
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__)
Пример #8
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__)
Пример #9
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))
Пример #10
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)
Пример #11
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)
Пример #12
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')
Пример #13
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)
Пример #14
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))
Пример #15
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)