Skip to content

Commit 932ed51

Browse files
console logs
1 parent 9626cb2 commit 932ed51

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

core/utils/device/device.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,21 @@ def __init__(self, id, name, type, model, version):
2626
self.type = type
2727
self.version = version
2828
self.model = model
29+
self.name = name
2930

3031
if type is DeviceType.IOS:
3132
type = run(cmd="ideviceinfo | grep ProductType").output
3233
type = type.replace(',', '')
3334
type = type.replace('ProductType:', '').strip(' ')
3435
self.name = type
35-
self.model = type
36-
if type is DeviceType.ANDROID:
37-
self.name = name
38-
model = run(cmd="adb shell getprop ro.product.model").output
36+
if type is DeviceType.SIM:
37+
self.model = name
38+
if type is DeviceType.EMU:
39+
cmd = 'shell getprop ro.product.model'
40+
model = Adb.run_adb_command(command=cmd, wait=True).output
3941
self.model= model
42+
else:
43+
self.name = name
4044

4145
if type is DeviceType.SIM:
4246
self.device_log_file = Simctl.get_log_file(self.id)

data/sync/hello_world_js.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def preview_sync_hello_world_js_ts(app_type, app_name, platform, device, bundle=
191191

192192
# Edit CSS file and verify changes are applied
193193
Sync.replace(app_name=app_name, change_set=css_change)
194-
strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle,
194+
strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, device=device,
195195
hmr=hmr, file_name='app.css', instrumented=instrumented)
196196
if hmr and instrumented and Settings.HOST_OS != OSType.WINDOWS:
197197
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings,
@@ -202,7 +202,7 @@ def preview_sync_hello_world_js_ts(app_type, app_name, platform, device, bundle=
202202

203203
# Edit JS file and verify changes are applied
204204
Sync.replace(app_name=app_name, change_set=js_change)
205-
strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, hmr=hmr,
205+
strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, hmr=hmr, device=device,
206206
file_name=js_file, instrumented=instrumented)
207207
if hmr and instrumented and Settings.HOST_OS != OSType.WINDOWS:
208208
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings,
@@ -213,7 +213,7 @@ def preview_sync_hello_world_js_ts(app_type, app_name, platform, device, bundle=
213213

214214
# Edit XML file and verify changes are applied
215215
Sync.replace(app_name=app_name, change_set=xml_change)
216-
strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle,
216+
strings = TnsLogs.preview_file_changed_messages(platform=platform, bundle=bundle, device=device,
217217
hmr=hmr, file_name='main-page.xml', instrumented=instrumented)
218218
if hmr and instrumented and Settings.HOST_OS != OSType.WINDOWS:
219219
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings,

products/nativescript/tns_logs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,25 +246,25 @@ def __webpack_messages():
246246
'Webpack build done!']
247247

248248
@staticmethod
249-
def preview_initial_messages(platform, device, bundle=True, hmr=False, instrumented=False):
250-
logs = ['Start sending initial files for platform {0}'.format(str(device.model)),
251-
'Successfully sent initial files for platform {0}'.format(str(device.model))]
249+
def preview_initial_messages(device, bundle=True, hmr=False, instrumented=False):
250+
logs = ["Start sending initial files for device \'{0}\'".format(str(device.model)),
251+
"Successfully sent initial files for device \'{0}\'".format(str(device.model))]
252252
if bundle or hmr:
253253
logs.extend(TnsLogs.__webpack_messages())
254254
if instrumented:
255255
logs.append('QA: Application started')
256256
return logs
257257

258258
@staticmethod
259-
def preview_file_changed_messages(platform, device, file_name, run_type=RunType.INCREMENTAL,
259+
def preview_file_changed_messages(device, file_name, run_type=RunType.INCREMENTAL,
260260
bundle=True, hmr=True, instrumented=False):
261-
logs = ['Start syncing changes for platform {0}'.format(str(platform))]
261+
logs = ["Start syncing changes for device \'{0}\'".format(str(device.model))]
262262
if bundle or hmr:
263263
logs.extend(TnsLogs.__webpack_messages())
264264
logs.append(file_name)
265265
else:
266266
logs.append('Successfully synced')
267-
logs.append('{0} for platform {1}'.format(file_name.replace('.ts', '.js'), str(platform)))
267+
logs.append('{0} for device {1}'.format(file_name.replace('.ts', '.js'), str(device.model)))
268268
if hmr:
269269
logs.append('hot-update.json')
270270
logs.append('HMR: Checking for updates to the bundle with hmr hash')

tests/cli/preview/templates/hello_word_js_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setUpClass(cls):
3131
cls.emu_API24 = DeviceManager.Emulator.ensure_available(Settings.Emulators.EMU_API_24)
3232

3333
# Download Preview and Playground packages
34-
# Preview.get_app_packages()
34+
Preview.get_app_packages()
3535

3636
# Install Preview and Playground
3737
Preview.install_preview_app(cls.emu, Platform.ANDROID)

0 commit comments

Comments
 (0)