def setUp(self): TnsRunTest.setUp(self) # Clean the demo folder and src folder with `git clean -fdx` and `git reset` command to ensure # every test starts with initial app setup Git.clean_repo_changes(self.plugin_folder) # Build the plugin cmd = 'run build' Npm.run_npm_command(cmd, os.path.join(DateTimePickerHmrTests.plugin_folder, 'src'))
def setUpClass(cls): TnsTest.setUpClass() cls.emu = DeviceManager.Emulator.ensure_available( Settings.Emulators.DEFAULT) if Settings.HOST_OS is OSType.OSX: cls.sim = DeviceManager.Simulator.ensure_available( Settings.Simulators.DEFAULT) for app in cls.test_data: org = app[1] repo = app[0] Folder.clean(os.path.join(Settings.TEST_RUN_HOME, repo)) Git.clone(repo_url='https://github.com/{0}/{1}'.format(org, repo), local_folder=repo)
def setUpClass(cls): TnsRunTest.setUpClass() app_folder = os.path.join(Settings.TEST_RUN_HOME, cls.app_name) Folder.clean(app_folder) Git.clone( repo_url='https://github.com/NativeScript/chrome-devtools-test-app', local_folder=app_folder) Tns.platform_add_android( app_name=cls.app_name, framework_path=Settings.Android.FRAMEWORK_PATH) if Settings.HOST_OS == OSType.OSX: Tns.platform_add_ios(app_name=cls.app_name, framework_path=Settings.IOS.FRAMEWORK_PATH) App.update(app_name=cls.app_name)
def test_010_create_app_remove_app_resources(self): # creates valid project from local directory template Folder.clean(os.path.join("template-hello-world")) Folder.clean(os.path.join(Settings.AppName.DEFAULT)) Git.clone( repo_url='[email protected]:NativeScript/template-hello-world.git', local_folder="template-hello-world") Folder.clean( os.path.join(Settings.TEST_RUN_HOME, 'template-hello-world', 'app', 'App_Resources')) file_path = os.path.join(Settings.TEST_RUN_HOME, 'template-hello-world', 'package.json') File.replace(path=file_path, old_string="tns-template-hello-world", new_string="test-tns-template-hello-world") path = os.path.join(Settings.TEST_RUN_HOME, 'template-hello-world') Tns.create(app_name=Settings.AppName.DEFAULT, template=path)
def __get_templates(branch=Settings.Packages.TEMPLATES_BRANCH): """ Clone hello-world templates and pack them as local npm packages. :param branch: Branch of https://github.com/NativeScript/nativescript-app-templates """ local_folder = os.path.join(Settings.TEST_SUT_HOME, 'templates') Git.clone(repo_url=Template.REPO, branch=branch, local_folder=local_folder) apps = [ Template.HELLO_WORLD_JS, Template.HELLO_WORLD_TS, Template.HELLO_WORLD_NG, Template.MASTER_DETAIL_NG, Template.VUE_BLANK, Template.MASTER_DETAIL_VUE, Template.TAB_NAVIGATION_JS ] for app in apps: template_name = app.name template_folder = os.path.join(local_folder, 'packages', template_name) out_file = os.path.join(Settings.TEST_SUT_HOME, template_name + '.tgz') Npm.pack(folder=template_folder, output_file=out_file) if File.exists(out_file): app.path = out_file else: raise IOError("Failed to clone and pack template: " + template_name)
def setUpClass(cls): TnsRunTest.setUpClass() # Clone the plugin Git.clone(repo_url=DateTimePickerHmrTests.plugin_repo, local_folder=DateTimePickerHmrTests.plugin_folder, branch="master")