@@ -252,3 +252,27 @@ def test_452_assert_static_binding_generator_is_generating_correct_code(self):
252
252
test_result = Wait .until (lambda : all (string in File .read (log .log_file ) for string in strings ), timeout = 320 ,
253
253
period = 5 )
254
254
assert test_result , 'Static binding generator did not generated code! Logs: ' + File .read (log .log_file )
255
+
256
+ def test_453_native_package_with_kotlin_are_working (self ):
257
+ """
258
+ Test native packages with kotlin are working
259
+ https://github.com/NativeScript/android-runtime/issues/1571
260
+ """
261
+ # Change main-page.js so it contains only logging information
262
+ source_js = os .path .join (TEST_RUN_HOME , 'assets' , 'runtime' , 'android' , 'files' , 'android-runtime-1571' ,
263
+ 'main-page.js' )
264
+ target_js = os .path .join (TEST_RUN_HOME , APP_NAME , 'app' , 'main-page.js' )
265
+ File .copy (source = source_js , target = target_js , backup_files = True )
266
+ # Change app app.gradle so it contains the dependencies to androidx.core:core-ktx:1.0.2
267
+ source_js = os .path .join (TEST_RUN_HOME , 'assets' , 'runtime' , 'android' , 'files' , 'android-runtime-1571' ,
268
+ 'app.gradle' )
269
+ target_js = os .path .join (TEST_RUN_HOME , APP_NAME , 'app' , 'App_Resources' , 'Android' , 'app.gradle' )
270
+ File .copy (source = source_js , target = target_js , backup_files = True )
271
+ log = Tns .run_android (APP_NAME , device = self .emulator .id , wait = False , verify = False )
272
+
273
+ strings = ['Project successfully built' , 'Successfully installed on device with identifier' , self .emulator .id ]
274
+
275
+ Wait .until (lambda : all (string in File .read (log .log_file ) for string in strings ), timeout = 240 , period = 5 )
276
+
277
+ test_result = Wait .until (lambda : "###TEST PASSED###" in File .read (log .log_file ), timeout = 100 , period = 5 )
278
+ assert test_result , 'Native packages with kotlin are not working! Logs:' + File .read (log .log_file )
0 commit comments