Skip to content

Commit a870832

Browse files
committed
1 parent 702f63c commit a870832

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed
Loading
Loading

tests/device/run_ios_device_tests.py

+19-10
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,16 @@ def test_330_tns_run_ios_after_rebuild_of_native_project(self):
250250
assert Device.wait_for_text(device_id=self.DEVICE_ID, text="Tap the button"), "App failed to load!"
251251

252252
# Change JS and wait until app is synced
253-
# ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
254-
# strings = ['Successfully transferred', 'main-view-model.js', 'Successfully synced application', self.DEVICE_ID]
255-
# Tns.wait_for_log(log_file=log, string_list=strings)
256-
# assert Device.wait_for_text(device_id=self.DEVICE_ID, text="clicks"), "JS changes not synced on device!"
253+
ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
254+
strings = ['Successfully transferred', 'main-view-model.js', 'Successfully synced application', self.DEVICE_ID]
255+
Tns.wait_for_log(log_file=log, string_list=strings)
256+
assert Device.wait_for_text(device_id=self.DEVICE_ID, text="clicks"), "JS changes not synced on device!"
257257

258258
# Rollback all the changes and verify files are synced
259-
# ReplaceHelper.rollback(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
260-
# strings = ['Successfully transferred', 'main-view-model.js', 'Refreshing application']
261-
# Tns.wait_for_log(log_file=log, string_list=strings)
262-
# assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "JS changes not synced on device!"
263-
264-
# TODO: We need test for issue 2988
259+
ReplaceHelper.rollback(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
260+
strings = ['Successfully transferred', 'main-view-model.js', 'Refreshing application']
261+
Tns.wait_for_log(log_file=log, string_list=strings)
262+
assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "JS changes not synced on device!"
265263

266264
def test_400_tns_run_ios_should_not_crash_when_uninstall_app(self):
267265
"""
@@ -292,3 +290,14 @@ def test_400_tns_run_ios_should_not_crash_when_uninstall_app(self):
292290
strings = ['Successfully installed', 'Successfully synced application']
293291
Tns.wait_for_log(log_file=log, string_list=strings, timeout=150, check_interval=10)
294292
assert Device.wait_for_text(device_id=self.DEVICE_ID, text="TEST"), "XML changes not synced on device!"
293+
294+
def test_404_tns_run_ios_on_not_existing_device_should_not_start_simualtor(self):
295+
"""
296+
`tns run ios --device fakeID` should show error and emulator should not be started (test for issue #2728)
297+
"""
298+
Simulator.stop()
299+
output = Tns.run_ios(attributes={'--path': self.app_name, '--device': 'fakeID', '--justlaunch': ''},
300+
assert_success=False)
301+
TnsAsserts.invalid_device(output=output)
302+
sleep(10)
303+
assert not Simulator.is_running()[0], 'iOS Simulator started by `tns run ios --device fakeID`!'

0 commit comments

Comments
 (0)