diff --git a/products/nativescript/tns_assert.py b/products/nativescript/tns_assert.py index a8cc9d45..e346c266 100644 --- a/products/nativescript/tns_assert.py +++ b/products/nativescript/tns_assert.py @@ -12,13 +12,14 @@ class TnsAssert(object): @staticmethod - def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME): + def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME, theme=True): """ Verify app is created properly. :param app_name: Name of the app. :param output: Console output of `tns create` command. :param app_data: AppInfo object. :param path: Base path where app is created. + :param theme: If true it will verify default {N} theme is installed. """ # Assert app exists app_path = os.path.join(path, app_name) @@ -40,7 +41,8 @@ def created(app_name, output=None, app_data=None, path=Settings.TEST_RUN_HOME): assert File.exists(os.path.join(node_path, 'tns-core-modules', 'tns-core-modules.d.ts')) # Verify {N} core theme is installed - assert Folder.exists(os.path.join(node_path, 'nativescript-theme-core')), '{N} theme do not exists in app.' + if theme: + assert Folder.exists(os.path.join(node_path, 'nativescript-theme-core')), '{N} theme do not exists.' # Verify webpack is installed before_watch_hooks = os.path.join(app_path, 'hooks', 'before-watch') diff --git a/tests/code_sharing/ng_new_tests.py b/tests/code_sharing/ng_new_tests.py index f3ea9e1e..facf10a4 100644 --- a/tests/code_sharing/ng_new_tests.py +++ b/tests/code_sharing/ng_new_tests.py @@ -104,7 +104,12 @@ def create_and_run(shared=True, sample=False, theme=True, style=None, prefix=Non # Create shared project with sample data result = NG.new(collection=NS_SCHEMATICS, project=NGNewTests.app_name, theme=theme, shared=shared, sample=sample, style=style, prefix=prefix, source_dir=source_dir, webpack=webpack) - TnsAssert.created(app_name=NGNewTests.app_name, app_data=app_data) + + # Verify valid {N} app is created + theme = True + if style is None: + theme = False + TnsAssert.created(app_name=NGNewTests.app_name, app_data=app_data, theme=theme) assert 'Directory is already under version control. Skipping initialization of git.' in result.output, \ 'Git init should be skipped because app is created already existing repo (the one with tests).'