|
27 | 27 | from core.osutils.folder import Folder
|
28 | 28 | from core.osutils.os_type import OSType
|
29 | 29 | from core.settings.settings import ANDROID_RUNTIME_PATH, ANDROID_KEYSTORE_PATH, ANDROID_KEYSTORE_PASS, \
|
30 |
| - ANDROID_KEYSTORE_ALIAS, ANDROID_KEYSTORE_ALIAS_PASS, EMULATOR_ID, EMULATOR_NAME, CURRENT_OS |
| 30 | + ANDROID_KEYSTORE_ALIAS, ANDROID_KEYSTORE_ALIAS_PASS, EMULATOR_ID, EMULATOR_NAME, CURRENT_OS, TEST_RUN_HOME |
31 | 31 | from core.settings.strings import cannot_resolve_device, list_devices
|
32 | 32 | from core.tns.replace_helper import ReplaceHelper
|
33 | 33 | from core.tns.tns import Tns
|
@@ -179,6 +179,7 @@ def test_100_tns_run_android_release(self):
|
179 | 179 | def test_200_tns_run_android_break_and_fix_app(self):
|
180 | 180 | """
|
181 | 181 | Make changes in xml that break the app and then changes that fix the app.
|
| 182 | + Add/remove js files that break the app and then fix it. |
182 | 183 | """
|
183 | 184 |
|
184 | 185 | log = Tns.run_android(attributes={'--path': self.app_name, '--device': EMULATOR_ID}, wait=False,
|
@@ -208,6 +209,22 @@ def test_200_tns_run_android_break_and_fix_app(self):
|
208 | 209 | Device.screen_match(device_name=EMULATOR_NAME, device_id=EMULATOR_ID,
|
209 | 210 | expected_image='livesync-hello-world_home')
|
210 | 211 |
|
| 212 | + # Move js files |
| 213 | + app_js_original_path = src=os.path.join(self.app_name, 'app', 'app.js') |
| 214 | + app_js_new_path = src = os.path.join(TEST_RUN_HOME, 'app.js') |
| 215 | + File.copy(src=app_js_original_path, dest=app_js_new_path) |
| 216 | + File.remove(file_path=app_js_original_path) |
| 217 | + strings = ['Successfully synced application', EMULATOR_ID] |
| 218 | + Tns.wait_for_log(log_file=log, string_list=strings, timeout=30, check_interval=10) |
| 219 | + |
| 220 | + File.copy(src=app_js_new_path, dest=app_js_original_path) |
| 221 | + strings = ['Successfully synced application', 'app.js', EMULATOR_ID] |
| 222 | + Tns.wait_for_log(log_file=log, string_list=strings, timeout=30, check_interval=10) |
| 223 | + |
| 224 | + # Verify app looks correct inside emulator |
| 225 | + Device.screen_match(device_name=EMULATOR_NAME, device_id=EMULATOR_ID, |
| 226 | + expected_image='livesync-hello-world_home') |
| 227 | + |
211 | 228 | def test_210_tns_run_android_add_remove_files_and_folders(self):
|
212 | 229 | """
|
213 | 230 | New files and folders should be synced properly.
|
|
0 commit comments