Skip to content

Commit e26dc76

Browse files
Vasil ChimevVasil Chimev
Vasil Chimev
authored and
Vasil Chimev
committed
Fix LiveSync Android emulator tests.
1 parent 50eaeba commit e26dc76

File tree

1 file changed

+17
-35
lines changed

1 file changed

+17
-35
lines changed

tests/livesync_linux.py

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
from helpers._os_lib import CleanupFolder, replace, catAppFile
55
from helpers._tns_lib import androidRuntimePath, \
66
CreateProjectAndAddPlatform, LiveSync, Run
7-
from helpers.device import GivenRunningEmulator, StopEmulators
7+
from helpers.device import GivenRunningEmulator, \
8+
StopEmulators, StopSimulators
89

910
class LiveSync_Linux(unittest.TestCase):
1011

1112
# LiveSync Tests on Android Emulator
1213

1314
@classmethod
1415
def setUpClass(cls):
15-
super(LiveSync_Linux, cls).setUpClass()
16+
StopEmulators()
17+
StopSimulators()
1618

1719
def setUp(self):
1820

@@ -30,18 +32,24 @@ def tearDown(self):
3032

3133
@classmethod
3234
def tearDownClass(cls):
33-
super(LiveSync_Linux, cls).tearDownClass()
3435
StopEmulators()
3536

36-
def test_001_LiveSync_Android_XmlFile(self):
37+
def test_001_LiveSync_Android_XmlJsCss_Files(self):
3738
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
3839
Run(platform="android", path="TNS_App")
3940

4041
replace("TNS_App/app/main-page.xml", "TAP", "TEST")
42+
replace("TNS_App/app/main-view-model.js", "taps", "clicks")
43+
replace("TNS_App/app/app.css", "30", "20")
44+
4145
LiveSync(platform="android", path="TNS_App")
4246

4347
output = catAppFile("android", "TNSApp", "app/main-page.xml")
4448
assert ("<Button text=\"TEST\" tap=\"{{ tapAction }}\" />" in output)
49+
output = catAppFile("android", "TNSApp", "app/main-view-model.js")
50+
assert ("this.set(\"message\", this.counter + \" clicks left\");" in output)
51+
output = catAppFile("android", "TNSApp", "app/app.css")
52+
assert ("font-size: 20;" in output)
4553

4654
def test_002_LiveSync_Android_Device_XmlFile(self):
4755
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
@@ -102,46 +110,20 @@ def test_004_LiveSync_Android_Watch(self):
102110
print "force killing child ..."
103111
pr.kill()
104112

105-
def test_011_LiveSync_Android_JsFile(self):
106-
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
107-
Run(platform="android", path="TNS_App")
108-
109-
replace("TNS_App/app/main-view-model.js", "taps", "clicks")
110-
LiveSync(platform="android", path="TNS_App")
111-
112-
output = catAppFile("android", "TNSApp", "app/main-view-model.js")
113-
assert ("this.set(\"message\", this.counter + \" clicks left\");" in output)
114-
115-
def test_012_LiveSync_Android_CssFile(self):
116-
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
117-
Run(platform="android", path="TNS_App")
118-
119-
replace("TNS_App/app/app.css", "30", "20")
120-
LiveSync(platform="android", path="TNS_App")
121-
122-
output = catAppFile("android", "TNSApp", "app/app.css")
123-
assert ("font-size: 20;" in output)
124-
125-
def test_013_LiveSync_Android_TnsModules_File(self):
126-
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
127-
Run(platform="android", path="TNS_App")
128-
129-
replace("TNS_App/node_modules/tns-core-modules/application/application-common.js", "(\"globals\");", "(\"globals\"); // test")
130-
LiveSync(platform="android", path="TNS_App")
131-
132-
output = catAppFile("android", "TNSApp", "app/tns_modules/application/application-common.js")
133-
assert ("require(\"globals\"); // test" in output)
134-
135-
def test_014_LiveSync_Android_TnsModules_LICENSE(self):
113+
def test_011_LiveSync_Android_TnsModules_Files(self):
136114
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
137115
Run(platform="android", path="TNS_App")
138116

139117
replace("TNS_App/node_modules/tns-core-modules/LICENSE", "2015", "9999")
118+
replace("TNS_App/node_modules/tns-core-modules/application/application-common.js", "(\"globals\");", "(\"globals\"); // test")
140119
LiveSync(platform="android", path="TNS_App")
141120

142121
output = catAppFile("android", "TNSApp", "app/tns_modules/LICENSE")
143122
assert ("Copyright (c) 9999 Telerik AD" in output)
144123

124+
output = catAppFile("android", "TNSApp", "app/tns_modules/application/application-common.js")
125+
assert ("require(\"globals\"); // test" in output)
126+
145127
def test_021_LiveSync_Android_AddNewFiles(self):
146128
CreateProjectAndAddPlatform(projName="TNS_App", platform="android", frameworkPath=androidRuntimePath)
147129
Run(platform="android", path="TNS_App")

0 commit comments

Comments
 (0)