|
| 1 | +import os |
1 | 2 | import unittest
|
2 | 3 |
|
3 | 4 | from core.base_class.BaseClass import BaseClass
|
|
6 | 7 | from core.device.simulator import Simulator
|
7 | 8 | from core.npm.npm import Npm
|
8 | 9 | from core.osutils.file import File
|
| 10 | +from core.osutils.folder import Folder |
9 | 11 | from core.osutils.os_type import OSType
|
10 | 12 | from core.settings.settings import ANDROID_KEYSTORE_PATH, \
|
11 | 13 | ANDROID_KEYSTORE_PASS, ANDROID_KEYSTORE_ALIAS, ANDROID_KEYSTORE_ALIAS_PASS, EMULATOR_ID, CURRENT_OS, \
|
@@ -65,6 +67,11 @@ def apply_changes(app_name, log, platform, aot=False):
|
65 | 67 | text_changed = Device.wait_for_text(device_id=EMULATOR_ID, text='Stegen Ter', timeout=20)
|
66 | 68 | assert text_changed, 'Changes in JS file not applied (UI is not refreshed).'
|
67 | 69 |
|
| 70 | + plugin_path = os.path.join(app_name, 'node_modules', 'nativescript-camera') |
| 71 | + if Folder.exists(plugin_path): |
| 72 | + assert "Building project" not in log, "Unexpected build was triggered." |
| 73 | + assert "Gradle build" not in log, "Unexpected gradle build was triggered." |
| 74 | + |
68 | 75 | ReplaceHelper.replace(app_name, WebPackHelloWorldNG.html_change, sleep=10)
|
69 | 76 | if aot:
|
70 | 77 | Tns.wait_for_log(log_file=log, string_list=['main.aot.ts'], clean_log=False)
|
@@ -270,3 +277,21 @@ def test_220_run_ios_with_bundle_uglify_aot_sync_changes(self):
|
270 | 277 |
|
271 | 278 | self.apply_changes(app_name=self.app_name, log=log, platform=Platform.IOS, aot=True)
|
272 | 279 | self.revert_changes(app_name=self.app_name, log=log, platform=Platform.IOS, aot=True)
|
| 280 | + |
| 281 | + def test_230_run_android_with_bundle_add_plugin_sync_changes(self): |
| 282 | + """ |
| 283 | + https://github.com/NativeScript/nativescript-cli/issues/3707 |
| 284 | + """ |
| 285 | + |
| 286 | + Tns.plugin_add("nativescript-camera", attributes={"--path": self.app_name}) |
| 287 | + |
| 288 | + log = Tns.run_android(attributes={'--path': self.app_name, |
| 289 | + "--bundle": "", |
| 290 | + '--device': EMULATOR_ID}, wait=False, assert_success=False) |
| 291 | + Tns.wait_for_log(log_file=log, string_list=Helpers.wp_run, not_existing_string_list=Helpers.wp_errors, |
| 292 | + timeout=240, check_interval=10) |
| 293 | + Helpers.android_screen_match(image=self.image_original, timeout=120) |
| 294 | + Helpers.wait_webpack_watcher() |
| 295 | + |
| 296 | + self.apply_changes(app_name=self.app_name, log=log, platform=Platform.ANDROID) |
| 297 | + self.revert_changes(app_name=self.app_name, log=log, platform=Platform.ANDROID) |
0 commit comments