def test_384_check_for_native_and_js_callstacks(self):
        """
        https://github.com/NativeScript/ios-runtime/pull/1144
        """
        # Replace main-page.js so there is an error
        File.copy(
            os.path.join(TEST_RUN_HOME, 'assets', 'runtime', 'ios', 'files',
                         'ios-pr-1144', 'main-page.js'),
            os.path.join(APP_PATH, 'app', 'main-page.js'), True)

        result = Tns.run_ios(app_name=APP_NAME,
                             emulator=True,
                             wait=False,
                             verify=False)
        strings = [
            'Native Stack:', 'sig_handler(int)', 'JS Stack:',
            '1   @[native code]',
            '2   onNavigatingTo@file:///app/main-page.js:34:0'
        ]
        TnsLogs.wait_for_log(log_file=result.log_file,
                             string_list=strings,
                             timeout=150,
                             check_interval=10)

        # Verify app is NOT running on device
        test_result = Wait.until(lambda: Simctl.is_process_running(
            self.sim, 'org.nativescript.' + APP_NAME) is False,
                                 timeout=120,
                                 period=5)
        assert test_result, "It seems that " + APP_NAME + " is still running when it should not!"
Beispiel #2
0
 def is_running_on_ios(device_info, app_id):
     """
     Get preview URL form tns log.
     This is the url you need to load in Preview app in order to see and sync your project.
     :param device_info: Information about the device we will search in.
     :param app_id: the App ID of the process.
     :return: boolean.
     """
     return Simctl.is_process_running(device_info, app_id)