@@ -316,6 +316,49 @@ def test_350_tns_run_ios_should_start_simulator(self):
316
316
else :
317
317
raise nose .SkipTest ('This test is not valid when devices are connected.' )
318
318
319
+ def test_370_tns_run_plugin_add (self ):
320
+ """
321
+ `tns run ios` should do full rebuild after plugin is added.
322
+ """
323
+ # `tns run ios` and wait until app is deployed
324
+ log = Tns .run_ios (attributes = {'--path' : self .app_name , '--emulator' : '' }, wait = False , assert_success = False )
325
+ strings = ['Project successfully built' , 'Successfully installed on device with identifier' , self .SIMULATOR_ID ]
326
+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 150 , check_interval = 10 )
327
+
328
+ # Verify app looks correct inside simulator
329
+ Device .screen_match (device_name = SIMULATOR_NAME , device_id = self .SIMULATOR_ID ,
330
+ expected_image = 'livesync-hello-world_home' )
331
+
332
+ # Add plugin
333
+ Tns .plugin_add ("nativescript-telerik-ui" , attributes = {"--path" : self .app_name })
334
+
335
+ # Change JS and wait for full sync
336
+ ReplaceHelper .replace (self .app_name , ReplaceHelper .CHANGE_JS , sleep = 10 )
337
+ strings = ['BUILD SUCCEEDED' , 'Project successfully built' , 'Successfully installed on device with identifier' ,
338
+ self .SIMULATOR_ID ]
339
+ Tns .wait_for_log (log_file = log , string_list = strings )
340
+
341
+ # Rollback JS changes and verify sync is incremental
342
+ ReplaceHelper .rollback (self .app_name , ReplaceHelper .CHANGE_JS , sleep = 10 )
343
+ strings = ['Successfully transferred' , 'main-view-model.js' , 'Successfully synced application' ]
344
+ Tns .wait_for_log (log_file = log , string_list = strings , clean_log = False )
345
+ assert 'BUILD SUCCEEDED' not in File .read (log ), "Second change of JS files after plugin add is not incremental!"
346
+ File .write (file_path = log , text = "" ) # Clean log file
347
+
348
+ # Change XML and wait until app is synced
349
+ ReplaceHelper .replace (self .app_name , ReplaceHelper .CHANGE_XML , sleep = 3 )
350
+ strings = ['Successfully transferred' , 'main-page.xml' , 'Successfully synced application' ]
351
+ Tns .wait_for_log (log_file = log , string_list = strings , clean_log = False )
352
+ assert 'BUILD SUCCEEDED' not in File .read (log ), "Change of XML files after plugin add is not incremental!"
353
+ File .write (file_path = log , text = "" ) # Clean log file
354
+
355
+ # Change CSS and wait until app is synced
356
+ ReplaceHelper .replace (self .app_name , ReplaceHelper .CHANGE_CSS , sleep = 3 )
357
+ strings = ['Successfully transferred' , 'app.css' , 'Successfully synced application' ]
358
+ Tns .wait_for_log (log_file = log , string_list = strings , clean_log = False )
359
+ assert 'BUILD SUCCEEDED' not in File .read (log ), "Change of CSS files after plugin add is not incremental!"
360
+ File .write (file_path = log , text = "" ) # Clean log file
361
+
319
362
def test_400_tns_run_on_folder_with_spaces (self ):
320
363
"""
321
364
`tns run ios` for apps with spaces
0 commit comments