@@ -138,6 +138,24 @@ def test_311_build_ios_release_with_copy_to(self):
138
138
Tns .build_ios (attributes = {"--path" : self .app_name , "--forDevice" : "" , "--release" : "" , "--copy-to" : "./" })
139
139
assert File .exists ("TestApp.ipa" )
140
140
141
+ def test_320_build_ios_with_custom_entitlements (self ):
142
+ Tns .create_app (self .app_name )
143
+ Tns .platform_add_ios (attributes = {"--path" : self .app_name , "--frameworkPath" : IOS_RUNTIME_PATH })
144
+ Tns .build_ios (attributes = {"--path" : self .app_name })
145
+
146
+ # Add entitlements in app/App_Resources/iOS/app.entitlements
147
+ source = os .path .join (TEST_RUN_HOME , 'data' , 'entitlements' , 'app.entitlements' )
148
+ target = os .path .join (self .app_name , 'app' , 'App_Resources' , 'iOS' , 'app.entitlements' )
149
+ File .copy (src = source , dest = target )
150
+
151
+ # Build again and verify entitlements are merged
152
+ Tns .build_ios (attributes = {"--path" : self .app_name })
153
+ entitlements_path = self .app_name + '/platforms/ios/' + self .app_name + '/' + self .app_name + '.entitlements'
154
+ assert File .exists (entitlements_path ), "Entitlements file is missing!"
155
+ entitlements_content = File .read (entitlements_path )
156
+ assert '<key>aps-environment</key>' in entitlements_content , "Entitlements file content is wrong!"
157
+ assert '<string>development</string>' in entitlements_content , "Entitlements file content is wrong!"
158
+
141
159
def test_400_build_ios_with_wrong_param (self ):
142
160
Tns .create_app (self .app_name_noplatform )
143
161
output = Tns .build_ios (attributes = {"--path" : self .app_name_noplatform , "--" + invalid : "" },
0 commit comments