Skip to content

chore: assert error not in create output #440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion products/nativescript/tns.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from core.log.log import Log
from core.settings import Settings
from core.utils.file_utils import Folder, File
from core.utils.json_utils import JsonUtils
from core.utils.npm import Npm
from core.utils.process import Process
from core.utils.run import run
from core.utils.json_utils import JsonUtils
from products.nativescript.app import App
from products.nativescript.tns_assert import TnsAssert
from products.nativescript.tns_logs import TnsLogs
Expand Down Expand Up @@ -47,6 +47,8 @@ def exec_command(command, cwd=Settings.TEST_RUN_HOME, platform=Platform.NONE, em
:param log_trace: If not None pass `--log <level>` to command.
:param just_launch: If true pass `--justlaunch` to command.
:param sync_all_files: If true pass `--syncAllFiles` to command.
:param aab: If true pass `--aab` to command.
:param compile_snapshot: If true pass `--env.compileSnapshot` to command.
:param clean: If true pass `--clean` to command.
:param options: Pass additional options as string.
:param wait: If true it will wait until command is complete.
Expand Down Expand Up @@ -166,6 +168,8 @@ def create(app_name=Settings.AppName.DEFAULT, template=None, path=None, app_id=N

# Verify app is created properly
if verify:
# Verify exit code
assert result.exit_code == 0, "Exit code of tns create is not 0."
# Usually we do not pass path on tns create, which actually equals to cwd.
# In such cases pass correct path to TnsAssert.created()
if path is None:
Expand Down Expand Up @@ -451,6 +455,7 @@ def preview(app_name, bundle=True, hmr=True, log_trace=False, verify=True, timeo
:param log_trace: If true pass --log trace.
:param verify: If true verify some logs.
:param timeout: Timeout in seconds.
:param options: Pass additional options.
:return: Result of `tns preview` command.
"""
result = Tns.exec_command(command='preview', path=app_name, bundle=bundle, hmr=hmr, wait=False,
Expand Down Expand Up @@ -490,6 +495,7 @@ def test(app_name, platform, emulator=True, device=None, just_launch=True, verif
:param device: Pass `--device <value>` to command.
:param just_launch: If true pass `--just_launch` to the command.
:param verify: Verify command was executed successfully.
:param wait: Wait command to complete it `true`.
:return: Result of `tns test` command.
"""
cmd = 'test {0}'.format(str(platform))
Expand Down
1 change: 1 addition & 0 deletions products/nativescript/tns_assert.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME, w

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