def setUpClass(cls):
     TnsTest.setUpClass()
     Folder.clean(os.path.join(TEST_RUN_HOME, APP_NAME))
     Tns.create(app_name=APP_NAME, template=Template.HELLO_WORLD_NG.local_package)
     json = App.get_package_json(app_name=APP_NAME)
     cls.app_id = json['nativescript']['id']
     devices = Adb.get_ids(include_emulators=False)
     device_id = None
     for device in devices:
         device_id = device
     if device_id is not None:
         cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID,
                             version=Adb.get_version(device_id))
     Adb.uninstall(cls.app_id, device_id, assert_success=False)
 def setUpClass(cls):
     TnsTest.setUpClass()
     cls.emulator = DeviceManager.Emulator.ensure_available(Emulators.DEFAULT)
     Folder.clean(os.path.join(TEST_RUN_HOME, APP_NAME))
     Tns.create(app_name=APP_NAME, template=Template.HELLO_WORLD_NG.local_package, update=True)
     json = App.get_package_json(app_name=APP_NAME)
     cls.app_id = json['nativescript']['id']
     devices = Adb.get_ids(include_emulators=False)
     device_id = None
     for device in devices:
         device_id = device
     if device_id is not None:
         cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID,
                             version=Adb.get_version(device_id))
     Adb.uninstall(cls.app_id, device_id, assert_success=False)
     Tns.platform_add_android(APP_NAME, framework_path=Android.FRAMEWORK_PATH)
 def assert_apk(apk, device, app_id):
     Adb.install(apk, device.id)
     Adb.start_application(device.id, app_id)
     Device.wait_for_text(device, text='Ter Stegen', timeout=90)
     Adb.stop_application(device_id=device.id, app_id=app_id)
     Adb.uninstall(app_id, device.id)