def test_120_platform_add_android_inside_project(self): """ Add platform inside project folder (not using --path)""" project_path = os.path.join(Settings.TEST_RUN_HOME, self.app_name) command = 'platform add android' result = Tns.exec_command(command=command, cwd=project_path) TnsAssert.platform_added(app_name=self.app_name, platform=Platform.ANDROID, output=result.output)
def test_150_platform_update_ios_when_platform_not_added(self): """`platform update` should work even if platform is not added""" runtime_version = '5.3.1' command = 'platform update ios@{0}'.format(runtime_version) result = Tns.exec_command(command=command, path=self.app_name) TnsAssert.platform_added(app_name=self.app_name, platform=Platform.IOS, version=runtime_version, output=result.output)
def platform_update(app_name=Settings.AppName.DEFAULT, platform=Platform.NONE, version=None): platform_add_string = str(platform) if version is not None: platform_add_string = platform_add_string + '@' + version command = 'platform update ' + platform_add_string result = Tns.exec_command(command=command, path=app_name) TnsAssert.platform_added(app_name=app_name, platform=platform, version=version, output=result.output) if version is not None: assert 'Successfully updated to version {0}'.format( version) in result.output else: assert 'Successfully updated to version' in result.output
def platform_add(app_name=Settings.AppName.DEFAULT, platform=Platform.NONE, framework_path=None, version=None, verify=True, log_trace=False): platform_add_string = str(platform) if version is not None: platform_add_string = platform_add_string + '@' + version command = 'platform add ' + platform_add_string + ' --path ' + app_name if framework_path is not None: command = command + ' --frameworkPath ' + framework_path result = Tns.exec_command(command=command, log_trace=log_trace) if verify: TnsAssert.platform_added(app_name=app_name, platform=platform, output=result.output, version=version) return result