Skip to content

Commit 66e3e97

Browse files
committed
1 parent e48af31 commit 66e3e97

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

tests/simulator/run_ios_tests.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,49 @@ def test_350_tns_run_ios_should_start_simulator(self):
316316
else:
317317
raise nose.SkipTest('This test is not valid when devices are connected.')
318318

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+
319362
def test_400_tns_run_on_folder_with_spaces(self):
320363
"""
321364
`tns run ios` for apps with spaces

0 commit comments

Comments
 (0)