Skip to content

Commit 2ce9ffa

Browse files
add new test (#163)
1 parent 330c029 commit 2ce9ffa

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

tests/templates/templates_tests.py

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""
2+
Verify getting started templates looks ok
3+
"""
4+
import os
5+
6+
from core.base_class.BaseClass import BaseClass
7+
from core.osutils.command import run
8+
from core.device.emulator import Emulator
9+
from core.device.simulator import Simulator
10+
from core.osutils.folder import Folder
11+
from core.settings.settings import ANDROID_PACKAGE, EMULATOR_ID, IOS_PACKAGE, SIMULATOR_NAME, TEST_RUN_HOME
12+
from core.tns.tns import Tns
13+
from core.git.git import Git
14+
15+
class TemplatesTests(BaseClass):
16+
@classmethod
17+
def setUpClass(cls):
18+
BaseClass.setUpClass(cls.__name__)
19+
Emulator.stop()
20+
Simulator.stop()
21+
Emulator.ensure_available()
22+
cls.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
23+
Folder.cleanup(cls.app_name)
24+
25+
def setUp(self):
26+
BaseClass.setUp(self)
27+
28+
def tearDown(self):
29+
Tns.kill()
30+
BaseClass.tearDown(self)
31+
Folder.cleanup('template-hello-world')
32+
33+
@classmethod
34+
def tearDownClass(cls):
35+
BaseClass.tearDownClass()
36+
Emulator.stop()
37+
38+
def test_001_template_v2_create_project_local_path(self):
39+
#https://github.com/NativeScript/nativescript-cli/pull/3793
40+
41+
Git.clone_repo(repo_url='[email protected]:NativeScript/template-hello-world.git',
42+
local_folder="template-hello-world")
43+
Folder.navigate_to(folder="template-hello-world")
44+
output = run(command="npm pack")
45+
Folder.navigate_to(folder=TEST_RUN_HOME, relative_from_current_folder=False)
46+
47+
Tns.create_app(self.app_name, attributes={'--template': os.path.join('template-hello-world',
48+
'tns-template-hello-world-4.2.0.tgz')})

0 commit comments

Comments
 (0)