Skip to content

Commit f277882

Browse files
committed
chore: assert error not in create output
- Assert "Error:" not in tns create output - Assert exit code - Add missing docs for params
1 parent 70e1757 commit f277882

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

products/nativescript/tns.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
from core.log.log import Log
1111
from core.settings import Settings
1212
from core.utils.file_utils import Folder, File
13+
from core.utils.json_utils import JsonUtils
1314
from core.utils.npm import Npm
1415
from core.utils.process import Process
1516
from core.utils.run import run
16-
from core.utils.json_utils import JsonUtils
1717
from products.nativescript.app import App
1818
from products.nativescript.tns_assert import TnsAssert
1919
from products.nativescript.tns_logs import TnsLogs
@@ -47,6 +47,8 @@ def exec_command(command, cwd=Settings.TEST_RUN_HOME, platform=Platform.NONE, em
4747
:param log_trace: If not None pass `--log <level>` to command.
4848
:param just_launch: If true pass `--justlaunch` to command.
4949
:param sync_all_files: If true pass `--syncAllFiles` to command.
50+
:param aab: If true pass `--aab` to command.
51+
:param compile_snapshot: If true pass `--env.compileSnapshot` to command.
5052
:param clean: If true pass `--clean` to command.
5153
:param options: Pass additional options as string.
5254
:param wait: If true it will wait until command is complete.
@@ -166,6 +168,8 @@ def create(app_name=Settings.AppName.DEFAULT, template=None, path=None, app_id=N
166168

167169
# Verify app is created properly
168170
if verify:
171+
# Verify exit code
172+
assert result.exit_code == 0, "Exit code of tns create is not 0."
169173
# Usually we do not pass path on tns create, which actually equals to cwd.
170174
# In such cases pass correct path to TnsAssert.created()
171175
if path is None:
@@ -451,6 +455,7 @@ def preview(app_name, bundle=True, hmr=True, log_trace=False, verify=True, timeo
451455
:param log_trace: If true pass --log trace.
452456
:param verify: If true verify some logs.
453457
:param timeout: Timeout in seconds.
458+
:param options: Pass additional options.
454459
:return: Result of `tns preview` command.
455460
"""
456461
result = Tns.exec_command(command='preview', path=app_name, bundle=bundle, hmr=hmr, wait=False,
@@ -490,6 +495,7 @@ def test(app_name, platform, emulator=True, device=None, just_launch=True, verif
490495
:param device: Pass `--device <value>` to command.
491496
:param just_launch: If true pass `--just_launch` to the command.
492497
:param verify: Verify command was executed successfully.
498+
:param wait: Wait command to complete it `true`.
493499
:return: Result of `tns test` command.
494500
"""
495501
cmd = 'test {0}'.format(str(platform))

products/nativescript/tns_assert.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME, w
3535

3636
# Assert output
3737
if output is not None:
38+
assert 'Error:' not in output
3839
assert 'Now you can navigate to your project with $ cd' in output
3940
assert 'After that you can preview it on device by executing $ tns preview' in output
4041
assert 'After that you can run it on device/emulator by executing $ tns run <platform>' not in output

0 commit comments

Comments
 (0)