diff --git a/core/utils/device/device.py b/core/utils/device/device.py index 574d29f8..150a5fad 100644 --- a/core/utils/device/device.py +++ b/core/utils/device/device.py @@ -21,16 +21,24 @@ class Device(object): # noinspection PyShadowingBuiltins - def __init__(self, id, name, type, version): + def __init__(self, id, name, type, model, version): self.id = id self.type = type self.version = version + self.model = model + self.name = name if type is DeviceType.IOS: type = run(cmd="ideviceinfo | grep ProductType").output type = type.replace(',', '') type = type.replace('ProductType:', '').strip(' ') self.name = type + if type is DeviceType.SIM: + self.model = name + if type is DeviceType.EMU: + cmd = 'shell getprop ro.product.model' + model = Adb.run_adb_command(command=cmd, wait=True, device_id=self.id).output + self.model = model.strip('\n\r') else: self.name = name diff --git a/core/utils/device/device_manager.py b/core/utils/device/device_manager.py index 6429b0fa..0b968db6 100644 --- a/core/utils/device/device_manager.py +++ b/core/utils/device/device_manager.py @@ -21,12 +21,12 @@ def get_devices(device_type=any): if device_type is DeviceType.ANDROID or device_type is any: for device_id in Adb.get_ids(include_emulators=False): version = Adb.get_version(device_id=device_id) - device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID, version=version) + device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID, version=version, model=None) devices.append(device) # Get iOS devices if device_type is DeviceType.IOS or device_type is any: for device_id in IDevice.get_devices(): - device = Device(id=device_id, name=device_id, type=DeviceType.IOS, version=None) + device = Device(id=device_id, name=device_id, type=DeviceType.IOS, version=None, model=None) devices.append(device) for device in devices: @@ -83,7 +83,8 @@ def start(emulator): booted = Adb.wait_until_boot(device_id=emulator.emu_id) if booted: Log.info('{0} is up and running!'.format(emulator.avd)) - device = Device(id=emulator.emu_id, name=emulator.avd, type=DeviceType.EMU, version=emulator.os_version) + device = Device(id=emulator.emu_id, model=emulator.model, name=emulator.avd, type=DeviceType.EMU, + version=emulator.os_version) TestContext.STARTED_DEVICES.append(device) return device else: @@ -169,7 +170,7 @@ def start(simulator_info): # Return result device = Device(id=simulator_info.id, name=simulator_info.name, type=DeviceType.SIM, - version=simulator_info.sdk) + version=simulator_info.sdk, model=simulator_info.id) TestContext.STARTED_DEVICES.append(device) return device @@ -187,7 +188,8 @@ def ensure_available(simulator_info): return Device(id=simulator_info.id, name=simulator_info.name, type=DeviceType.SIM, - version=simulator_info.sdk) + version=simulator_info.sdk, + model=None) elif DeviceManager.Simulator.is_available(simulator_info=simulator_info): return DeviceManager.Simulator.start(simulator_info) else: diff --git a/core/utils/device/emulator_info.py b/core/utils/device/emulator_info.py index d996ea52..c59a09d0 100644 --- a/core/utils/device/emulator_info.py +++ b/core/utils/device/emulator_info.py @@ -1,7 +1,8 @@ # noinspection PyShadowingBuiltins class EmulatorInfo(object): - def __init__(self, avd=None, os_version=None, port=None, emu_id=None): + def __init__(self, avd=None, os_version=None, port=None, emu_id=None, model=None): self.avd = avd self.os_version = os_version self.port = port self.emu_id = emu_id + self.model = model diff --git a/core_tests/unit/product/tns_helpers_tests.py b/core_tests/unit/product/tns_helpers_tests.py index 0dcfc432..3b9e18c7 100644 --- a/core_tests/unit/product/tns_helpers_tests.py +++ b/core_tests/unit/product/tns_helpers_tests.py @@ -29,7 +29,7 @@ def test_10_get_run_messages_first_run(self): platform=Platform.ANDROID, run_type=RunType.FIRST_TIME, file_name=None, - device=Device(id='123', name='Emu', type=DeviceType.EMU, version=6.0)) + device=Device(id='123', name='Emu', type=DeviceType.EMU, version=6.0, model=None)) assert 'Skipping prepare.' not in logs assert 'Preparing project...' in logs assert 'Project successfully prepared (android)' in logs @@ -52,7 +52,7 @@ def test_11_get_run_messages_sync_js(self): file_name='main-view-model.js', bundle=False, hmr=False, - device=Device(id='123', name='Emu', type=DeviceType.EMU, version=8.0)) + device=Device(id='123', name='Emu', type=DeviceType.EMU, version=8.0, model=None)) assert 'Successfully transferred main-view-model.js' in logs assert 'Restarting application on device' in logs assert 'Successfully synced application org.nativescript.TestApp on device' in logs @@ -84,7 +84,7 @@ def test_13_get_run_messages_sync_js_bundle_uglify(self): bundle=True, uglify=True, hmr=False, - device=Device(id='123', name='Emu', type=DeviceType.EMU, version=4.4)) + device=Device(id='123', name='Emu', type=DeviceType.EMU, version=4.4, model=None)) assert 'Skipping prepare.' not in logs assert 'File change detected.' in logs assert 'main-view-model.js' in logs diff --git a/data/sync/blank_vue.py b/data/sync/blank_vue.py index 84716f03..b2f2987a 100644 --- a/data/sync/blank_vue.py +++ b/data/sync/blank_vue.py @@ -21,15 +21,15 @@ def __run_vue(app_name, platform, hmr): return Tns.run(app_name=app_name, platform=platform, emulator=True, wait=False, hmr=hmr) -def __preview_vue(app_name, platform, device, hmr): +def __preview_vue(app_name, device, hmr): # Execute `tns run` and wait until logs are OK - return Preview.run_app(app_name=app_name, hmr=hmr, platform=platform, device=device, click_open_alert=True) + return Preview.run_app(app_name=app_name, hmr=hmr, device=device, click_open_alert=True) def __workflow(preview, app_name, platform, device, hmr=True): # Execute tns command if preview: - result = __preview_vue(app_name=app_name, platform=platform, device=device, hmr=hmr) + result = __preview_vue(app_name=app_name, device=device, hmr=hmr) else: result = __run_vue(app_name=app_name, platform=platform, hmr=hmr) diff --git a/data/sync/hello_world_js.py b/data/sync/hello_world_js.py index 52fc4397..4a1175d6 100644 --- a/data/sync/hello_world_js.py +++ b/data/sync/hello_world_js.py @@ -3,6 +3,7 @@ """ import os +import time from core.enums.app_type import AppType from core.enums.os_type import OSType @@ -151,10 +152,10 @@ def __sync_hello_world_js_ts(app_type, app_name, platform, device, bundle=True, device.screen_match(expected_image=initial_state, tolerance=1.0, timeout=30) -def preview_hello_world_js_ts(app_name, platform, device, bundle=True, hmr=True, instrumented=False, +def preview_hello_world_js_ts(app_name, device, bundle=True, hmr=True, instrumented=False, click_open_alert=False): - result = Preview.run_app(app_name=app_name, bundle=bundle, hmr=hmr, platform=platform, - device=device, instrumented=instrumented, click_open_alert=click_open_alert) + result = Preview.run_app(app_name=app_name, bundle=bundle, hmr=hmr, device=device, + instrumented=instrumented, click_open_alert=click_open_alert) # Verify app looks properly device.wait_for_text(text=Changes.JSHelloWord.JS.old_text, timeout=90, retry_delay=5) @@ -165,12 +166,17 @@ def preview_hello_world_js_ts(app_name, platform, device, bundle=True, hmr=True, return result -def preview_sync_hello_world_js_ts(app_type, app_name, platform, device, bundle=True, hmr=True, instrumented=False, +def preview_sync_hello_world_js_ts(app_type, app_name, device, bundle=True, hmr=True, instrumented=False, click_open_alert=False): - result = preview_hello_world_js_ts(app_name=app_name, platform=platform, device=device, bundle=bundle, hmr=hmr, + result = preview_hello_world_js_ts(app_name=app_name, device=device, bundle=bundle, hmr=hmr, instrumented=instrumented, click_open_alert=click_open_alert) blue_count = device.get_pixels_by_color(color=Colors.LIGHT_BLUE) + + # due to implementation when app restarts and if changes are made too quickly device is stated as + # not connected during the restart. Workaround is to wait some seconds before next change + time.sleep(5) + # Set changes js_file = os.path.basename(Changes.JSHelloWord.JS.file_path) if app_type == AppType.JS: @@ -191,30 +197,38 @@ def preview_sync_hello_world_js_ts(app_type, app_name, platform, device, bundle= # Edit CSS file and verify changes are applied Sync.replace(app_name=app_name, change_set=css_change) - strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, - hmr=hmr, file_name='app.css', instrumented=instrumented) + strings = TnsLogs.preview_file_changed_messages(bundle=bundle, device=device, hmr=hmr, + file_name='app.css', instrumented=instrumented) if hmr and instrumented and Settings.HOST_OS != OSType.WINDOWS: TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, not_existing_string_list=not_existing_string_list) else: TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=90) device.wait_for_color(color=css_change.new_color, pixel_count=blue_count, delta=25) + # due to implementation when no hmr app restarts and if changes are made too quickly device is stated as + # not connected during the restart. Workaround is to wait some seconds before next change when in no hmr situation + if not hmr: + time.sleep(5) # Edit JS file and verify changes are applied Sync.replace(app_name=app_name, change_set=js_change) - strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, hmr=hmr, - file_name=js_file, instrumented=instrumented) + strings = TnsLogs.preview_file_changed_messages(bundle=bundle, hmr=hmr, device=device, file_name=js_file, + instrumented=instrumented) if hmr and instrumented and Settings.HOST_OS != OSType.WINDOWS: TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, not_existing_string_list=not_existing_string_list) else: TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=90) device.wait_for_text(text=js_change.new_text) + # due to implementation when no hmr app restarts and if changes are made too quickly device is stated as + # not connected during the restart. Workaround is to wait some seconds before next change when in no hmr situation + if not hmr: + time.sleep(5) # Edit XML file and verify changes are applied Sync.replace(app_name=app_name, change_set=xml_change) - strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, - hmr=hmr, file_name='main-page.xml', instrumented=instrumented) + strings = TnsLogs.preview_file_changed_messages(bundle=bundle, device=device, hmr=hmr, + file_name='main-page.xml', instrumented=instrumented) if hmr and instrumented and Settings.HOST_OS != OSType.WINDOWS: TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, not_existing_string_list=not_existing_string_list) diff --git a/data/sync/hello_world_ng.py b/data/sync/hello_world_ng.py index 991f8e1f..b6b4e9ea 100644 --- a/data/sync/hello_world_ng.py +++ b/data/sync/hello_world_ng.py @@ -3,6 +3,7 @@ """ import os +import time from core.enums.app_type import AppType from core.enums.device_type import DeviceType @@ -129,10 +130,10 @@ def sync_hello_world_ng(app_name, platform, device, bundle=True, uglify=False, a device.screen_match(expected_image=initial_state, tolerance=1.0, timeout=30) -def preview_hello_world_ng(app_name, platform, device, bundle=False, hmr=False, instrumented=False, +def preview_hello_world_ng(app_name, device, bundle=False, hmr=False, instrumented=False, click_open_alert=False): - result = Preview.run_app(app_name=app_name, bundle=bundle, hmr=hmr, platform=platform, - device=device, instrumented=instrumented, click_open_alert=click_open_alert) + result = Preview.run_app(app_name=app_name, bundle=bundle, hmr=hmr, device=device, + instrumented=instrumented, click_open_alert=click_open_alert) # Verify app looks properly device.wait_for_text(text=Changes.NGHelloWorld.TS.old_text) @@ -144,7 +145,7 @@ def preview_hello_world_ng(app_name, platform, device, bundle=False, hmr=False, def preview_sync_hello_world_ng(app_name, platform, device, bundle=True, hmr=True, instrumented=False, click_open_alert=False): - result = preview_hello_world_ng(app_name=app_name, platform=platform, device=device, bundle=bundle, hmr=hmr, + result = preview_hello_world_ng(app_name=app_name, device=device, bundle=bundle, hmr=hmr, instrumented=instrumented, click_open_alert=click_open_alert) # Verify that application is not restarted on file changes when hmr=true @@ -153,18 +154,27 @@ def preview_sync_hello_world_ng(app_name, platform, device, bundle=True, hmr=Tru else: not_existing_string_list = None + # due to implementation when app restarts and if changes are made too quickly device is stated as + # not connected during the restart. Workaround is to wait some seconds before next change + time.sleep(5) + # Edit TS file and verify changes are applied Sync.replace(app_name=app_name, change_set=Changes.NGHelloWorld.TS) - strings = TnsLogs.preview_file_changed_messages(platform=platform, run_type=RunType.INCREMENTAL, bundle=bundle, - file_name='item.service.ts', hmr=hmr, instrumented=instrumented) + strings = TnsLogs.preview_file_changed_messages(run_type=RunType.INCREMENTAL, bundle=bundle, + file_name='item.service.ts', hmr=hmr, instrumented=instrumented, + device=device) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180, not_existing_string_list=not_existing_string_list) device.wait_for_text(text=Changes.NGHelloWorld.TS.new_text) + # due to implementation when no hmr app restarts and if changes are made too quickly device is stated as + # not connected during the restart. Workaround is to wait some seconds before next change when in no hmr situation + if not hmr: + time.sleep(5) # Edit HTML file and verify changes are applied Sync.replace(app_name=app_name, change_set=Changes.NGHelloWorld.HTML) - strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, file_name='items.component.html', - hmr=hmr, instrumented=instrumented) + strings = TnsLogs.preview_file_changed_messages(bundle=bundle, file_name='items.component.html', + hmr=hmr, instrumented=instrumented, device=device) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180, not_existing_string_list=not_existing_string_list) if platform == Platform.IOS: @@ -174,11 +184,15 @@ def preview_sync_hello_world_ng(app_name, platform, device, bundle=True, hmr=Tru for number in ["8", "9"]: device.wait_for_text(text=number) assert not device.is_text_visible(text=Changes.NGHelloWorld.TS.new_text) + # due to implementation when no hmr app restarts and if changes are made too quickly device is stated as + # not connected during the restart. Workaround is to wait some seconds before next change when in no hmr situation + if not hmr: + time.sleep(5) # Edit CSS file and verify changes are applied Sync.replace(app_name=app_name, change_set=Changes.NGHelloWorld.CSS) - strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, file_name='app.css', - hmr=hmr, instrumented=instrumented) + strings = TnsLogs.preview_file_changed_messages(bundle=bundle, file_name='app.css', + hmr=hmr, instrumented=instrumented, device=device) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=180, not_existing_string_list=not_existing_string_list) device.wait_for_main_color(color=Changes.NGHelloWorld.CSS.new_color) diff --git a/products/nativescript/preview_helpers.py b/products/nativescript/preview_helpers.py index 33ba3cae..3a16e9fd 100644 --- a/products/nativescript/preview_helpers.py +++ b/products/nativescript/preview_helpers.py @@ -128,7 +128,7 @@ def dismiss_simulator_alert(): run(command) @staticmethod - def run_app(app_name, platform, device, bundle=True, hmr=True, instrumented=False, click_open_alert=False): + def run_app(app_name, device, bundle=True, hmr=True, instrumented=False, click_open_alert=False): result = Tns.preview(app_name=app_name, bundle=bundle, hmr=hmr) # Read the log and extract the url to load the app on emulator @@ -143,7 +143,8 @@ def run_app(app_name, platform, device, bundle=True, hmr=True, instrumented=Fals device.click("Open") # Verify logs - strings = TnsLogs.preview_initial_messages(platform=platform, hmr=hmr, bundle=bundle, instrumented=instrumented) + strings = TnsLogs.preview_initial_messages(device=device, hmr=hmr, bundle=bundle, + instrumented=instrumented) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=200) return result diff --git a/products/nativescript/tns_assert.py b/products/nativescript/tns_assert.py index cbd2bd75..afe42cfb 100644 --- a/products/nativescript/tns_assert.py +++ b/products/nativescript/tns_assert.py @@ -181,21 +181,17 @@ def test_initialized(app_name, framework, output): assert 'Run your tests using the' in output @staticmethod - def file_is_synced_once(log, platform, file_name): + def file_is_synced_once(log, device, file_name): """ Assert file is synced once on livesync. :param log: log or part of log you want to check :param platform: The platform you are syncing on. :param file_name: name of the file you are syncing. """ - if platform == Platform.ANDROID: - assert log.count('Start syncing changes for platform android') == 1, "File is synced more than once!" - assert log.count('hot-update.json for platform android') == 1, "File is synced more than once!" - assert file_name in log - else: - assert log.count('Start syncing changes for platform ios') == 1, "File is synced more than once!" - assert log.count('hot-update.json for platform ios') == 1, "File is synced more than once!" - assert file_name in log + assert log.count('Start syncing changes for device {0}'.format(str(device.model))) == 1, \ + "File is synced more than once!" + # assert log.count('hot-update.json for device') == 1, "File is synced more than once!" + assert file_name in log @staticmethod def snapshot_skipped(snapshot, result, release): diff --git a/products/nativescript/tns_logs.py b/products/nativescript/tns_logs.py index a845d545..b4a69055 100644 --- a/products/nativescript/tns_logs.py +++ b/products/nativescript/tns_logs.py @@ -246,9 +246,9 @@ def __webpack_messages(): 'Webpack build done!'] @staticmethod - def preview_initial_messages(platform, bundle=True, hmr=False, instrumented=False): - logs = ['Start sending initial files for platform {0}'.format(str(platform)), - 'Successfully sent initial files for platform {0}'.format(str(platform))] + def preview_initial_messages(device, bundle=True, hmr=False, instrumented=False): + logs = ["Start sending initial files for device {0}".format(str(device.model)), + "Successfully sent initial files for device {0}".format(str(device.model))] if bundle or hmr: logs.extend(TnsLogs.__webpack_messages()) if instrumented: @@ -256,15 +256,15 @@ def preview_initial_messages(platform, bundle=True, hmr=False, instrumented=Fals return logs @staticmethod - def preview_file_changed_messages(platform, file_name, run_type=RunType.INCREMENTAL, + def preview_file_changed_messages(device, file_name, run_type=RunType.INCREMENTAL, bundle=True, hmr=True, instrumented=False): - logs = ['Start syncing changes for platform {0}'.format(str(platform))] + logs = ["Start syncing changes for device {0}".format(str(device.model))] if bundle or hmr: logs.extend(TnsLogs.__webpack_messages()) logs.append(file_name) else: logs.append('Successfully synced') - logs.append('{0} for platform {1}'.format(file_name.replace('.ts', '.js'), str(platform))) + logs.append('{0} for device {1}'.format(file_name.replace('.ts', '.js'), str(device.model))) if hmr: logs.append('hot-update.json') logs.append('HMR: Checking for updates to the bundle with hmr hash') diff --git a/tests/cli/preview/templates/hello_word_js_tests.py b/tests/cli/preview/templates/hello_word_js_tests.py index 0c71f7db..4fa22ee2 100644 --- a/tests/cli/preview/templates/hello_word_js_tests.py +++ b/tests/cli/preview/templates/hello_word_js_tests.py @@ -64,24 +64,24 @@ class PreviewJSTests(TnsPreviewJSTests): def test_100_preview_android(self): """Preview project on emulator. Make valid changes in JS, CSS and XML""" - preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, platform=Platform.ANDROID, + preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, device=self.emu, instrumented=True) @unittest.skipIf(Settings.HOST_OS != OSType.OSX, 'iOS tests can be executed only on macOS.') def test_100_preview_ios(self): """Preview project on simulator. Make valid changes in JS, CSS and XML""" - preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, platform=Platform.IOS, + preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, device=self.sim, click_open_alert=True) def test_205_preview_android_no_hmr(self): """Preview project on emulator with --no-hmr. Make valid changes in JS, CSS and XML""" - preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, platform=Platform.ANDROID, + preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, device=self.emu, hmr=False) @unittest.skipIf(Settings.HOST_OS != OSType.OSX, 'iOS tests can be executed only on macOS.') def test_205_preview_ios_no_hmr(self): """Preview project on simulator with --no-hmr. Make valid changes in JS, CSS and XML""" - preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, platform=Platform.IOS, + preview_sync_hello_world_js_ts(app_type=AppType.JS, app_name=self.app_name, device=self.sim, hmr=False) def test_210_tns_preview_android_livesync_on_two_emulators(self): @@ -96,9 +96,9 @@ def test_210_tns_preview_android_livesync_on_two_emulators(self): log = File.read(result.log_file) url = Preview.get_url(log) Preview.run_url(url=url, device=self.emu) - strings = TnsLogs.preview_initial_messages(platform=Platform.ANDROID) + strings = TnsLogs.preview_initial_messages(device=self.emu) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings) - self.emu.wait_for_text(text=Changes.JSHelloWord.JS.old_text, timeout=90) + self.emu.wait_for_text(text=Changes.JSHelloWord.JS.old_text, timeout=120) # Click on TAP button on emulator Adb.click_element_by_text(self.emu.id, 'TAP', case_sensitive=True) @@ -107,8 +107,8 @@ def test_210_tns_preview_android_livesync_on_two_emulators(self): Preview.run_url(url=url, device=self.emu_API24) # Here use bundle=False because on consecutive preview build is not executed again # and no bundle messages are displayed in log - strings = TnsLogs.preview_initial_messages(platform=Platform.ANDROID, bundle=False) - TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings) + strings = TnsLogs.preview_initial_messages(device=self.emu, bundle=False) + TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=120) self.emu_API24.wait_for_text(text=Changes.JSHelloWord.JS.old_text) # Verify first emulator is not refreshed, state of app is preserved @@ -136,7 +136,7 @@ def test_210_tns_preview_on_simulator_and_emulator_livesync(self): log = File.read(result.log_file) url = Preview.get_url(log) Preview.run_url(url=url, device=self.emu) - strings = TnsLogs.preview_initial_messages(platform=Platform.ANDROID) + strings = TnsLogs.preview_initial_messages(device=self.emu) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings) self.emu.wait_for_text(text=Changes.JSHelloWord.JS.old_text) @@ -145,7 +145,7 @@ def test_210_tns_preview_on_simulator_and_emulator_livesync(self): # Preview on simulator Preview.run_url(url=url, device=self.sim) - strings = TnsLogs.preview_initial_messages(platform=Platform.IOS) + strings = TnsLogs.preview_initial_messages(device=self.sim) TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings) self.sim.wait_for_text(text=Changes.JSHelloWord.JS.old_text) @@ -162,8 +162,8 @@ def test_210_tns_preview_on_simulator_and_emulator_livesync(self): log = File.read(result.log_file) log = File.extract_part_of_text(log, '[VERIFIED]') # Verify files are synced once - TnsAssert.file_is_synced_once(log, Platform.ANDROID, 'main-view-model.js') - TnsAssert.file_is_synced_once(log, Platform.IOS, 'main-view-model.js') + TnsAssert.file_is_synced_once(log, device=self.emu, file_name='main-view-model.js') + TnsAssert.file_is_synced_once(log, device=self.sim, file_name='main-view-model.js') # Mark that part of the log as verified before next sync File.append(result.log_file, '[VERIFIED]') @@ -177,8 +177,8 @@ def test_210_tns_preview_on_simulator_and_emulator_livesync(self): log = File.read(result.log_file) log = File.extract_part_of_text(log, '[VERIFIED]') # Verify files are synced once - TnsAssert.file_is_synced_once(log, Platform.ANDROID, 'main-page.xml') - TnsAssert.file_is_synced_once(log, Platform.IOS, 'main-page.xml') + TnsAssert.file_is_synced_once(log, device=self.emu, file_name='main-page.xml') + TnsAssert.file_is_synced_once(log, device=self.sim, file_name='main-page.xml') def test_240_tns_preview_android_verify_plugin_warnings(self): """ diff --git a/tests/runtimes/android/abi_split_with_snapshot_arm64_tests.py b/tests/runtimes/android/abi_split_with_snapshot_arm64_tests.py index dc0c050f..963ff42d 100644 --- a/tests/runtimes/android/abi_split_with_snapshot_arm64_tests.py +++ b/tests/runtimes/android/abi_split_with_snapshot_arm64_tests.py @@ -32,7 +32,7 @@ def setUpClass(cls): device_id = device if device_id is not None: cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID, - version=Adb.get_version(device_id)) + version=Adb.get_version(device_id), model=None) Adb.uninstall(cls.app_id, device_id, assert_success=False) def test_202_run_app_with_abi_split_and_snapshot_on_64_phone(self): diff --git a/tests/runtimes/android/abi_split_with_snapshot_arm_tests.py b/tests/runtimes/android/abi_split_with_snapshot_arm_tests.py index 5fac3fa6..c63b245a 100644 --- a/tests/runtimes/android/abi_split_with_snapshot_arm_tests.py +++ b/tests/runtimes/android/abi_split_with_snapshot_arm_tests.py @@ -32,7 +32,7 @@ def setUpClass(cls): device_id = device if device_id is not None: cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID, - version=Adb.get_version(device_id)) + version=Adb.get_version(device_id), model=None) Adb.uninstall(cls.app_id, device_id, assert_success=False) def test_201_run_app_with_abi_split_and_snapshot_on_32_phone(self): diff --git a/tests/runtimes/android/abi_split_with_snapshot_tests.py b/tests/runtimes/android/abi_split_with_snapshot_tests.py index 62763a01..6a6446f8 100644 --- a/tests/runtimes/android/abi_split_with_snapshot_tests.py +++ b/tests/runtimes/android/abi_split_with_snapshot_tests.py @@ -37,7 +37,7 @@ def setUpClass(cls): device_id = device if device_id is not None: cls.device = Device(id=device_id, name=device_id, type=DeviceType.ANDROID, - version=Adb.get_version(device_id)) + version=Adb.get_version(device_id), model=None) Adb.uninstall(cls.app_id, device_id, assert_success=False) Tns.platform_add_android(APP_NAME, framework_path=Android.FRAMEWORK_PATH)