Skip to content

Commit 04f34b3

Browse files
authored
Merge pull request #63 from NativeScript/dtopuzov/verify-livesync=framework-in-ios-apps
[DO NOT MERGE] Add test for NativeScript/ios-jsc#747
2 parents 5c0c392 + 22e6ab7 commit 04f34b3

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

core/tns/tns.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -356,25 +356,21 @@ def build_ios(attributes={}, assert_success=True, tns_path=None):
356356
emu_folder = app_name + "/platforms/ios/build/emulator/"
357357
if "--forDevice" in attributes.keys() or "--for-device" in attributes.keys():
358358
assert "build/device/" + app_id + ".app" in output
359-
assert File.exists(app_name + "/platforms/ios/build/device/" + app_id + ".ipa")
359+
assert File.exists(device_folder + app_id + ".ipa")
360+
output = File.read(device_folder + app_id + ".app/" + app_id)
360361
if "--release" in attributes.keys():
361-
assert not File.pattern_exists(directory=device_folder, pattern="*TKLiveSync*"), \
362-
"TKLiveSync binaries available in release configuration."
362+
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
363363
else:
364-
pass
365-
# assert File.pattern_exists(directory=device_folder, pattern="*TKLiveSync*"), \
366-
# "TKLiveSync binaries not available in debug configuration."
364+
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
367365
else:
368366
assert "build/emulator/" + app_id + ".app" in output
369-
assert File.exists(app_name + "/platforms/ios/build/emulator/" + app_id + ".app")
370367
assert File.exists(app_name + "/platforms/ios/" + app_id + "/" + app_id + "-Prefix.pch")
368+
assert File.exists(emu_folder + app_id + ".app")
369+
output = File.read(emu_folder + app_id + ".app/" + app_id)
371370
if "--release" in attributes.keys():
372-
assert not File.pattern_exists(directory=emu_folder, pattern="*TKLiveSync*"), \
373-
"TKLiveSync binaries available in release configuration."
371+
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
374372
else:
375-
pass
376-
# assert File.pattern_exists(directory=emu_folder, pattern="*TKLiveSync*"), \
377-
# "TKLiveSync binaries not available in debug configuration."
373+
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
378374
return output
379375

380376
@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)