@@ -46,7 +46,7 @@ def setUpClass(cls):
46
46
Emulator .stop ()
47
47
Simulator .stop ()
48
48
Device .ensure_available (platform = Platform .IOS )
49
- Device .uninstall_app (app_prefix = " org.nativescript." , platform = Platform .IOS )
49
+ Device .uninstall_app (app_prefix = ' org.nativescript.' , platform = Platform .IOS )
50
50
51
51
Folder .cleanup (cls .app_name )
52
52
Tns .create_app (cls .app_name ,
@@ -249,4 +249,33 @@ def test_330_tns_run_ios_after_rebuild_of_native_project(self):
249
249
# Tns.wait_for_log(log_file=log, string_list=strings)
250
250
# assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "JS changes not synced on device!"
251
251
252
- # TODO: We need test for issue 2988 and 3007
252
+ # TODO: We need test for issue 2988
253
+
254
+ def test_400_tns_run_ios_should_not_crash_when_uninstall_app (self ):
255
+ """
256
+ `tns run ios` should work properly even if I manually uninstall the app (test for issue #3007)
257
+ """
258
+
259
+ # `tns run ios` and wait until app is deployed
260
+ log = Tns .run_ios (attributes = {'--path' : self .app_name , "--device" : self .DEVICE_ID }, log_trace = True , wait = False , assert_success = False )
261
+ strings = [self .DEVICE_ID ,'Successfully synced application' ]
262
+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 150 , check_interval = 10 )
263
+
264
+ # Verify app is running
265
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "taps left" ), "App failed to load!"
266
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TAP" ), "App failed to load!"
267
+
268
+ # Change JS and wait until app is synced
269
+ ReplaceHelper .replace (self .app_name , ReplaceHelper .CHANGE_JS , sleep = 3 )
270
+ strings = ['Successfully transferred' , 'main-view-model.js' , 'Successfully synced application' , self .DEVICE_ID ]
271
+ Tns .wait_for_log (log_file = log , string_list = strings )
272
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "clicks" ), "JS changes not synced on device!"
273
+
274
+ # Uninstall app while `tns run` is running
275
+ Device .uninstall_app (app_prefix = 'org.nativescript.' , platform = Platform .IOS )
276
+
277
+ # Change XML and wait until app is synced
278
+ ReplaceHelper .replace (self .app_name , ReplaceHelper .CHANGE_XML , sleep = 3 )
279
+ strings = ['Successfully transferred' , 'main-page.xml' , 'Successfully synced application' ]
280
+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 150 , check_interval = 10 )
281
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TEST" ), "XML changes not synced on device!"
0 commit comments