Skip to content

[DO NOT MERGE] Add test for https://github.com/NativeScript/ios-runtime/pull/747 #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions core/tns/tns.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,25 +356,21 @@ def build_ios(attributes={}, assert_success=True, tns_path=None):
emu_folder = app_name + "/platforms/ios/build/emulator/"
if "--forDevice" in attributes.keys() or "--for-device" in attributes.keys():
assert "build/device/" + app_id + ".app" in output
assert File.exists(app_name + "/platforms/ios/build/device/" + app_id + ".ipa")
assert File.exists(device_folder + app_id + ".ipa")
output = File.read(device_folder + app_id + ".app/" + app_id)
if "--release" in attributes.keys():
assert not File.pattern_exists(directory=device_folder, pattern="*TKLiveSync*"), \
"TKLiveSync binaries available in release configuration."
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
else:
pass
# assert File.pattern_exists(directory=device_folder, pattern="*TKLiveSync*"), \
# "TKLiveSync binaries not available in debug configuration."
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
else:
assert "build/emulator/" + app_id + ".app" in output
assert File.exists(app_name + "/platforms/ios/build/emulator/" + app_id + ".app")
assert File.exists(app_name + "/platforms/ios/" + app_id + "/" + app_id + "-Prefix.pch")
assert File.exists(emu_folder + app_id + ".app")
output = File.read(emu_folder + app_id + ".app/" + app_id)
if "--release" in attributes.keys():
assert not File.pattern_exists(directory=emu_folder, pattern="*TKLiveSync*"), \
"TKLiveSync binaries available in release configuration."
assert "TKLiveSync" not in output, "TKLiveSync binaries available in release configuration."
else:
pass
# assert File.pattern_exists(directory=emu_folder, pattern="*TKLiveSync*"), \
# "TKLiveSync binaries not available in debug configuration."
assert "TKLiveSync" in output, "TKLiveSync binaries not available in debug configuration."
return output

@staticmethod
Expand Down
12 changes: 8 additions & 4 deletions tests/build/ios/build_ios_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os

from core.base_class.BaseClass import BaseClass
from core.device.simulator import Simulator
from core.osutils.command import run
from core.osutils.file import File
from core.osutils.folder import Folder
Expand Down Expand Up @@ -31,7 +32,7 @@ def setUpClass(cls):

def setUp(self):
BaseClass.setUp(self)

Simulator.stop()
Folder.cleanup(self.app_name_dash)
Folder.cleanup(self.app_name_space)
Folder.cleanup(self.app_name_ios)
Expand All @@ -40,6 +41,11 @@ def setUp(self):

Folder.cleanup(self.app_name)

def tearDown(self):
BaseClass.tearDown(self)
# Uncomment after https://github.com/NativeScript/nativescript-cli/issues/2757 is fixed
# assert not Simulator.is_running()[0], "Simulator started after " + self._testMethodName

@classmethod
def tearDownClass(cls):
File.remove("TestApp.app")
Expand Down Expand Up @@ -84,9 +90,7 @@ def test_201_build_ios_fordevice(self):

def test_211_build_ios_inside_project(self):
Tns.create_app(self.app_name)
Tns.platform_add_ios(attributes={"--path": self.app_name,
"--frameworkPath": IOS_RUNTIME_PATH
})
Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})
Folder.navigate_to(self.app_name)
output = Tns.build_ios(tns_path=os.path.join("..", TNS_PATH), attributes={"--path": self.app_name},
assert_success=False)
Expand Down