Skip to content

Commit 69c5082

Browse files
author
Nataliya Hristova
authored
Add test for cli issue 3707 (#154)
1 parent d91c251 commit 69c5082

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/webpack/hello_world_ng_tests.py

+25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import unittest
23

34
from core.base_class.BaseClass import BaseClass
@@ -6,6 +7,7 @@
67
from core.device.simulator import Simulator
78
from core.npm.npm import Npm
89
from core.osutils.file import File
10+
from core.osutils.folder import Folder
911
from core.osutils.os_type import OSType
1012
from core.settings.settings import ANDROID_KEYSTORE_PATH, \
1113
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):
6567
text_changed = Device.wait_for_text(device_id=EMULATOR_ID, text='Stegen Ter', timeout=20)
6668
assert text_changed, 'Changes in JS file not applied (UI is not refreshed).'
6769

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+
6875
ReplaceHelper.replace(app_name, WebPackHelloWorldNG.html_change, sleep=10)
6976
if aot:
7077
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):
270277

271278
self.apply_changes(app_name=self.app_name, log=log, platform=Platform.IOS, aot=True)
272279
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

Comments
 (0)