@@ -221,6 +221,10 @@ def create_app_ng(app_name, attributes={}, log_trace=False, assert_success=True,
221221 if Npm .version () < 5 :
222222 assert "nativescript-angular" in output
223223 assert File .exists (os .path .join (app_name , 'node_modules' , 'nativescript-theme-core' ))
224+ package_json = File .read (os .path .join (app_name , 'package.json' ))
225+ assert "tns-core-modules" in package_json
226+ assert "nativescript-angular" in package_json
227+ assert "nativescript-dev-typescript" in package_json
224228
225229 return output
226230
@@ -348,13 +352,17 @@ def prepare_ios(attributes={}, assert_success=True, log_trace=False, tns_path=No
348352 return output
349353
350354 @staticmethod
351- def build_android (attributes = {}, assert_success = True , tns_path = None ):
352- output = Tns .run_tns_command ("build android" , attributes = attributes , tns_path = tns_path )
355+ def build_android (attributes = {}, assert_success = True , tns_path = None , log_trace = False ):
356+ output = Tns .run_tns_command ("build android" , attributes = attributes , tns_path = tns_path , log_trace = log_trace )
353357 if assert_success :
354358 # Verify output of build command
355- assert "BUILD SUCCESSFUL" in output , "Build failed!" + os .linesep + output
356359 assert "Project successfully built" in output , "Build failed!" + os .linesep + output
360+ assert "FAILURE" not in output
357361 assert "NOT FOUND" not in output # Test for https://github.com/NativeScript/android-runtime/issues/390
362+ if log_trace :
363+ assert "BUILD SUCCESSFUL" in output , "Build failed!" + os .linesep + output
364+ else :
365+ assert "BUILD SUCCESSFUL" not in output , "Native build out is displayed even without --log trace"
358366
359367 # Verify apk packages
360368 app_name = Tns .__get_app_name_from_attributes (attributes = attributes )
@@ -377,24 +385,29 @@ def build_android(attributes={}, assert_success=True, tns_path=None):
377385 return output
378386
379387 @staticmethod
380- def build_ios (attributes = {}, assert_success = True , tns_path = None ):
388+ def build_ios (attributes = {}, assert_success = True , tns_path = None , log_trace = False ):
381389
382390 if "--provision" not in attributes .keys ():
383391 attr = {"--teamId" : DEVELOPMENT_TEAM }
384392 attributes .update (attr )
385393
386- output = Tns .run_tns_command ("build ios" , attributes = attributes , tns_path = tns_path )
394+ output = Tns .run_tns_command ("build ios" , attributes = attributes , tns_path = tns_path , log_trace = log_trace )
387395
388396 app_name = Tns .__get_app_name_from_attributes (attributes = attributes )
389397 app_name = app_name .replace ("\" " , "" ) # Handle projects with space
390398 app_id = Tns .__get_final_package_name (app_name , platform = Platform .IOS )
391399
392400 if assert_success :
393- assert "BUILD SUCCEEDED" in output
394401 assert "Project successfully built" in output
395402 assert "ERROR" not in output
396403 assert "malformed" not in output
397- assert "CodeSign" in output
404+
405+ if log_trace :
406+ assert "BUILD SUCCEEDED" in output
407+ assert "CodeSign" in output
408+ else :
409+ assert "BUILD SUCCEEDED" not in output , "Native build out is displayed even without --log trace"
410+ assert "CodeSign" not in output , "Native build out is displayed even without --log trace"
398411
399412 # Verify release/debug builds
400413 if "--release" in attributes .keys ():
@@ -410,9 +423,13 @@ def build_ios(attributes={}, assert_success=True, tns_path=None):
410423 device_folder = app_name + "/platforms/ios/build/device/"
411424 emu_folder = app_name + "/platforms/ios/build/emulator/"
412425 if "--forDevice" in attributes .keys () or "--for-device" in attributes .keys ():
413- assert "build/device/" + app_id + ".app" in output
414- assert "ARCHIVE SUCCEEDED" in output
415- assert "EXPORT SUCCEEDED" in output
426+ if log_trace :
427+ assert "build/device/" + app_id + ".app" in output
428+ assert "ARCHIVE SUCCEEDED" in output
429+ assert "EXPORT SUCCEEDED" in output
430+ else :
431+ assert "ARCHIVE SUCCEEDED" not in output , "Native build out is displayed even without --log trace"
432+ assert "EXPORT SUCCEEDED" not in output , "Native build out is displayed even without --log trace"
416433 assert File .exists (device_folder + app_id + ".ipa" ), "IPA file not found!"
417434 bundle_content = File .read (device_folder + app_id + ".app/" + app_id )
418435 xcode_project = Tns .__get_xcode_project_file (app_name )
@@ -422,7 +439,11 @@ def build_ios(attributes={}, assert_success=True, tns_path=None):
422439 assert DEVELOPMENT_TEAM in xcode_project or DISTRIBUTION_PROVISIONING in xcode_project , \
423440 "TeamID not passed to Xcode!"
424441 else :
425- assert "build/emulator/" + app_id + ".app" in output
442+ if log_trace :
443+ assert "build/emulator/" + app_id + ".app" in output
444+ else :
445+ assert "build/emulator/" + app_id + ".app" not in output , \
446+ "Native build out is displayed even without --log trace"
426447 assert File .exists (app_name + "/platforms/ios/" + app_id + "/" + app_id + "-Prefix.pch" )
427448 assert File .exists (emu_folder + app_id + ".app" )
428449 bundle_content = File .read (emu_folder + app_id + ".app/" + app_id )
0 commit comments