|
2 | 2 |
|
3 | 3 | from nose_parameterized import parameterized
|
4 | 4 |
|
| 5 | +from const import Colors |
5 | 6 | from core.base_test.tns_test import TnsTest
|
6 | 7 | from core.enums.env import EnvironmentType
|
7 | 8 | from core.enums.os_type import OSType
|
|
11 | 12 | from data.templates import Template
|
12 | 13 | from products.nativescript.app import App
|
13 | 14 | from products.nativescript.tns import Tns
|
| 15 | +from utils.device.adb import Adb |
14 | 16 |
|
15 | 17 |
|
16 | 18 | # noinspection PyUnusedLocal
|
@@ -75,19 +77,26 @@ def test(self, template_name, template_info):
|
75 | 77 | if Settings.ENV != EnvironmentType.LIVE:
|
76 | 78 | App.update(app_name=app_name)
|
77 | 79 |
|
| 80 | + # Run Android with bundle |
| 81 | + Adb.open_home(id=self.emu.id) |
| 82 | + Tns.run_android(app_name=app_name, device=self.emu.id, bundle=True) |
| 83 | + self.emu.wait_for_main_color(color=Colors.WHITE) |
| 84 | + if template_info.texts is not None: |
| 85 | + for text in template_info.texts: |
| 86 | + self.emu.wait_for_text(text=text, timeout=30) |
| 87 | + |
| 88 | + # Run iOS with bundle |
| 89 | + if Settings.HOST_OS is OSType.OSX: |
| 90 | + Tns.run_ios(app_name=app_name, device=self.sim.id, bundle=True) |
| 91 | + self.sim.wait_for_main_color(color=Colors.WHITE) |
| 92 | + if template_info.texts is not None: |
| 93 | + for text in template_info.texts: |
| 94 | + self.sim.wait_for_text(text=text, timeout=30) |
| 95 | + |
78 | 96 | # Build in release
|
79 | 97 | Tns.build_android(app_name=app_name, release=True, bundle=True, aot=True, uglify=True, snapshot=True)
|
80 | 98 | if Settings.HOST_OS is OSType.OSX:
|
81 | 99 | Tns.build_ios(app_name=app_name, release=True, for_device=True, bundle=True, aot=True, uglify=True)
|
82 | 100 |
|
83 |
| - # Run with bundle |
84 |
| - Tns.run_android(app_name=app_name, device=self.emu.id, bundle=True, justlaunch=True, wait=True) |
85 |
| - for text in template_info.texts: |
86 |
| - self.emu.wait_for_text(text=text, timeout=30) |
87 |
| - if Settings.HOST_OS is OSType.OSX: |
88 |
| - Tns.run_ios(app_name=app_name, device=self.sim.id, bundle=True, justlaunch=True, wait=True) |
89 |
| - for text in template_info.texts: |
90 |
| - self.sim.wait_for_text(text=text, timeout=30) |
91 |
| - |
92 | 101 | # Cleanup
|
93 | 102 | Folder.clean(local_path)
|
0 commit comments