Пример #1
0
 def test_deploy(self):
     device = Device("emulator-5554")
     self.assertTrue(self.call_log_env.deploy(device))
     self.assertTrue(self.contact_env.deploy(device))
     self.assertTrue(self.gps_env.deploy(device))
     self.assertTrue(self.settings_env.deploy(device))
     self.assertTrue(self.sms_log_env.deploy(device))
     device.disconnect()
Пример #2
0
 def test_send(self):
     device = Device("emulator-5554")
     self.assertTrue(self.touch_event.send(device))
     self.assertTrue(self.intent_event.send(device))
     self.assertTrue(self.long_touch_event.send(device))
     self.assertTrue(self.key_event.send(device))
     self.assertTrue(self.emulator_event.send(device))
     self.assertTrue(self.drag_event.send(device))
     self.assertTrue(self.context_event1.send(device))
     device.disconnect()
Пример #3
0
    def test_context(self):
        device = Device("emulator-5554")
        self.assertFalse(self.activity_context.assert_in_device(device))
        self.assertFalse(self.window_context.assert_in_device(device))

        settings_activity_context = ActivityNameContext(
            "com.android.settings/.Settings")
        settings_window_context = WindowNameContext(
            "com.android.settings/com.android.settings.Settings")
        device.start_app("com.android.settings")
        time.sleep(2)
        self.assertTrue(settings_activity_context.assert_in_device(device))
        self.assertTrue(settings_window_context.assert_in_device(device))

        device.disconnect()
Пример #4
0
    def test_init(self):
        self.assertTrue(self.device.is_connected)
        self.assertIsNotNone(self.device.get_display_info())

        device_real = Device("emulator-5554", is_emulator=False)
        self.assertTrue(device_real.is_connected)
Пример #5
0
 def setUp(self):
     self.device = Device("emulator-5554")
Пример #6
0
__author__ = 'yuanchun'

from droidbot.droidbot_types import Device, App
from droidbot.app_event import CustomizedEventFactory, AppEventManager, AppEvent


class MyEventFactory(CustomizedEventFactory):
    def gen_event_based_on_state(self, state):
        print state
        return AppEvent.get_random_instance(self.device, self.app)


if __name__ == "__main__":
    d = Device()
    a = App(app_path="/home/liyc/experiments/apks/hot_apks_types/Personalization/net.zedge.android.apk")
    event_manager = AppEventManager(device=d, app=a, event_policy="none", event_count=100, event_interval=3,
                                    event_duration=100)
    event_manager.set_event_factory(MyEventFactory(d, a))
    d.install_app(a)
    event_manager.start()
    d.uninstall_app(a)
Пример #7
0
 def setUp(self):
     self.device=Device("emulator-5554")
     self.adb = ADB(self.device)
Пример #8
0
 def setUp(self):
     self.device=Device("emulator-5554")
     self.telnet = TelnetConsole(self.device)