Skip to content

Commit c71daaf

Browse files
committed
1 parent b970166 commit c71daaf

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ iOS Only: Install ideviceinstaller
2020
```
2121
brew install ideviceinstaller --HEAD
2222
brew install libimobiledevice --HEAD
23+
(for iOS11 support) brew install https://gist.github.com/Haraguroicha/0dee2ee29c7376999178c5392080c16e/raw/libimobiledevice.rb --HEAD --with-ios11
2324
```
2425

2526
Perf Tests Only:

tests/device/run_ios_tests.py

+31-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def setUpClass(cls):
4646
Emulator.stop()
4747
Simulator.stop()
4848
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)
5050

5151
Folder.cleanup(cls.app_name)
5252
Tns.create_app(cls.app_name,
@@ -249,4 +249,33 @@ def test_330_tns_run_ios_after_rebuild_of_native_project(self):
249249
# Tns.wait_for_log(log_file=log, string_list=strings)
250250
# assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "JS changes not synced on device!"
251251

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

Comments
 (0)