def setUpClass(cls): TnsRunTest.setUpClass() # Download Preview and Playground packages Preview.get_app_packages() # Install Preview and Playground Preview.install_preview_app(cls.emu, Platform.ANDROID) if Settings.HOST_OS is OSType.OSX: Preview.install_preview_app(cls.sim, Platform.IOS) Preview.install_playground_app(cls.sim, Platform.IOS) # Create app Tns.create(app_name=cls.app_name, template=Template.HELLO_WORLD_NG.local_package, update=True) src = os.path.join(Settings.TEST_RUN_HOME, 'assets', 'logs', 'hello-world-ng', 'main.ts') target = os.path.join(Settings.TEST_RUN_HOME, cls.app_name, 'src') File.copy(source=src, target=target) src = os.path.join(Settings.TEST_RUN_HOME, 'assets', 'logs', 'hello-world-ng', 'items.component.ts') target = os.path.join(Settings.TEST_RUN_HOME, cls.app_name, 'src', 'app', 'item') File.copy(source=src, target=target) # Copy TestApp to data folder. Folder.copy(source=cls.source_project_dir, target=cls.target_project_dir)
def setUpClass(cls): TnsRunTest.setUpClass() # Start second emulator for tests cls.emu_API24 = DeviceManager.Emulator.ensure_available( Settings.Emulators.EMU_API_24) # Download Preview and Playground packages Preview.get_app_packages() # Install Preview and Playground Preview.install_preview_app(cls.emu, Platform.ANDROID) Preview.install_preview_app(cls.emu_API24, Platform.ANDROID) if Settings.HOST_OS is OSType.OSX: Preview.install_preview_app(cls.sim, Platform.IOS) Preview.install_playground_app(cls.sim, Platform.IOS) # Create app Tns.create(app_name=cls.app_name, template=Template.HELLO_WORLD_JS.local_package, update=True) src = os.path.join(Settings.TEST_RUN_HOME, 'assets', 'logs', 'hello-world-js', 'app.js') target = os.path.join(Settings.TEST_RUN_HOME, cls.app_name, 'app') File.copy(source=src, target=target) # Copy TestApp to data folder. Folder.copy(source=cls.source_project_dir, target=cls.target_project_dir)
def prepare(clone_templates=True, install_ng_cli=False, get_preivew_packages=False): Log.info('================== Prepare Test Run ==================') __cleanup() __install_ns_cli() __get_runtimes() if install_ng_cli: __install_ng_cli() __install_schematics() if clone_templates: __get_templates() if get_preivew_packages: Preview.get_app_packages() Log.settings()