4
4
from helpers ._os_lib import CleanupFolder , replace , catAppFile
5
5
from helpers ._tns_lib import androidRuntimePath , \
6
6
CreateProjectAndAddPlatform , LiveSync , Run
7
- from helpers .device import GivenRealDeviceRunning , StopEmulators
7
+ from helpers .device import GivenRealDeviceRunning , StopEmulators , \
8
+ StopSimulators
8
9
9
10
class LiveSync_Android (unittest .TestCase ):
10
11
11
12
# LiveSync Tests on Android Device
12
13
13
14
@classmethod
14
15
def setUpClass (cls ):
15
- super (LiveSync_Android , cls ).setUpClass ()
16
16
StopEmulators ()
17
+ StopSimulators ()
17
18
18
19
def setUp (self ):
19
20
@@ -31,7 +32,7 @@ def tearDown(self):
31
32
32
33
@classmethod
33
34
def tearDownClass (cls ):
34
- super ( LiveSync_Android , cls ). tearDownClass ()
35
+ pass
35
36
36
37
def test_001_LiveSync_Android_XmlFile (self ):
37
38
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
@@ -92,46 +93,34 @@ def test_004_LiveSync_Android_Watch(self):
92
93
print "force killing child ..."
93
94
pr .kill ()
94
95
95
- def test_011_LiveSync_Android_JsFile (self ):
96
- CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
97
- Run (platform = "android" , path = "TNS_App" )
98
-
99
- replace ("TNS_App/app/main-view-model.js" , "taps" , "clicks" )
100
- LiveSync (platform = "android" , path = "TNS_App" )
101
-
102
- output = catAppFile ("android" , "TNSApp" , "app/main-view-model.js" )
103
- assert ("this.set(\" message\" , this.counter + \" clicks left\" );" in output )
104
-
105
- def test_012_LiveSync_Android_CssFile (self ):
96
+ def test_011_LiveSync_Android_CssJs_Files (self ):
106
97
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
107
98
Run (platform = "android" , path = "TNS_App" )
108
99
109
100
replace ("TNS_App/app/app.css" , "30" , "20" )
101
+ replace ("TNS_App/app/main-view-model.js" , "taps" , "clicks" )
110
102
LiveSync (platform = "android" , path = "TNS_App" )
111
103
112
104
output = catAppFile ("android" , "TNSApp" , "app/app.css" )
113
105
assert ("font-size: 20;" in output )
114
106
115
- def test_013_LiveSync_Android_TnsModules_File (self ):
116
- CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
117
- Run (platform = "android" , path = "TNS_App" )
118
-
119
- replace ("TNS_App/node_modules/tns-core-modules/application/application-common.js" , "(\" globals\" );" , "(\" globals\" ); // test" )
120
- LiveSync (platform = "android" , path = "TNS_App" )
121
-
122
- output = catAppFile ("android" , "TNSApp" , "app/tns_modules/application/application-common.js" )
123
- assert ("require(\" globals\" ); // test" in output )
107
+ output = catAppFile ("android" , "TNSApp" , "app/main-view-model.js" )
108
+ assert ("this.set(\" message\" , this.counter + \" clicks left\" );" in output )
124
109
125
- def test_014_LiveSync_Android_TnsModules_LICENSE (self ):
110
+ def test_012_LiveSync_Android_TnsModules_Files (self ):
126
111
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
127
112
Run (platform = "android" , path = "TNS_App" )
128
113
129
114
replace ("TNS_App/node_modules/tns-core-modules/LICENSE" , "2015" , "9999" )
115
+ replace ("TNS_App/node_modules/tns-core-modules/application/application-common.js" , "(\" globals\" );" , "(\" globals\" ); // test" )
130
116
LiveSync (platform = "android" , path = "TNS_App" )
131
117
132
118
output = catAppFile ("android" , "TNSApp" , "app/tns_modules/LICENSE" )
133
119
assert ("Copyright (c) 9999 Telerik AD" in output )
134
120
121
+ output = catAppFile ("android" , "TNSApp" , "app/tns_modules/application/application-common.js" )
122
+ assert ("require(\" globals\" ); // test" in output )
123
+
135
124
def test_021_LiveSync_Android_AddNewFiles (self ):
136
125
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
137
126
Run (platform = "android" , path = "TNS_App" )
@@ -165,22 +154,15 @@ def test_031_LiveSync_Android_DeleteFiles(self):
165
154
output = catAppFile ("android" , "TNSApp" , "app/LICENSE" )
166
155
assert ("cat: files/app/LICENSE: No such file or directory" in output )
167
156
168
- def test_302_LiveSync_XmlFile (self ):
157
+ def test_302_LiveSync (self ):
169
158
CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
170
159
Run (platform = "android" , path = "TNS_App" )
171
160
172
161
replace ("TNS_App/app/main-page.xml" , "TAP" , "TEST" )
173
- LiveSync (path = "TNS_App" )
174
-
175
- output = catAppFile ("android" , "TNSApp" , "app/main-page.xml" )
176
- assert ("<Button text=\" TEST\" tap=\" {{ tapAction }}\" />" in output )
162
+ output = LiveSync (path = "TNS_App" , assertSuccess = False )
177
163
178
- def test_303_LiveSync_BeforeRun (self ):
179
- CreateProjectAndAddPlatform (projName = "TNS_App" , platform = "android" , frameworkPath = androidRuntimePath )
180
- LiveSync (path = "TNS_App" )
181
-
182
- output = catAppFile ("android" , "TNSApp" , "app/main-page.xml" )
183
- assert ("<Button text=\" TAP\" tap=\" {{ tapAction }}\" />" in output )
164
+ assert ("Multiple device platforms detected (iOS and Android). Specify platform or device on command line." in output )
165
+ assert ("# livesync" in output )
184
166
185
167
# # TODO: Implement it.
186
168
# @unittest.skip("Fix LiveSync for Android device.")
0 commit comments