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 TNS_PATH , IOS_RUNTIME_PATH , ANDROID_RUNTIME_PATH
12
+ from core .settings .settings import TNS_PATH , IOS_RUNTIME_PATH , ANDROID_RUNTIME_PATH , TEST_RUN_HOME
13
13
from core .settings .strings import *
14
14
from core .tns .tns import Tns
15
15
from core .tns .tns_platform_type import Platform
@@ -190,6 +190,20 @@ def test_302_plugin_and_npm_modules_in_same_project(self):
190
190
assert not File .exists (self .app_name + "/platforms/android/src/main/assets/app/tns_modules/" +
191
191
"nativescript-appversion/appversion.ios.js" )
192
192
193
+ def test_320_CFBundleURLTypes_overridden_from_plugin (self ):
194
+ """
195
+ Test for issue https://github.com/NativeScript/nativescript-cli/issues/2936
196
+ """
197
+ Tns .create_app (self .app_name )
198
+ plugin_path = os .path .join (TEST_RUN_HOME , 'data' , 'plugins' , 'CFBundleURLName-Plugin.tgz' )
199
+ Tns .plugin_add (plugin_path , attributes = {"--path" : self .app_name })
200
+ Tns .prepare_ios (attributes = {"--path" : self .app_name })
201
+ plist = File .read (os .path .join (TEST_RUN_HOME , self .app_name , 'platforms' , 'ios' , self .app_name ,
202
+ self .app_name + "-Info.plist" ))
203
+ assert "<key>NSAllowsArbitraryLoads</key>" in plist , \
204
+ "NSAppTransportSecurity from plugin is not found in final Info.plist"
205
+ assert "<string>bar</string>" in plist , "CFBundleURLTypes from plugin is not found in final Info.plist"
206
+
193
207
def test_401_plugin_add_invalid_plugin (self ):
194
208
Tns .create_app (self .app_name )
195
209
output = Tns .plugin_add ("wd" , attributes = {"--path" : self .app_name }, assert_success = False )
@@ -220,4 +234,4 @@ def test_403_plugin_add_plugin_not_supported_on_specific_platform(self):
220
234
output = Tns .prepare_android (attributes = {"--path" : self .app_name })
221
235
TnsAsserts .prepared (self .app_name , platform = Platform .ANDROID , output = output , prepare = Prepare .FULL )
222
236
assert File .pattern_exists (self .app_name + "/platforms/android" , pattern = "*.aar" )
223
- assert File .pattern_exists (self .app_name + "/platforms/android" , pattern = "*ACRA*" )
237
+ assert File .pattern_exists (self .app_name + "/platforms/android" , pattern = "*ACRA*" )
0 commit comments