From d325f1348b5e4d72db79712dc694dcb924e751d1 Mon Sep 17 00:00:00 2001 From: Dimitar Topuzov Date: Wed, 6 Mar 2019 10:31:23 +0200 Subject: [PATCH] fix: base tests for test command on TnsRunTest (#66) * fix: qunit tests Workaround https://github.com/NativeScript/nativescript-cli/issues/4390 by manually installing correct `karma-qunit` * fix: enable commented tests * refactor: migrate to TnsRunTest * chore: remove hacks to handle qunit * fix: unused imports --- tests/cli/test/test_test.py | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/tests/cli/test/test_test.py b/tests/cli/test/test_test.py index 23452000..83dde669 100644 --- a/tests/cli/test/test_test.py +++ b/tests/cli/test/test_test.py @@ -5,13 +5,11 @@ from parameterized import parameterized -from core.base_test.tns_test import TnsTest +from core.base_test.tns_run_test import TnsRunTest from core.enums.framework_type import FrameworkType from core.enums.os_type import OSType from core.enums.platform_type import Platform -from core.log.log import Log from core.settings import Settings -from core.utils.device.device_manager import DeviceManager from core.utils.npm import Npm from data.templates import Template from products.nativescript.tns import Tns @@ -49,21 +47,7 @@ def get_data(): # noinspection PyMethodMayBeStatic,PyUnusedLocal -class TestsForTnsTest(TnsTest): - - @classmethod - def setUpClass(cls): - TnsTest.setUpClass() - cls.emu = DeviceManager.Emulator.ensure_available(Settings.Emulators.DEFAULT) - if Settings.HOST_OS is OSType.OSX: - cls.sim = DeviceManager.Simulator.ensure_available(Settings.Simulators.DEFAULT) - - def setUp(self): - TnsTest.setUp(self) - - @classmethod - def tearDownClass(cls): - TnsTest.tearDownClass() +class TestsForTnsTest(TnsRunTest): @parameterized.expand(get_data()) def test_100(self, title, framework, template, platform): @@ -89,12 +73,7 @@ def test_100(self, title, framework, template, platform): Tns.test_init(app_name=APP_NAME, framework=framework) # Run Tests - if Settings.HOST_OS != OSType.WINDOWS: - Tns.test(app_name=APP_NAME, platform=Platform.ANDROID, emulator=True, justlaunch=True) - # TODO: Modify hello-world test with some real test (importing modules) and run the test again. - else: - Log.info('Due to unknown issues --justlauch do not exit on Windows when tests are executed on Jenkins!') - # TODO: Fix it! + Tns.test(app_name=APP_NAME, platform=Platform.ANDROID, emulator=True, justlaunch=True) def test_400_invalid_framework_name(self): result = Tns.create(app_name=APP_NAME, template=Template.MIN_JS.local_package, update=False, verify=False)