Skip to content

Commit c0ea3db

Browse files
committed
1 parent 7aa79a9 commit c0ea3db

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

core/tns/tns.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -358,23 +358,23 @@ def build_ios(attributes={}, assert_success=True, tns_path=None):
358358
assert "build/device/" + app_id + ".app" in output
359359
assert File.exists(app_name + "/platforms/ios/build/device/" + app_id + ".ipa")
360360
if "--release" in attributes.keys():
361-
assert not File.pattern_exists(directory=device_folder, pattern="*TKLiveSync*"), \
362-
"TKLiveSync binaries available in release configuration."
361+
output = File.read(app_name + "/platforms/ios/build/device/" + app_id + ".app/" + app_id)
362+
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
363363
else:
364364
pass
365-
# assert File.pattern_exists(directory=device_folder, pattern="*TKLiveSync*"), \
366-
# "TKLiveSync binaries not available in debug configuration."
365+
output = File.read(app_name + "/platforms/ios/build/device/" + app_id + ".app/" + app_id)
366+
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
367367
else:
368368
assert "build/emulator/" + app_id + ".app" in output
369369
assert File.exists(app_name + "/platforms/ios/build/emulator/" + app_id + ".app")
370370
assert File.exists(app_name + "/platforms/ios/" + app_id + "/" + app_id + "-Prefix.pch")
371371
if "--release" in attributes.keys():
372-
assert not File.pattern_exists(directory=emu_folder, pattern="*TKLiveSync*"), \
373-
"TKLiveSync binaries available in release configuration."
372+
output = File.read(app_name + "/platforms/ios/build/emulator/" + app_id + ".app/" + app_id)
373+
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
374374
else:
375375
pass
376-
# assert File.pattern_exists(directory=emu_folder, pattern="*TKLiveSync*"), \
377-
# "TKLiveSync binaries not available in debug configuration."
376+
output = File.read(app_name + "/platforms/ios/build/emulator/" + app_id + ".app/" + app_id)
377+
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
378378
return output
379379

380380
@staticmethod

tests/build/ios/build_ios_tests.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55

66
from core.base_class.BaseClass import BaseClass
7+
from core.device.simulator import Simulator
78
from core.osutils.command import run
89
from core.osutils.file import File
910
from core.osutils.folder import Folder
@@ -31,7 +32,7 @@ def setUpClass(cls):
3132

3233
def setUp(self):
3334
BaseClass.setUp(self)
34-
35+
Simulator.stop()
3536
Folder.cleanup(self.app_name_dash)
3637
Folder.cleanup(self.app_name_space)
3738
Folder.cleanup(self.app_name_ios)
@@ -40,6 +41,11 @@ def setUp(self):
4041

4142
Folder.cleanup(self.app_name)
4243

44+
def tearDown(self):
45+
BaseClass.tearDown(self)
46+
# Uncomment after https://github.com/NativeScript/nativescript-cli/issues/2757 is fixed
47+
# assert not Simulator.is_running()[0], "Simulator started after " + self._testMethodName
48+
4349
@classmethod
4450
def tearDownClass(cls):
4551
File.remove("TestApp.app")
@@ -84,9 +90,7 @@ def test_201_build_ios_fordevice(self):
8490

8591
def test_211_build_ios_inside_project(self):
8692
Tns.create_app(self.app_name)
87-
Tns.platform_add_ios(attributes={"--path": self.app_name,
88-
"--frameworkPath": IOS_RUNTIME_PATH
89-
})
93+
Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})
9094
Folder.navigate_to(self.app_name)
9195
output = Tns.build_ios(tns_path=os.path.join("..", TNS_PATH), attributes={"--path": self.app_name},
9296
assert_success=False)

0 commit comments

Comments
 (0)