|
20 | 20 |
|
21 | 21 |
|
22 | 22 | def sync_master_detail_vue(app_name, platform, device):
|
23 |
| - # Execute tns command |
24 |
| - log_trace = False |
| 23 | + # workaraund for appium restarting application when attaching |
25 | 24 | if platform == Platform.IOS:
|
26 |
| - # Temporary add log trace on iOS to debug an issue |
27 |
| - log_trace = True |
28 |
| - result = Tns.run(app_name=app_name, platform=platform, emulator=True, log_trace=log_trace, wait=False) |
29 |
| - strings = TnsLogs.run_messages(app_name=app_name, platform=platform, run_type=RunType.FULL, app_type=AppType.VUE, |
30 |
| - transfer_all=True) |
31 |
| - TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=360) |
| 25 | + result = Tns.run(app_name=app_name, emulator=True, platform=platform, just_launch=True) |
| 26 | + strings = TnsLogs.run_messages(app_name=app_name, platform=platform, |
| 27 | + run_type=RunType.JUST_LAUNCH, device=device, just_launch=True) |
| 28 | + TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=360) |
| 29 | + device.wait_for_text(text="Ford KA") |
| 30 | + # start appium driver (need it on iOS only) |
| 31 | + appium = AppiumDriver(platform=platform, device=device, bundle_id=TnsPaths.get_bundle_id(app_name)) |
32 | 32 |
|
33 |
| - # start appium driver (need it on iOS only) |
34 |
| - appium = None |
| 33 | + result = Tns.run(app_name=app_name, platform=platform, emulator=True, wait=False) |
35 | 34 | if platform == Platform.IOS:
|
36 |
| - appium = AppiumDriver(platform=platform, device=device, bundle_id=TnsPaths.get_bundle_id(app_name)) |
| 35 | + # because of workaround for appium this run is not first run on ios |
| 36 | + strings = TnsLogs.run_messages(app_name=app_name, platform=platform, run_type=RunType.INCREMENTAL, |
| 37 | + app_type=AppType.VUE, transfer_all=True) |
| 38 | + strings.remove('Refreshing application on device') |
| 39 | + strings.append('Restarting application on device') |
| 40 | + else: |
| 41 | + strings = TnsLogs.run_messages(app_name=app_name, platform=platform, run_type=RunType.FULL, |
| 42 | + app_type=AppType.VUE, transfer_all=True) |
| 43 | + |
| 44 | + TnsLogs.wait_for_log(log_file=result.log_file, string_list=strings, timeout=360) |
37 | 45 |
|
38 | 46 | # Verify app home page looks properly
|
39 | 47 | device.wait_for_text(text="Ford KA")
|
@@ -89,5 +97,7 @@ def sync_master_detail_vue(app_name, platform, device):
|
89 | 97 | device.wait_for_text(text=Changes.MasterDetailVUE.VUE_DETAIL_PAGE_TEMPLATE.new_text)
|
90 | 98 |
|
91 | 99 | # Kill Appium
|
92 |
| - if appium is not None: |
93 |
| - appium.stop() |
| 100 | + if platform == Platform.IOS: |
| 101 | + # Kill Appium |
| 102 | + if appium is not None: |
| 103 | + appium.stop() |
0 commit comments