@@ -81,7 +81,7 @@ def test_001_tns_run_ios_js_css_xml(self):
81
81
82
82
# Verify app is running
83
83
assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "taps left" ), "App failed to load!"
84
- assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TAP" ), "XML changes not synced on device !"
84
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TAP" ), "App failed to load !"
85
85
86
86
# Verify Simulator is not started
87
87
assert not Simulator .is_running ()[0 ], 'Device is attached, but emulator is also started after `tns run ios`!'
@@ -198,3 +198,55 @@ def test_320_tns_run_ios_specific_device(self):
198
198
for device_id in self .DEVICES :
199
199
assert device_id not in output , \
200
200
'Application is deployed on {0} while it should be only on {1}' .format (device_id , self .SIMULATOR_ID )
201
+
202
+ def test_330_tns_run_ios_after_rebuild_of_native_project (self ):
203
+ """
204
+ `tns run ios` should work properly after rebuild of native project (test for issue #2860)
205
+ """
206
+
207
+ # `tns run ios` and wait until app is deployed
208
+ log = Tns .run_ios (attributes = {'--path' : self .app_name , '--device' : self .DEVICE_ID }, wait = False ,assert_success = False )
209
+ strings = ['Project successfully built' ,
210
+ 'Successfully installed on device with identifier' , self .DEVICE_ID ,
211
+ 'Successfully synced application' ]
212
+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 120 , check_interval = 10 )
213
+
214
+ # Verify app is running
215
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "taps left" ), "App failed to load!"
216
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TAP" ), "App failed to load!"
217
+
218
+ # Update native project
219
+ config_path = os .path .join (self .app_name , 'app' , 'App_Resources' , 'iOS' , 'build.xcconfig' )
220
+ File .replace (file_path = config_path , str1 = 'More info' , str2 = 'If you need more info' )
221
+ strings = ['BUILD SUCCEEDED' , 'Successfully synced application' , self .DEVICE_ID ]
222
+ Tns .wait_for_log (log_file = log , string_list = strings , timeout = 120 )
223
+
224
+ # Verify app is running
225
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "taps left" ), "App failed to load!"
226
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TAP" ), "App failed to load!"
227
+
228
+ # Kill livesync process
229
+ Process .kill (proc_name = 'node' , proc_cmdline = 'tns' )
230
+
231
+ # `tns run ios` and again and verify sync works without issues
232
+ log = Tns .run_ios (attributes = {'--path' : self .app_name , '--device' : self .DEVICE_ID }, wait = False , assert_success = False )
233
+ strings = ['Successfully synced application' , 'CONSOLE LOG' ]
234
+ not_existing_strings = ['Unable to sync files' , 'Multiple errors were thrown' , '.nsbuildinfo' ]
235
+ Tns .wait_for_log (log_file = log , string_list = strings , not_existing_string_list = not_existing_strings , timeout = 120 )
236
+
237
+ # Verify app is running
238
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "taps left" ), "App failed to load!"
239
+ assert Device .wait_for_text (device_id = self .DEVICE_ID , text = "TAP" ), "App failed to load!"
240
+
241
+ # TODO: After changes app freeze, uncomment when it is fixed
242
+ # Change JS and wait until app is synced
243
+ # ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
244
+ # strings = ['Successfully transferred', 'main-view-model.js', 'Successfully synced application', self.DEVICE_ID]
245
+ # Tns.wait_for_log(log_file=log, string_list=strings)
246
+ # assert Device.wait_for_text(device_id=self.DEVICE_ID, text="clicks"), "JS changes not synced on device!"
247
+
248
+ # Rollback all the changes and verify files are synced
249
+ # ReplaceHelper.rollback(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
250
+ # strings = ['Successfully transferred', 'main-view-model.js', 'Refreshing application']
251
+ # Tns.wait_for_log(log_file=log, string_list=strings)
252
+ # assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "JS changes not synced on device!"
0 commit comments