Ejemplo n.º 1
0
 def install_preview_app_no_unpack(device_info, platform, uninstall=True):
     """Installs Preview App on emulator and simulator"""
     package_android = os.path.join(TEST_SUT_HOME, 'app-universal-release.apk')
     package_ios = os.path.join(TEST_SUT_HOME, 'nsplaydev.app')
     if platform is Platform.IOS:
         if uninstall:
             Simctl.uninstall(device_info, Settings.Packages.PREVIEW_APP_ID)
         Simctl.install(device_info, package_ios)
     elif platform is Platform.ANDROID:
         if uninstall:
             Adb.uninstall(Settings.Packages.PREVIEW_APP_ID, device_info.id, False)
         Adb.install(package_android, device_info.id)
Ejemplo n.º 2
0
 def test_201_error_is_shown_when_metadata_folder_in_apk_is_missing(self):
     """
        https://github.com/NativeScript/android-runtime/issues/1471
        https://github.com/NativeScript/android-runtime/issues/1382
     """
     Adb.uninstall("org.nativescript.TestApp", self.emulator.id, True)
     Tns.build_android(os.path.join(TEST_RUN_HOME, APP_NAME), verify=True)
     apk_folder_path = os.path.join(TEST_RUN_HOME, APP_NAME, PLATFORM_ANDROID_APK_DEBUG_PATH)
     apk_path = os.path.join(apk_folder_path, "app-debug.apk")
     unzip_folder = os.path.join(apk_folder_path, "app-debug")
     File.unzip(apk_path, unzip_folder)
     Folder.clean(os.path.join(unzip_folder, "assets", "metadata"))
     File.delete(apk_path)
     File.zip(unzip_folder, apk_path)
     self.sign_apk(apk_path)
     Adb.install(apk_path, self.emulator.id, 60)
     Adb.start_application(self.emulator.id, "org.nativescript.TestApp")
     text_on_screen = "com.tns.NativescriptException: metadata folder couldn\'t be opened!"
     self.emulator.wait_for_text(text_on_screen)
     error_message = "Missing metadata in apk is not causing the correct error! Logs: "
     assert self.emulator.is_text_visible(text_on_screen), error_message + self.emulator.get_text()
Ejemplo n.º 3
0
 def test_04_install(self):
     Adb.install(self.apk_path, self.emu.id)
     Adb.uninstall("com.wdiodemoapp", self.emu.id)