From cc4670e97e2b861137b9ca1918f7c57051f67acf Mon Sep 17 00:00:00 2001 From: Vasil Hristov Date: Fri, 13 Mar 2020 20:57:18 +0200 Subject: [PATCH] Merge Master in Release (#481) * add logs (#475) * Fix error activity test (#476) * Fix Api29 tests. Fix changing of time zone tests. increase the time for waiting an emulator. (#478) * Fix Api29 tests. Fix changing of time zone tests. increase the time for waiting an emulator. * Change max-public-methods value * Fix regex checks missing android class. (#480) --- .pylintrc | 2 +- core/utils/device/adb.py | 15 +++++++- .../runtimes/android/android_plugins_tests.py | 4 +-- .../runtimes/android/android_runtime_tests.py | 36 +++++++++---------- .../runtimes/android/android_service_tests.py | 10 +++--- .../runtimes/android/error_activity_tests.py | 2 +- 6 files changed, 42 insertions(+), 27 deletions(-) diff --git a/.pylintrc b/.pylintrc index dc36894c..bf2c6e72 100644 --- a/.pylintrc +++ b/.pylintrc @@ -530,7 +530,7 @@ max-locals=15 max-parents=7 # Maximum number of public methods for a class (see R0904). -max-public-methods=30 +max-public-methods=35 # Maximum number of return / yield for function / method body. max-returns=6 diff --git a/core/utils/device/adb.py b/core/utils/device/adb.py index 50bb36e0..c13675f8 100644 --- a/core/utils/device/adb.py +++ b/core/utils/device/adb.py @@ -118,7 +118,7 @@ def is_running(device_id): return bool('mSurface=Surface' in result.output) @staticmethod - def wait_until_boot(device_id, timeout=180, check_interval=3): + def wait_until_boot(device_id, timeout=250, check_interval=3): """ Wait android device/emulator is up and running. :param device_id: Device identifier. @@ -413,6 +413,19 @@ def kill_process(device_id, process_name): assert result.output == "", "Process {0} not killed! Logs:{1}".format(process_name, result.output) time.sleep(5) + @staticmethod + def kill_application(device_id, app_id, process_id): + """ + Stop application + :param device_id: Device identifier + :param app_id: Bundle identifier (example: org.nativescript.TestApp) + :param process_id: The id of the process + """ + Adb.run_adb_command(command='shell run-as {0} kill {1}'.format(app_id, process_id), + device_id=device_id, wait=True) + # wait application to be killed + time.sleep(2) + @staticmethod def run_adb_as_root(device_id): """ diff --git a/tests/runtimes/android/android_plugins_tests.py b/tests/runtimes/android/android_plugins_tests.py index a2fea8ef..9f1f0f55 100644 --- a/tests/runtimes/android/android_plugins_tests.py +++ b/tests/runtimes/android/android_plugins_tests.py @@ -422,7 +422,7 @@ def test_453_support_Kotlin_with_jar_without_use_kotlin(self): strings = ['Successfully synced application org.nativescript.TestApp on device '] test_result = Wait.until(lambda: all(string in File.read(log.log_file) for string in strings), timeout=300, period=5) - messages = "App with Kotlin enabled and kotlin jar not build correctly! Logs: " + messages = "App with Kotlin enabled and kotlin jar not build correctly! Logs: " + File.read(log.log_file) assert test_result, messages + File.read(log.log_file) self.assert_kotlin_is_working(self.emulator) with open(ANALYTICS_FILE, "r") as read_file: @@ -464,7 +464,7 @@ def test_454_support_gradle_properties_for_enable_Kotlin_with_kotlin_file(self): test_result = Wait.until(lambda: all(string in File.read(log.log_file) for string in strings), timeout=300, period=5) - messages = "App with Kotlin enabled and kotlin jar not build correctly! Logs: " + messages = "App with Kotlin enabled and kotlin jar not build correctly! Logs: " + File.read(log.log_file) assert test_result, messages + File.read(log.log_file) self.assert_kotlin_is_working(self.emulator) with open(ANALYTICS_FILE, "r") as read_file: diff --git a/tests/runtimes/android/android_runtime_tests.py b/tests/runtimes/android/android_runtime_tests.py index 68ed431f..234354ac 100644 --- a/tests/runtimes/android/android_runtime_tests.py +++ b/tests/runtimes/android/android_runtime_tests.py @@ -173,14 +173,14 @@ def test_316_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+at Observable\.viewModel\.onTap \(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at Button\.push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify \(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at Button\.push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit \(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at Object\.ClickListenerImpl\.onClick \(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at Object\.ClickListenerImpl\.onClick \(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS:.+### UNCAUGHT MESSAGE: Calling js method onClick failed JS:.+Error: New Error! JS:.+### Stack Trace Start JS:.+### UNCAUGHT STACKTRACE:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS:.+at com\.tns\.Runtime\.callJSMethodNative\(Native Method\) JS:.+at com\.tns\.Runtime\.dispatchCallJSMethodNative\(Runtime\.java:\d+\) JS:.+at com\.tns\.Runtime\.callJSMethodImpl\(Runtime\.java:\d+\) @@ -203,7 +203,7 @@ def test_316_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### UNCAUGHT STACK:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) """ # noqa: E501 else: stack_trace = r"""JS:.+### CAUGHT MESSAGE: New Error! @@ -215,14 +215,14 @@ def test_316_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+at Observable\.viewModel\.onTap \(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at Button\.push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify \(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at Button\.push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit \(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at Object\.ClickListenerImpl\.onClick \(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at Object\.ClickListenerImpl\.onClick \(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS:.+### UNCAUGHT MESSAGE: Calling js method onClick failed JS:.+Error: New Error! JS:.+### Stack Trace Start JS:.+### UNCAUGHT STACKTRACE:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS:.+at com\.tns\.Runtime\.callJSMethodNative\(Native Method\) JS:.+at com\.tns\.Runtime\.dispatchCallJSMethodNative\(Runtime\.java:\d+\) JS:.+at com\.tns\.Runtime\.callJSMethodImpl\(Runtime\.java:\d+\) @@ -247,7 +247,7 @@ def test_316_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### UNCAUGHT STACK:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) """ # noqa: E501 strings = ["Error: New Error!", "UNCAUGHT STACKTRACE:"] @@ -300,7 +300,7 @@ def test_317_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### CAUGHT STACKTRACE:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS:.+com\.tns\.Runtime\.resolveMethodOverload\(Runtime\.java:\d+\) JS:.+com\.tns\.Runtime\.callJSMethodNative\(Native Method\) JS:.+com\.tns\.Runtime\.dispatchCallJSMethodNative\(Runtime\.java:\d+\) @@ -323,14 +323,14 @@ def test_317_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### CAUGHT STACK:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS: ### UNCAUGHT MESSAGE: Calling js method onClick failed JS:.+Error: java\.lang\.Exception: Failed resolving method createTempFile on class java\.io\.File JS:.+### Stack Trace Start JS:.+### UNCAUGHT STACKTRACE:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS: .+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS: .+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS: .+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS: .+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS: .+at com\.tns\.Runtime\.callJSMethodNative\(Native Method\) JS: .+at com\.tns\.Runtime\.dispatchCallJSMethodNative\(Runtime\.java:\d+\) JS: .+at com\.tns\.Runtime\.callJSMethodImpl\(Runtime\.java:\d+\) @@ -356,7 +356,7 @@ def test_317_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### UNCAUGHT STACK:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) """ # noqa: E501 else: stack_trace = r""" @@ -365,7 +365,7 @@ def test_317_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### CAUGHT STACKTRACE:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS:.+com\.tns\.Runtime\.resolveMethodOverload\(Runtime\.java:\d+\) JS:.+com\.tns\.Runtime\.callJSMethodNative\(Native Method\) JS:.+com\.tns\.Runtime\.dispatchCallJSMethodNative\(Runtime\.java:\d+\) @@ -390,14 +390,14 @@ def test_317_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### CAUGHT STACK:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS: ### UNCAUGHT MESSAGE: Calling js method onClick failed JS:.+Error: java\.lang\.Exception: Failed resolving method createTempFile on class java\.io\.File JS:.+### Stack Trace Start JS:.+### UNCAUGHT STACKTRACE:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS: .+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS: .+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS: .+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS: .+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) JS: .+at com\.tns\.Runtime\.callJSMethodNative\(Native Method\) JS: .+at com\.tns\.Runtime\.dispatchCallJSMethodNative\(Runtime\.java:\d+\) JS: .+at com\.tns\.Runtime\.callJSMethodImpl\(Runtime\.java:\d+\) @@ -425,7 +425,7 @@ def test_317_check_native_crash_will_not_crash_when_discardUncaughtJsExceptions_ JS:.+### UNCAUGHT STACK:.+viewModel\.onTap\(file: app\/main-view-model\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\.notify\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) JS:.+at push\.\.\.\/node_modules\/@nativescript\/core\/data\/observable\/observable\.js\.Observable\._emit\(file: node_modules\/@nativescript\/core\/data\/observable\/observable\.js:\d+:\d+\) -JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.js:\d+:\d+\) +JS:.+at ClickListenerImpl\.onClick\(file: node_modules\/@nativescript\/core\/ui\/button\/button\.android\.js:\d+:\d+\) """ # noqa: E501 strings = ["Error: java.lang.Exception: Failed resolving method createTempFile on class java.io.File", "Caused by: java.lang.Exception: Failed resolving method createTempFile on class java.io.File"] @@ -627,10 +627,10 @@ def test_440_tns_run_android_new_date_work_as_expected_when_changing_timezone(se period=5) assert test_result, "Select time zone Button is missing on the device" Device.click(self.emulator, text="Select time zone") - test_result = Wait.until(lambda: Device.is_text_visible(self.emulator, "Los Angeles", True), + test_result = Wait.until(lambda: Device.is_text_visible(self.emulator, "Tijuana", True), timeout=30, period=5) assert test_result, "Los Angeles Button is missing on the device." - Device.click(self.emulator, text="Los Angeles") + Device.click(self.emulator, text="Tijuana") else: output = Adb.run_adb_command("shell am start -a android.settings.DATE_SETTINGS", self.emulator.id, @@ -654,10 +654,10 @@ def test_440_tns_run_android_new_date_work_as_expected_when_changing_timezone(se period=5) assert test_result, "TAP Button is missing on the device" Device.click(self.emulator, text="TAP", case_sensitive=True) - assert_result = Wait.until(lambda: "GMT-0800 (PST)" in File.read(log.log_file), timeout=240, period=5) + assert_result = Wait.until(lambda: "GMT-0700 (PDT)" in File.read(log.log_file), timeout=240, period=5) assert assert_result, "Missing log for time! Logs: " + File.read(log.log_file) # Generate regex for asserting date and time - date_to_find_los_angeles = los_angeles_time.strftime(r'%a %b %d %Y %H:.{2}:.{2}') + r" GMT\-0800 \(PST\)" + date_to_find_los_angeles = los_angeles_time.strftime(r'%a %b %d %Y %H:.{2}:.{2}') + r" GMT\-0700 \(PDT\)" # Assert date time is correct assert_result = Wait.until(lambda: re.search(date_to_find_los_angeles, File.read(log.log_file)), timeout=20, period=5) diff --git a/tests/runtimes/android/android_service_tests.py b/tests/runtimes/android/android_service_tests.py index 4011d445..06050d17 100644 --- a/tests/runtimes/android/android_service_tests.py +++ b/tests/runtimes/android/android_service_tests.py @@ -68,7 +68,9 @@ def test_200_test_foreground_sticky_services_are_working(self): assert service_name in service_info, "{0} service not found! Logs: {1}".format(service_name, service_info) pid = Adb.get_process_pid(self.emulator.id, "org.nativescript.TestApp") - Adb.kill_process(self.emulator.id, "org.nativescript.TestApp") + Adb.kill_application(self.emulator.id, "org.nativescript.TestApp", pid) + service_info = Adb.get_active_services(self.emulator.id) + assert service_name in service_info, "{0} service not found! Logs: {1}".format(service_name, service_info) services = Adb.get_active_services(self.emulator.id, service_name) assert service_name in services, "{0} service not found! Logs: {1}".format(service_name, services) @@ -81,6 +83,7 @@ def test_201_test_foreground_not_sticky_services_are_working(self): """ https://github.com/NativeScript/android-runtime/issues/1347 """ + Adb.stop_application(self.emulator.id, "org.nativescript.TestApp") File.copy(os.path.join(TEST_RUN_HOME, 'assets', 'runtime', 'android', 'files', 'android-runtime-1347', 'AndroidManifest.xml'), os.path.join(TEST_RUN_HOME, APP_NAME, 'app', 'App_Resources', 'Android', 'src', 'main', @@ -108,8 +111,7 @@ def test_201_test_foreground_not_sticky_services_are_working(self): assert service_name in service_info, "{0} service not found! Logs: {1}".format(service_name, service_info) pid = Adb.get_process_pid(self.emulator.id, "org.nativescript.TestApp") - Adb.kill_process(self.emulator.id, "org.nativescript.TestApp") - + Adb.kill_application(self.emulator.id, "org.nativescript.TestApp", pid) service_info = Adb.get_active_services(self.emulator.id, service_name) assert service_name not in service_info, "{0} service found! Logs: {1}".format(service_name, service_info) assert pid not in service_info, "{0} service with id {1} found! Logs: {2}".format(service_name, pid, @@ -146,7 +148,7 @@ def test_202_test_foreground_service_without_oncreate_method_is_working(self): assert service_name in service_info, "{0} service not found! Logs: {1}".format(service_name, service_info) pid = Adb.get_process_pid(self.emulator.id, "org.nativescript.TestApp") - Adb.kill_process(self.emulator.id, "org.nativescript.TestApp") + Adb.kill_application(self.emulator.id, "org.nativescript.TestApp", pid) service_info = Adb.get_active_services(self.emulator.id, service_name) assert service_name not in service_info, "{0} service found! Logs: {1}".format(service_name, service_info) diff --git a/tests/runtimes/android/error_activity_tests.py b/tests/runtimes/android/error_activity_tests.py index 479a8afe..2c7213bf 100644 --- a/tests/runtimes/android/error_activity_tests.py +++ b/tests/runtimes/android/error_activity_tests.py @@ -143,7 +143,7 @@ def test_400_no_error_activity_in_release_builds(self): self.emulator.is_text_visible('Exception') else: regex_to_check = r"""System\.err: Error: Kill the app! -.+System\.err: File: \(file:\/\/\/]data\/data\/org\.nativescript\.TestApp\/files\/app\/bundle\.js:\d+:\d+\) +.+System\.err: File: \(file:\/\/\/data\/data\/org\.nativescript\.TestApp\/files\/app\/bundle\.js:\d+:\d+\) .+System\.err:.+ .+System\.err: StackTrace:.+ .+System\.err:.+\(file:\/\/\/data\/data\/org\.nativescript\.TestApp\/files\/app\/bundle\.js:\d+:\d+\)