Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9626cb2

Browse files
committedNov 21, 2019
console logs
1 parent 9b143bc commit 9626cb2

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed
 

‎core/utils/device/device.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@
2121

2222
class Device(object):
2323
# noinspection PyShadowingBuiltins
24-
def __init__(self, id, name, type, version):
24+
def __init__(self, id, name, type, model, version):
2525
self.id = id
2626
self.type = type
2727
self.version = version
28+
self.model = model
2829

2930
if type is DeviceType.IOS:
3031
type = run(cmd="ideviceinfo | grep ProductType").output
3132
type = type.replace(',', '')
3233
type = type.replace('ProductType:', '').strip(' ')
3334
self.name = type
34-
else:
35+
self.model = type
36+
if type is DeviceType.ANDROID:
3537
self.name = name
38+
model = run(cmd="adb shell getprop ro.product.model").output
39+
self.model= model
3640

3741
if type is DeviceType.SIM:
3842
self.device_log_file = Simctl.get_log_file(self.id)

‎core/utils/device/device_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def start(emulator):
8383
booted = Adb.wait_until_boot(device_id=emulator.emu_id)
8484
if booted:
8585
Log.info('{0} is up and running!'.format(emulator.avd))
86-
device = Device(id=emulator.emu_id, name=emulator.avd, type=DeviceType.EMU, version=emulator.os_version)
86+
device = Device(id=emulator.emu_id, model=emulator.model, name=emulator.avd, type=DeviceType.EMU,
87+
version=emulator.os_version)
8788
TestContext.STARTED_DEVICES.append(device)
8889
return device
8990
else:
@@ -169,7 +170,7 @@ def start(simulator_info):
169170

170171
# Return result
171172
device = Device(id=simulator_info.id, name=simulator_info.name, type=DeviceType.SIM,
172-
version=simulator_info.sdk)
173+
version=simulator_info.sdk, model=simulator_info.id)
173174
TestContext.STARTED_DEVICES.append(device)
174175
return device
175176

‎core/utils/device/emulator_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# noinspection PyShadowingBuiltins
22
class EmulatorInfo(object):
3-
def __init__(self, avd=None, os_version=None, port=None, emu_id=None):
3+
def __init__(self, avd=None, os_version=None, port=None, emu_id=None, model=None):
44
self.avd = avd
55
self.os_version = os_version
66
self.port = port
77
self.emu_id = emu_id
8+
self.model = model

‎products/nativescript/preview_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def run_app(app_name, platform, device, bundle=True, hmr=True, instrumented=Fals
143143
device.click("Open")
144144

145145
# Verify logs
146-
strings = TnsLogs.preview_initial_messages(platform=platform, hmr=hmr, bundle=bundle, instrumented=instrumented)
146+
strings = TnsLogs.preview_initial_messages(platform=platform, device=device, hmr=hmr, bundle=bundle,
147+
instrumented=instrumented)
147148
TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=200)
148149
return result
149150

‎products/nativescript/tns_logs.py

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

248248
@staticmethod
249-
def preview_initial_messages(platform, bundle=True, hmr=False, instrumented=False):
250-
logs = ['Start sending initial files for platform {0}'.format(str(platform)),
251-
'Successfully sent initial files for platform {0}'.format(str(platform))]
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))]
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, file_name, run_type=RunType.INCREMENTAL,
259+
def preview_file_changed_messages(platform, device, file_name, run_type=RunType.INCREMENTAL,
260260
bundle=True, hmr=True, instrumented=False):
261261
logs = ['Start syncing changes for platform {0}'.format(str(platform))]
262262
if bundle or hmr:

‎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)
Please sign in to comment.