当前位置: 首页>>代码示例>>Python>>正文


Python Tns.run_ios方法代码示例

本文整理汇总了Python中core.tns.tns.Tns.run_ios方法的典型用法代码示例。如果您正苦于以下问题:Python Tns.run_ios方法的具体用法?Python Tns.run_ios怎么用?Python Tns.run_ios使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core.tns.tns.Tns的用法示例。


在下文中一共展示了Tns.run_ios方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_300_tns_run_ios_emulator_should_start_emulator_even_if_device_is_connected

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
 def test_300_tns_run_ios_emulator_should_start_emulator_even_if_device_is_connected(self):
     """
     `tns run ios --emulator` should start emulator even if physical device is connected
     """
     Simulator.stop()
     Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--justlaunch': ''}, assert_success=False)
     assert Simulator.wait_for_simulator()[0], 'iOS Simulator not started by `tns run ios`!'
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:9,代码来源:run_ios_device_tests.py

示例2: test_210_tns_run_ios_add_remove_files_and_folders

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_210_tns_run_ios_add_remove_files_and_folders(self):
        """
        New files and folders should be synced properly.
        """

        log = Tns.run_ios(attributes={'--path': self.app_name, '--device': self.DEVICE_ID}, wait=False,
                          assert_success=False)
        strings = ['Successfully synced application', self.DEVICE_ID]
        Tns.wait_for_log(log_file=log, string_list=strings, timeout=120, check_interval=10)

        # Add new files
        new_file_name = 'app2.css'
        source_file = os.path.join(self.app_name, 'app', 'app.css')
        destination_file = os.path.join(self.app_name, 'app', new_file_name)
        File.copy(source_file, destination_file)
        strings = ['Successfully transferred', new_file_name, 'Refreshing application']
        Tns.wait_for_log(log_file=log, string_list=strings)

        # Revert changes(rename file and delete file)
        # File.copy(destination_file, source_file)
        # File.remove(destination_file)
        # strings = ['Successfully transferred', new_file_name]
        # Tns.wait_for_log(log_file=log, string_list=strings)

        # Add folder
        new_folder_name = 'test2'
        source_file = os.path.join(self.app_name, 'app', 'test')
        destination_file = os.path.join(self.app_name, 'app', new_folder_name)
        Folder.copy(source_file, destination_file)
        strings = ['Successfully transferred test.txt', 'Successfully synced application']
        Tns.wait_for_log(log_file=log, string_list=strings)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:33,代码来源:run_ios_device_tests.py

示例3: test_400_tns_run_ios_should_not_crash_when_uninstall_app

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_400_tns_run_ios_should_not_crash_when_uninstall_app(self):
        """
        `tns run ios` should work properly even if I manually uninstall the app (test for issue #3007)
        """

        # `tns run ios` and wait until app is deployed
        log = Tns.run_ios(attributes={'--path': self.app_name, "--device": self.DEVICE_ID}, wait=False,
                          assert_success=False)
        strings = [self.DEVICE_ID, 'Successfully synced application']
        Tns.wait_for_log(log_file=log, string_list=strings, timeout=180, check_interval=10)

        # Verify app is running
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "App failed to load!"
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="TAP"), "App failed to load!"

        # Change JS and wait until app is synced
        ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS, sleep=3)
        strings = ['Successfully transferred', 'main-view-model.js', 'Successfully synced application', self.DEVICE_ID]
        Tns.wait_for_log(log_file=log, string_list=strings)
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="clicks"), "JS changes not synced on device!"

        # Uninstall app while `tns run` is running
        Device.uninstall_app(app_prefix='org.nativescript.', platform=Platform.IOS)
        sleep(10)

        # Change XML and wait until app is synced
        Tns.wait_for_log(log_file=log, string_list=[], timeout=30)  # Just to cleanup log file
        ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_XML, sleep=10)
        strings = ['Successfully installed', 'Successfully synced application']
        Tns.wait_for_log(log_file=log, string_list=strings, timeout=180, check_interval=10)
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="TEST"), "XML changes not synced on device!"
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:33,代码来源:run_ios_device_tests.py

