|
9 | 9 | from core.osutils.command import run
|
10 | 10 | from core.osutils.file import File
|
11 | 11 | from core.osutils.folder import Folder
|
12 |
| -from core.settings.settings import IOS_RUNTIME_PATH, CURRENT_OS, OSType |
| 12 | +from core.settings.settings import IOS_RUNTIME_PATH, CURRENT_OS, OSType, TEST_RUN_HOME |
13 | 13 | from core.tns.replace_helper import ReplaceHelper
|
14 | 14 | from core.tns.tns import Tns
|
15 | 15 | from core.tns.tns_platform_type import Platform
|
@@ -79,6 +79,27 @@ def test_201_prepare_ios_platform_not_added(self):
|
79 | 79 | output = Tns.prepare_ios(attributes={"--path": self.app_name})
|
80 | 80 | TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.FIRST_TIME)
|
81 | 81 |
|
| 82 | + def test_220_build_ios_with_custom_plist(self): |
| 83 | + Tns.create_app(self.app_name) |
| 84 | + Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH}) |
| 85 | + |
| 86 | + # Update Info.plist |
| 87 | + src_file = os.path.join(TEST_RUN_HOME, 'data', 'Info.plist') |
| 88 | + target_file = os.path.join(TEST_RUN_HOME, self.app_name, 'app', 'App_Resources', 'iOS', 'Info.plist') |
| 89 | + File.remove(target_file) |
| 90 | + File.copy(src=src_file, dest=target_file) |
| 91 | + |
| 92 | + # Prepare in debug |
| 93 | + final_plist = os.path.join(TEST_RUN_HOME, self.app_name, 'platforms', 'ios', 'TestApp', 'TestApp-Info.plist') |
| 94 | + Tns.prepare_ios(attributes={"--path": self.app_name}) |
| 95 | + assert "<string>fbXXXXXXXXX</string>" in File.read(final_plist) |
| 96 | + assert "<string>orgnativescriptTestApp</string>" in File.read(final_plist) |
| 97 | + |
| 98 | + # Prepare in release |
| 99 | + Tns.prepare_ios(attributes={"--path": self.app_name, '--release': ''}) |
| 100 | + assert "<string>fbXXXXXXXXX</string>" in File.read(final_plist) |
| 101 | + assert not "<string>orgnativescriptTestApp</string>" in File.read(final_plist) |
| 102 | + |
82 | 103 | def test_300_prepare_ios_preserve_case(self):
|
83 | 104 | Tns.create_app(self.app_name)
|
84 | 105 | Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_RUNTIME_PATH})
|
|
0 commit comments