@@ -507,6 +507,36 @@ def test_350_tns_run_android_should_start_emulator(self):
507507 else :
508508 raise nose .SkipTest ('This test is not valid when devices are connected.' )
509509
510+ def test_360_tns_run_android_with_jar_file_in_plugin (self ):
511+ """
512+ App should not crash when reference .jar file in some plugin
513+ https://github.com/NativeScript/android-runtime/pull/905
514+ """
515+
516+ # Create app
517+ Tns .create_app (self .app_name )
518+
519+ # Add .jar file in plugin and modify the app to reference it
520+ custom_jar_file = os .path .join ('data' , 'issues' , 'android-runtime-pr-905' , 'customLib.jar' )
521+ modules_widgets = os .path .join (self .app_name , 'node_modules' , 'tns-core-modules-widgets' , 'platforms' , 'android' )
522+ File .copy (src = custom_jar_file , dest = modules_widgets )
523+
524+ source = os .path .join ('data' , 'issues' , 'android-runtime-pr-905' , 'app.js' )
525+ target = os .path .join (self .app_name , 'app' , 'app.js' )
526+ File .copy (src = source , dest = target )
527+
528+ # `tns run android` and wait until app is deployed
529+ log = Tns .run_android (attributes = {'--path' : self .app_name , '--device' : EMULATOR_ID }, wait = False ,
530+ assert_success = False )
531+ strings = ['Project successfully built' ,
532+ 'Successfully installed on device with identifier' , EMULATOR_ID ,
533+ 'Successfully synced application' ]
534+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 180 , check_interval = 10 )
535+
536+ # Verify app looks correct inside emulator
537+ Device .screen_match (device_name = EMULATOR_NAME , device_id = EMULATOR_ID ,
538+ expected_image = 'livesync-hello-world_home' )
539+
510540 @unittest .skip ("Skip because of https://github.com/NativeScript/nativescript-cli/issues/2825" )
511541 def test_390_tns_run_android_should_warn_if_package_ids_do_not_match (self ):
512542 """
0 commit comments