示例4: test_330_tns_run_ios_after_rebuild_of_native_project

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_330_tns_run_ios_after_rebuild_of_native_project(self):
        """
        `tns run ios` should work properly after rebuild of native project (test for issue #2860)
        """

        # `tns run ios` and wait until app is deployed
        log = Tns.run_ios(attributes={'--path': self.app_name, '--device': self.DEVICE_ID}, wait=False,
                          assert_success=False, log_trace=True)
        strings = [self.DEVICE_ID, 'Successfully synced application']
        Tns.wait_for_log(log_file=log, string_list=strings, timeout=120, check_interval=10)

        # Verify app is running
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="Tap the button"), "App failed to load!"

        # Update native project
        config_path = os.path.join(self.app_name, 'app', 'App_Resources', 'iOS', 'build.xcconfig')
        File.replace(file_path=config_path, str1='More info', str2='If you need more info')
        strings = ['ARCHIVE SUCCEEDED', 'Successfully synced application', self.DEVICE_ID, 'CONSOLE LOG']
        not_existing_strings = ['Unable to sync files', 'Multiple errors were thrown']
        Tns.wait_for_log(log_file=log, string_list=strings, not_existing_string_list=not_existing_strings, timeout=120)

        # Verify app is running
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="Tap the button"), "App failed to load!"

        # Change JS and wait until app is synced
        ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
        strings = ['Successfully transferred', 'main-view-model.js', 'Successfully synced application', self.DEVICE_ID]
        Tns.wait_for_log(log_file=log, string_list=strings)
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="clicks"), "JS changes not synced on device!"

        # Rollback all the changes and verify files are synced
        ReplaceHelper.rollback(self.app_name, ReplaceHelper.CHANGE_JS, sleep=10)
        strings = ['Successfully transferred', 'main-view-model.js', 'Restarting application']
        Tns.wait_for_log(log_file=log, string_list=strings)
        assert Device.wait_for_text(device_id=self.DEVICE_ID, text="taps left"), "JS changes not synced on device!"
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:37,代码来源:run_ios_device_tests.py

示例5: test_181_tns_run_ios_console_dir

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_181_tns_run_ios_console_dir(self):
        """
         Test console.dir() of different objects.
        """

        # Change main-page.js so it contains console logging
        source_js = os.path.join('data', 'console-dir', 'main-page.js')
        target_js = os.path.join(self.app_name, 'app', 'main-page.js')
        File.copy(src=source_js, dest=target_js)

        john_obj = "==== object dump start ====\n" \
                   "name: John\n" \
                   "age: 34\n" \
                   "==== object dump end ===="

        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': ''}, wait=False, assert_success=False)
        strings = ['Project successfully built',
                   'Successfully installed on device with identifier', self.SIMULATOR_ID,
                   "true",
                   "false",
                   "null",
                   "undefined",
                   "-1",
                   "text",
                   self.max_long_string,
                   john_obj
                   ]

        Tns.wait_for_log(log_file=log, string_list=strings, timeout=150, check_interval=10)
        assert self.very_long_string not in log
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:32,代码来源:run_ios_tests.py

示例6: test_008_ios_run_hmr_console_log

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_008_ios_run_hmr_console_log(self):
        source_js = os.path.join('data', "issues", 'console-log-hmr', 'main-view-model.js')
        target_js = os.path.join(self.app_name, 'app', 'main-view-model.js')
        File.copy(src=source_js, dest=target_js)

        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--hmr': ''}, wait=False,
                                assert_success=False)
        strings = ['LOG Hello']
        Tns.wait_for_log(log_file=log, string_list=strings)

        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original, timeout=120)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:13,代码来源:hello_world_js_hmr_ios.py

示例7: test_310_tns_run_ios_emulator_should_run_only_on_emulator

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
 def test_310_tns_run_ios_emulator_should_run_only_on_emulator(self):
     """
     `tns run ios --emulator` should start emulator even if physical device is connected
     """
     self.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
     output = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--justlaunch': ''},
                          assert_success=False)
     TnsAsserts.prepared(app_name=self.app_name, output=output, platform=Platform.IOS, prepare=Prepare.INCREMENTAL)
     app_id = Tns.get_app_id(self.app_name)
     assert app_id + " on device " + self.SIMULATOR_ID in output, "App not deployed on iOS Simulator!"
     for device_id in self.DEVICES:
         assert app_id + " on device " + device_id not in output, 'App is deployed on {0} device.'.format(device_id)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:14,代码来源:run_ios_device_tests.py

示例8: test_003_debug_ios_simulator_start

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_003_debug_ios_simulator_start(self):
        """
        Attach the debug tools to a running app in the iOS Simulator
        """

        # Run the app and ensure it works
        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--justlaunch': ''},
                          assert_success=False, timeout=30)
        TnsAsserts.prepared(app_name=self.app_name, platform=Platform.IOS, output=log, prepare=Prepare.SKIP)
        Device.screen_match(device_name=SIMULATOR_NAME, device_id=self.SIMULATOR_ID,
                            expected_image='livesync-hello-world_home')

        # Attach debugger
        log = Tns.debug_ios(attributes={'--path': self.app_name, '--emulator': '', '--start': '', '--inspector': ''})
        DebugiOSInspectorSimulatorTests.__verify_debugger_attach(log, app_started=False)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:17,代码来源:debug_ios_inspector_tests.py

