def test_391_platform_list(self): """Platform list command should list installed platforms and if app is prepared for those platforms""" Folder.cleanup(self.app_name) Tns.create_app(self.app_name, update_modules=False) # `tns platform list` on brand new project output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE) # `tns platform list` when iOS is added Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.IOS) # `tns platform list` when iOS is prepared Tns.prepare_ios(attributes={"--path": self.app_name}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.IOS) # `tns platform list` when android is added (iOS already prepared) Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.BOTH) # `tns platform list` when android is prepared (iOS already prepared) Tns.prepare_android(attributes={"--path": self.app_name}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.BOTH, added=Platform.BOTH) # Verify build both platforms is not allowed # Test for https://github.com/NativeScript/nativescript-cli/pull/3425 output = Tns.run_tns_command(command="build", attributes={"--path": self.app_name}) assert "The input is not valid sub-command for 'build' command" in output assert "<Platform> is the target mobile platform for which you want to build your project" in output
def test_391_platform_list(self): """Platform list command should list installed platforms and if app is prepared for those platforms""" Folder.cleanup(self.app_name) Tns.create_app(self.app_name, update_modules=False) # `tns platform list` on brand new project output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE) # `tns platform list` when iOS is added Tns.platform_add_ios(attributes={ "--path": self.app_name, "--frameworkPath": IOS_PACKAGE }) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.IOS) # `tns platform list` when iOS is prepared Tns.prepare_ios(attributes={"--path": self.app_name}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.IOS) # `tns platform list` when android is added (iOS already prepared) Tns.platform_add_android(attributes={ "--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE }) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.BOTH) # `tns platform list` when android is prepared (iOS already prepared) Tns.prepare_android(attributes={"--path": self.app_name}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.BOTH, added=Platform.BOTH) # Verify build both platforms is not allowed # Test for https://github.com/NativeScript/nativescript-cli/pull/3425 output = Tns.run_tns_command(command="build", attributes={"--path": self.app_name}) assert "The input is not valid sub-command for 'build' command" in output assert "<Platform> is the target mobile platform for which you want to build your project" in output
def test_390_platform_list(self): """Platform list command should list installed platforms and if app is prepared for those platforms""" # issue with v2 of templates - workaround with remove ios platform Tns.platform_remove(platform=Platform.IOS, attributes={"--path": self.app_name}, assert_success=False) # `tns platform list` on brand new project output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE) # `tns platform list` when android is added Tns.platform_add_android(attributes={ "--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE }) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.ANDROID) # `tns platform list` when android is prepared Tns.prepare_android(attributes={"--path": self.app_name}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.ANDROID, added=Platform.ANDROID)
def test_390_platform_list(self): """Platform list command should list installed platforms and if app is prepared for those platforms""" # issue with v2 of templates - workaround with remove ios platform Tns.platform_remove(platform=Platform.IOS, attributes={"--path": self.app_name}, assert_success=False) # `tns platform list` on brand new project output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE) # `tns platform list` when android is added Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.ANDROID) # `tns platform list` when android is prepared Tns.prepare_android(attributes={"--path": self.app_name}) output = Tns.platform_list(attributes={"--path": self.app_name}) TnsAsserts.platform_list_status(output=output, prepared=Platform.ANDROID, added=Platform.ANDROID)