示例9: test_001_ios_run_hmr

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_001_ios_run_hmr(self):
        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--hmr': ''}, wait=False,
                        assert_success=False)

        Tns.wait_for_log(log_file=log, string_list=HelpersHMR.run_hmr, not_existing_string_list=HelpersHMR.errors_hmr,
                         timeout=240)
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original, timeout=120)
        Helpers.wait_webpack_watcher()

        HelpersHMR.apply_changes(app_name=self.app_name, log=log, platform=Platform.IOS)
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_change,
                                 timeout=120)
        HelpersHMR.revert_changes(app_name=self.app_name, log=log, platform=Platform.IOS)
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original,
                                 timeout=120)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:17,代码来源:hello_world_js_hmr_ios.py

示例10: test_003_ios_run_hmr_wrong_xml

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_003_ios_run_hmr_wrong_xml(self):
        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--hmr': ''}, wait=False,
                            assert_success=False)
        Tns.wait_for_log(log_file=log, string_list=HelpersHMR.run_hmr_with_platforms, not_existing_string_list=HelpersHMR.errors_hmr,
                         timeout=240)
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original, timeout=120)
        Helpers.wait_webpack_watcher()

        HelpersHMR.apply_changes_js(app_name=self.app_name, log=log, platform=Platform.IOS)

        # Uninstall app while `tns run` is running
        Simulator.uninstall("org.nativescript." + self.app_name)

        HelpersHMR.revert_changes_js(app_name=self.app_name, log=log, platform=Platform.IOS)
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original, timeout=120)
        Helpers.wait_webpack_watcher()
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:18,代码来源:hello_world_js_hmr_ios.py

示例11: test_002_ios_run_hmr_uninstall_app

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_002_ios_run_hmr_uninstall_app(self):
        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': '', '--hmr': ''}, wait=False,
                            assert_success=False)
        Tns.wait_for_log(log_file=log, string_list=HelpersHMR.run_hmr_with_platforms, not_existing_string_list=HelpersHMR.errors_hmr,
                         timeout=240)
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original, timeout=120)
        Helpers.wait_webpack_watcher()
        
        HelpersHMR.apply_changes_js(app_name=self.app_name, log=log, platform=Platform.IOS)

        # Uninstall app while `tns run` is running
        Simulator.uninstall("org.nativescript." + self.app_name)

        ReplaceHelper.rollback(self.app_name, HelpersHMR.js_change, sleep=10)
        strings = ['Restarting application on device', 'HMR: Hot Module Replacement Enabled. Waiting for signal.']
        Tns.wait_for_log(log_file=log, string_list=strings)
        
        Helpers.ios_screen_match(sim_id=self.SIMULATOR_ID, image=HelpersHMR.image_original, timeout=120)
        Helpers.wait_webpack_watcher()
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:21,代码来源:hello_world_js_hmr_ios.py

示例12: test_180_tns_run_ios_console_log

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import run_ios [as 别名]
    def test_180_tns_run_ios_console_log(self):
        """
         Test console info, warn, error, assert, trace, time and logging of different objects.
        """

        # Change main-page.js so it contains console logging
        source_js = os.path.join('data', 'console-log', 'main-page.js')
        target_js = os.path.join(self.app_name, 'app', 'main-page.js')
        File.copy(src=source_js, dest=target_js)

        john_obj = "{\n" \
                   "\"name\": \"John\",\n" \
                   "\"age\": 34\n" \
                   "}"

        john_obj2 = "[\n" + "1,\n" \
                            "5,\n" \
                            "12.5,\n" \
                            "{\n" \
                            "\"name\": \"John\",\n" \
                            "\"age\": 34\n" \
                            "},\n" \
                            "\"text\",\n" \
                            "42\n" \
                            "]"

        log = Tns.run_ios(attributes={'--path': self.app_name, '--emulator': ''}, wait=False, assert_success=False)
        strings = ['Project successfully built',
                   'Successfully installed on device with identifier', self.SIMULATOR_ID,
                   "CONSOLE LOG file:///app/main-page.js",
                   "true",
                   "false",
                   "null",
                   "undefined",
                   "-1",
                   "text",
                   john_obj,
                   "number: -1",
                   "string: text",
                   "text -1",
                   "CONSOLE INFO",
                   "info",
                   "CONSOLE WARN",
                   "warn",
                   "CONSOLE ERROR",
                   "error",
                   "false == true",
                   "empty string evaluates to 'false'",
                   "CONSOLE TRACE file:///app/main-page.js",
                   "console.trace() called",
                   "pageLoaded",
                   "Button(8)",
                   "-1 text {",
                   john_obj2,
                   self.max_long_string,
                   "CONSOLE INFO Time:",
                   "### TEST END ###"
                   ]

        Tns.wait_for_log(log_file=log, string_list=strings, timeout=150, check_interval=10)
        assert self.very_long_string not in log
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:63,代码来源:run_ios_tests.py


注:本文中的core.tns.tns.Tns.run_ios方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。